feat: add gallery add icon and implement RStepper widget for poultry farm inspection
This commit is contained in:
55
packages/core/lib/presentation/widget/stepper/r_stepper.dart
Normal file
55
packages/core/lib/presentation/widget/stepper/r_stepper.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class RStepper extends StatelessWidget {
|
||||
const RStepper({
|
||||
super.key,
|
||||
required this.activeStepColor,
|
||||
this.deactiveStepColor,
|
||||
this.dividerColor,
|
||||
required this.stepsCount,
|
||||
required this.activeStep,
|
||||
});
|
||||
|
||||
final Color activeStepColor;
|
||||
final Color? deactiveStepColor;
|
||||
final Color? dividerColor;
|
||||
final int stepsCount;
|
||||
final int activeStep;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
|
||||
return SizedBox(
|
||||
height: 24.h,
|
||||
width: Get.width,
|
||||
child: Row(
|
||||
children: List.generate(stepsCount, (index) {
|
||||
final isFirst = index == 0;
|
||||
return SizedBox(
|
||||
width: (Get.width) / (stepsCount - 1),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: index == activeStep
|
||||
? activeStepColor
|
||||
: deactiveStepColor ?? AppColor.whiteNormalActive,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
child: Center(
|
||||
child: Text(
|
||||
(index + 1).toString(),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -45,6 +45,7 @@ export 'overlay_dropdown_widget/resource_overlay_dropdown.dart';
|
||||
export 'pagination/pagination_from_until.dart';
|
||||
export 'pagination/show_more.dart';
|
||||
export 'slider/slider.dart';
|
||||
export 'stepper/r_stepper.dart';
|
||||
export 'tabs/new_tab.dart';
|
||||
export 'tabs/r_segment.dart';
|
||||
export 'tabs/tab.dart';
|
||||
|
||||
Reference in New Issue
Block a user