update to 3.13
This commit is contained in:
@ -1,12 +1,17 @@
|
||||
|
||||
import 'package:flutter_map/plugin_api.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
|
||||
class IndexBinding extends Bindings {
|
||||
|
||||
IndexBinding(this.token);
|
||||
|
||||
String? token;
|
||||
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.put<IndexController>(IndexController());
|
||||
final IndexController indexController = IndexController();
|
||||
indexController.userToken = token;
|
||||
Get.put<IndexController>(indexController);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,26 +1,18 @@
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/model/destination.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/drawer/drawer_page.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/services/maxtrix_service.dart';
|
||||
import 'package:rogapp/utils/database_helper.dart';
|
||||
import 'package:rogapp/widgets/bread_crum_widget.dart';
|
||||
import 'package:rogapp/widgets/cat_widget.dart';
|
||||
import 'package:rogapp/widgets/list_widget.dart';
|
||||
import 'package:rogapp/widgets/map_widget.dart';
|
||||
|
||||
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
|
||||
|
||||
class IndexPage extends GetView<IndexController> {
|
||||
IndexPage({Key? key}) : super(key: key);
|
||||
|
||||
final IndexController indexController = Get.find<IndexController>();
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
final DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -30,33 +22,37 @@ class IndexPage extends GetView<IndexController> {
|
||||
return false;
|
||||
},
|
||||
child: Scaffold(
|
||||
//drawer: const DrawerPage(),
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(Icons.arrow_back_ios),
|
||||
onPressed: (){
|
||||
indexController.switchPage(AppPages.TRAVEL);
|
||||
drawer: DrawerPage(),
|
||||
appBar: AppBar(
|
||||
// leading: IconButton(
|
||||
// icon: const Icon(Icons.arrow_back_ios),
|
||||
// onPressed: (){
|
||||
// indexController.switchPage(AppPages.TRAVEL);
|
||||
// },
|
||||
// ),
|
||||
//automaticallyImplyLeading: false,
|
||||
title: Text("add_location".tr),
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Get.toNamed(AppPages.SEARCH);
|
||||
},
|
||||
),
|
||||
//automaticallyImplyLeading: false,
|
||||
title: Text("add_location".tr),
|
||||
actions: [
|
||||
InkWell(
|
||||
onTap: (){
|
||||
Get.toNamed(AppPages.SEARCH);
|
||||
},
|
||||
child: Container(
|
||||
height: 32,
|
||||
width: 75,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue,
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
|
||||
),
|
||||
child: const Center(child: Icon(Icons.search),),
|
||||
),
|
||||
child: Container(
|
||||
height: 32,
|
||||
width: 75,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
),
|
||||
//CatWidget(indexController: indexController,),
|
||||
child: const Center(
|
||||
child: Icon(Icons.search),
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(onPressed: () {
|
||||
Get.toNamed(AppPages.HISTORY);
|
||||
}, icon: const Icon(Icons.history))
|
||||
|
||||
//CatWidget(indexController: indexController,),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
@ -64,51 +60,59 @@ class IndexPage extends GetView<IndexController> {
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||
padding:
|
||||
const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child:
|
||||
Obx(() =>
|
||||
destinationController.is_gps_selected == true ?
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child: Image(image: AssetImage('assets/images/route3_off.png'), width: 35, height: 35,),
|
||||
onTap: (){
|
||||
indexController.switchPage(AppPages.TRAVEL);
|
||||
},
|
||||
),
|
||||
) :
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child: Image(image: AssetImage('assets/images/route2_on.png'),width: 35, height: 35,),
|
||||
onTap: (){
|
||||
indexController.switchPage(AppPages.TRAVEL);
|
||||
},
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
child:
|
||||
Obx(() => destinationController.is_gps_selected == true
|
||||
? Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child: const Image(
|
||||
image: AssetImage(
|
||||
'assets/images/route3_off.png'),
|
||||
width: 35,
|
||||
height: 35,
|
||||
),
|
||||
onTap: () {
|
||||
indexController.switchPage(AppPages.TRAVEL);
|
||||
},
|
||||
),
|
||||
)
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
right: 10.0, top: 4.0, bottom: 4.0),
|
||||
child: InkWell(
|
||||
child: const Image(
|
||||
image: AssetImage(
|
||||
'assets/images/route2_on.png'),
|
||||
width: 35,
|
||||
height: 35,
|
||||
),
|
||||
onTap: () {
|
||||
indexController.switchPage(AppPages.TRAVEL);
|
||||
},
|
||||
),
|
||||
))),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: (){
|
||||
onPressed: () {
|
||||
indexController.toggleMode();
|
||||
if(indexController.currentCat.isNotEmpty){
|
||||
print(indexController.currentCat[0].toString());
|
||||
}
|
||||
|
||||
if (indexController.currentCat.isNotEmpty) {
|
||||
print(indexController.currentCat[0].toString());
|
||||
}
|
||||
},
|
||||
tooltip: 'Increment',
|
||||
child: Obx(() =>
|
||||
indexController.mode == 0 ?
|
||||
Image(image: AssetImage('assets/images/list2.png'))
|
||||
:
|
||||
Image(image: AssetImage('assets/images/map.png')),
|
||||
),
|
||||
elevation: 4.0,
|
||||
child: Obx(
|
||||
() => indexController.mode == 0
|
||||
? const Image(image: AssetImage('assets/images/list2.png'))
|
||||
: const Image(image: AssetImage('assets/images/map.png')),
|
||||
),
|
||||
),
|
||||
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
||||
body: SafeArea(
|
||||
@ -132,11 +136,11 @@ class IndexPage extends GetView<IndexController> {
|
||||
// // ),
|
||||
// child: SingleChildScrollView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// child: Obx(() =>
|
||||
// child: Obx(() =>
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// indexController.is_mapController_loaded.value == false ?
|
||||
// indexController.is_mapController_loaded.value == false ?
|
||||
// Center(child: CircularProgressIndicator())
|
||||
// :
|
||||
// BreadCrumbWidget(mapController: indexController.mapController),
|
||||
@ -149,7 +153,7 @@ class IndexPage extends GetView<IndexController> {
|
||||
// // onPressed: (){
|
||||
// // indexController.currentCat.clear();
|
||||
// // indexController.loadLocationsBound();
|
||||
// // },
|
||||
// // },
|
||||
// // icon: Icon(Icons.cancel, color: Colors.red,)
|
||||
// // ) :
|
||||
// // Container(width: 0, height: 0,)
|
||||
@ -161,18 +165,13 @@ class IndexPage extends GetView<IndexController> {
|
||||
// ),
|
||||
// ),
|
||||
Expanded(
|
||||
child: Obx(() =>
|
||||
indexController.mode == 0 ?
|
||||
MapWidget() :
|
||||
ListWidget(),
|
||||
)
|
||||
|
||||
)
|
||||
child: Obx(
|
||||
() => indexController.mode == 0 ? MapWidget() : ListWidget(),
|
||||
))
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user