update to add resume app from sleep

This commit is contained in:
Mohamed Nouffer
2023-08-16 14:53:32 +05:30
parent 68bf3e9ab3
commit 2ab96cc3d0
51 changed files with 748 additions and 789 deletions

View File

@ -23,7 +23,7 @@ class CameraPage extends StatelessWidget {
return FileImage(destinationController.photos[0]);
}
else{
return AssetImage('assets/images/empty_image.png');
return const AssetImage('assets/images/empty_image.png');
}
}
@ -45,12 +45,12 @@ class CameraPage extends StatelessWidget {
settingGoal.value == false ?
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.red
backgroundColor: Colors.red
),
onPressed: () async {
settingGoal.value = true;
try{
int user_id = indexController.currentUser[0]["user"]["id"];
int userId = indexController.currentUser[0]["user"]["id"];
//print("--- Pressed -----");
String _team = indexController.currentUser[0]["user"]['team_name'];
//print("--- _team : ${_team}-----");
@ -61,7 +61,7 @@ class CameraPage extends StatelessWidget {
DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
await ExternalService().makeGoal(user_id, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
await ExternalService().makeGoal(userId, _token, _team, destinationController.photos[0].path, formattedDate, _event_code).then((value){
print("---called ext api ${value['status']} ------");
if(value['status'] == 'OK'){
Get.back();
@ -86,7 +86,7 @@ class CameraPage extends StatelessWidget {
)
:
Container(
child: Center(
child: const Center(
child: CircularProgressIndicator(),
),
)
@ -105,14 +105,14 @@ class CameraPage extends StatelessWidget {
onPressed: (){
destinationController.openCamera(context);
},
child: destinationController.photos.length > 0 ? Text("再撮影") : Text("撮影")
child: destinationController.photos.isNotEmpty ? const Text("再撮影") : const Text("撮影")
)
),
Obx(() =>
destinationController.photos.isNotEmpty ?
ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.red
backgroundColor: Colors.red
),
onPressed: (){
print("##### current destination ${indexController.currentDestinationFeature[0].sub_loc_id} #######");
@ -136,7 +136,7 @@ class CameraPage extends StatelessWidget {
// }
// });
},
child: Text("チェックイン")
child: const Text("チェックイン")
):
Container()
)
@ -166,7 +166,7 @@ class CameraPage extends StatelessWidget {
onPressed: (){
Navigator.of(context).pop();
destinationController.skip_10s = true;
timer = Timer.periodic(Duration(seconds: 10), (Timer t){
timer = Timer.periodic(const Duration(seconds: 10), (Timer t){
destinationController.skip_10s = false;
});
},
@ -175,13 +175,13 @@ class CameraPage extends StatelessWidget {
)
:
AppBar(
title: Text("チェックポイント"),
title: const Text("チェックポイント"),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Padding(
padding: EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0),
child: Center(
child: Obx(() =>
Container(
@ -226,14 +226,14 @@ class StartRogaining extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("You have not started rogaining yet.".tr, style: TextStyle(fontSize: 24)),
SizedBox(height: 40.0,),
Text("You have not started rogaining yet.".tr, style: const TextStyle(fontSize: 24)),
const SizedBox(height: 40.0,),
ElevatedButton(
onPressed: (){
Get.back();
destinationController.skip_gps = false;
},
child: Text("Back"),
child: const Text("Back"),
),
],
),
@ -259,14 +259,14 @@ class NotAtGoal extends StatelessWidget {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("You have not reached the goal yet.".tr, style: TextStyle(fontSize: 24)),
SizedBox(height: 40.0,),
Text("You have not reached the goal yet.".tr, style: const TextStyle(fontSize: 24)),
const SizedBox(height: 40.0,),
ElevatedButton(
onPressed: (){
Get.back();
destinationController.skip_gps = false;
},
child: Text("Back"),
child: const Text("Back"),
),
],
),

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
class ChangePasswordPage extends StatelessWidget {
ChangePasswordPage({Key? key}) : super(key: key);
@ -23,10 +22,10 @@ class ChangePasswordPage extends StatelessWidget {
leading:
IconButton( onPressed: (){
Navigator.pop(context);
},icon:Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
),
body:
Container(
SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@ -37,13 +36,13 @@ class ChangePasswordPage extends StatelessWidget {
Column(
children: [
Container(
child: Text("change_password".tr, style: TextStyle(fontSize: 24.0),),
child: Text("change_password".tr, style: const TextStyle(fontSize: 24.0),),
),
SizedBox(height: 30,),
const SizedBox(height: 30,),
],
),
Padding(
padding: EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric(
horizontal: 40
),
child: Column(
@ -54,9 +53,9 @@ class ChangePasswordPage extends StatelessWidget {
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Container(
padding: EdgeInsets.only(top: 3,left: 3),
padding: const EdgeInsets.only(top: 3,left: 3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
),
@ -71,7 +70,7 @@ class ChangePasswordPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: CircularProgressIndicator(),
child: const CircularProgressIndicator(),
) :
Column(
children: [
@ -83,9 +82,9 @@ class ChangePasswordPage extends StatelessWidget {
Get.snackbar(
"no_values".tr,
"values_required".tr,
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -99,12 +98,12 @@ class ChangePasswordPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("ログイン",style: TextStyle(
child: const Text("ログイン",style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
),
SizedBox(height: 10.0,),
const SizedBox(height: 10.0,),
],
)
@ -112,7 +111,7 @@ class ChangePasswordPage extends StatelessWidget {
),
)
),
SizedBox(height: 20,),
const SizedBox(height: 20,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@ -132,17 +131,17 @@ class ChangePasswordPage extends StatelessWidget {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label,style:TextStyle(
Text(label,style:const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w400,
color: Colors.black87
),),
SizedBox(height: 5,),
const SizedBox(height: 5,),
TextField(
controller: controller,
obscureText: obsureText,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 0,horizontal: 10),
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (Colors.grey[400])!,
@ -154,7 +153,7 @@ class ChangePasswordPage extends StatelessWidget {
),
),
),
SizedBox(height: 30.0,)
const SizedBox(height: 30.0,)
],
);
}

View File

@ -1,6 +1,5 @@
import 'package:get/get.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
class DestinationBinding extends Bindings {
@override

View File

@ -1,6 +1,5 @@
import 'dart:convert';
import 'dart:io';
import 'package:camera_camera/camera_camera.dart';
@ -12,25 +11,19 @@ import 'package:geolocator/geolocator.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/model/Rogaining.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/pages/camera/camera_page.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:rogapp/services/action_service.dart';
import 'package:rogapp/services/destination_service.dart';
import 'package:rogapp/services/external_service.dart';
import 'package:rogapp/services/location_line_service.dart';
import 'package:rogapp/services/location_service.dart';
import 'package:rogapp/services/maxtrix_service.dart';
import 'package:rogapp/services/perfecture_service.dart';
import 'package:rogapp/services/reacking_service.dart';
import 'package:rogapp/utils/database_helper.dart';
import 'package:rogapp/widgets/bottom_sheet_new.dart';
import 'dart:async';
import 'package:rogapp/widgets/bottom_sheet_widget.dart';
import 'package:sqflite/sqlite_api.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class DestinationController extends GetxController {
@ -51,7 +44,7 @@ class DestinationController extends GetxController {
var is_at_start = false.obs;
var is_at_goal = false.obs;
var is_photo_shoot = false.obs;
DateTime last_goal_at = DateTime.now().subtract(Duration(days:1));
DateTime last_goal_at = DateTime.now().subtract(const Duration(days:1));
//List<Rogaining> rogainings = <Rogaining>[].obs;
bool checking_in = false;
@ -115,8 +108,8 @@ class DestinationController extends GetxController {
void startTimerLocation(GeoJsonFeature fs, double distance) {
print("---- in startTimer ----");
//skip_gps = true;
double checkin_radious = fs.properties!['checkin_radius'] ?? double.infinity;
if(checkin_radious >= distance){
double checkinRadious = fs.properties!['checkin_radius'] ?? double.infinity;
if(checkinRadious >= distance){
indexController.currentFeature.clear();
Destination d = festuretoDestination(fs);
for(Destination de in destinations){
@ -135,14 +128,14 @@ class DestinationController extends GetxController {
print("=== passed dest is ${d.location_id} ${d.checkedin} ====");
skip_gps = true;
print("---- in startTimer ----");
double checkin_radious = d.checkin_radious ?? double.infinity;
bool auto_checkin = d.auto_checkin == 0 ? false : true;
bool location_already_checked_in = d.checkedin ?? false;
bool isUser_logged_in = indexController.currentUser.length > 0 ? true : false;
double checkinRadious = d.checkin_radious ?? double.infinity;
bool autoCheckin = d.auto_checkin == 0 ? false : true;
bool locationAlreadyCheckedIn = d.checkedin ?? false;
bool isuserLoggedIn = indexController.currentUser.isNotEmpty ? true : false;
//make current destination
print("---- checkin_radious ${checkin_radious} ----");
print("---- distance ${distance} ----");
if(checkin_radious >= distance){
print("---- checkin_radious $checkinRadious ----");
print("---- distance $distance ----");
if(checkinRadious >= distance){
//currentSelectedDestinations.add(d);
indexController.currentDestinationFeature.clear();
indexController.currentDestinationFeature.add(d);
@ -202,9 +195,9 @@ class DestinationController extends GetxController {
}
print("---- location checkin radious ${d.checkin_radious} ----");
print("---- already checked in ${location_already_checked_in} ----");
if(checkin_radious >= distance && location_already_checked_in == false && is_in_rog.value == true){
if(auto_checkin){
print("---- already checked in $locationAlreadyCheckedIn ----");
if(checkinRadious >= distance && locationAlreadyCheckedIn == false && is_in_rog.value == true){
if(autoCheckin){
if(!checking_in){
print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ make checkin ${d.sub_loc_id}@@@@@@@@@@@");
makeCheckin(d, true,"");
@ -255,11 +248,11 @@ class DestinationController extends GetxController {
}
}
print("---- cp --- ${d.cp} -----");
print("--- at goal ${is_at_goal} ---");
print("--- rog counted ${rogaining_counted} ---");
print("--- loc already checked in ${location_already_checked_in} ---");
print("--- at goal $is_at_goal ---");
print("--- rog counted $rogaining_counted ---");
print("--- loc already checked in $locationAlreadyCheckedIn ---");
print("==== date diff is ${DateTime.now().difference(last_goal_at).inHours} ====");
if(isUser_logged_in && d.cp == -1 && location_already_checked_in && skip_10s == false){
if(isuserLoggedIn && d.cp == -1 && locationAlreadyCheckedIn && skip_10s == false){
//check for rogaining
if(is_at_goal.value == false && rogaining_counted.value){
//goal
@ -290,7 +283,7 @@ class DestinationController extends GetxController {
});
}
}
print("==== _chekcs ${chekcs} ====");
print("==== _chekcs $chekcs ====");
if(chekcs == 0){
skip_gps = false;
}
@ -316,7 +309,7 @@ class DestinationController extends GetxController {
int? _latgoal = await db.latestGoal();
if(_latgoal != null){
last_goal_at = DateTime.fromMicrosecondsSinceEpoch(_latgoal);
print("===== last goal : ${last_goal_at} =====");
print("===== last goal : $last_goal_at =====");
}
@ -339,7 +332,7 @@ class DestinationController extends GetxController {
onFile: (file) {
photos.add(file);
Navigator.pop(context);
print("----image file is : ${file}----");
print("----image file is : $file----");
//setState(() {});
},
)));
@ -362,11 +355,12 @@ class DestinationController extends GetxController {
return d;
}
}
return null;
}
void checkForCheckin(double la, double ln){
print("--- skip_gps ---- ${skip_gps}----");
print("--- skip_gps ---- $skip_gps----");
for(final d in destinations){
@ -376,7 +370,7 @@ class DestinationController extends GetxController {
double lon = d.lon!;
LatLng p = LatLng(lat, lon);
getDestinationForLatLong(lat, lon).then((value){
var distance = Distance();
var distance = const Distance();
double dist = distance.as(LengthUnit.Meter, LatLng(lat, lon), LatLng(la, ln));
//double checkin_radious = value!.checkin_radious ?? double.infinity;
//bool auto_checkin = value.auto_checkin == 0 ? false : true;
@ -405,23 +399,23 @@ class DestinationController extends GetxController {
GeoJsonMultiPoint mp = fs.geometry as GeoJsonMultiPoint;
LatLng pt = LatLng(mp.geoSerie!.geoPoints[0].latitude, mp.geoSerie!.geoPoints[0].longitude);
double lat_fs = pt.latitude;
double lon_fs = pt.longitude;
LatLng p_fs = LatLng(lat_fs, lon_fs);
var distance_fs = Distance();
double dist_fs = distance_fs.as(LengthUnit.Meter, LatLng(lat_fs, lon_fs), LatLng(la, ln));
double latFs = pt.latitude;
double lonFs = pt.longitude;
LatLng pFs = LatLng(latFs, lonFs);
var distanceFs = const Distance();
double distFs = distanceFs.as(LengthUnit.Meter, LatLng(latFs, lonFs), LatLng(la, ln));
if(dist_fs <= 250 && skip_gps == false){
if(distFs <= 250 && skip_gps == false){
//near a location
print("---- before call startTimerLocation ----");
startTimerLocation(fs, dist_fs);
startTimerLocation(fs, distFs);
}
}
}
void addToRogaining(double lat, double lon, int destination_id) async {
void addToRogaining(double lat, double lon, int destinationId) async {
DatabaseHelper db = DatabaseHelper.instance;
List<Destination> d = await db.getDestinationById(destination_id);
List<Destination> d = await db.getDestinationById(destinationId);
if(d.isEmpty){
Destination df = festuretoDestination(indexController.currentFeature[0]);
print("--- made checkin ${df.location_id} ----");
@ -443,10 +437,10 @@ class DestinationController extends GetxController {
PopulateDestinations();
/// post to NATNAT
if(indexController.currentUser.length > 0){
double cp_num = destination.cp!;
if(indexController.currentUser.isNotEmpty){
double cpNum = destination.cp!;
int user_id = indexController.currentUser[0]["user"]["id"];
int userId = indexController.currentUser[0]["user"]["id"];
//print("--- Pressed -----");
String _team = indexController.currentUser[0]["user"]['team_name'];
//print("--- _team : ${_team}-----");
@ -457,9 +451,9 @@ class DestinationController extends GetxController {
DateTime now = DateTime.now();
String formattedDate = DateFormat('yyyy-MM-dd HH:mm:ss').format(now);
print("------ checkin event ${_event_code} ------");
ExternalService().makeCheckpoint(user_id, _token, formattedDate, _team,cp_num.round(), _event_code, imageurl).then((value){
print("------Ext service check point ${value} ------");
print("------ checkin event $_event_code ------");
ExternalService().makeCheckpoint(userId, _token, formattedDate, _team,cpNum.round(), _event_code, imageurl).then((value){
print("------Ext service check point $value ------");
});
}
@ -496,7 +490,7 @@ class DestinationController extends GetxController {
showBackgroundLocationIndicator: true
);
} else {
locationSettings = LocationSettings(
locationSettings = const LocationSettings(
accuracy: LocationAccuracy.high,
distanceFilter: 0,
);
@ -513,17 +507,17 @@ class DestinationController extends GetxController {
indexController.current_lat = position != null ? position.latitude : 0;
current_lon = position != null ? position.longitude : 0;
print("==== gps skip is : ${skip_gps.toString()}, selected is ${is_gps_selected} , ${current_lat}");
print("==== gps skip is : ${skip_gps.toString()}, selected is $is_gps_selected , $current_lat");
if(is_gps_selected.value){
double czoom = indexController.rogMapController!.zoom;
indexController.rogMapController!.move(LatLng(position!.latitude, position!.longitude), czoom);
double czoom = indexController.rogMapController.zoom;
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}");
gps.clear();
gps.add("-- lat : ${position.latitude}, lon : ${position.longitude} --");
checkForCheckin(position!.latitude, position.longitude);
checkForCheckin(position.latitude, position.longitude);
print("--- call check checkin");
print("---- skip gps is ${skip_gps.toString()} ----");
//});
@ -552,7 +546,7 @@ class DestinationController extends GetxController {
@override
void onReady() {
Get.toNamed(AppPages.LOGIN)!.then((value){
if(indexController.currentUser.length > 0) {
if(indexController.currentUser.isNotEmpty) {
fixMapBound();
}
else {
@ -560,7 +554,7 @@ class DestinationController extends GetxController {
PerfectureService.getSubExt("9").then((value){
if(value != null){
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
indexController.mapController!.fitBounds(bnds); //.centerZoomFitBounds(bnds);
indexController.mapController.fitBounds(bnds); //.centerZoomFitBounds(bnds);
}
});
}
@ -573,10 +567,10 @@ class DestinationController extends GetxController {
indexController.switchPage(AppPages.INITIAL);
LocationService.getLocationsExt(_token).then((value) {
if(value != null){
print("--- loc ext is - ${value} ----");
print("--- loc ext is - $value ----");
LatLngBounds bnds = LatLngBounds(LatLng(value[1], value[0]), LatLng(value[3], value[2]));
print("--- bnds is - ${bnds} ----");
indexController.mapController!.fitBounds(
print("--- bnds is - $bnds ----");
indexController.mapController.fitBounds(
bnds,
);
indexController.currentBound.clear();
@ -587,7 +581,7 @@ class DestinationController extends GetxController {
}
void connectionChanged(String val) {
print('----- %%%%%%%%%%%%%%%%%%%%% ----- ${val}');
print('----- %%%%%%%%%%%%%%%%%%%%% ----- $val');
Map<String, dynamic> _res = {};
if(val == "wifi" || val == "mobile"){
String _token = indexController.currentUser[0]["token"];
@ -598,11 +592,11 @@ class DestinationController extends GetxController {
_res = await ExternalService().StartRogaining();
}
else if(e.rog_action_type == 1){
var datetime = new DateTime.fromMicrosecondsSinceEpoch(e.checkintime!);
var datetime = DateTime.fromMicrosecondsSinceEpoch(e.checkintime!);
_res = await ExternalService().makeCheckpoint(e.user_id!, _token, getFormatedTime(datetime), e.team_name!, e.cp_number!, e.event_code!, e.image!);
}
else if(e.rog_action_type == 2){
var datetime = new DateTime.fromMicrosecondsSinceEpoch(e.checkintime!);
var datetime = DateTime.fromMicrosecondsSinceEpoch(e.checkintime!);
_res = await ExternalService().makeGoal(e.user_id!, _token, e.team_name!, e.image!, getFormatedTime(datetime), e.event_code!);
}
@ -626,8 +620,8 @@ class DestinationController extends GetxController {
}
Destination? destinationById(int id){
Destination? d = null;
print("--- target des - ${id} ----");
Destination? d;
print("--- target des - $id ----");
for(Destination ss in destinations){
print("--- des - ${ss.location_id} ----");
if(ss.location_id == id){
@ -678,7 +672,7 @@ class DestinationController extends GetxController {
}
else {
db.insertDestination(dest).then((value){
print("----- destination controller added as new ${value}--- :::::");
print("----- destination controller added as new $value--- :::::");
PopulateDestinations();
});
}
@ -710,7 +704,7 @@ class DestinationController extends GetxController {
context: context,
barrierDismissible: false,
builder: (BuildContext context) {
return Center(
return const Center(
child: CircularProgressIndicator(),
);
});
@ -719,7 +713,7 @@ class DestinationController extends GetxController {
void destinationMatrixFromCurrentPoint(List<Destination> points){
buildShowDialog(Get.context!);
MatrixService.getDestinations(points).then((mat){
print(" matrix is ------- ${mat}");
print(" matrix is ------- $mat");
matrix = mat;
try{
@ -755,7 +749,7 @@ class DestinationController extends GetxController {
destinations.add(d);
}
// destinationCount.value = 0;
print("------ destination controller destinationcount-------- ${destinationCount}-------- :::::");
print("------ destination controller destinationcount-------- $destinationCount-------- :::::");
// MatrixService.getDestinations(value).then((mat){

View File

@ -1,20 +1,14 @@
import 'dart:developer';
import 'dart:io';
import 'package:camera_camera/camera_camera.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:get/get.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/pages/camera/camera_page.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/destination_map/destination_map_page.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/external_service.dart';
import 'package:rogapp/widgets/destination_widget.dart';
import 'package:timeline_tile/timeline_tile.dart';
class DestnationPage extends StatelessWidget {
DestnationPage({Key? key}) : super(key: key);
@ -32,13 +26,13 @@ class DestnationPage extends StatelessWidget {
permission = await Geolocator.requestPermission();
}
Position position = await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high);
indexController.rogMapController?.move(LatLng(position.latitude, position.longitude), 14);
desiredAccuracy: LocationAccuracy.high, forceAndroidLocationManager: true);
indexController.rogMapController.move(LatLng(position.latitude, position.longitude), 14);
}
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{
return Image(image: NetworkImage(destinationController.destinations[index].photos!));
@ -48,21 +42,18 @@ class DestnationPage extends StatelessWidget {
Widget getRoutingImage(int route){
switch (route) {
case 0:
return Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
return const Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
case 1:
return Image(image: AssetImage('assets/images/p4_8_car.png'), width: 35.0,);
return const Image(image: AssetImage('assets/images/p4_8_car.png'), width: 35.0,);
case 2:
return Image(image: AssetImage('assets/images/p4_10_train.png'), width: 35.0,);
return const Image(image: AssetImage('assets/images/p4_10_train.png'), width: 35.0,);
default:
return Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
return const Image(image: AssetImage('assets/images/p4_9_man.png'), width: 35.0,);
}
}
@override
Widget build(BuildContext context) {
final ColorScheme colorScheme = Theme.of(context).colorScheme;
final Color oddItemColor = colorScheme.primary.withOpacity(0.05);
final Color evenItemColor = colorScheme.primary.withOpacity(0.15);
return WillPopScope(
onWillPop: () async {
indexController.switchPage(AppPages.INITIAL);
@ -85,12 +76,12 @@ class DestnationPage extends StatelessWidget {
children: [
Padding(
padding: const EdgeInsets.only(top:30.0, bottom: 30),
child: Center(child: Text("select_travel_mode".tr, style: TextStyle(fontSize: 22.0, color:Colors.red, fontWeight:FontWeight.bold),),),
child: Center(child: Text("select_travel_mode".tr, style: const TextStyle(fontSize: 22.0, color:Colors.red, fontWeight:FontWeight.bold),),),
),
ListTile(
selected: destinationController.travelMode == 0 ? true : false,
selectedTileColor: Colors.amber.shade200,
leading: Image(image: AssetImage('assets/images/p4_9_man.png'),),
leading: const Image(image: AssetImage('assets/images/p4_9_man.png'),),
title: Text("walking".tr),
onTap:(){
destinationController.travelMode.value = 0;
@ -101,7 +92,7 @@ class DestnationPage extends StatelessWidget {
ListTile(
selected: destinationController.travelMode == 1 ? true : false,
selectedTileColor: Colors.amber.shade200,
leading: Image(image: AssetImage('assets/images/p4_8_car.png'),),
leading: const Image(image: AssetImage('assets/images/p4_8_car.png'),),
title: Text("driving".tr),
onTap:(){
destinationController.travelMode.value = 1;
@ -149,9 +140,9 @@ class DestnationPage extends StatelessWidget {
tooltip: 'Increment',
child: Obx(() =>
indexController.desination_mode == 1 ?
Image(image: AssetImage('assets/images/list2.png'))
const Image(image: AssetImage('assets/images/list2.png'))
:
Image(image: AssetImage('assets/images/map.png'))
const Image(image: AssetImage('assets/images/map.png'))
),
elevation: 4.0,
),
@ -170,12 +161,12 @@ class DestnationPage extends StatelessWidget {
destinationController.is_at_goal == true ?
IconButton(
onPressed:(){Get.toNamed(AppPages.CAMERA_PAGE);},
icon: Icon(Icons.assistant_photo),
icon: const Icon(Icons.assistant_photo),
)
:
IconButton(
onPressed:(){Get.toNamed(AppPages.CAMERA_PAGE);},
icon: Icon(Icons.accessibility),
icon: const Icon(Icons.accessibility),
),
),
// Obx(() =>
@ -185,7 +176,7 @@ class DestnationPage extends StatelessWidget {
ToggleButtons(
disabledColor: Colors.grey.shade200,
selectedColor: Colors.red,
children: <Widget>[
children: const <Widget>[
Icon(Icons.explore, size: 35.0,
)],
onPressed: (int index) {

View File

@ -5,21 +5,15 @@ import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:flutter_map_marker_popup/flutter_map_marker_popup.dart';
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
import 'package:flutter_polyline_points/flutter_polyline_points.dart';
import 'package:geojson/geojson.dart';
import 'package:geolocator/geolocator.dart';
import 'package:get/get.dart';
import 'package:latlong2/latlong.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/services/destination_service.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';
import 'package:rogapp/widgets/bread_crum_widget.dart';
class DestinationMapPage extends StatelessWidget {
@ -46,7 +40,7 @@ class DestinationMapPage extends StatelessWidget {
int index = -1;
for (int i = 0; i < destinationController.destinations.length; i++) {
Destination d = destinationController.destinations[i];
print("^^^^ ${d} ^^^^");
print("^^^^ $d ^^^^");
Marker m = Marker(
point: LatLng(d.lat!, d.lon!),
anchorPos: AnchorPos.align(AnchorAlign.center),
@ -55,20 +49,18 @@ class DestinationMapPage extends StatelessWidget {
return InkWell(
onTap: (){
print("-- Destination is --- ${d.name} ------");
if(d != null){
if(indexController.currentDestinationFeature.length > 0) {
indexController.currentDestinationFeature.clear();
}
indexController.currentDestinationFeature.add(d);
//indexController.getAction();
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew())
).whenComplete((){
print("---- set skip gps to false -----");
destinationController.skip_gps = false;
});
if(indexController.currentDestinationFeature.isNotEmpty) {
indexController.currentDestinationFeature.clear();
}
indexController.currentDestinationFeature.add(d);
//indexController.getAction();
showModalBottomSheet(context: Get.context!, isScrollControlled: true,
builder:((context) => BottomSheetNew())
).whenComplete((){
print("---- set skip gps to false -----");
destinationController.skip_gps = false;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -79,19 +71,19 @@ class DestinationMapPage extends StatelessWidget {
decoration: BoxDecoration(
color: Colors.red,
shape: BoxShape.circle,
border: new Border.all(
border: Border.all(
color: Colors.white,
width: d.checkin_radious != null ? d.checkin_radious! : 1,
),
),
child: new Center(
child: new Text(
child: Center(
child: Text(
(i + 1).toString(),
style: TextStyle(color: Colors.white),
style: const TextStyle(color: Colors.white),
),
),
),
Container( color: Colors.yellow, child: Text(TextUtils.getDisplayText(d), style: TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),)),
Container( color: Colors.yellow, child: Text(TextUtils.getDisplayText(d), style: const TextStyle(fontSize: 15.0, fontWeight: FontWeight.bold, overflow: TextOverflow.visible),)),
],
),
);
@ -132,28 +124,28 @@ class DestinationMapPage extends StatelessWidget {
options: MapOptions(
onMapReady: (){
indexController.is_rog_mapcontroller_loaded.value = true;
subscription = indexController.rogMapController!.mapEventStream.listen((MapEvent mapEvent) {
subscription = indexController.rogMapController.mapEventStream.listen((MapEvent mapEvent) {
if (mapEvent is MapEventMoveStart) {
}
if (mapEvent is MapEventMoveEnd) {
//destinationController.is_gps_selected.value = true;
//indexController.mapController!.move(c.center, c.zoom);
LatLngBounds bounds = indexController.rogMapController!.bounds!;
LatLngBounds bounds = indexController.rogMapController.bounds!;
indexController.currentBound.clear();
indexController.currentBound.add(bounds);
if(indexController.currentUser.length <= 0){
if(indexController.currentUser.isEmpty){
indexController.loadLocationsBound();
}
}
});
} ,
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,
maxZoom: 42,
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
),
children: [
BaseLayer(),
const BaseLayer(),
Obx(() =>
indexController.routePointLenght > 0 ?
PolylineLayer(

View File

@ -1,7 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:rogapp/pages/destination/destination_controller.dart';
import 'package:rogapp/pages/index/index_controller.dart';
import 'package:rogapp/routes/app_pages.dart';
import 'package:rogapp/services/auth_service.dart';
@ -33,16 +32,16 @@ class DrawerPage extends StatelessWidget {
child: Padding(
padding: const EdgeInsets.all(8.0),
child:
indexController.currentUser.length == 0 ?
Flexible(child: Text("drawer_title".tr, style: TextStyle(color: Colors.black, fontSize: 20),))
indexController.currentUser.isEmpty ?
Flexible(child: Text("drawer_title".tr, style: const TextStyle(color: Colors.black, fontSize: 20),))
:
Text(indexController.currentUser[0]['user']['email'], style: TextStyle(color: Colors.black, fontSize: 20),),
Text(indexController.currentUser[0]['user']['email'], style: const TextStyle(color: Colors.black, fontSize: 20),),
),
)
),
),
Obx(() =>
indexController.currentUser.length == 0 ?
indexController.currentUser.isEmpty ?
ListTile(
leading: const Icon(Icons.login),
title: Text("login".tr),
@ -59,7 +58,7 @@ class DrawerPage extends StatelessWidget {
},
)
),
indexController.currentUser.length > 0 ?
indexController.currentUser.isNotEmpty ?
ListTile(
leading: const Icon(Icons.password),
title: Text("change_password".tr),
@ -67,8 +66,8 @@ class DrawerPage extends StatelessWidget {
Get.toNamed(AppPages.CHANGE_PASSWORD);
},
) :
Container(width: 0, height: 0,),
indexController.currentUser.length == 0 ?
const SizedBox(width: 0, height: 0,),
indexController.currentUser.isEmpty ?
ListTile(
leading: const Icon(Icons.person),
title: Text("sign_up".tr),
@ -76,8 +75,8 @@ class DrawerPage extends StatelessWidget {
Get.toNamed(AppPages.REGISTER);
},
) :
Container(width: 0, height: 0,),
indexController.currentUser.length > 0 ?
const SizedBox(width: 0, height: 0,),
indexController.currentUser.isNotEmpty ?
ListTile(
leading: const Icon(Icons.delete_forever),
title: Text("delete_account".tr),
@ -92,7 +91,7 @@ class DrawerPage extends StatelessWidget {
});
},
) :
Container(width: 0, height: 0,),
const SizedBox(width: 0, height: 0,),
// ListTile(
// leading: const Icon(Icons.person),
// title: Text("profile".tr),
@ -108,7 +107,7 @@ class DrawerPage extends StatelessWidget {
// title: Text("point_rank".tr),
// onTap: (){},
// ),
indexController.currentUser.length > 0 ?
indexController.currentUser.isNotEmpty ?
ListTile(
leading: const Icon(Icons.featured_video),
title: Text("rog_web".tr),
@ -116,7 +115,7 @@ class DrawerPage extends StatelessWidget {
_launchURL("https://www.gifuai.net/?page_id=17397");
},
) :
Container(width: 0, height: 0,),
const SizedBox(width: 0, height: 0,),
ListTile(
leading: const Icon(Icons.privacy_tip),
title: Text("privacy".tr),

View File

@ -3,6 +3,8 @@ import 'package:get/get.dart';
import 'package:rogapp/pages/search/search_page.dart';
class HomePage extends GetView{
const HomePage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(

View File

@ -1,7 +1,5 @@
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 {

View File

@ -124,7 +124,7 @@ class IndexController extends GetxController {
void onInit() {
_ever = ever(rog_mode, (_) => print("$_ has been changed (ever)"));
if(perfectures.length == 0){
if(perfectures.isEmpty){
PerfectureService.loadPerfectures().then((value){
perfectures.add(value);
loadAreaFor("9");
@ -193,7 +193,7 @@ List<LatLng> getLocationsList(){
void login(String email, String password, BuildContext context){
AuthService.login(email, password).then((value){
print("------- logged in user details ######## ${value} ###### --------");
print("------- logged in user details ######## $value ###### --------");
if(value.isNotEmpty){
currentUser.clear();
currentUser.add(value);
@ -206,7 +206,7 @@ void login(String email, String password, BuildContext context){
getAction();
}
if(currentUser.length > 0){
if(currentUser.isNotEmpty){
rog_mode.value = 0 ;
}
else{
@ -225,9 +225,9 @@ void login(String email, String password, BuildContext context){
Get.snackbar(
"Failed",
"User login failed, please try again.",
icon: Icon(Icons.error, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -240,7 +240,7 @@ void login(String email, String password, BuildContext context){
String _token = currentUser[0]['token'];
//print("------- change password ######## ${currentUser[0]['token']} ###### --------");
AuthService.changePassword(oldpassword, newpassword, _token).then((value){
print("------- change password ######## ${value} ###### --------");
print("------- change password ######## $value ###### --------");
if(value.isNotEmpty){
is_loading.value = false;
Navigator.pop(context);
@ -254,9 +254,9 @@ void login(String email, String password, BuildContext context){
Get.snackbar(
'failed'.tr,
'password_change_failed_please_try_again'.tr,
icon: Icon(Icons.error, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -271,9 +271,7 @@ void login(String email, String password, BuildContext context){
DatabaseHelper db = DatabaseHelper.instance;
db.deleteAllDestinations().then((value){
DestinationController destinationController = Get.find<DestinationController>();
if(destinationController != null){
destinationController.PopulateDestinations();
}
destinationController.PopulateDestinations();
});
currentUser.clear();
cats.clear();
@ -293,9 +291,9 @@ void login(String email, String password, BuildContext context){
Get.snackbar(
'failed'.tr,
'user_registration_failed_please_try_again'.tr,
icon: Icon(Icons.error, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.error, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -304,13 +302,13 @@ void login(String email, String password, BuildContext context){
}
void makeAction(BuildContext context){
int user_id = currentUser[0]["user"]["id"] as int;
int location_id = currentFeature[0].properties!["location_id"] as int;
int userId = currentUser[0]["user"]["id"] as int;
int locationId = currentFeature[0].properties!["location_id"] as int;
bool wanttogo = currentAction[0][0]["wanttogo"];
bool like = currentAction[0][0]["like"];
bool checkin = currentAction[0][0]["checkin"];
if(user_id > 0){
ActionService.makeAction(user_id, location_id, wanttogo, like, checkin).then((value){
if(userId > 0){
ActionService.makeAction(userId, locationId, wanttogo, like, checkin).then((value){
});
}
@ -318,7 +316,7 @@ void login(String email, String password, BuildContext context){
String getCatText(){
String _cat = 'all'.tr;
if(currentUser.length > 0){
if(currentUser.isNotEmpty){
Map<String, dynamic> _urs = currentUser[0];
print('-- is_rogaining :-- ${_urs['user']['is_rogaining']} ------');
if(_urs['user']['is_rogaining'] == true){
@ -333,8 +331,8 @@ void login(String email, String password, BuildContext context){
void loadCatsv2(){
dynamic initVal = {'category':getCatText()};
LatLngBounds bounds = mapController!.bounds!;
if(bounds.southEast != null && bounds.southWest != null && bounds.northEast != null && bounds.southEast != null ){
LatLngBounds bounds = mapController.bounds!;
if(bounds.southWest != null && bounds.northEast != null ){
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) {
cats.clear();
cats.add(initVal);
@ -349,8 +347,8 @@ void login(String email, String password, BuildContext context){
void loadCatForCity(String city){
dynamic initVal = {'category':getCatText()};
LatLngBounds bounds = mapController!.bounds!;
if(bounds.southEast != null && bounds.southWest != null && bounds.northEast != null && bounds.southEast != null ){
LatLngBounds bounds = mapController.bounds!;
if(bounds.southWest != null && bounds.northEast != null ){
CatService.loadCatByCity(city).then((value) {
cats.clear();
cats.add(initVal);
@ -395,12 +393,12 @@ void login(String email, String password, BuildContext context){
}
void loadUserDetails(){
if(currentUser.length > 0){
int user_id = currentUser[0]["user"]["id"] as int;
AuthService.UserDetails(user_id).then((value){
print("--------- user details ----- ${value}");
if(currentUser.isNotEmpty){
int userId = currentUser[0]["user"]["id"] as int;
AuthService.UserDetails(userId).then((value){
print("--------- user details ----- $value");
if(value != null && value.isNotEmpty){
bool paid = value![0]["paid"] as bool;
bool paid = value[0]["paid"] as bool;
if(paid){
loadCustomAreas();
}
@ -413,7 +411,7 @@ void login(String email, String password, BuildContext context){
void loadCustomAreas(){
customAreas.clear();
PerfectureService.loadCustomAreas().then((value){
print("--- loading custom areas ${value}");
print("--- loading custom areas $value");
customAreas.add(value);
});
}
@ -431,7 +429,7 @@ void login(String email, String password, BuildContext context){
String getSubInitialVal(){
int min = 0;
if(subPerfs.length > 0){
if(subPerfs.isNotEmpty){
min = int.parse(subPerfs[0][0]['id'].toString());
for(var sub in subPerfs[0]){
int x = int.parse(sub['id'].toString()); // as int;
@ -471,16 +469,16 @@ void login(String email, String password, BuildContext context){
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
cat = "";
}
print("----- ${customarea}");
print("----- $customarea");
LocationService.loadCustomLocations(customarea, cat).then((value){
locations.clear();
locations.add(value!);
List<LatLng> locs = getLocationsList();
LatLngBounds bounds = boundsFromLatLngList(locs);
mapController!.fitBounds(bounds);
mapController.fitBounds(bounds);
setBound(bounds);
Future.delayed(Duration(microseconds: 400), () {
mapController!.fitBounds(bounds);
Future.delayed(const Duration(microseconds: 400), () {
mapController.fitBounds(bounds);
});
});
@ -495,33 +493,33 @@ void login(String email, String password, BuildContext context){
if(currentCat.isNotEmpty && currentCat[0] == "-all-"){
cat = "";
}
LatLngBounds bounds = mapController!.bounds!;
LatLngBounds bounds = mapController.bounds!;
currentBound.clear();
currentBound.add(bounds);
//print(currentCat);
if(bounds.southEast != null && bounds.southWest != null && bounds.northEast != null && bounds.southEast != null ){
if(bounds.southWest != null && bounds.northEast != null ){
LocationService.loadLocationsBound(bounds.southWest!.latitude, bounds.southWest!.longitude, bounds.northWest.latitude, bounds.northWest.longitude, bounds.northEast!.latitude, bounds.northEast!.longitude, bounds.southEast.latitude, bounds.southEast.longitude, cat).then((value){
//print("---value length ------ ${value!.collection.length}");
if(value == null){
return;
}
if(value != null && value.collection.isEmpty){
if(value.collection.isEmpty){
if(showPopup == false) {
return;
}
Get.snackbar(
"Too many Points",
"please zoom in",
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
showPopup = false;
//Get.showSnackbar(GetSnackBar(message: "Too many points, please zoom in",));
}
if(value != null && value.collection.isNotEmpty){
if(value.collection.isNotEmpty){
//print("---- added---");
locations.add(value);
loadCatsv2();
@ -542,7 +540,7 @@ void login(String email, String password, BuildContext context){
LatLng lat1 = LatLng(value![1], value[0]);
LatLng lat2 = LatLng(value[3], value[2]);
LatLngBounds bound = LatLngBounds(lat1, lat2);
mapController!.fitBounds(bound);
mapController.fitBounds(bound);
setBound(bound);
});
@ -556,7 +554,7 @@ void login(String email, String password, BuildContext context){
LatLng lat1 = LatLng(value![1], value[0]);
LatLng lat2 = LatLng(value[3], value[2]);
LatLngBounds bound = LatLngBounds(lat1, lat2);
mapController!.fitBounds(bound);
mapController.fitBounds(bound);
setBound(bound);
});
@ -586,7 +584,7 @@ void login(String email, String password, BuildContext context){
GeoJsonFeature? getFeatureForLatLong(double lat, double long){
if(locations.length > 0){
if(locations.isNotEmpty){
for(GeoJsonFeature i in locations[0].collection){
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
if(p.geoSerie!.geoPoints[0].latitude == lat && p.geoSerie!.geoPoints[0].longitude == long){
@ -594,25 +592,26 @@ void login(String email, String password, BuildContext context){
}
}
}
return null;
}
void getAction(){
//print(currentUser[0]["user"]["id"]);
//print(currentFeature[0].properties!["location_id"]);
if(currentUser.length == 0){
if(currentUser.isEmpty){
return;
}
int user_id = currentUser[0]["user"]["id"] as int;
int userId = currentUser[0]["user"]["id"] as int;
print("---- loc id ${currentFeature[0].properties}");
int location_id = currentFeature[0].properties!["location_id"] as int;
ActionService.userAction(user_id, location_id).then((value){
print("------${value}");
if(value != null && value.length > 0){
int locationId = currentFeature[0].properties!["location_id"] as int;
ActionService.userAction(userId, locationId).then((value){
print("------$value");
if(value != null && value.isNotEmpty){
currentAction.clear();
currentAction.add(value);
print("------${currentAction[0]}");
}else{
List<dynamic> initval = [{"user": user_id, "location": location_id, "wanttogo": false, "like": false, "checkin": false}];
List<dynamic> initval = [{"user": userId, "location": locationId, "wanttogo": false, "like": false, "checkin": false}];
currentAction.clear();
currentAction.add(initval);
}
@ -632,15 +631,15 @@ void login(String email, String password, BuildContext context){
if(p.geoSerie!.geoPoints[0].latitude == pt.geometry!.geoSerie!.geoPoints[0].latitude && p.geoSerie!.geoPoints[0].longitude == pt.geometry!.geoSerie!.geoPoints[0].longitude ){
if(currentFeature.length > 0){
if(currentFeature.isNotEmpty){
currentFeature.clear();
}
if(i >= locations[0].collection.length - 1 ){
currentFeature.add(locations[0].collection[0] as GeoJsonFeature);
currentFeature.add(locations[0].collection[0]);
getAction();
}
else{
currentFeature.add(locations[0].collection[i + 1] as GeoJsonFeature);
currentFeature.add(locations[0].collection[i + 1]);
getAction();
}
}
@ -665,15 +664,15 @@ void login(String email, String password, BuildContext context){
if(p.geoSerie!.geoPoints[0].latitude == pt.geometry!.geoSerie!.geoPoints[0].latitude && p.geoSerie!.geoPoints[0].longitude == pt.geometry!.geoSerie!.geoPoints[0].longitude ){
if(currentFeature.length > 0){
if(currentFeature.isNotEmpty){
currentFeature.clear();
}
if(i == 0 ){
currentFeature.add(locations[0].collection[locations[0].collection.length -1] as GeoJsonFeature);
currentFeature.add(locations[0].collection[locations[0].collection.length -1]);
getAction();
}
else{
currentFeature.add(locations[0].collection[i - 1] as GeoJsonFeature);
currentFeature.add(locations[0].collection[i - 1]);
getAction();
}
}

View File

@ -1,20 +1,13 @@
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);
@ -43,7 +36,7 @@ class IndexPage extends GetView<IndexController> {
onPressed: (){
destinationController.fixMapBound();
},
icon: Icon(Icons.refresh)
icon: const Icon(Icons.refresh)
),
InkWell(
onTap: (){
@ -76,7 +69,7 @@ class IndexPage extends GetView<IndexController> {
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,),
child: const Image(image: AssetImage('assets/images/route3_off.png'), width: 35, height: 35,),
onTap: (){
//indexController.switchPage(AppPages.TRAVEL);
},
@ -85,7 +78,7 @@ class IndexPage extends GetView<IndexController> {
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,),
child: const Image(image: AssetImage('assets/images/route2_on.png'),width: 35, height: 35,),
onTap: (){
//indexController.switchPage(AppPages.TRAVEL);
},
@ -108,9 +101,9 @@ class IndexPage extends GetView<IndexController> {
tooltip: 'Increment',
child: Obx(() =>
indexController.mode == 0 ?
Image(image: AssetImage('assets/images/list2.png'))
const Image(image: AssetImage('assets/images/list2.png'))
:
Image(image: AssetImage('assets/images/map.png')),
const Image(image: AssetImage('assets/images/map.png')),
),
elevation: 4.0,
),
@ -168,7 +161,7 @@ class IndexPage extends GetView<IndexController> {
child: Obx(() =>
indexController.mode == 0 ?
MapWidget() :
ListWidget(),
const ListWidget(),
)
)

View File

@ -17,18 +17,18 @@ class _LandingPageState extends State<LandingPage> {
child: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height,
padding: EdgeInsets.symmetric(horizontal: 30,vertical: 30),
padding: const EdgeInsets.symmetric(horizontal: 30,vertical: 30),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
const Text(
"こんにちは!",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 40),
),
SizedBox(height: 30,),
const SizedBox(height: 30,),
Text("ログインを有効にして本人確認を行うと、サーバーが改善されます",
textAlign: TextAlign.center,
style: TextStyle(
@ -38,11 +38,11 @@ class _LandingPageState extends State<LandingPage> {
),
Container(
height: MediaQuery.of(context).size.height/3,
decoration: BoxDecoration(
decoration: const BoxDecoration(
image:DecorationImage(image: AssetImage('assets/images/gradient_japanese_temple.jpg'))
),
),
SizedBox(height: 20.0,),
const SizedBox(height: 20.0,),
MaterialButton(
minWidth: double.infinity,
height:60,
@ -51,18 +51,18 @@ class _LandingPageState extends State<LandingPage> {
},
color: Colors.indigoAccent[400],
shape: RoundedRectangleBorder(
side: BorderSide(
side: const BorderSide(
color: Colors.black,
),
borderRadius: BorderRadius.circular(40)
),
child: Text("ログイン",style: TextStyle(
child: const Text("ログイン",style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
),
SizedBox(height: 15.0,),
const SizedBox(height: 15.0,),
MaterialButton(
minWidth: double.infinity,
@ -74,7 +74,7 @@ class _LandingPageState extends State<LandingPage> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("サインアップ",style: TextStyle(
child: const Text("サインアップ",style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,
),),

View File

@ -7,8 +7,8 @@ class LoadingPage extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 20),
child: CircularProgressIndicator(
margin: const EdgeInsets.only(top: 20),
child: const CircularProgressIndicator(
value: 0.8,
)
);

View File

@ -11,6 +11,8 @@ class LoginPage extends StatelessWidget {
TextEditingController emailController = TextEditingController();
TextEditingController passwordController = TextEditingController();
LoginPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
@ -22,11 +24,11 @@ class LoginPage extends StatelessWidget {
leading:
IconButton( onPressed: (){
Navigator.pop(context);
},icon:Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
),
body:
indexController.currentUser.length == 0 ?
Container(
indexController.currentUser.isEmpty ?
SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -37,16 +39,16 @@ class LoginPage extends StatelessWidget {
children: [
Container(
height: MediaQuery.of(context).size.height/6,
decoration: BoxDecoration(
decoration: const BoxDecoration(
image:DecorationImage(image: AssetImage('assets/images/login_image.jpg'))
),
),
SizedBox(height: 5,),
const SizedBox(height: 5,),
],
),
Padding(
padding: EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric(
horizontal: 40
),
child: Column(
@ -57,9 +59,9 @@ class LoginPage extends StatelessWidget {
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Container(
padding: EdgeInsets.only(top: 3,left: 3),
padding: const EdgeInsets.only(top: 3,left: 3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
),
@ -74,7 +76,7 @@ class LoginPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: CircularProgressIndicator(),
child: const CircularProgressIndicator(),
) :
Column(
children: [
@ -86,9 +88,9 @@ class LoginPage extends StatelessWidget {
Get.snackbar(
"no_values".tr,
"email_and_password_required".tr,
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -101,12 +103,12 @@ class LoginPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("ログイン",style: TextStyle(
child: const Text("ログイン",style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
),
SizedBox(height: 5.0,),
const SizedBox(height: 5.0,),
MaterialButton(
minWidth: double.infinity,
height:40,
@ -117,12 +119,12 @@ class LoginPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("sign_up".tr,style: TextStyle(
child: Text("sign_up".tr,style: const TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
),
SizedBox(height: 2.0,),
const SizedBox(height: 2.0,),
MaterialButton(
minWidth: double.infinity,
height:40,
@ -133,7 +135,7 @@ class LoginPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("cancel".tr,style: TextStyle(
child: Text("cancel".tr,style: const TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
@ -144,14 +146,14 @@ class LoginPage extends StatelessWidget {
),
)
),
SizedBox(height: 5,),
const SizedBox(height: 5,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("rogaining_user_need_tosign_up".tr, style: TextStyle(
child: Text("rogaining_user_need_tosign_up".tr, style: const TextStyle(
overflow: TextOverflow.ellipsis,
),),
),
@ -164,7 +166,7 @@ class LoginPage extends StatelessWidget {
Flexible(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("app_developed_by_gifu_dx".tr, style: TextStyle(
child: Text("app_developed_by_gifu_dx".tr, style: const TextStyle(
overflow: TextOverflow.ellipsis, fontSize: 10.0
),),
),
@ -182,7 +184,7 @@ class LoginPage extends StatelessWidget {
onPressed: (){
indexController.currentUser.clear();
},
child: Text("Already Logged in, Click to logout"),
child: const Text("Already Logged in, Click to logout"),
),
)
,
@ -194,17 +196,17 @@ Widget makeInput({label, required TextEditingController controller, obsureText =
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label,style:TextStyle(
Text(label,style:const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w400,
color: Colors.black87
),),
SizedBox(height: 5,),
const SizedBox(height: 5,),
TextField(
controller: controller,
obscureText: obsureText,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 0,horizontal: 10),
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (Colors.grey[400])!,
@ -216,7 +218,7 @@ Widget makeInput({label, required TextEditingController controller, obsureText =
),
),
),
SizedBox(height: 30.0,)
const SizedBox(height: 30.0,)
],
);
}

View File

@ -22,11 +22,11 @@ class LoginPopupPage extends StatelessWidget {
leading:
IconButton( onPressed: (){
Navigator.pop(context);
},icon:Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
),
body:
indexController.currentUser.length == 0 ?
Container(
indexController.currentUser.isEmpty ?
SizedBox(
width: double.infinity,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
@ -37,16 +37,16 @@ class LoginPopupPage extends StatelessWidget {
children: [
Container(
height: MediaQuery.of(context).size.height/5,
decoration: BoxDecoration(
decoration: const BoxDecoration(
image:DecorationImage(image: AssetImage('assets/images/login_image.jpg'))
),
),
SizedBox(height: 5,),
const SizedBox(height: 5,),
],
),
Padding(
padding: EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric(
horizontal: 40
),
child: Column(
@ -57,9 +57,9 @@ class LoginPopupPage extends StatelessWidget {
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Container(
padding: EdgeInsets.only(top: 3,left: 3),
padding: const EdgeInsets.only(top: 3,left: 3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
),
@ -74,7 +74,7 @@ class LoginPopupPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: CircularProgressIndicator(),
child: const CircularProgressIndicator(),
) :
Column(
children: [
@ -86,9 +86,9 @@ class LoginPopupPage extends StatelessWidget {
Get.snackbar(
"no_values".tr,
"email_and_password_required".tr,
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -101,12 +101,12 @@ class LoginPopupPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("ログイン",style: TextStyle(
child: const Text("ログイン",style: TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
),
SizedBox(height: 19.0,),
const SizedBox(height: 19.0,),
MaterialButton(
minWidth: double.infinity,
height:50,
@ -117,12 +117,12 @@ class LoginPopupPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("sign_up".tr,style: TextStyle(
child: Text("sign_up".tr,style: const TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
),
SizedBox(height: 19.0,),
const SizedBox(height: 19.0,),
MaterialButton(
minWidth: double.infinity,
height:50,
@ -133,7 +133,7 @@ class LoginPopupPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("cancel".tr,style: TextStyle(
child: Text("cancel".tr,style: const TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,color: Colors.white70
),
),
@ -144,14 +144,14 @@ class LoginPopupPage extends StatelessWidget {
),
)
),
SizedBox(height: 20,),
const SizedBox(height: 20,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("rogaining_user_need_tosign_up".tr, style: TextStyle(
child: Text("rogaining_user_need_tosign_up".tr, style: const TextStyle(
overflow: TextOverflow.ellipsis,
),),
),
@ -169,7 +169,7 @@ class LoginPopupPage extends StatelessWidget {
onPressed: (){
indexController.currentUser.clear();
},
child: Text("Already Logged in, Click to logout"),
child: const Text("Already Logged in, Click to logout"),
),
)
,
@ -181,17 +181,17 @@ Widget makeInput({label, required TextEditingController controller, obsureText =
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label,style:TextStyle(
Text(label,style:const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w400,
color: Colors.black87
),),
SizedBox(height: 5,),
const SizedBox(height: 5,),
TextField(
controller: controller,
obscureText: obsureText,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 0,horizontal: 10),
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (Colors.grey[400])!,
@ -203,7 +203,7 @@ Widget makeInput({label, required TextEditingController controller, obsureText =
),
),
),
SizedBox(height: 30.0,)
const SizedBox(height: 30.0,)
],
);
}

View File

@ -11,7 +11,7 @@ class MainPerfPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Select Main Perfecture"),
title: const Text("Select Main Perfecture"),
),
body: ListView.builder(
itemCount: indexController.perfectures.length,
@ -19,7 +19,7 @@ class MainPerfPage extends StatelessWidget {
return ListTile(
onTap: (){
indexController.dropdownValue = indexController.perfectures[index][0]["id"].toString();
indexController.populateForPerf(indexController.dropdownValue, indexController.mapController!);
indexController.populateForPerf(indexController.dropdownValue, indexController.mapController);
Get.back();
},
title: Text(indexController.perfectures[index][0]["adm1_ja"].toString()),

View File

@ -5,7 +5,7 @@ import 'package:rogapp/routes/app_pages.dart';
import 'dart:io';
class PermissionHandlerScreen extends StatefulWidget {
PermissionHandlerScreen({Key? key}) : super(key: key);
const PermissionHandlerScreen({Key? key}) : super(key: key);
@override
State<PermissionHandlerScreen> createState() => _PermissionHandlerScreenState();
@ -20,10 +20,10 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
barrierDismissible: false, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('ロケーション許可'),
title: Text('ロケーション許可'),
content: SingleChildScrollView(
child: ListBody(
children: const <Widget>[
children: <Widget>[
Text( 'このアプリでは、位置情報の収集を行います。'),
Text( 'このアプリでは、開始時点で位置情報を収集します。'),
],
@ -58,20 +58,18 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
permissionServiceCall() async {
await permissionServices().then(
(value) {
if (value != null) {
if (value[Permission.location]!.isGranted ) {
/* ========= New Screen Added ============= */
if (value[Permission.location]!.isGranted ) {
/* ========= New Screen Added ============= */
Get.toNamed(AppPages.TRAVEL);
Get.toNamed(AppPages.TRAVEL);
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(builder: (context) => SplashScreen()),
// );
}
else{
_showMyDialog();
}
// Navigator.pushReplacement(
// context,
// MaterialPageRoute(builder: (context) => SplashScreen()),
// );
}
else{
_showMyDialog();
}
},
);
@ -153,7 +151,7 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
});
return Scaffold(
body: Container(
child: Text(""),
child: const Text(""),
),
);
}
@ -162,10 +160,10 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: const Text('無効'),
title: Text('無効'),
content: SingleChildScrollView(
child: ListBody(
children: const <Widget>[
children: <Widget>[
Text( '位置情報が無効になっています'),
Text('このアプリケーションへの位置情報アクセスが無効になっています。続行するには設定>プライバシーとセキュリティ>位置情報サービス>岐阜ナビ で有効にしてください。'),
],
@ -189,10 +187,10 @@ class _PermissionHandlerScreenState extends State<PermissionHandlerScreen> {
showDialog(
context: context,
builder: (_) => AlertDialog(
title: const Text('ロケーション許可'),
title: Text('ロケーション許可'),
content: SingleChildScrollView(
child: ListBody(
children: const <Widget>[
children: <Widget>[
Text( 'このアプリでは、位置情報の収集を行います。'),
Text('岐阜ナビアプリではチェックポイントの自動チェックインの機能を可能にするために、現在地のデータが収集されます。アプリを閉じている時や、使用していないときにも収集されます。位置情報は、個人を特定できない統計的な情報として、ユーザーの個人情報とは一切結びつかない形で送信されます。お知らせの配信、位置情報の利用を許可しない場合は、この後表示されるダイアログで「許可しない」を選択してください。'),
],

View File

@ -1,7 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/container.dart';
import 'package:flutter/src/widgets/framework.dart';
class ProgressPage extends StatelessWidget {
const ProgressPage({Key? key}) : super(key: key);
@ -10,7 +7,7 @@ class ProgressPage extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
color: Colors.transparent,
child: Center(
child: const Center(
child: CircularProgressIndicator(),
),
);

View File

@ -13,6 +13,8 @@ class RegisterPage extends StatelessWidget {
TextEditingController passwordController = TextEditingController();
TextEditingController confirmPasswordController = TextEditingController();
RegisterPage({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
@ -24,11 +26,11 @@ class RegisterPage extends StatelessWidget {
leading:
IconButton( onPressed: (){
Navigator.pop(context);
},icon:Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
},icon:const Icon(Icons.arrow_back_ios,size: 20,color: Colors.black,)),
),
body: SafeArea(
child: SingleChildScrollView(
child: Container(
child: SizedBox(
height: MediaQuery.of(context).size.height,
width: double.infinity,
child: Column(
@ -39,20 +41,20 @@ class RegisterPage extends StatelessWidget {
Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Text ("サインアップ", style: TextStyle(
const Text ("サインアップ", style: TextStyle(
fontSize: 30,
fontWeight: FontWeight.bold,
),),
SizedBox(height: 20,),
const SizedBox(height: 20,),
Text("アカウントを作成し、無料です",style: TextStyle(
fontSize: 15,
color: Colors.grey[700],
),),
SizedBox(height: 30,)
const SizedBox(height: 30,)
],
),
Padding(
padding: EdgeInsets.symmetric(
padding: const EdgeInsets.symmetric(
horizontal: 40
),
child: Column(
@ -64,12 +66,12 @@ class RegisterPage extends StatelessWidget {
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 40),
padding: const EdgeInsets.symmetric(horizontal: 40),
child: Container(
padding: EdgeInsets.only(top: 3,left: 3),
padding: const EdgeInsets.only(top: 3,left: 3),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(40),
border: Border(
border: const Border(
bottom: BorderSide(color: Colors.black),
top: BorderSide(color: Colors.black),
right: BorderSide(color: Colors.black),
@ -84,9 +86,9 @@ class RegisterPage extends StatelessWidget {
Get.snackbar(
"No match",
"Passwords does not match",
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -95,9 +97,9 @@ class RegisterPage extends StatelessWidget {
Get.snackbar(
"no_values".tr,
"email_and_password_required".tr,
icon: Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
icon: const Icon(Icons.assistant_photo_outlined, size: 40.0, color: Colors.blue),
snackPosition: SnackPosition.TOP,
duration: Duration(milliseconds: 800),
duration: const Duration(milliseconds: 800),
backgroundColor: Colors.yellow,
//icon:Image(image:AssetImage("assets/images/dora.png"))
);
@ -110,23 +112,23 @@ class RegisterPage extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40)
),
child: Text("sign_up".tr,style: TextStyle(
child: Text("sign_up".tr,style: const TextStyle(
fontWeight: FontWeight.w600,fontSize: 16,
),),
),
),
),
SizedBox(height: 20,),
const SizedBox(height: 20,),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Flexible(child: Text("すでにアカウントをお持ちですか?")),
const Flexible(child: Text("すでにアカウントをお持ちですか?")),
TextButton(
onPressed: (){
Get.toNamed(AppPages.LOGIN);
},
child: Text("ログイン",style: TextStyle(
child: const Text("ログイン",style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 18
),),
@ -149,17 +151,17 @@ Widget makeInput({label, required TextEditingController controller, obsureText =
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label,style:TextStyle(
Text(label,style:const TextStyle(
fontSize: 15,
fontWeight: FontWeight.w400,
color: Colors.black87
),),
SizedBox(height: 5,),
const SizedBox(height: 5,),
TextField(
controller: controller,
obscureText: obsureText,
decoration: InputDecoration(
contentPadding: EdgeInsets.symmetric(vertical: 0,horizontal: 10),
contentPadding: const EdgeInsets.symmetric(vertical: 0,horizontal: 10),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: (Colors.grey[400])!,
@ -171,7 +173,7 @@ Widget makeInput({label, required TextEditingController controller, obsureText =
),
),
),
SizedBox(height: 30,)
const SizedBox(height: 30,)
],
);

View File

@ -1,8 +1,5 @@
import 'package:flutter/material.dart';
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:get/get_state_manager/get_state_manager.dart';
import 'package:rogapp/model/destination.dart';
import 'package:rogapp/pages/index/index_controller.dart';
class SearchBarController extends GetxController {

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_typeahead/flutter_typeahead.dart';
import 'package:geojson/geojson.dart';
@ -15,7 +14,7 @@ class SearchPage extends StatelessWidget {
Image getImage(int index){
if(searchController.searchResults[index].properties!["photos"] == null || searchController.searchResults[index].properties!["photos"] == ""){
return Image(image: AssetImage('assets/images/empty_image.png'));
return const Image(image: AssetImage('assets/images/empty_image.png'));
}
else{
return Image(
@ -52,11 +51,11 @@ class SearchPage extends StatelessWidget {
fontSize: 15.0,
),
decoration: InputDecoration(
border: OutlineInputBorder(),
border: const OutlineInputBorder(),
hintText: "検索",
prefixIcon: Icon(Icons.search),
prefixIcon: const Icon(Icons.search),
suffixIcon: IconButton(
icon: Icon(Icons.clear),
icon: const Icon(Icons.clear),
onPressed: () {
// clear the text field
},
@ -70,7 +69,7 @@ class SearchPage extends StatelessWidget {
itemBuilder: (context, GeoJsonFeature suggestion){
return ListTile(
title: Text(suggestion.properties!["location_name"]),
subtitle: suggestion.properties!["category"] != null ? Text(suggestion.properties!["category"]) : Text(""),
subtitle: suggestion.properties!["category"] != null ? Text(suggestion.properties!["category"]) : const Text(""),
//leading: getImage(index),
);
},

View File

@ -11,7 +11,7 @@ class SubPerfPage extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Select Sub Perfecture"),
title: const Text("Select Sub Perfecture"),
),
body: ListView.builder(
itemCount: indexController.subPerfs.length,