feat: refactor financial wallet UI components and add offline map service support

This commit is contained in:
Hamza-Ayed
2026-04-21 00:35:30 +03:00
parent 4293d20561
commit b92db3bb39
99 changed files with 22888 additions and 27387 deletions

View File

@@ -6,65 +6,72 @@ import 'mydialoug.dart';
class MyCircleContainer extends StatelessWidget {
final Widget child;
final Color backgroundColor;
final Color borderColor;
final Color? backgroundColor;
final Color? borderColor;
MyCircleContainer({
Key? key,
super.key,
required this.child,
this.backgroundColor = AppColor.secondaryColor,
this.borderColor = AppColor.accentColor,
}) : super(key: key);
this.backgroundColor,
this.borderColor,
});
final controller = Get.put(CircleController());
@override
Widget build(BuildContext context) {
final effectiveBorderColor = borderColor ?? AppColor.borderColor;
return GetBuilder<CircleController>(
builder: ((controller) => GestureDetector(
onTap: () {
controller.changeColor();
MyDialog().getDialog(
'Rejected Orders Count'.tr,
'This is the total number of rejected orders per day after accepting the orders'
.tr, () {
Get.back();
});
},
child: AnimatedContainer(
onEnd: () {
controller.onEnd();
builder: ((controller) {
final effectiveBackgroundColor = backgroundColor ??
(controller.isActive ? AppColor.accentColor : AppColor.secondaryColor);
return GestureDetector(
onTap: () {
controller.toggleActive();
MyDialog().getDialog(
'Rejected Orders Count'.tr,
'This is the total number of rejected orders per day after accepting the orders'
.tr, () {
Get.back();
});
},
duration: const Duration(milliseconds: 300),
width: controller.size,
height: controller.size,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: controller.backgroundColor,
border: Border.all(
color: borderColor,
width: 1,
child: AnimatedContainer(
onEnd: () {
controller.resetSize();
},
duration: const Duration(milliseconds: 300),
width: controller.size,
height: controller.size,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: effectiveBackgroundColor,
border: Border.all(
color: effectiveBorderColor,
width: 1,
),
),
child: Center(child: child),
),
child: Center(child: child),
),
)));
);
}));
}
}
class CircleController extends GetxController {
Color backgroundColor = AppColor.secondaryColor;
bool isActive = false;
double size = 40;
void changeColor() {
backgroundColor = backgroundColor == AppColor.secondaryColor
? AppColor.accentColor
: AppColor.secondaryColor;
void toggleActive() {
isActive = !isActive;
size = 60;
update();
}
void onEnd() {
void resetSize() {
size = 40;
update();
}
}