update
This commit is contained in:
@ -12,6 +12,7 @@ class DestinationController extends GetxController {
|
||||
|
||||
List<dynamic> destinations = <dynamic>[].obs;
|
||||
List<Map<String, dynamic>> destination_index_data = <Map<String, dynamic>>[].obs;
|
||||
|
||||
Map<String, dynamic> matrix = {};
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
@ -22,6 +23,15 @@ class DestinationController extends GetxController {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
void deleteDestination(int index){
|
||||
int id = destinations[index]["id"];
|
||||
DestinationService.deleteDestination(id).then((val){
|
||||
destination_index_data.clear();
|
||||
PopulateDestinations();
|
||||
print("####### dest id : ${id}");
|
||||
});
|
||||
}
|
||||
|
||||
void PopulateDestinations(){
|
||||
if(indexController.currentUser.isNotEmpty){
|
||||
int user_id = indexController.currentUser[0]["user"]["id"] as int;
|
||||
|
||||
@ -68,34 +68,6 @@ class _DestinationPageState extends State<DestinationPage> {
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
appBar:AppBar(
|
||||
title: Text("Iternery"),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
icon: Icon(Icons.more_vert),
|
||||
itemBuilder: (BuildContext context) => <PopupMenuEntry>[
|
||||
const PopupMenuItem(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.cut),
|
||||
title: Text('Cut'),
|
||||
),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.paste),
|
||||
title: Text('Paste'),
|
||||
),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
child: ListTile(
|
||||
leading: Icon(Icons.delete),
|
||||
title: Text('Delete'),
|
||||
),
|
||||
),
|
||||
// const PopupMenuDivider(),
|
||||
// const PopupMenuItem(child: Text('Item A')),
|
||||
// const PopupMenuItem(child: Text('Item B')),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Obx(() =>
|
||||
indexController.desination_mode.value == 0 ?
|
||||
|
||||
Reference in New Issue
Block a user