optimized
This commit is contained in:
24
lib/model/auth_user.dart
Normal file
24
lib/model/auth_user.dart
Normal file
@ -0,0 +1,24 @@
|
||||
class AuthUser {
|
||||
AuthUser();
|
||||
|
||||
//AuthUser.from({required this.id, required this.email, required this.is_rogaining, required this.group, required this.zekken_number, required this.event_code, required this.team_name});
|
||||
|
||||
AuthUser.fromMap(Map<String, dynamic> map)
|
||||
: id = int.parse(map["id"].toString()),
|
||||
email = map["email"].toString(),
|
||||
is_rogaining = bool.parse(map["is_rogaining"].toString()),
|
||||
group = map["group"].toString(),
|
||||
zekken_number = map["zekken_number"].toString(),
|
||||
event_code = map["event_code"].toString(),
|
||||
team_name = map["team_name"].toString(),
|
||||
auth_token = map["token"];
|
||||
|
||||
int? id;
|
||||
String? email;
|
||||
bool? is_rogaining;
|
||||
String? group;
|
||||
String? zekken_number;
|
||||
String? event_code;
|
||||
String? team_name;
|
||||
String? auth_token;
|
||||
}
|
||||
@ -1,131 +1,124 @@
|
||||
|
||||
|
||||
class Destination {
|
||||
String? name;
|
||||
String? address;
|
||||
String? phone;
|
||||
String? email;
|
||||
String? webcontents;
|
||||
String? videos;
|
||||
String? category;
|
||||
int? series;
|
||||
double? lat;
|
||||
double? lon;
|
||||
String? sub_loc_id;
|
||||
int? location_id;
|
||||
int? list_order;
|
||||
String? photos;
|
||||
double? checkin_radious;
|
||||
int? auto_checkin;
|
||||
bool? selected = false;
|
||||
bool? checkedin = false;
|
||||
double? cp;
|
||||
double? checkin_point;
|
||||
double? buy_point;
|
||||
int? hidden_location;
|
||||
String? checkin_image;
|
||||
String? buypoint_image;
|
||||
bool forced_checkin = false;
|
||||
int recipt_times = 0;
|
||||
String? name;
|
||||
String? address;
|
||||
String? phone;
|
||||
String? email;
|
||||
String? webcontents;
|
||||
String? videos;
|
||||
String? category;
|
||||
int? series;
|
||||
double? lat;
|
||||
double? lon;
|
||||
String? sub_loc_id;
|
||||
int? location_id;
|
||||
int? list_order;
|
||||
String? photos;
|
||||
double? checkin_radious;
|
||||
int? auto_checkin;
|
||||
bool? selected = false;
|
||||
bool? checkedin = false;
|
||||
double? cp;
|
||||
double? checkin_point;
|
||||
double? buy_point;
|
||||
int? hidden_location;
|
||||
String? checkin_image;
|
||||
String? buypoint_image;
|
||||
bool forced_checkin = false;
|
||||
int recipt_times = 0;
|
||||
|
||||
Destination({
|
||||
this.name,
|
||||
this.address,
|
||||
this.phone,
|
||||
this.email,
|
||||
this.webcontents,
|
||||
this.videos,
|
||||
this.category,
|
||||
this.series,
|
||||
this.lat,
|
||||
this.lon,
|
||||
this.sub_loc_id,
|
||||
this.location_id,
|
||||
this.list_order,
|
||||
this.photos,
|
||||
this.checkin_radious,
|
||||
this.auto_checkin,
|
||||
this.selected,
|
||||
this.checkedin,
|
||||
this.cp,
|
||||
this.checkin_point,
|
||||
this.buy_point,
|
||||
this.hidden_location,
|
||||
this.checkin_image,
|
||||
this.buypoint_image,
|
||||
this.forced_checkin = false,
|
||||
this.recipt_times = 0
|
||||
});
|
||||
Destination(
|
||||
{this.name,
|
||||
this.address,
|
||||
this.phone,
|
||||
this.email,
|
||||
this.webcontents,
|
||||
this.videos,
|
||||
this.category,
|
||||
this.series,
|
||||
this.lat,
|
||||
this.lon,
|
||||
this.sub_loc_id,
|
||||
this.location_id,
|
||||
this.list_order,
|
||||
this.photos,
|
||||
this.checkin_radious,
|
||||
this.auto_checkin,
|
||||
this.selected,
|
||||
this.checkedin,
|
||||
this.cp,
|
||||
this.checkin_point,
|
||||
this.buy_point,
|
||||
this.hidden_location,
|
||||
this.checkin_image,
|
||||
this.buypoint_image,
|
||||
this.forced_checkin = false,
|
||||
this.recipt_times = 0});
|
||||
|
||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||
factory Destination.fromMap(Map<String, dynamic> json) {
|
||||
bool selec = json['selected'] == 0 ? false : true;
|
||||
bool checkin = json['checkedin'] == 0 ? false : true;
|
||||
bool forcedCheckin = json['forced_checkin'] == 0 ? false : true;
|
||||
|
||||
bool selec = json['selected'] == 0 ? false : true;
|
||||
bool checkin = json['checkedin'] == 0 ? false : true;
|
||||
bool _forced_checkin = json['forced_checkin'] == 0 ? false : true;
|
||||
return Destination(
|
||||
name: json['name'],
|
||||
address: json['address'],
|
||||
phone: json['phone'],
|
||||
email: json['email'],
|
||||
webcontents: json['webcontents'],
|
||||
videos: json['videos'],
|
||||
category: json['category'],
|
||||
series: json['series'],
|
||||
lat: json['lat'],
|
||||
lon: json['lon'],
|
||||
sub_loc_id: json['sub_loc_id'],
|
||||
location_id: json['location_id'],
|
||||
list_order: json['list_order'],
|
||||
photos: json['photos'],
|
||||
checkin_radious: json['checkin_radious'],
|
||||
auto_checkin: json['auto_checkin'],
|
||||
selected: selec,
|
||||
checkedin: checkin,
|
||||
cp: json['cp'],
|
||||
checkin_point: json['checkin_point'],
|
||||
buy_point: json['buy_point'],
|
||||
hidden_location: json['hidden_location'],
|
||||
checkin_image: json['checkin_image'],
|
||||
buypoint_image: json["buypoint_image"],
|
||||
forced_checkin: forcedCheckin,
|
||||
recipt_times: json["recipt_times"]);
|
||||
}
|
||||
|
||||
return Destination(
|
||||
name: json['name'],
|
||||
address: json['address'],
|
||||
phone: json['phone'],
|
||||
email: json['email'],
|
||||
webcontents: json['webcontents'],
|
||||
videos: json['videos'],
|
||||
category: json['category'],
|
||||
series: json['series'],
|
||||
lat: json['lat'],
|
||||
lon: json['lon'],
|
||||
sub_loc_id : json['sub_loc_id'],
|
||||
location_id: json['location_id'],
|
||||
list_order: json['list_order'],
|
||||
photos: json['photos'],
|
||||
checkin_radious: json['checkin_radious'],
|
||||
auto_checkin:json['auto_checkin'],
|
||||
selected: selec,
|
||||
checkedin: checkin,
|
||||
cp: json['cp'],
|
||||
checkin_point: json['checkin_point'],
|
||||
buy_point: json['buy_point'],
|
||||
hidden_location: json['hidden_location'],
|
||||
checkin_image: json['checkin_image'],
|
||||
buypoint_image: json["buypoint_image"],
|
||||
forced_checkin: _forced_checkin,
|
||||
recipt_times: json["recipt_times"]
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap(){
|
||||
int sel = selected == false ? 0 : 1;
|
||||
int check = checkedin == false ? 0 : 1;
|
||||
int _forced_checkin = forced_checkin == false ? 0 : 1;
|
||||
return {
|
||||
'name':name,
|
||||
'address': address,
|
||||
'phone': phone,
|
||||
'email': email,
|
||||
'webcontents': webcontents,
|
||||
'videos': videos,
|
||||
'category':category,
|
||||
'series':series,
|
||||
'lat':lat,
|
||||
'lon':lon,
|
||||
'sub_loc_id': sub_loc_id,
|
||||
'location_id':location_id,
|
||||
'list_order':list_order,
|
||||
'photos':photos,
|
||||
'checkin_radious': checkin_radious,
|
||||
'auto_checkin': auto_checkin,
|
||||
'selected': sel,
|
||||
'checkedin': check,
|
||||
'cp' : cp,
|
||||
'checkin_point' : checkin_point,
|
||||
'buy_point' : buy_point,
|
||||
'hidden_location' : hidden_location,
|
||||
'checkin_image': checkin_image,
|
||||
'buypoint_image' : buypoint_image,
|
||||
'forced_checkin' : _forced_checkin,
|
||||
'recipt_times' : recipt_times
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Map<String, dynamic> toMap() {
|
||||
int sel = selected == false ? 0 : 1;
|
||||
int check = checkedin == false ? 0 : 1;
|
||||
int forcedCheckin = forced_checkin == false ? 0 : 1;
|
||||
return {
|
||||
'name': name,
|
||||
'address': address,
|
||||
'phone': phone,
|
||||
'email': email,
|
||||
'webcontents': webcontents,
|
||||
'videos': videos,
|
||||
'category': category,
|
||||
'series': series,
|
||||
'lat': lat,
|
||||
'lon': lon,
|
||||
'sub_loc_id': sub_loc_id,
|
||||
'location_id': location_id,
|
||||
'list_order': list_order,
|
||||
'photos': photos,
|
||||
'checkin_radious': checkin_radious,
|
||||
'auto_checkin': auto_checkin,
|
||||
'selected': sel,
|
||||
'checkedin': check,
|
||||
'cp': cp,
|
||||
'checkin_point': checkin_point,
|
||||
'buy_point': buy_point,
|
||||
'hidden_location': hidden_location,
|
||||
'checkin_image': checkin_image,
|
||||
'buypoint_image': buypoint_image,
|
||||
'forced_checkin': forcedCheckin,
|
||||
'recipt_times': recipt_times
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
enum LocationState {
|
||||
noGps,
|
||||
notInCheckin,
|
||||
withinCheckin
|
||||
}
|
||||
|
||||
enum GameState {
|
||||
notStarted,
|
||||
startedNotCounted,
|
||||
startedCounted,
|
||||
nodeGoal
|
||||
}
|
||||
|
||||
|
||||
class GameInstanceState{
|
||||
LocationState locationState = LocationState.noGps;
|
||||
GameState gameState = GameState.notStarted;
|
||||
}
|
||||
8
lib/model/game_state_instance.dart
Normal file
8
lib/model/game_state_instance.dart
Normal file
@ -0,0 +1,8 @@
|
||||
enum LocationState { noGps, notInCheckin, withinCheckin }
|
||||
|
||||
enum GameState { notStarted, startedNotCounted, startedCounted, nodeGoal }
|
||||
|
||||
class GameInsStatetance {
|
||||
LocationState locationState = LocationState.noGps;
|
||||
GameState gameState = GameState.notStarted;
|
||||
}
|
||||
6
lib/model/map_state_instance.dart
Normal file
6
lib/model/map_state_instance.dart
Normal file
@ -0,0 +1,6 @@
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
|
||||
class MapStateInstance {
|
||||
MapController? mapController;
|
||||
LatLngBounds? currentBounds;
|
||||
}
|
||||
Reference in New Issue
Block a user