This commit is contained in:
Hamza-Ayed
2023-10-16 16:53:27 +03:00
parent 2105de243c
commit 06905be0e9
13 changed files with 339 additions and 191 deletions

View File

@@ -71,24 +71,26 @@ class MainBottomMenuMap extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(
height: 30,
child: AnimatedTextKit(
animatedTexts: [
ScaleAnimatedText(
'${'Where to'.tr} ${box.read(BoxName.name)}'),
// WavyAnimatedText(
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
// FlickerAnimatedText(
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
// WavyAnimatedText(
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
],
isRepeatingAnimation: true,
onTap: () {
print("Tap Event");
},
),
),
height: 30,
child: Text(
'${'Where to'.tr} ${box.read(BoxName.name)}')
// AnimatedTextKit(
// animatedTexts: [
// ScaleAnimatedText(
// '${'Where to'.tr} ${box.read(BoxName.name)}'),
// // WavyAnimatedText(
// // '${'Where to'.tr} ${box.read(BoxName.name)}'),
// // FlickerAnimatedText(
// // '${'Where to'.tr} ${box.read(BoxName.name)}'),
// // WavyAnimatedText(
// // '${'Where to'.tr} ${box.read(BoxName.name)}'),
// ],
// isRepeatingAnimation: true,
// onTap: () {
// print("Tap Event");
// },
// ),
),
Row(
mainAxisAlignment:
MainAxisAlignment.center,
@@ -148,96 +150,88 @@ class FavioratePlacesDialogu extends StatelessWidget {
builder: (controller) => DefaultTextStyle(
style: AppStyle.title,
child: Center(
child: AnimatedTextKit(
animatedTexts: [
TypewriterAnimatedText('Favorite Places'.tr),
ScaleAnimatedText(
'Favorite Places'.tr,
),
// TyperAnimatedText(
// 'Favorite Places'.tr,
// ),
],
isRepeatingAnimation: true,
onTap: () async {
List favoritePlaces =
await sql.getAllData(TableName.placesFavorite);
print(favoritePlaces);
Get.defaultDialog(
title: 'Favorite Places'.tr,
content: SizedBox(
width: Get.width * .8,
height: 300,
child: favoritePlaces.isEmpty
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
child: InkWell(
onTap: () async {
List favoritePlaces =
await sql.getAllData(TableName.placesFavorite);
// print(favoritePlaces);
Get.defaultDialog(
title: 'Favorite Places'.tr,
content: SizedBox(
width: Get.width * .8,
height: 300,
child: favoritePlaces.isEmpty
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(
Icons.hourglass_empty_rounded,
size: 99,
color: AppColor.primaryColor,
),
Text(
'You Dont Have Any places yet !'.tr,
style: AppStyle.title,
),
],
),
)
: ListView.builder(
itemCount: favoritePlaces.length,
itemBuilder: (BuildContext context, int index) {
return Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
const Icon(
Icons.hourglass_empty_rounded,
size: 99,
color: AppColor.primaryColor,
TextButton(
onPressed: () async {
await controller.getMap(
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
);
// controller.changePickerShown();
controller.showBottomSheet1();
Get.back();
controller.showBottomSheet1();
},
child: Text(
favoritePlaces[index]['name'],
style: AppStyle.title,
),
),
Text(
'You Dont Have Any places yet !'.tr,
style: AppStyle.title,
IconButton(
onPressed: () async {
await sql.deleteData(
TableName.placesFavorite,
favoritePlaces[index]['id']);
Get.back();
// ignore: use_build_context_synchronously
Toast.show(
context,
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
AppColor.redColor);
// Get.snackbar('Deleted'.tr,
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
// backgroundColor:
// AppColor.accentColor);
},
icon: const Icon(Icons.favorite_outlined),
),
],
),
)
: ListView.builder(
itemCount: favoritePlaces.length,
itemBuilder: (BuildContext context, int index) {
return Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
TextButton(
onPressed: () async {
await controller.getMap(
'${controller.myLocation.latitude},${controller.myLocation.longitude}',
'${favoritePlaces[index]['latitude']},${favoritePlaces[index]['longitude']}',
);
// controller.changePickerShown();
controller.showBottomSheet1();
Get.back();
controller.showBottomSheet1();
},
child: Text(
favoritePlaces[index]['name'],
style: AppStyle.title,
),
),
IconButton(
onPressed: () async {
await sql.deleteData(
TableName.placesFavorite,
favoritePlaces[index]['id']);
Get.back();
// ignore: use_build_context_synchronously
Toast.show(
context,
'${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
AppColor.redColor);
// Get.snackbar('Deleted'.tr,
// '${'You are Delete'.tr} ${favoritePlaces[index]['name']} from your list',
// backgroundColor:
// AppColor.accentColor);
},
icon:
const Icon(Icons.favorite_outlined),
),
],
);
},
),
),
cancel: MyElevatedButton(
title: 'Back'.tr, onPressed: () => Get.back()),
);
},
);
},
),
),
cancel: MyElevatedButton(
title: 'Back'.tr, onPressed: () => Get.back()),
);
},
child: Text(
'\u{1F3D8} ' 'Favorite Places'.tr,
style: AppStyle.title,
),
),
)),
));
}
}