update
This commit is contained in:
10
lib/pages/category/category_page.dart
Normal file
10
lib/pages/category/category_page.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CategoryPage extends StatelessWidget {
|
||||
const CategoryPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
10
lib/pages/city/city_page.dart
Normal file
10
lib/pages/city/city_page.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CityPage extends StatelessWidget {
|
||||
const CityPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container();
|
||||
}
|
||||
}
|
||||
@ -150,7 +150,7 @@ class DestinationController extends GetxController {
|
||||
PopulateDestinations();
|
||||
|
||||
|
||||
print("------ in iniit");
|
||||
//print("------ in iniit");
|
||||
|
||||
|
||||
|
||||
@ -195,14 +195,14 @@ class DestinationController extends GetxController {
|
||||
indexController.rogMapController!.move(LatLng(position!.latitude, position!.longitude), czoom);
|
||||
//String user_id = indexController.currentUser[0]["user"]["id"].toString();
|
||||
//TrackingService.addTrack(user_id, position!.latitude, position.longitude).then((val){
|
||||
print("---- postion is ${position.latitude}, ${position.longitude}");
|
||||
//print("---- postion is ${position.latitude}, ${position.longitude}");
|
||||
gps.clear();
|
||||
gps.add("-- lat : ${position.latitude}, lon : ${position.longitude} --");
|
||||
checkForCheckin(position!.latitude, position.longitude);
|
||||
//});
|
||||
|
||||
}
|
||||
print(position == null ? 'Unknown' : 'current position is ${position.latitude.toString()}, ${position.longitude.toString()}');
|
||||
//print(position == null ? 'Unknown' : 'current position is ${position.latitude.toString()}, ${position.longitude.toString()}');
|
||||
});
|
||||
} catch (err){
|
||||
locationPermission.clear();
|
||||
|
||||
@ -58,6 +58,7 @@ class IndexController extends GetxController {
|
||||
String dropdownValue = "9";
|
||||
String subDropdownValue = "-1";
|
||||
String areaDropdownValue = "-1";
|
||||
String cateogory = "-all-";
|
||||
|
||||
late Worker _ever;
|
||||
|
||||
@ -234,13 +235,13 @@ void login(String email, String password, BuildContext context){
|
||||
|
||||
|
||||
void loadCatsv2(){
|
||||
dynamic initVal = {'category':'---'};
|
||||
dynamic initVal = {'category':'-all-'};
|
||||
LatLngBounds bounds = mapController!.bounds!;
|
||||
if(bounds.southEast != null && bounds.southWest != null && bounds.northEast != null && bounds.southEast != null ){
|
||||
cats.clear();
|
||||
CatService.loadCats(bounds.southWest!.latitude, bounds.southWest!.longitude, bounds.northWest.latitude, bounds.northWest.longitude, bounds.northEast!.latitude, bounds.northEast!.longitude, bounds.southEast.latitude, bounds.southEast.longitude).then((value) {
|
||||
print(value);
|
||||
cats.add(value);
|
||||
cats.clear();
|
||||
cats.add(initVal);
|
||||
cats.addAll(value!);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ class IndexPage extends GetView<IndexController> {
|
||||
child: const Center(child: Icon(Icons.search),),
|
||||
),
|
||||
),
|
||||
CatWidget(indexController: indexController,),
|
||||
//CatWidget(indexController: indexController,),
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: BottomAppBar(
|
||||
@ -89,47 +89,47 @@ class IndexPage extends GetView<IndexController> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0),
|
||||
alignment: Alignment.centerLeft,
|
||||
height: 50.0,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
child:Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
TextButton(child:Text("Main Pef >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.SEARCH);},),
|
||||
TextButton(child:Text("Sub Pef >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.SEARCH);},),
|
||||
TextButton(child:Text("Cities >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.SEARCH);},),
|
||||
TextButton(child:Text("Categories", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.SEARCH);},),
|
||||
],
|
||||
)
|
||||
),
|
||||
// child: SingleChildScrollView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// child: Obx(() =>
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
//child: SingleChildScrollView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// child:Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// 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,)
|
||||
// ],
|
||||
// )
|
||||
// TextButton(child:Text("Main Pef >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.MAINPERF);},),
|
||||
// TextButton(child:Text("Sub Pef >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.SUBPERF);},),
|
||||
// TextButton(child:Text("Cities >", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.CITY);},),
|
||||
// TextButton(child:Text("Categories", style: TextStyle(fontSize:16.0, fontWeight: FontWeight.bold),), onPressed: (){Get.toNamed(AppPages.CATEGORY);},),
|
||||
// ],
|
||||
// )
|
||||
// ),
|
||||
// ),
|
||||
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(() =>
|
||||
|
||||
31
lib/pages/mainperf/mainperf_page.dart
Normal file
31
lib/pages/mainperf/mainperf_page.dart
Normal file
@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
|
||||
class MainPerfPage extends StatelessWidget {
|
||||
MainPerfPage({Key? key}) : super(key: key);
|
||||
|
||||
IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Select Main Perfecture"),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: indexController.perfectures.length,
|
||||
itemBuilder: (context, index){
|
||||
return ListTile(
|
||||
onTap: (){
|
||||
indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
|
||||
indexController.populateForPerf(indexController.dropdownValue, indexController.mapController!);
|
||||
Get.back();
|
||||
},
|
||||
title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
31
lib/pages/subperf/subperf_page.dart
Normal file
31
lib/pages/subperf/subperf_page.dart
Normal file
@ -0,0 +1,31 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
|
||||
class SubPerfPage extends StatelessWidget {
|
||||
SubPerfPage({Key? key}) : super(key: key);
|
||||
|
||||
IndexController indexController = Get.find<IndexController>();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Select Sub Perfecture"),
|
||||
),
|
||||
body: ListView.builder(
|
||||
itemCount: indexController.subPerfs.length,
|
||||
itemBuilder: (context, index){
|
||||
return ListTile(
|
||||
onTap: (){
|
||||
indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
|
||||
//indexController.populateForPerf(indexController.dropdownValue, indexController.mapController!);
|
||||
Get.back();
|
||||
},
|
||||
title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,19 +1,22 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_navigation/src/routes/get_route.dart';
|
||||
import 'package:rogapp/pages/category/category_page.dart';
|
||||
import 'package:rogapp/pages/city/city_page.dart';
|
||||
import 'package:rogapp/pages/destination/destination_binding.dart';
|
||||
import 'package:rogapp/pages/destination/destination_page.dart';
|
||||
import 'package:rogapp/pages/home/home_binding.dart';
|
||||
import 'package:rogapp/pages/home/home_page.dart';
|
||||
import 'package:rogapp/pages/index/index_binding.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
|
||||
import 'package:rogapp/pages/index/index_page.dart';
|
||||
import 'package:rogapp/pages/landing/landing_page.dart';
|
||||
import 'package:rogapp/pages/loading/loading_page.dart';
|
||||
import 'package:rogapp/pages/login/login_page.dart';
|
||||
import 'package:rogapp/pages/mainperf/mainperf_page.dart';
|
||||
import 'package:rogapp/pages/permission/permission.dart';
|
||||
import 'package:rogapp/pages/register/register_page.dart';
|
||||
import 'package:rogapp/pages/search/search_binding.dart';
|
||||
import 'package:rogapp/pages/search/search_page.dart';
|
||||
import 'package:rogapp/pages/subperf/subperf_page.dart';
|
||||
import 'package:rogapp/spa/spa_binding.dart';
|
||||
import 'package:rogapp/spa/spa_page.dart';
|
||||
|
||||
@ -35,6 +38,10 @@ class AppPages {
|
||||
static const HOME = Routes.HOME;
|
||||
static const PERMISSION = Routes.PERMISSION;
|
||||
static const SEARCH = Routes.SEARCH;
|
||||
static const MAINPERF = Routes.MAINPERF;
|
||||
static const SUBPERF = Routes.SUBPERF;
|
||||
static const CITY = Routes.CITY;
|
||||
static const CATEGORY = Routes.CATEOGORY;
|
||||
|
||||
static final routes = [
|
||||
// GetPage(
|
||||
@ -100,6 +107,22 @@ class AppPages {
|
||||
name: Routes.SEARCH,
|
||||
page: () => SearchPage(),
|
||||
binding: SearchBinding(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.MAINPERF,
|
||||
page: () => MainPerfPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.SUBPERF,
|
||||
page: () => SubPerfPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.CITY,
|
||||
page: () => CityPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routes.CATEOGORY,
|
||||
page: () => CategoryPage(),
|
||||
)
|
||||
];
|
||||
}
|
||||
@ -17,4 +17,8 @@ abstract class Routes {
|
||||
static const HOME = '/home';
|
||||
static const PERMISSION = '/permission';
|
||||
static const SEARCH = '/search';
|
||||
static const MAINPERF = '/mainperf';
|
||||
static const SUBPERF = '/subperf';
|
||||
static const CITY = '/city';
|
||||
static const CATEOGORY = '/category';
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/index/index_controller.dart';
|
||||
import 'package:rogapp/widgets/cat_widget.dart';
|
||||
|
||||
|
||||
class PerfectureWidget extends StatefulWidget {
|
||||
@ -97,6 +98,24 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
return dropDownItems;
|
||||
}
|
||||
|
||||
List<DropdownMenuItem<String>> getCategory(){
|
||||
List<DropdownMenuItem<String>> dropDownItems = [];
|
||||
|
||||
dropDownItems.clear();
|
||||
|
||||
//print("--------cats ------############### ${widget.indexController.cats.toString()} -------------");
|
||||
for(dynamic d in widget.indexController.cats){
|
||||
print("-------- ddd ------############### ${d} --------dddd-----");
|
||||
var newDropdown = DropdownMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
|
||||
//print("--------cats ------############### ${d['category'].toString()} -------------");
|
||||
dropDownItems.add(newDropdown);
|
||||
}
|
||||
|
||||
//return [];
|
||||
|
||||
return dropDownItems;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
@ -155,7 +174,6 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
): const Text(""),
|
||||
|
||||
widget.indexController.subPerfs.isNotEmpty ?
|
||||
|
||||
DropdownButton<String>(
|
||||
value: widget.indexController.subDropdownValue,
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
@ -179,7 +197,31 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
|
||||
items:
|
||||
getSubDropdownItems()
|
||||
) :
|
||||
const Text("")
|
||||
const Text(""),
|
||||
//CatWidget(indexController: widget.indexController,),
|
||||
DropdownButton<String>(
|
||||
value: widget.indexController.cateogory,
|
||||
icon: const Icon(Icons.arrow_downward),
|
||||
elevation: 16,
|
||||
style: const TextStyle(color: Colors.deepPurple),
|
||||
hint: const Text("select"),
|
||||
underline: Container(
|
||||
height: 2,
|
||||
color: Colors.deepPurpleAccent,
|
||||
),
|
||||
onChanged: (String? newValue) {
|
||||
setState(() {
|
||||
if(newValue != null){
|
||||
widget.indexController.is_loading.value = true;
|
||||
widget.indexController.populateForSubPerf(newValue, widget.mapController);
|
||||
//widget.indexController.loadLocationforSubPerf(newValue, widget.mapController);
|
||||
//widget.indexController.subDropdownValue = newValue;
|
||||
}
|
||||
});
|
||||
},
|
||||
items:
|
||||
getCategory(),
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user