update to 3.13

This commit is contained in:
Mohamed Nouffer
2023-09-03 23:37:41 +05:30
parent c41dde4c33
commit 56e9861c7a
60 changed files with 3111 additions and 2705 deletions

View File

@ -13,7 +13,7 @@ class BaseLayer extends StatelessWidget {
FMTCTileProviderSettings(
behavior: CacheBehavior.values
.byName('cacheFirst'),
cachedValidDuration: Duration(
cachedValidDuration: const Duration(
days: 14
),
),

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
@ -13,9 +12,11 @@ class BottomSheetWidget extends StatelessWidget {
final IndexController indexController = Get.find<IndexController>();
BottomSheetWidget({Key? key}) : super(key: key);
Image getImage(GeoJsonFeature? gf){
if(gf!.properties!["photos"] == null || gf.properties!["photos"] == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
return const Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
return Image(image: NetworkImage(
@ -37,7 +38,7 @@ class BottomSheetWidget extends StatelessWidget {
return SingleChildScrollView(
child: Column(
children: [
SizedBox(height: 5.0,),
const SizedBox(height: 5.0,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@ -47,18 +48,18 @@ class BottomSheetWidget extends StatelessWidget {
},
color: Colors.blue,
textColor: Colors.white,
child: Icon(
padding: const EdgeInsets.all(14),
shape: const CircleBorder(),
child: const Icon(
Icons.arrow_back_ios,
size: 14,
),
padding: EdgeInsets.all(14),
shape: CircleBorder(),
),
Expanded(
child: Container(
alignment: Alignment.center,
child: Obx(() =>
Text(indexController.currentFeature[0].properties!["location_name"], style: TextStyle(
Text(indexController.currentFeature[0].properties!["location_name"], style: const TextStyle(
fontSize: 15.0,
fontWeight: FontWeight.bold,
),
@ -72,12 +73,12 @@ class BottomSheetWidget extends StatelessWidget {
},
color: Colors.blue,
textColor: Colors.white,
child: Icon(
padding: const EdgeInsets.all(14),
shape: const CircleBorder(),
child: const Icon(
Icons.arrow_forward_ios,
size: 14,
),
padding: EdgeInsets.all(14),
shape: CircleBorder(),
),
],
),
@ -105,59 +106,59 @@ class BottomSheetWidget extends StatelessWidget {
Expanded(
child: Container(
alignment: Alignment.topRight,
child: Text("address".tr, style: TextStyle(fontWeight: FontWeight.bold),)),
child: Text("address".tr, style: const TextStyle(fontWeight: FontWeight.bold),)),
),
SizedBox(width: 12.0,),
const SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["address"] ?? '',
style: TextStyle(color: Colors.blue,),
style: const TextStyle(color: Colors.blue,),
softWrap: true,
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0.0, height: 0,),
): const SizedBox(width: 0.0, height: 0,),
indexController.currentFeature[0].properties!["phone"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text("telephone".tr, style: TextStyle(fontWeight: FontWeight.bold),))),
SizedBox(width: 12.0,),
child: Text("telephone".tr, style: const TextStyle(fontWeight: FontWeight.bold),))),
const SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["phone"] ?? '',
style: TextStyle(color: Colors.blue,),
style: const TextStyle(color: Colors.blue,),
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0, height: 0,),
): const SizedBox(width: 0, height: 0,),
indexController.currentFeature[0].properties!["email"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text("email".tr, style: TextStyle(fontWeight: FontWeight.bold),))),
SizedBox(width: 12.0,),
child: Text("email".tr, style: const TextStyle(fontWeight: FontWeight.bold),))),
const SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["email"] ?? '',
style: TextStyle(color: Colors.blue,),
style: const TextStyle(color: Colors.blue,),
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0, height: 0,),
): const SizedBox(width: 0, height: 0,),
indexController.currentFeature[0].properties!["webcontents"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -165,8 +166,8 @@ class BottomSheetWidget extends StatelessWidget {
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text(
"web".tr, style: TextStyle(fontWeight: FontWeight.bold)))),
SizedBox(width: 12.0,),
"web".tr, style: const TextStyle(fontWeight: FontWeight.bold)))),
const SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
@ -175,40 +176,40 @@ class BottomSheetWidget extends StatelessWidget {
_launchURL(indexController.currentFeature[0].properties!["webcontents"]);
},
child: Text(indexController.currentFeature[0].properties!["webcontents"] ?? '',
style: TextStyle(color: Colors.blue,),
style: const TextStyle(color: Colors.blue,),
softWrap: false,
overflow: TextOverflow.fade,),
)),
),
)
],
): Container(width: 0.0, height: 0.0,),
): const SizedBox(width: 0.0, height: 0.0,),
indexController.currentFeature[0].properties!["videos"] != null ?
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(child: Container(
alignment: Alignment.topRight,
child: Text("video".tr, style: TextStyle(fontWeight: FontWeight.bold)))),
SizedBox(width: 12.0,),
child: Text("video".tr, style: const TextStyle(fontWeight: FontWeight.bold)))),
const SizedBox(width: 12.0,),
Expanded(
child: Container(
alignment: Alignment.topLeft,
child: Obx(() => Text(indexController.currentFeature[0].properties!["videos"] ?? '',
style: TextStyle(color: Colors.blue,),
style: const TextStyle(color: Colors.blue,),
overflow: TextOverflow.ellipsis,)
),
),
)
],
): Container(width: 0.0, height: 0.0,),
): const SizedBox(width: 0.0, height: 0.0,),
],
),
),
),
],
),
SizedBox(height: 20.0,),
const SizedBox(height: 20.0,),
Obx(() =>
indexController.currentAction.isNotEmpty ?
Row(
@ -232,7 +233,7 @@ class BottomSheetWidget extends StatelessWidget {
indexController.currentAction[0][0]["wanttogo"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
print("---temp---$temp");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
@ -246,7 +247,7 @@ class BottomSheetWidget extends StatelessWidget {
indexController.currentAction[0][0]["wanttogo"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
print("---temp---$temp");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
@ -267,7 +268,7 @@ class BottomSheetWidget extends StatelessWidget {
indexController.currentAction[0][0]["like"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
print("---temp---$temp");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
@ -281,7 +282,7 @@ class BottomSheetWidget extends StatelessWidget {
indexController.currentAction[0][0]["like"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
print("---temp---$temp");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
@ -302,7 +303,7 @@ class BottomSheetWidget extends StatelessWidget {
:
Container(width: 0, height: 0,),
const SizedBox(width: 0, height: 0,),
indexController.rog_mode.value == 1 ?
indexController.currentAction[0][0]["checkin"] == false ?
Column(
@ -311,9 +312,9 @@ class BottomSheetWidget extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
children: [
ElevatedButton(
child: Text("Image"), onPressed: (){
final ImagePicker _picker = ImagePicker();
_picker.pickImage(source: ImageSource.camera).then((value){
child: const Text("Image"), onPressed: (){
final ImagePicker picker = ImagePicker();
picker.pickImage(source: ImageSource.camera).then((value){
print("----- image---- ${value!.path}");
});
},
@ -327,7 +328,7 @@ class BottomSheetWidget extends StatelessWidget {
indexController.currentAction[0][0]["checkin"] = true;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
print("---temp---$temp");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
@ -344,18 +345,18 @@ class BottomSheetWidget extends StatelessWidget {
indexController.currentAction[0][0]["checkin"] = false;
Map<String,dynamic> temp = Map<String,dynamic>.from(indexController.currentAction[0][0]);
indexController.currentAction.clear();
print("---temp---${temp}");
print("---temp---$temp");
indexController.currentAction.add([temp]);
}
indexController.makeAction(context);
},
child: Icon(
child: const Icon(
Icons.favorite, color: Colors.red)
,
):
Container(width: 0, height: 0,),
const SizedBox(width: 0, height: 0,),
],
): Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -364,11 +365,11 @@ class BottomSheetWidget extends StatelessWidget {
onPressed: (){
Get.toNamed(AppPages.LOGIN);
},
child: Flexible(child: Text("その他のオプションについてはログインしてください")))
child: const Flexible(child: Text("その他のオプションについてはログインしてください")))
],
),
),
Row(
const Row(
children: [
SizedBox(height: 60.0,),
],

View File

@ -15,7 +15,7 @@ class BreadCrumbWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
print("------ map controller is ${mapController}------------");
print("------ map controller is $mapController------------");
return
Obx(()=>
indexController.perfectures.isNotEmpty && mapController != null ?

View File

@ -1,6 +1,5 @@
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);
@ -31,7 +30,7 @@ class _CatWidgetState extends State<CatWidget> {
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());
PopupMenuItem itm = PopupMenuItem(value: d['category'].toString(), child: Text(d['category'].toString()));
itms.add(itm);
}
return itms;

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
@ -7,8 +6,6 @@ import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/utils/const.dart';
import 'package:rogapp/utils/database_helper.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
import 'package:sqflite/sqlite_api.dart';
import 'package:timeline_tile/timeline_tile.dart';
class DestinationWidget extends StatelessWidget {
@ -22,12 +19,12 @@ class DestinationWidget extends StatelessWidget {
Image getImage(int index){
if(destinationController.destinations[index].photos== null || destinationController.destinations[index].photos == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
return const Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
print("------- image is ${destinationController.destinations[index].photos!}------");
String _photo = destinationController.destinations[index].photos!;
if(_photo.contains('http')){
String photo = destinationController.destinations[index].photos!;
if(photo.contains('http')){
return Image(image: NetworkImage(
destinationController.destinations[index].photos!),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
@ -36,10 +33,10 @@ class DestinationWidget extends StatelessWidget {
);
}
else {
String server_url = ConstValues.currentServer();
String serverUrl = ConstValues.currentServer();
//print("==== photo is ${server_url + '/media/compressed/' + destinationController.destinations[index].photos!} ===");
return Image(image: NetworkImage(
'${server_url}/media/compressed/' + destinationController.destinations[index].photos!),
'$serverUrl/media/compressed/${destinationController.destinations[index].photos!}'),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
},
@ -63,10 +60,10 @@ class DestinationWidget extends StatelessWidget {
// }
void doDelete() {
destinationController.currentSelectedDestinations.forEach((element) {
for (var element in destinationController.currentSelectedDestinations) {
destinationController.deleteDestination(element);
destinationController.resetRogaining();
});
}
// destinationController.destination_index_data.forEach((element) {
// //print(element["index"]);
// destinationController.deleteDestination(element["index"]);
@ -75,7 +72,7 @@ class DestinationWidget extends StatelessWidget {
}
void moveUp() {
Destination? d = null;
Destination? d;
for(Destination ad in destinationController.destinations){
if(ad.selected == true){
d = ad;
@ -89,7 +86,7 @@ class DestinationWidget extends StatelessWidget {
}
void moveDown() {
Destination? d = null;
Destination? d;
for(Destination ad in destinationController.destinations){
if(ad.selected == true){
d = ad;
@ -107,8 +104,8 @@ class DestinationWidget extends StatelessWidget {
title: "are_you_sure_want_to_delete_all".tr,
middleText: "all_added_destination_will_be_deleted".tr,
backgroundColor: Colors.blue.shade300,
titleStyle: TextStyle(color: Colors.white),
middleTextStyle: TextStyle(color: Colors.white),
titleStyle: const TextStyle(color: Colors.white),
middleTextStyle: const TextStyle(color: Colors.white),
textConfirm: "confirm".tr,
textCancel: "cancel".tr,
cancelTextColor: Colors.white,
@ -116,7 +113,7 @@ class DestinationWidget extends StatelessWidget {
buttonColor: Colors.white,
barrierDismissible: false,
radius: 10,
content: Column(
content: const Column(
children: [
],
),
@ -138,9 +135,9 @@ class DestinationWidget extends StatelessWidget {
// });
}
Future getIsLocationAvilable(int location_id) async {
Future getIsLocationAvilable(int locationId) async {
DatabaseHelper db = DatabaseHelper.instance;
return await db.isAlreadyAvailable(location_id);
return await db.isAlreadyAvailable(locationId);
}
@override
@ -164,8 +161,8 @@ class DestinationWidget extends StatelessWidget {
isFirst: index == 0 ? true : false,
indicatorStyle: IndicatorStyle(
indicator: CircleAvatar(
child: Text(destinationController.destinations[index].list_order.toString(), style: TextStyle(color: Colors.white),),
backgroundColor: Colors.red,
child: Text(destinationController.destinations[index].list_order.toString(), style: const TextStyle(color: Colors.white),),
),
),
key: Key(index.toString()),
@ -178,22 +175,20 @@ class DestinationWidget extends StatelessWidget {
onTap: () async {
{
Destination? fs = destinationController.destinations[index];
print("----fsf-----${index}");
if(fs != null){
if(indexController.currentDestinationFeature.isNotEmpty) {
indexController.currentDestinationFeature.clear();
}
indexController.currentDestinationFeature.add(fs);
print("--- ndexController.currentDestinationFeature ----- ${ indexController.currentDestinationFeature[0].name} ----");
//indexController.getAction();
showModalBottomSheet(context: context, isScrollControlled: true,
//builder:((context) => BottomSheetWidget())
builder:((context) => BottomSheetNew())
);
print("----fsf-----$index");
if(indexController.currentDestinationFeature.isNotEmpty) {
indexController.currentDestinationFeature.clear();
}
};
indexController.currentDestinationFeature.add(fs);
print("--- ndexController.currentDestinationFeature ----- ${ indexController.currentDestinationFeature[0].name} ----");
//indexController.getAction();
showModalBottomSheet(context: context, isScrollControlled: true,
//builder:((context) => BottomSheetWidget())
builder:((context) => BottomSheetNew())
);
}
},
onLongPress: (){
destinationController.toggleSelection(destinationController.destinations[index]);
@ -229,7 +224,7 @@ class DestinationWidget extends StatelessWidget {
color: Colors.grey.withOpacity(0.3),
spreadRadius: 5,
blurRadius: 3,
offset: Offset(0, 7), // changes position of shadow
offset: const Offset(0, 7), // changes position of shadow
),
],
),
@ -239,22 +234,22 @@ class DestinationWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
IconButton(
icon:Icon(Icons.delete_forever),
icon:const Icon(Icons.delete_forever),
//onPressed: (){doDelete();},
onPressed: clearall,
),
IconButton(
icon:Icon(Icons.cancel),
icon:const Icon(Icons.cancel),
//onPressed: (){doDelete();},
onPressed: destinationController.currentSelectedDestinations.length > 0 ? doDelete : null,
onPressed: destinationController.currentSelectedDestinations.isNotEmpty ? doDelete : null,
),
IconButton(
icon:Icon(Icons.move_up),
onPressed: destinationController.currentSelectedDestinations.length > 0 ? moveUp : null,
icon:const Icon(Icons.move_up),
onPressed: destinationController.currentSelectedDestinations.isNotEmpty ? moveUp : null,
),
IconButton(
icon:Icon(Icons.move_down),
onPressed: destinationController.currentSelectedDestinations.length > 0 ? moveDown : null,
icon:const Icon(Icons.move_down),
onPressed: destinationController.currentSelectedDestinations.isNotEmpty ? moveDown : null,
),
// IconButton(
// icon:Icon(Icons.sync),

View File

@ -6,7 +6,6 @@ import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/utils/const.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
class ListWidget extends StatelessWidget {
ListWidget({ Key? key }) : super(key: key);
@ -16,16 +15,16 @@ class ListWidget extends StatelessWidget {
Image getImage(int index){
if(indexController.locations[0].collection[index].properties!["photos"] == null || indexController.locations[0].collection[index].properties!["photos"] == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
return const Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
print("==== photo index is ${index} ===");
String server_url = ConstValues.currentServer();
print("==== photo index is $index ===");
String serverUrl = ConstValues.currentServer();
GeoJsonFeature<dynamic> gf = indexController.locations[0].collection[index];
String _photo = gf!.properties!["photos"];
String photo = gf.properties!["photos"];
return Image(
image: NetworkImage(
'${server_url}/media/compressed/' + _photo
'$serverUrl/media/compressed/$photo'
),
errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
return Image.asset("assets/images/empty_image.png");
@ -35,7 +34,7 @@ class ListWidget extends StatelessWidget {
}
void changeCurrentFeature(GeoJsonFeature fs){
if(indexController.currentFeature.length > 0){
if(indexController.currentFeature.isNotEmpty){
indexController.currentFeature.clear();
}
indexController.currentFeature.add(fs);
@ -44,21 +43,21 @@ class ListWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Obx(() =>
indexController.locations.length > 0 ?
indexController.locations.isNotEmpty ?
ListView.builder(
itemCount: indexController.locations[0].collection.length,
shrinkWrap: true,
itemBuilder: (_, index){
bool _is_found = false;
bool isFound = false;
for(Destination d in destinationController.destinations){
if(indexController.locations[0].collection[index].properties!['location_id'] == d.location_id){
_is_found = true;
isFound = true;
break;
}
}
return Card(
child: ListTile(
selected: _is_found,
selected: isFound,
selectedTileColor: Colors.yellow.shade200,
onTap: (){
@ -72,13 +71,13 @@ class ListWidget extends StatelessWidget {
);
},
leading: getImage(index),
title: indexController.locations[0].collection[index].properties!['location_name'] != null ? Text(indexController.locations[0].collection[index].properties!['location_name'].toString()) : Text(""),
subtitle: indexController.locations[0].collection[index].properties!['category'] != null ? Text(indexController.locations[0].collection[index].properties!['category']) : Text(""),
trailing: indexController.locations[0].collection[index].properties!['sub_loc_id'] != null ? Text(indexController.locations[0].collection[index].properties!['sub_loc_id']) : Text(""),
title: indexController.locations[0].collection[index].properties!['location_name'] != null ? Text(indexController.locations[0].collection[index].properties!['location_name'].toString()) : const Text(""),
subtitle: indexController.locations[0].collection[index].properties!['category'] != null ? Text(indexController.locations[0].collection[index].properties!['category']) : const Text(""),
trailing: indexController.locations[0].collection[index].properties!['sub_loc_id'] != null ? Text(indexController.locations[0].collection[index].properties!['sub_loc_id']) : const Text(""),
),
);
},
) : Container(width: 0, height: 0,),
) : const SizedBox(width: 0, height: 0,),
);
}
}

View File

@ -5,14 +5,12 @@ import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:flutter_map_marker_cluster/flutter_map_marker_cluster.dart';
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/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/utils/text_util.dart';
import 'package:rogapp/widgets/base_layer_widget.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
class MapWidget extends StatelessWidget {
@ -69,19 +67,19 @@ class MapWidget extends StatelessWidget {
child: Stack(
alignment: Alignment.center,
children: [
Icon(Icons.circle,size: 6.0,),
const Icon(Icons.circle,size: 6.0,),
i.properties!['cp'] == -1 ?
Transform.rotate(
alignment: Alignment.centerLeft,
origin: Offset.fromDirection(1, 26),
angle: 270 * pi / 180,
child: Icon(Icons.play_arrow_outlined, color: Colors.red, size: 70,)):
child: const Icon(Icons.play_arrow_outlined, color: Colors.red, size: 70,)):
Container(color: Colors.transparent,),
],
)
),
),
Container(color: Colors.white, child: Text(TextUtils.getDisplayTextFeture(i), style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))),
Container(color: Colors.white, child: Text(TextUtils.getDisplayTextFeture(i), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold, color:Colors.red,))),
],
);
}
@ -91,12 +89,12 @@ class MapWidget extends StatelessWidget {
print("---------- rog mode is ${indexController.rog_mode.value.toString()}----------");
final PopupController _popupController = PopupController();
final PopupController popupController = PopupController();
return Stack(
children: [
Obx(() =>
indexController.is_loading == true ? Padding(
padding: const EdgeInsets.only(top: 60.0),
indexController.is_loading == true ? const Padding(
padding: EdgeInsets.only(top: 60.0),
child: CircularProgressIndicator(),
):
FlutterMap(
@ -110,7 +108,7 @@ class MapWidget extends StatelessWidget {
//print(DateTime.now().toString() + ' [MapEventMoveStart] START');
// do something
}
if (mapEvent is MapEventMoveEnd && indexController.currentUser. length <= 0) {
if (mapEvent is MapEventMoveEnd && indexController.currentUser.isEmpty) {
//print(DateTime.now().toString() + ' [MapEventMoveStart] END');
indexController.loadLocationsBound();
//indexController.rogMapController!.move(c.center, c.zoom);
@ -119,7 +117,7 @@ class MapWidget extends StatelessWidget {
},
//center: LatLng(37.15319600454702, 139.58765950528198),
bounds: indexController.currentBound.length > 0 ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
bounds: indexController.currentBound.isNotEmpty ? indexController.currentBound[0]: LatLngBounds.fromPoints([LatLng(35.03999881162295, 136.40587119778962), LatLng(36.642756778706904, 137.95226720406063)]),
zoom: 1,
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
@ -127,11 +125,11 @@ class MapWidget extends StatelessWidget {
},
onTap: (_, __) =>
_popupController
popupController
.hideAllPopups(), // Hide popup when the map is tapped.
),
children: [
BaseLayer(),
const BaseLayer(),
CurrentLocationLayer(),
indexController.locations.isNotEmpty && indexController.locations[0].collection.isNotEmpty ?
MarkerLayer(

View File

@ -2,7 +2,6 @@ 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 {
@ -41,8 +40,8 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
for (Map<String, dynamic> currency in widget.indexController.perfectures[0]) {
//print(currency["id"].toString());
var newDropdown = DropdownMenuItem(
child: Text(currency["adm1_ja"].toString()),
value: currency["id"].toString(),
child: Text(currency["adm1_ja"].toString()),
);
dropDownItems.add(newDropdown);
@ -57,8 +56,8 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
for (Map<String, dynamic> currency in widget.indexController.subPerfs[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["adm2_ja"].toString()),
value: currency["id"].toString(),
child: Text(currency["adm2_ja"].toString()),
);
dropDownItems.add(newDropdown);
}
@ -72,8 +71,8 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
for (Map<String, dynamic> currency in widget.indexController.areas[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["area_nm"].toString()),
value: currency["id"].toString(),
child: Text(currency["area_nm"].toString()),
);
dropDownItems.add(newDropdown);
@ -85,8 +84,8 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
for (Map<String, dynamic> currency in widget.indexController.customAreas[0]) {
var newDropdown = DropdownMenuItem(
child: Text(currency["event_name"].toString()),
value: currency["event_name"].toString(),
child: Text(currency["event_name"].toString()),
);
dropDownItems.add(newDropdown);
@ -105,7 +104,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
//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());
var newDropdown = DropdownMenuItem(value: d['category'].toString(), child: Text(d['category'].toString()));
//print("--------cats ------############### ${d['category'].toString()} -------------");
dropDownItems.add(newDropdown);
}
@ -166,12 +165,10 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
}
setState(() {
widget.indexController.locations.clear();
if(newValue != null){
widget.indexController.is_loading.value = true;
widget.indexController.areaDropdownValue = newValue;
widget.indexController.populateSubPerForArea(newValue, widget.mapController);
}
});
widget.indexController.is_loading.value = true;
widget.indexController.areaDropdownValue = newValue;
widget.indexController.populateSubPerForArea(newValue, widget.mapController);
});
},
items: getCustomArea(),
): const Text(""),
@ -203,7 +200,7 @@ class _PerfectureWidgetState extends State<PerfectureWidget> {
) :
const Text(""),
//CatWidget(indexController: widget.indexController,),
widget.indexController.cats.length > 0 ?
widget.indexController.cats.isNotEmpty ?
DropdownButton<String>(
value: widget.indexController.getCatText(),
icon: const Icon(Icons.arrow_downward),