This commit is contained in:
Mohamed Nouffer
2022-05-12 02:17:08 +05:30
parent 9d253fc5e2
commit 80a976baa0
37 changed files with 1159 additions and 592 deletions

View File

@ -1,7 +1,10 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:rogapp/index/index_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:url_launcher/url_launcher.dart';
class BottomSheetWidget extends StatelessWidget {
@ -22,20 +25,6 @@ class BottomSheetWidget extends StatelessWidget {
if (!await launch(url)) throw 'Could not launch $url';
}
// Widget getAttrib(String name){
// print("calling ...");
// if(homeController.currentFeature[0].properties!["phone"] == null || homeController.currentFeature[0].properties!["phone"] == ""){
// return Container(height: 0, width: 0,);
// }
// else {
// return Obx(() =>
// Text(homeController.currentFeature[0].properties!["phone"] ?? '',
// style: TextStyle(color: Colors.blue,),
// overflow: TextOverflow.ellipsis,)
// );
// }
// }
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
@ -213,22 +202,125 @@ class BottomSheetWidget extends StatelessWidget {
],
),
SizedBox(height: 20.0,),
Obx(() =>
indexController.currentAction.isNotEmpty ?
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
indexController.currentAction[0][0]["wanttogo"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["wanttogo"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("want_to_go".tr)
) :
ElevatedButton(
onPressed: (){},
child: Text("schedule_point".tr)
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["wanttogo"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: IconButton(
icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "want_to_go".tr,), onPressed: () {
},
)
),
indexController.currentAction[0][0]["like"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["like"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("like".tr)
) :
ElevatedButton(
onPressed: (){},
child: Text("schedule_point".tr)
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["like"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: IconButton(
icon: Icon(Icons.favorite, color: Colors.red, semanticLabel: "like".tr,), onPressed: () {
},
)
),
indexController.currentAction[0][0]["checkin"] == false ?
ElevatedButton(
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["checkin"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Text("checkin".tr)
) :
ElevatedButton(
onPressed: (){},
child: Text("schedule_point".tr)
onPressed: (){
if(indexController.currentAction.isNotEmpty){
print(indexController.currentAction[0]);
indexController.currentAction[0][0]["checkin"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Icon(
Icons.favorite, color: Colors.red)
,
)
],
): Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
TextButton(
onPressed: (){
Get.toNamed(AppPages.LOGIN);
},
child: Flexible(child: Text("その他のオプションについてはログインしてください")))
],
),
),
Row(
children: [

View File

@ -1,8 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:get/get.dart';
import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
import 'package:rogapp/index/index_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/perfecture_widget.dart';
class BreadCrumbWidget extends StatelessWidget {

View File

@ -0,0 +1,49 @@
import 'package:flutter/material.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/services/location_service.dart';
class CatWidget extends StatefulWidget {
CatWidget({ Key? key, required this.indexController, }) : super(key: key);
IndexController indexController;
@override
State<CatWidget> createState() => _CatWidgetState();
}
class _CatWidgetState extends State<CatWidget> {
String defaultValue = "---";
@override
Widget build(BuildContext context) {
return
PopupMenuButton(
onSelected: (value) {
widget.indexController.currentCat.clear();
widget.indexController.currentCat.add(value.toString());
widget.indexController.refreshLocationForCat();
setState(() {
print(value);
defaultValue = value.toString();
});
},
itemBuilder: (BuildContext context){
List<PopupMenuItem> itms = <PopupMenuItem>[];
for(dynamic d in widget.indexController.cats[0]){
PopupMenuItem itm = PopupMenuItem(child: Text(d['category'].toString()), value: d['category'].toString());
itms.add(itm);
}
return itms;
}
);
}
}
// widget.indexController.cats.map((e) =>
// PopupMenuItem(
// value: defaultValue,
// child: Text(e[0]['category'].toString()),
// )
// ).toList(),

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:rogapp/index/index_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
class ListWidget extends StatelessWidget {

View File

@ -6,7 +6,7 @@ import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/index/index_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/widgets/base_layer_widget.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
@ -57,6 +57,7 @@ class MapWidget extends StatelessWidget {
indexController.currentFeature.clear();
}
indexController.currentFeature.add(fs);
indexController.getAction();
showModalBottomSheet(context: context, isScrollControlled: true,
builder:((context) => BottomSheetWidget())

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:get/get.dart';
import 'package:rogapp/index/index_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
class PerfectureWidget extends StatefulWidget {
@ -18,7 +18,7 @@ class PerfectureWidget extends StatefulWidget {
}
class _PerfectureWidgetState extends State<PerfectureWidget> {
String dropdownValue = "9";
List<DropdownMenuItem<String>> getDropdownItems() {
List<DropdownMenuItem<String>> dropDownItems = [];
@ -58,7 +58,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
Row(
children: [
DropdownButton<String>(
value: dropdownValue,
value: widget.indexController.dropdownValue,
icon: const Icon(Icons.arrow_downward),
elevation: 16,
style: const TextStyle(color: Colors.deepPurple),
@ -69,7 +69,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
onChanged: (String? newValue) {
//setState(() {
if(newValue != null){
dropdownValue = newValue;
widget.indexController.dropdownValue = newValue;
widget.indexController.populateForPerf(newValue, widget.mapController);
}
//});