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;

View File

@ -430,6 +430,10 @@ class DestinationController extends GetxController {
rogainingCounted.value = false;
DatabaseHelper db = DatabaseHelper.instance;
await db.deleteAllDestinations();
await db.deleteAllRogaining();
int? latgoal = await db.latestGoal();
if (latgoal != null) {
lastGoalAt = DateTime.fromMicrosecondsSinceEpoch(latgoal);
@ -794,6 +798,8 @@ class DestinationController extends GetxController {
orElse: () => null, // Provide a null value if no element is found
);
//print("gfs : ${gfs}");
if (gfs == null) {
return distanceToDest;
}

View File

@ -209,7 +209,25 @@ class LoginPage extends StatelessWidget {
),
),
],
)
),
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(
child: Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"※第8回と第9回は、岐阜県からの「清流の国ぎふ」SDGs推進ネットワーク連携促進補助金を受けています",
style: TextStyle(
fontSize:
12, // Consider adjusting the font size if the text is too small.
// Removed overflow: TextOverflow.ellipsis to allow text wrapping.
),
),
),
),
],
),
],
),
],