added disabled feature to buttons and reset on start

This commit is contained in:
2024-02-26 20:23:58 +05:30
parent c3cb6d758c
commit 992f9f3414
5 changed files with 169 additions and 452 deletions

View File

@ -396,45 +396,6 @@ class StartRogaining extends StatelessWidget {
}
}
// class NotAtGoal extends StatelessWidget {
// NotAtGoal({Key? key}) : super(key: key);
// DestinationController destinationController =
// Get.find<DestinationController>();
// @override
// Widget build(BuildContext context) {
// return Scaffold(
// appBar: AppBar(
// title: Text(
// "Not reached the goal yet".tr,
// ),
// ),
// body: Container(
// child: Center(
// child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text("You have not reached the goal yet.".tr,
// style: const TextStyle(fontSize: 24)),
// const SizedBox(
// height: 40.0,
// ),
// ElevatedButton(
// onPressed: () {
// Get.back();
// destinationController.skip_gps = false;
// },
// child: const Text("Back"),
// ),
// ],
// ),
// ),
// ),
// );
// }
// }
class BuyPointCamera extends StatelessWidget {
BuyPointCamera({Key? key, required this.destination}) : super(key: key);
@ -445,6 +406,8 @@ class BuyPointCamera extends StatelessWidget {
@override
Widget build(BuildContext context) {
print("in camera purchase 1 ${destinationController.isInRog.value}");
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
@ -482,6 +445,8 @@ class BuyPointCamera extends StatelessWidget {
children: [
ElevatedButton(
onPressed: () {
print(
"in camera purchase 2 ${destinationController.isInRog.value}");
destinationController.openCamera(
context, destination);
},
@ -520,10 +485,14 @@ class BuyPointCamera extends StatelessWidget {
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red),
onPressed: () async {
print(
"in camera purchase 3 ${destinationController.isInRog.value}");
await destinationController.makeBuyPoint(
destination,
destinationController.photos[0].path);
Get.back();
print(
"in camera purchase 4 ${destinationController.isInRog.value}");
destinationController.rogainingCounted.value =
true;
destinationController.skipGps = false;