115 lines
3.9 KiB
Dart
115 lines
3.9 KiB
Dart
import 'dart:ui';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:get/get.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/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>();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
drawer: const DrawerPage(),
|
|
appBar: AppBar(
|
|
leading: IconButton(
|
|
icon: Icon(Icons.arrow_back_ios),
|
|
onPressed: (){
|
|
indexController.switchPage(AppPages.TRAVEL);
|
|
},
|
|
),
|
|
automaticallyImplyLeading: false,
|
|
title: Text("Add locations"),
|
|
actions: [
|
|
CatWidget(indexController: indexController,),
|
|
],
|
|
),
|
|
bottomNavigationBar: BottomAppBar(
|
|
child: Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: <Widget>[
|
|
Expanded(child: IconButton(icon: const Icon(Icons.camera_enhance), onPressed: (){},),),
|
|
const Expanded(child: Text('')),
|
|
Expanded(child: IconButton(icon: const Icon(Icons.travel_explore), onPressed: (){
|
|
indexController.switchPage(AppPages.TRAVEL);
|
|
}),),
|
|
],
|
|
),
|
|
),
|
|
floatingActionButton: FloatingActionButton(
|
|
onPressed: (){
|
|
indexController.toggleMode();
|
|
if(indexController.currentCat.isNotEmpty){
|
|
print("###############");
|
|
print(indexController.currentCat[0].toString());
|
|
}
|
|
|
|
},
|
|
tooltip: 'Increment',
|
|
child: const Icon(Icons.document_scanner),
|
|
elevation: 4.0,
|
|
),
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
body: SafeArea(
|
|
child: Column(
|
|
children: [
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
|
alignment: Alignment.centerLeft,
|
|
height: 50.0,
|
|
child: SingleChildScrollView(
|
|
scrollDirection: Axis.horizontal,
|
|
child: Obx(() =>
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
indexController.is_mapController_loaded.value == false ?
|
|
Center(child: CircularProgressIndicator())
|
|
:
|
|
BreadCrumbWidget(mapController: indexController.mapController),
|
|
Container(width: 24.0,),
|
|
Row(
|
|
children: [
|
|
indexController.currentCat.isNotEmpty ? Text(indexController.currentCat[0].toString()): Text(""),
|
|
indexController.currentCat.isNotEmpty ?
|
|
IconButton(
|
|
onPressed: (){
|
|
indexController.currentCat.clear();
|
|
indexController.loadLocationsBound();
|
|
},
|
|
icon: Icon(Icons.cancel, color: Colors.red,)
|
|
) :
|
|
Container(width: 0, height: 0,)
|
|
],
|
|
)
|
|
],
|
|
)
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Obx(() =>
|
|
indexController.mode == 0 ?
|
|
MapWidget() :
|
|
ListWidget(),
|
|
)
|
|
|
|
)
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
} |