Compare commits
4 Commits
c6eb97bbb2
...
next
| Author | SHA1 | Date | |
|---|---|---|---|
| edbf52825b | |||
| dd36ab8399 | |||
| b37a33bc2f | |||
| e35608651b |
@ -33,7 +33,7 @@ if (keystorePropertiesFile.exists()) {
|
||||
|
||||
android {
|
||||
|
||||
compileSdkVersion 33
|
||||
compileSdkVersion 34
|
||||
|
||||
lintOptions {
|
||||
checkReleaseBuilds false
|
||||
|
||||
@ -155,7 +155,7 @@
|
||||
97C146E61CF9000F007C117D /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 1430;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1430"
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
71
lib/features/auth/login/login_page.dart
Normal file
71
lib/features/auth/login/login_page.dart
Normal file
@ -0,0 +1,71 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/features/home/home_page.dart';
|
||||
import 'package:rogapp/features/services/auth_repo.dart';
|
||||
import 'package:rogapp/features/state/user_state.dart';
|
||||
|
||||
class LoginPage extends ConsumerStatefulWidget {
|
||||
@override
|
||||
_LoginScreenState createState() => _LoginScreenState();
|
||||
}
|
||||
|
||||
class _LoginScreenState extends ConsumerState<LoginPage> {
|
||||
final TextEditingController _emailController = TextEditingController();
|
||||
final TextEditingController _passwordController = TextEditingController();
|
||||
bool _isLoading = false; // Track loading state
|
||||
|
||||
void _login() {
|
||||
setState(() {
|
||||
_isLoading = true; // Start loading
|
||||
});
|
||||
String email = _emailController.text.trim();
|
||||
String password = _passwordController.text;
|
||||
|
||||
ref.read(authProvider("$email|$password").future).then((user) {
|
||||
setState(() {
|
||||
_isLoading = false; // Stop loading
|
||||
});
|
||||
if (user != null) {
|
||||
ref.read(userNotifierProvider.notifier).setUser(user);
|
||||
Navigator.of(context).pushReplacement(MaterialPageRoute(
|
||||
builder: (context) => const HomePage(),
|
||||
));
|
||||
} else {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(const SnackBar(content: Text('Login failed')));
|
||||
}
|
||||
}).catchError((error) {
|
||||
ScaffoldMessenger.of(context)
|
||||
.showSnackBar(SnackBar(content: Text('Error: $error')));
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Login')),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
TextFormField(
|
||||
controller: _emailController,
|
||||
decoration: const InputDecoration(labelText: 'Email'),
|
||||
),
|
||||
TextFormField(
|
||||
controller: _passwordController,
|
||||
decoration: const InputDecoration(labelText: 'Password'),
|
||||
obscureText: true,
|
||||
),
|
||||
_isLoading
|
||||
? CircularProgressIndicator()
|
||||
: ElevatedButton(
|
||||
onPressed: _login,
|
||||
child: const Text('Login'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
397
lib/features/data/checkpoint.dart
Normal file
397
lib/features/data/checkpoint.dart
Normal file
@ -0,0 +1,397 @@
|
||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
import 'dart:convert';
|
||||
|
||||
class FeatureCollection {
|
||||
final String type;
|
||||
final List<Feature> features;
|
||||
|
||||
FeatureCollection({required this.type, required this.features});
|
||||
|
||||
factory FeatureCollection.fromJson(Map<String, dynamic> json) {
|
||||
return FeatureCollection(
|
||||
type: json['type'],
|
||||
features:
|
||||
List<Feature>.from(json['features'].map((x) => Feature.fromJson(x))),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class Feature {
|
||||
final int id;
|
||||
final String type;
|
||||
final Geometry geometry;
|
||||
final Properties properties;
|
||||
|
||||
Feature(
|
||||
{required this.id,
|
||||
required this.type,
|
||||
required this.geometry,
|
||||
required this.properties});
|
||||
|
||||
factory Feature.fromJson(Map<String, dynamic> json) {
|
||||
return Feature(
|
||||
id: json['id'],
|
||||
type: json['type'],
|
||||
geometry: Geometry.fromJson(json['geometry']),
|
||||
properties: Properties.fromJson(json['properties']),
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'type': type,
|
||||
'geometry': geometry.toMap(), // Assuming Geometry has a toMap method
|
||||
'properties':
|
||||
properties.toMap(), // Assuming Properties has a toMap method
|
||||
};
|
||||
}
|
||||
|
||||
Feature.fromMap(Map<String, dynamic> map)
|
||||
: id = map['id'],
|
||||
type = map['type'],
|
||||
geometry = Geometry.fromMap(map['geometry']),
|
||||
properties = Properties.fromJson(map['properties']);
|
||||
|
||||
static empty() {}
|
||||
}
|
||||
|
||||
class Geometry {
|
||||
final String type;
|
||||
final List<List<double>> coordinates;
|
||||
|
||||
Geometry({required this.type, required this.coordinates});
|
||||
|
||||
Geometry copyWith({
|
||||
String? type,
|
||||
List<List<double>>? coordinates,
|
||||
}) {
|
||||
return Geometry(
|
||||
type: type ?? this.type,
|
||||
coordinates: coordinates ?? this.coordinates,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'type': type,
|
||||
'coordinates': coordinates,
|
||||
};
|
||||
}
|
||||
|
||||
factory Geometry.fromMap(Map<String, dynamic> map) {
|
||||
return Geometry(
|
||||
type: map['type'] as String,
|
||||
coordinates: List<List<double>>.from(
|
||||
(map['coordinates'] as List<dynamic>).map<List<double>>(
|
||||
(coordinateList) {
|
||||
// Ensure 'coordinateList' is treated as a List of dynamic elements.
|
||||
// Then, for each element in the list, explicitly cast or convert it to double.
|
||||
return List<double>.from(coordinateList.map((coordinate) {
|
||||
// 'coordinate' is dynamic, needs explicit conversion to double.
|
||||
// The conversion depends on the original data type of 'coordinate';
|
||||
// if it's already a number, you can use .toDouble(); if it's a String, you might need double.parse.
|
||||
return double.parse(coordinate.toString());
|
||||
}));
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory Geometry.fromJson(Map<String, dynamic> source) {
|
||||
final geom = Geometry.fromMap(source);
|
||||
return geom;
|
||||
}
|
||||
|
||||
get latitude => coordinates[0][1];
|
||||
get longitude => coordinates[0][0];
|
||||
}
|
||||
|
||||
class Properties {
|
||||
// Include all properties fields
|
||||
final int locationId;
|
||||
final String subLocId;
|
||||
final double cp;
|
||||
final String? name;
|
||||
final String? address;
|
||||
final String? phone;
|
||||
final String? email;
|
||||
final String? webcontents;
|
||||
final String? videos;
|
||||
final String? category;
|
||||
final int? series;
|
||||
final double? lat;
|
||||
final double? lon;
|
||||
final int? listOrder;
|
||||
final String? photos;
|
||||
final double? checkinRadious;
|
||||
final bool? autoCheckin;
|
||||
bool? selected = false;
|
||||
bool? checkedin = false;
|
||||
final double? checkinPoint;
|
||||
final double? buyPoint;
|
||||
final bool? hiddenLocation;
|
||||
String? checkinImage;
|
||||
String? buypointImage;
|
||||
bool? forcedCheckin = false;
|
||||
final String? tags;
|
||||
|
||||
Properties(
|
||||
{required this.locationId,
|
||||
required this.subLocId,
|
||||
required this.cp,
|
||||
this.name,
|
||||
this.address,
|
||||
this.phone,
|
||||
this.email,
|
||||
this.webcontents,
|
||||
this.videos,
|
||||
this.category,
|
||||
this.series,
|
||||
this.lat,
|
||||
this.lon,
|
||||
this.listOrder,
|
||||
this.photos,
|
||||
this.checkinRadious,
|
||||
this.autoCheckin,
|
||||
this.selected,
|
||||
this.checkedin,
|
||||
this.checkinPoint,
|
||||
this.buyPoint,
|
||||
this.hiddenLocation,
|
||||
this.checkinImage,
|
||||
this.buypointImage,
|
||||
this.forcedCheckin,
|
||||
this.tags});
|
||||
|
||||
factory Properties.fromJson(Map<String, dynamic> json) {
|
||||
Properties prop;
|
||||
try {
|
||||
prop = Properties(
|
||||
locationId: json['location_id'],
|
||||
subLocId: json['sub_loc_id'],
|
||||
cp: json['cp'],
|
||||
name: json['name'] ?? '',
|
||||
address: json['address'] ?? '',
|
||||
phone: json['phone'] ?? '',
|
||||
email: json['email'] ?? '',
|
||||
webcontents: json['webcontents'] ?? '',
|
||||
videos: json['videos'] ?? '',
|
||||
category: json['category'] ?? '',
|
||||
series: json['series'] ?? 0,
|
||||
lat: json['lat'] ?? 0.0,
|
||||
lon: json['lon'] ?? 0.0,
|
||||
listOrder: json['list_order'] ?? 0,
|
||||
photos: json['photos'] ?? '',
|
||||
checkinRadious: json['checkin_radious'] ?? 0.0,
|
||||
autoCheckin: json['auto_checkin'] == 0 ? false : true,
|
||||
selected: json['selected'] == 0 ? false : true,
|
||||
checkedin: json['checkedin'] == 0 ? false : true,
|
||||
checkinPoint: json['checkin_point'] ?? 0.0,
|
||||
buyPoint: json['buy_point'] ?? 0.0,
|
||||
hiddenLocation: json['hidden_location'] == 0 ? false : true,
|
||||
checkinImage: json['checkin_image'] ?? '',
|
||||
buypointImage: json['buypoint_image'] ?? '',
|
||||
forcedCheckin: json['forced_checkin'] == 0 ? false : true,
|
||||
tags: json['tags'] ?? '');
|
||||
//print("from json --- $prop");
|
||||
} catch (e) {
|
||||
//print("from json --- $e");
|
||||
return Properties(locationId: 0, subLocId: '', cp: 0.0, name: '');
|
||||
}
|
||||
return prop;
|
||||
}
|
||||
|
||||
factory Properties.toJson(Properties prop) {
|
||||
return Properties(
|
||||
locationId: prop.locationId,
|
||||
subLocId: prop.subLocId,
|
||||
cp: prop.cp,
|
||||
name: prop.name,
|
||||
address: prop.address,
|
||||
phone: prop.phone,
|
||||
email: prop.email,
|
||||
webcontents: prop.webcontents,
|
||||
videos: prop.videos,
|
||||
category: prop.category,
|
||||
series: prop.series,
|
||||
lat: prop.lat,
|
||||
lon: prop.lon,
|
||||
listOrder: prop.listOrder,
|
||||
photos: prop.photos,
|
||||
checkinRadious: prop.checkinRadious,
|
||||
autoCheckin: prop.autoCheckin,
|
||||
selected: prop.selected,
|
||||
checkedin: prop.checkedin,
|
||||
checkinPoint: prop.checkinPoint,
|
||||
buyPoint: prop.buyPoint,
|
||||
hiddenLocation: prop.hiddenLocation,
|
||||
checkinImage: prop.checkinImage,
|
||||
buypointImage: prop.buypointImage,
|
||||
forcedCheckin: prop.forcedCheckin,
|
||||
tags: prop.tags);
|
||||
}
|
||||
|
||||
Properties copyWith({
|
||||
int? locationId,
|
||||
String? subLocId,
|
||||
double? cp,
|
||||
String? name,
|
||||
String? address,
|
||||
String? phone,
|
||||
String? email,
|
||||
String? webcontents,
|
||||
String? videos,
|
||||
String? category,
|
||||
int? series,
|
||||
double? lat,
|
||||
double? lon,
|
||||
int? listOrder,
|
||||
String? photos,
|
||||
double? checkinRadious,
|
||||
bool? autoCheckin,
|
||||
bool? selected,
|
||||
bool? checkedin,
|
||||
double? checkinPoint,
|
||||
double? buyPoint,
|
||||
bool? hiddenLocation,
|
||||
String? checkinImage,
|
||||
String? buypointImage,
|
||||
bool? forcedCheckin,
|
||||
String? tags,
|
||||
}) {
|
||||
return Properties(
|
||||
locationId: locationId ?? this.locationId,
|
||||
subLocId: subLocId ?? this.subLocId,
|
||||
cp: cp ?? this.cp,
|
||||
name: name ?? this.name,
|
||||
address: address ?? this.address,
|
||||
phone: phone ?? this.phone,
|
||||
email: email ?? this.email,
|
||||
webcontents: webcontents ?? this.webcontents,
|
||||
videos: videos ?? this.videos,
|
||||
category: category ?? this.category,
|
||||
series: series ?? this.series,
|
||||
lat: lat ?? this.lat,
|
||||
lon: lon ?? this.lon,
|
||||
listOrder: listOrder ?? this.listOrder,
|
||||
photos: photos ?? this.photos,
|
||||
checkinRadious: checkinRadious ?? this.checkinRadious,
|
||||
autoCheckin: autoCheckin ?? this.autoCheckin,
|
||||
selected: selected ?? this.selected,
|
||||
checkedin: checkedin ?? this.checkedin,
|
||||
checkinPoint: checkinPoint ?? this.checkinPoint,
|
||||
buyPoint: buyPoint ?? this.buyPoint,
|
||||
hiddenLocation: hiddenLocation ?? this.hiddenLocation,
|
||||
checkinImage: checkinImage ?? this.checkinImage,
|
||||
buypointImage: buypointImage ?? this.buypointImage,
|
||||
forcedCheckin: forcedCheckin ?? this.forcedCheckin,
|
||||
tags: tags ?? this.tags,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'locationId': locationId,
|
||||
'subLocId': subLocId,
|
||||
'cp': cp,
|
||||
'name': name,
|
||||
'address': address,
|
||||
'phone': phone,
|
||||
'email': email,
|
||||
'webcontents': webcontents,
|
||||
'videos': videos,
|
||||
'category': category,
|
||||
'series': series,
|
||||
'lat': lat,
|
||||
'lon': lon,
|
||||
'listOrder': listOrder,
|
||||
'photos': photos,
|
||||
'checkinRadious': checkinRadious,
|
||||
'autoCheckin': autoCheckin,
|
||||
'selected': selected,
|
||||
'checkedin': checkedin,
|
||||
'checkinPoint': checkinPoint,
|
||||
'buyPoint': buyPoint,
|
||||
'hiddenLocation': hiddenLocation,
|
||||
'checkinImage': checkinImage,
|
||||
'buypointImage': buypointImage,
|
||||
'forcedCheckin': forcedCheckin,
|
||||
'tags': tags,
|
||||
};
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Properties(locationId: $locationId, subLocId: $subLocId, cp: $cp, name: $name, address: $address, phone: $phone, email: $email, webcontents: $webcontents, videos: $videos, category: $category, series: $series, lat: $lat, lon: $lon, listOrder: $listOrder, photos: $photos, checkinRadious: $checkinRadious, autoCheckin: $autoCheckin, selected: $selected, checkedin: $checkedin, checkinPoint: $checkinPoint, buyPoint: $buyPoint, hiddenLocation: $hiddenLocation, checkinImage: $checkinImage, buypointImage: $buypointImage, forcedCheckin: $forcedCheckin, tags: $tags)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(covariant Properties other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other.locationId == locationId &&
|
||||
other.subLocId == subLocId &&
|
||||
other.cp == cp &&
|
||||
other.name == name &&
|
||||
other.address == address &&
|
||||
other.phone == phone &&
|
||||
other.email == email &&
|
||||
other.webcontents == webcontents &&
|
||||
other.videos == videos &&
|
||||
other.category == category &&
|
||||
other.series == series &&
|
||||
other.lat == lat &&
|
||||
other.lon == lon &&
|
||||
other.listOrder == listOrder &&
|
||||
other.photos == photos &&
|
||||
other.checkinRadious == checkinRadious &&
|
||||
other.autoCheckin == autoCheckin &&
|
||||
other.selected == selected &&
|
||||
other.checkedin == checkedin &&
|
||||
other.checkinPoint == checkinPoint &&
|
||||
other.buyPoint == buyPoint &&
|
||||
other.hiddenLocation == hiddenLocation &&
|
||||
other.checkinImage == checkinImage &&
|
||||
other.buypointImage == buypointImage &&
|
||||
other.forcedCheckin == forcedCheckin &&
|
||||
other.tags == tags;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode {
|
||||
return locationId.hashCode ^
|
||||
subLocId.hashCode ^
|
||||
cp.hashCode ^
|
||||
name.hashCode ^
|
||||
address.hashCode ^
|
||||
phone.hashCode ^
|
||||
email.hashCode ^
|
||||
webcontents.hashCode ^
|
||||
videos.hashCode ^
|
||||
category.hashCode ^
|
||||
series.hashCode ^
|
||||
lat.hashCode ^
|
||||
lon.hashCode ^
|
||||
listOrder.hashCode ^
|
||||
photos.hashCode ^
|
||||
checkinRadious.hashCode ^
|
||||
autoCheckin.hashCode ^
|
||||
selected.hashCode ^
|
||||
checkedin.hashCode ^
|
||||
checkinPoint.hashCode ^
|
||||
buyPoint.hashCode ^
|
||||
hiddenLocation.hashCode ^
|
||||
checkinImage.hashCode ^
|
||||
buypointImage.hashCode ^
|
||||
forcedCheckin.hashCode ^
|
||||
tags.hashCode;
|
||||
}
|
||||
}
|
||||
82
lib/features/data/checkpoint_visitis.dart
Normal file
82
lib/features/data/checkpoint_visitis.dart
Normal file
@ -0,0 +1,82 @@
|
||||
import 'dart:convert';
|
||||
|
||||
class CheckpointVisit {
|
||||
final String id;
|
||||
final String checkpointId;
|
||||
final String teamName;
|
||||
final String userName;
|
||||
final String eventCode;
|
||||
final DateTime visitTime;
|
||||
|
||||
CheckpointVisit({
|
||||
required this.id,
|
||||
required this.checkpointId,
|
||||
required this.teamName,
|
||||
required this.userName,
|
||||
required this.eventCode,
|
||||
required this.visitTime,
|
||||
});
|
||||
|
||||
CheckpointVisit copyWith({
|
||||
String? id,
|
||||
String? checkpointId,
|
||||
String? teamName,
|
||||
String? userName,
|
||||
String? eventCode,
|
||||
DateTime? visitTime,
|
||||
}) {
|
||||
return CheckpointVisit(
|
||||
id: id ?? this.id,
|
||||
checkpointId: checkpointId ?? this.checkpointId,
|
||||
teamName: teamName ?? this.teamName,
|
||||
userName: userName ?? this.userName,
|
||||
eventCode: eventCode ?? this.eventCode,
|
||||
visitTime: visitTime ?? this.visitTime,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'checkpointId': checkpointId,
|
||||
'teamName': teamName,
|
||||
'userName': userName,
|
||||
'eventCode': eventCode,
|
||||
'visitTime': visitTime.millisecondsSinceEpoch,
|
||||
};
|
||||
}
|
||||
|
||||
factory CheckpointVisit.fromMap(Map<String, dynamic> map) {
|
||||
return CheckpointVisit(
|
||||
id: map['id'],
|
||||
checkpointId: map['checkpointId'],
|
||||
teamName: map['teamName'],
|
||||
userName: map['userName'],
|
||||
eventCode: map['eventCode'],
|
||||
visitTime: DateTime.fromMillisecondsSinceEpoch(map['visitTime']),
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory CheckpointVisit.fromJson(String source) =>
|
||||
CheckpointVisit.fromMap(json.decode(source));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CheckpointVisit(id: $id, checkpointId: $checkpointId, teamName: $teamName, userName: $userName, eventCode: $eventCode, visitTime: $visitTime)';
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
||||
return other is CheckpointVisit &&
|
||||
other.id == id &&
|
||||
other.checkpointId == checkpointId &&
|
||||
other.teamName == teamName &&
|
||||
other.userName == userName &&
|
||||
other.eventCode == eventCode &&
|
||||
other.visitTime == visitTime;
|
||||
}
|
||||
}
|
||||
329
lib/features/data/data_provider.dart
Normal file
329
lib/features/data/data_provider.dart
Normal file
@ -0,0 +1,329 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:rogapp/features/data/checkpoint.dart';
|
||||
import 'package:rogapp/features/data/user_location.dart';
|
||||
|
||||
final dataProviderProvider = Provider<DataProvider>((ref) {
|
||||
return DataProvider();
|
||||
});
|
||||
|
||||
// Convert a Feature object to a Map
|
||||
Map<String, dynamic> featureToMap(Feature feature) {
|
||||
var properties = feature.properties;
|
||||
|
||||
try {
|
||||
return {
|
||||
'id': feature.id,
|
||||
'type': feature.type,
|
||||
'name': properties.name ?? '',
|
||||
'address': properties.address ?? '',
|
||||
'phone': properties.phone ?? '',
|
||||
'email': properties.email ?? '',
|
||||
'webcontents': properties.webcontents ?? '',
|
||||
'videos': properties.videos ?? '',
|
||||
'category': properties.category ?? '',
|
||||
'series': properties.series,
|
||||
'lat': feature.geometry.latitude,
|
||||
'lon': feature.geometry.longitude,
|
||||
'list_order': properties.listOrder,
|
||||
'photos': properties.photos ?? '',
|
||||
'checkin_radious': properties.checkinRadious,
|
||||
'sub_loc_id': properties.subLocId,
|
||||
'auto_checkin': properties.autoCheckin! ? 1 : 0,
|
||||
'selected': properties.selected == null
|
||||
? 0
|
||||
: properties.selected!
|
||||
? 1
|
||||
: 0,
|
||||
'checkedin': properties.checkedin == null
|
||||
? 0
|
||||
: properties.checkedin!
|
||||
? 1
|
||||
: 0,
|
||||
'cp': properties.cp,
|
||||
'checkin_point': properties.checkinPoint,
|
||||
'buy_point': properties.buyPoint,
|
||||
'hidden_location': properties.hiddenLocation,
|
||||
'checkin_image': properties.checkinImage,
|
||||
'buypoint_image': properties.buypointImage,
|
||||
'forced_checkin': properties.forcedCheckin == null
|
||||
? 0
|
||||
: properties.forcedCheckin!
|
||||
? 1
|
||||
: 0,
|
||||
'tags': properties.tags ?? '',
|
||||
'location_id': properties.locationId,
|
||||
};
|
||||
} catch (e) {
|
||||
//print("--- feature to map Error: $e");
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
// Convert a Map to a Feature object
|
||||
Feature mapToFeature(Map<String, dynamic> map) {
|
||||
Feature feat;
|
||||
//print("mapToFeature id --- ${Properties.fromJson(map)}");
|
||||
//print("mapToFeature --- ${map['type']}");
|
||||
feat = Feature(
|
||||
id: map['id'],
|
||||
type: map['type'],
|
||||
geometry: Geometry(
|
||||
type: map['type'] ?? 'Point',
|
||||
coordinates: [
|
||||
[map['lon'], map['lat']]
|
||||
],
|
||||
),
|
||||
properties: Properties.fromJson(map),
|
||||
);
|
||||
|
||||
//print("mapToFeature --- $feat");
|
||||
|
||||
return feat;
|
||||
}
|
||||
|
||||
class DataProvider {
|
||||
static Database? _database;
|
||||
|
||||
Future<Database> get database async {
|
||||
if (_database != null) return _database!;
|
||||
_database = await initDB();
|
||||
return _database!;
|
||||
}
|
||||
|
||||
initDB() async {
|
||||
var documentsDirectory = await getApplicationDocumentsDirectory();
|
||||
String path = join(documentsDirectory.path, "GameDB.db");
|
||||
return await openDatabase(path,
|
||||
version: 1, onOpen: (db) {}, onCreate: _onCreate);
|
||||
}
|
||||
|
||||
_onCreate(Database db, int version) async {
|
||||
await db.execute('''
|
||||
CREATE TABLE Checkpoints (
|
||||
location_id INTEGER PRIMARY KEY,
|
||||
id INTEGER,
|
||||
type TEXT,
|
||||
name TEXT,
|
||||
address TEXT,
|
||||
phone TEXT,
|
||||
email TEXT,
|
||||
webcontents TEXT,
|
||||
videos TEXT,
|
||||
category TEXT,
|
||||
series INTEGER,
|
||||
lat REAL,
|
||||
lon REAL,
|
||||
list_order INTEGER,
|
||||
photos TEXT,
|
||||
checkin_radious REAL,
|
||||
sub_loc_id TEXT,
|
||||
auto_checkin INTEGER,
|
||||
selected INTEGER,
|
||||
checkedin INTEGER,
|
||||
cp REAL,
|
||||
checkin_point REAL,
|
||||
buy_point REAL,
|
||||
hidden_location INTEGER,
|
||||
checkin_image TEXT,
|
||||
buypoint_image TEXT,
|
||||
forced_checkin INTEGER,
|
||||
recipt_times INTEGER,
|
||||
tags TEXT
|
||||
)
|
||||
''');
|
||||
await db.execute('''
|
||||
CREATE TABLE GPSLocations (
|
||||
timestamp TEXT PRIMARY KEY,
|
||||
latitude REAL,
|
||||
longitude REAL,
|
||||
event_code TEXT,
|
||||
team_name TEXT,
|
||||
user_name TEXT,
|
||||
attempt_count INTEGER
|
||||
)
|
||||
''');
|
||||
await db.execute('''
|
||||
CREATE TABLE GameState (
|
||||
key TEXT PRIMARY KEY,
|
||||
value TEXT,
|
||||
event_code TEXT,
|
||||
team_name TEXT,
|
||||
user_name TEXT,
|
||||
attempt_count INTEGER
|
||||
)
|
||||
''');
|
||||
await db.execute('''
|
||||
CREATE TABLE CheckpointVisits (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
checkpointId INTEGER,
|
||||
photoTaken BOOLEAN,
|
||||
receiptPhotoTaken BOOLEAN,
|
||||
timestamp DATETIME DEFAULT CURRENT_TIMESTAMP,
|
||||
event_code TEXT,
|
||||
team_name TEXT,
|
||||
user_name TEXT,
|
||||
attempt_count INTEGER DEFAULT 1,
|
||||
FOREIGN KEY (checkpointId) REFERENCES Checkpoints(location_id)
|
||||
)
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> recordCheckpointVisit(
|
||||
int locationId, String userName, String teamName, String eventCode,
|
||||
{bool photoTaken = false, bool? receiptPhotoTaken}) async {
|
||||
final db = await database;
|
||||
|
||||
// Fetching buy_point to determine if a receipt is required
|
||||
var checkpointQueryResult = await db.query(
|
||||
'Checkpoints',
|
||||
columns: ['buy_point'],
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [locationId],
|
||||
);
|
||||
|
||||
var buyPoint = checkpointQueryResult.isNotEmpty
|
||||
? checkpointQueryResult.first['buy_point'] as double?
|
||||
: null;
|
||||
var requiresReceipt = buyPoint != null && buyPoint > 0.0;
|
||||
|
||||
await db.insert(
|
||||
'CheckpointVisits',
|
||||
{
|
||||
'checkpointId': locationId,
|
||||
'user_name': userName,
|
||||
'team_name': teamName,
|
||||
'event_code': eventCode,
|
||||
'photoTaken': photoTaken ? 1 : 0,
|
||||
'receiptPhotoTaken':
|
||||
requiresReceipt ? (receiptPhotoTaken == true ? 1 : 0) : null,
|
||||
},
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getIncompleteTasks(int locationId,
|
||||
String userName, String teamName, String eventCode) async {
|
||||
final db = await database;
|
||||
var checkpoint = await db.query(
|
||||
'Checkpoints',
|
||||
where: 'location_id = ?',
|
||||
whereArgs: [locationId],
|
||||
);
|
||||
|
||||
var buyPointValue =
|
||||
checkpoint.isNotEmpty ? checkpoint.first['buy_point'] as double? : null;
|
||||
var requiresReceipt = buyPointValue != null && buyPointValue > 0.0;
|
||||
|
||||
// Fetch visits considering all relevant identifiers
|
||||
List<Map> visits = await db.query(
|
||||
'CheckpointVisits',
|
||||
where:
|
||||
'checkpointId = ? AND user_name = ? AND team_name = ? AND event_code = ?',
|
||||
whereArgs: [locationId, userName, teamName, eventCode],
|
||||
);
|
||||
|
||||
if (visits.isNotEmpty) {
|
||||
var lastVisit = visits.last;
|
||||
return {
|
||||
'photoTaken': lastVisit['photoTaken'] == 1,
|
||||
'receiptPhotoTaken':
|
||||
requiresReceipt ? lastVisit['receiptPhotoTaken'] == 1 : true,
|
||||
};
|
||||
}
|
||||
|
||||
// Default return values when no visits found
|
||||
return {
|
||||
'photoTaken': false,
|
||||
'receiptPhotoTaken': requiresReceipt ? false : true,
|
||||
};
|
||||
}
|
||||
|
||||
Future<void> insertMarker(Feature marker) async {
|
||||
//print("--- inserting ${featureToMap(marker)} ---");
|
||||
final db = await database;
|
||||
try {
|
||||
await db.insert(
|
||||
'Checkpoints',
|
||||
featureToMap(marker),
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
} catch (e) {
|
||||
print("--- ${e.toString()} ---");
|
||||
}
|
||||
}
|
||||
|
||||
Future<List<Feature>> getMarkers() async {
|
||||
final db = await database;
|
||||
var res = await db.query('Checkpoints');
|
||||
List<Feature> list =
|
||||
res.isNotEmpty ? res.map((c) => mapToFeature(c)).toList() : [];
|
||||
//print("--- checkpoints ${res} ---");
|
||||
return list;
|
||||
}
|
||||
|
||||
Future<int> deleteMarker(int id) async {
|
||||
final db = await database;
|
||||
return db.delete('Checkpoints', where: 'id = ?', whereArgs: [id]);
|
||||
}
|
||||
|
||||
Future<void> insertGPSLocation(UserLocation location) async {
|
||||
final db = await database;
|
||||
await db.insert(
|
||||
'GPSLocations',
|
||||
location
|
||||
.toMap(), // Implement a method in UserLocation to convert the object to a Map
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<UserLocation>> getGPSLocations() async {
|
||||
final db = await database;
|
||||
var res = await db.query('GPSLocations');
|
||||
List<UserLocation> locations =
|
||||
res.isNotEmpty ? res.map((c) => UserLocation.fromMap(c)).toList() : [];
|
||||
return locations;
|
||||
}
|
||||
|
||||
Future<void> updateGameState(
|
||||
String key,
|
||||
String value,
|
||||
String userName,
|
||||
String teamName,
|
||||
String eventCode,
|
||||
) async {
|
||||
final db = await database;
|
||||
await db.insert(
|
||||
'GameState',
|
||||
{
|
||||
'key': key,
|
||||
'value': value,
|
||||
'team_name': teamName,
|
||||
'event_code': eventCode,
|
||||
'user_name': userName,
|
||||
},
|
||||
conflictAlgorithm: ConflictAlgorithm.replace,
|
||||
);
|
||||
}
|
||||
|
||||
Future<String?> getGameState(
|
||||
String key,
|
||||
String userName,
|
||||
String teamName,
|
||||
String eventCode,
|
||||
) async {
|
||||
final db = await database;
|
||||
List<Map<String, dynamic>> results = await db.query(
|
||||
'GameState',
|
||||
where: 'key = ? AND team_name = ? AND event_code = ? AND user_name = ?',
|
||||
whereArgs: [key, teamName, eventCode, userName],
|
||||
);
|
||||
|
||||
if (results.isNotEmpty) {
|
||||
return results.first['value'] as String?;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
17
lib/features/data/game_event.dart
Normal file
17
lib/features/data/game_event.dart
Normal file
@ -0,0 +1,17 @@
|
||||
enum EventType {
|
||||
atStart,
|
||||
starting,
|
||||
started,
|
||||
inCheckin,
|
||||
checkiningIn,
|
||||
checkedIn,
|
||||
atGoal,
|
||||
finishingGoal,
|
||||
finishedGoal,
|
||||
}
|
||||
|
||||
class GameEvent {
|
||||
final EventType type;
|
||||
final DateTime timestamp;
|
||||
GameEvent({this.type = EventType.atStart, required this.timestamp});
|
||||
}
|
||||
24
lib/features/data/user.dart
Normal file
24
lib/features/data/user.dart
Normal file
@ -0,0 +1,24 @@
|
||||
class User {
|
||||
User.User();
|
||||
|
||||
//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});
|
||||
|
||||
User.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;
|
||||
}
|
||||
59
lib/features/data/user_location.dart
Normal file
59
lib/features/data/user_location.dart
Normal file
@ -0,0 +1,59 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
|
||||
// ignore_for_file: public_member_api_docs, sort_constructors_first
|
||||
class UserLocation {
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final DateTime timestamp;
|
||||
UserLocation(
|
||||
{required this.latitude,
|
||||
required this.longitude,
|
||||
required this.timestamp});
|
||||
|
||||
static UserLocation empty() {
|
||||
return UserLocation(
|
||||
latitude: 0.0, longitude: 0.0, timestamp: DateTime.now());
|
||||
}
|
||||
|
||||
factory UserLocation.fromPosition(Position position) {
|
||||
return UserLocation(
|
||||
latitude: position.latitude,
|
||||
longitude: position.longitude,
|
||||
timestamp: position.timestamp);
|
||||
}
|
||||
|
||||
UserLocation copyWith({
|
||||
double? latitude,
|
||||
double? longitude,
|
||||
DateTime? timestamp,
|
||||
}) {
|
||||
return UserLocation(
|
||||
latitude: latitude ?? this.latitude,
|
||||
longitude: longitude ?? this.longitude,
|
||||
timestamp: timestamp ?? this.timestamp,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return <String, dynamic>{
|
||||
'latitude': latitude,
|
||||
'longitude': longitude,
|
||||
'timestamp': timestamp.millisecondsSinceEpoch,
|
||||
};
|
||||
}
|
||||
|
||||
factory UserLocation.fromMap(Map<String, dynamic> map) {
|
||||
return UserLocation(
|
||||
latitude: map['latitude'] as double,
|
||||
longitude: map['longitude'] as double,
|
||||
timestamp: DateTime.fromMillisecondsSinceEpoch(map['timestamp'] as int),
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
|
||||
factory UserLocation.fromJson(String source) =>
|
||||
UserLocation.fromMap(json.decode(source) as Map<String, dynamic>);
|
||||
}
|
||||
131
lib/features/home/home_page.dart
Normal file
131
lib/features/home/home_page.dart
Normal file
@ -0,0 +1,131 @@
|
||||
import 'package:dio_cache_interceptor_hive_store/dio_cache_interceptor_hive_store.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:flutter_map_cache/flutter_map_cache.dart';
|
||||
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
|
||||
import 'package:rogapp/features/location/location_provider.dart';
|
||||
import 'package:rogapp/features/state/game_state.dart';
|
||||
import 'package:rogapp/features/state/game_view_model.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
class HomePage extends ConsumerStatefulWidget {
|
||||
const HomePage({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<HomePage> createState() => _HomePageState();
|
||||
}
|
||||
|
||||
class _HomePageState extends ConsumerState<HomePage> {
|
||||
MapController mapController = MapController();
|
||||
String? _cachePath;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
//ref.read(featureCheckpointCollectionProvider.future);
|
||||
ref.read(locationNotifierProvider.notifier).startListening();
|
||||
_initializeCachePath();
|
||||
}
|
||||
|
||||
Future<void> _initializeCachePath() async {
|
||||
_cachePath = await getTemporaryDirectory().then((dir) => dir.path);
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final gameState = ref.watch(gameViewModelProvider);
|
||||
final locationState = ref.watch(locationNotifierProvider);
|
||||
|
||||
if (_cachePath == null || gameState.markers.isEmpty) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(),
|
||||
body: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
actions: [
|
||||
Text(
|
||||
'Current Latitude: ${locationState.currentPosition?.latitude ?? 'No data'}'),
|
||||
IconButton(
|
||||
icon: Icon(MdiIcons.logout),
|
||||
onPressed: () => _logGameState(gameState),
|
||||
),
|
||||
Text(gameState.currentLocation?.latitude.toString() ??
|
||||
'--- No location'),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Expanded(child: _buildMap(gameState, _cachePath!)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _logGameState(GameState gameState) {
|
||||
print("Checkpoint photo taken: ${gameState.checkpointPhotoTaken}");
|
||||
print("Current checkpoint: ${gameState.currentCheckpoint}");
|
||||
print("Has left start area: ${gameState.hasLeftStartArea}");
|
||||
print("Has visited checkpoint: ${gameState.hasVisitedCheckpoint}");
|
||||
}
|
||||
|
||||
Widget _buildMap(GameState gameState, String cachePath) {
|
||||
return FlutterMap(
|
||||
mapController: mapController,
|
||||
options: MapOptions(
|
||||
interactionOptions: const InteractionOptions(
|
||||
enableMultiFingerGestureRace: true,
|
||||
flags: InteractiveFlag.doubleTapDragZoom |
|
||||
InteractiveFlag.doubleTapZoom |
|
||||
InteractiveFlag.drag |
|
||||
InteractiveFlag.flingAnimation |
|
||||
InteractiveFlag.pinchZoom |
|
||||
InteractiveFlag.scrollWheelZoom,
|
||||
),
|
||||
maxZoom: 18.4,
|
||||
onMapReady: () => mapController.move(LatLng(37.153196, 139.587659), 4),
|
||||
),
|
||||
children: [
|
||||
TileLayer(
|
||||
urlTemplate:
|
||||
'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
||||
tileProvider: CachedTileProvider(
|
||||
maxStale: Duration(days: 30),
|
||||
store: HiveCacheStore(cachePath, hiveBoxName: 'HiveCacheStore'),
|
||||
),
|
||||
),
|
||||
CurrentLocationLayer(
|
||||
alignDirectionOnUpdate: AlignOnUpdate.never,
|
||||
style: const LocationMarkerStyle(
|
||||
marker: DefaultLocationMarker(
|
||||
child: Icon(
|
||||
Icons.navigation,
|
||||
color: Colors.white,
|
||||
size: 15,
|
||||
),
|
||||
),
|
||||
markerSize: Size(27, 27),
|
||||
markerDirection: MarkerDirection.heading,
|
||||
),
|
||||
),
|
||||
MarkerLayer(
|
||||
markers: gameState.markers.map((feature) {
|
||||
return Marker(
|
||||
child: const Icon(Icons.location_on),
|
||||
// Convert each Feature to a Marker
|
||||
width: 80.0,
|
||||
height: 80.0,
|
||||
point:
|
||||
LatLng(feature.geometry.latitude, feature.geometry.longitude),
|
||||
);
|
||||
}).toList(),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
53
lib/features/initializer/app_initializer.dart
Normal file
53
lib/features/initializer/app_initializer.dart
Normal file
@ -0,0 +1,53 @@
|
||||
import 'package:rogapp/features/initializer/camera_check.dart';
|
||||
import 'package:rogapp/features/initializer/icheck.dart';
|
||||
import 'package:rogapp/features/initializer/location_check.dart';
|
||||
|
||||
class AppInitializer {
|
||||
final List<ICheck> checks;
|
||||
|
||||
AppInitializer()
|
||||
: checks = [
|
||||
LocationCheck(),
|
||||
CameraCheck(),
|
||||
//NetworkCheck(),
|
||||
];
|
||||
|
||||
Future<bool> permissionStatus() async {
|
||||
return await LocationCheck().locationPermissionStatus() &&
|
||||
await CameraCheck().cameraPermissionStatus();
|
||||
}
|
||||
|
||||
Future<bool> initializeApp() async {
|
||||
if (!await runPreFlightChecks()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//await initializeTileCaching();
|
||||
await loadInitialData();
|
||||
await configureGlobalSettings();
|
||||
// Add other initialization tasks as needed
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<bool> runPreFlightChecks() async {
|
||||
for (var check in checks) {
|
||||
if (!await check.check()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> initializeTileCaching() async {}
|
||||
|
||||
Future<void> loadInitialData() async {
|
||||
// Logic to preload data that your app will need
|
||||
}
|
||||
|
||||
Future<void> configureGlobalSettings() async {
|
||||
// Logic to set up any global configurations for your app
|
||||
}
|
||||
|
||||
// You can add more methods for other initialization tasks
|
||||
}
|
||||
19
lib/features/initializer/camera_check.dart
Normal file
19
lib/features/initializer/camera_check.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:rogapp/features/initializer/icheck.dart';
|
||||
|
||||
class CameraCheck implements ICameraCheck {
|
||||
@override
|
||||
Future<bool> cameraPermissionStatus() async {
|
||||
var permission = await Permission.camera.status;
|
||||
return permission.isGranted;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> check() async {
|
||||
var permission = await Permission.camera.status;
|
||||
if (!permission.isGranted) {
|
||||
permission = await Permission.camera.request();
|
||||
}
|
||||
return permission.isGranted;
|
||||
}
|
||||
}
|
||||
17
lib/features/initializer/icheck.dart
Normal file
17
lib/features/initializer/icheck.dart
Normal file
@ -0,0 +1,17 @@
|
||||
abstract class ICheck {
|
||||
Future<bool> check();
|
||||
}
|
||||
|
||||
abstract class ILocationCheck extends ICheck {
|
||||
Future<bool> locationPermissionStatus();
|
||||
// Additional location-specific methods can be defined here
|
||||
}
|
||||
|
||||
abstract class ICameraCheck extends ICheck {
|
||||
Future<bool> cameraPermissionStatus();
|
||||
// Additional camera-specific methods can be defined here
|
||||
}
|
||||
|
||||
abstract class INetworkCheck extends ICheck {
|
||||
// Additional network-specific methods can be defined here
|
||||
}
|
||||
19
lib/features/initializer/location_check.dart
Normal file
19
lib/features/initializer/location_check.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:rogapp/features/initializer/icheck.dart';
|
||||
|
||||
class LocationCheck implements ILocationCheck {
|
||||
@override
|
||||
Future<bool> check() async {
|
||||
var permission = await Permission.locationWhenInUse.status;
|
||||
if (!permission.isGranted) {
|
||||
permission = await Permission.locationWhenInUse.request();
|
||||
}
|
||||
return permission.isGranted && await Geolocator.isLocationServiceEnabled();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> locationPermissionStatus() {
|
||||
return Permission.locationWhenInUse.isGranted;
|
||||
}
|
||||
}
|
||||
10
lib/features/initializer/network_check.dart
Normal file
10
lib/features/initializer/network_check.dart
Normal file
@ -0,0 +1,10 @@
|
||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||
import 'package:rogapp/features/initializer/icheck.dart';
|
||||
|
||||
class NetworkCheck implements INetworkCheck {
|
||||
@override
|
||||
Future<bool> check() async {
|
||||
var connectivityResult = await Connectivity().checkConnectivity();
|
||||
return connectivityResult != ConnectivityResult.none;
|
||||
}
|
||||
}
|
||||
19
lib/features/landing/denied_screen.dart
Normal file
19
lib/features/landing/denied_screen.dart
Normal file
@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// This screen shows when user denied and intented to close the app
|
||||
|
||||
class DeniedScreen extends StatefulWidget {
|
||||
const DeniedScreen({super.key});
|
||||
|
||||
@override
|
||||
State<DeniedScreen> createState() => _DeniedScreenState();
|
||||
}
|
||||
|
||||
class _DeniedScreenState extends State<DeniedScreen> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Scaffold(
|
||||
body: Text("Dnied"),
|
||||
);
|
||||
}
|
||||
}
|
||||
172
lib/features/landing/landing_page.dart
Normal file
172
lib/features/landing/landing_page.dart
Normal file
@ -0,0 +1,172 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/features/data/checkpoint.dart';
|
||||
import 'package:rogapp/features/data/data_provider.dart';
|
||||
import 'package:rogapp/features/home/home_page.dart';
|
||||
import 'package:rogapp/features/landing/denied_screen.dart';
|
||||
import 'package:rogapp/features/initializer/app_initializer.dart';
|
||||
import 'package:rogapp/features/services/checkpoint_repo.dart';
|
||||
import 'package:rogapp/features/state/game_state.dart';
|
||||
import 'package:rogapp/features/state/game_view_model.dart';
|
||||
|
||||
// LandingPage serves as the initial screen displayed by the application to perform necessary checks, initialize required values, and set up services essential for the app's functionality.
|
||||
|
||||
class LandingPage extends ConsumerStatefulWidget {
|
||||
const LandingPage({super.key});
|
||||
|
||||
@override
|
||||
ConsumerState<LandingPage> createState() => _LandingPageState();
|
||||
}
|
||||
|
||||
class _LandingPageState extends ConsumerState<LandingPage> {
|
||||
bool? _isInitialized;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
//load only if network available
|
||||
ref.read(featureCheckpointCollectionProvider.future);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_initializeApp();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AsyncValue<FeatureCollection> featureCollection =
|
||||
ref.watch(featureCheckpointCollectionProvider);
|
||||
|
||||
return featureCollection.when(
|
||||
data: (data) {
|
||||
if (_isInitialized == null) {
|
||||
return const MaterialApp(
|
||||
home: Scaffold(body: Center(child: CircularProgressIndicator())));
|
||||
}
|
||||
|
||||
return _isInitialized! ? const HomePage() : const DeniedScreen();
|
||||
},
|
||||
loading: () => const MaterialApp(
|
||||
home: Scaffold(body: Center(child: CircularProgressIndicator()))),
|
||||
error: (error, stack) => ErrorScreen(error: error),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _restoreAppState() async {
|
||||
final dataProvider = ref.read(dataProviderProvider);
|
||||
|
||||
// Example values, replace these with actual values from user and event context
|
||||
String userName =
|
||||
"current_user"; // Fetch the current user's name or identifier
|
||||
String teamName = "user_team"; // Fetch the current user's team
|
||||
String eventCode = "event_code"; // Fetch the current event code
|
||||
|
||||
// Load and restore game state
|
||||
String? gameStateKey = "current_game_state";
|
||||
String? gameStateValue = await dataProvider.getGameState(
|
||||
gameStateKey, userName, teamName, eventCode);
|
||||
if (gameStateValue != null) {
|
||||
Map<String, dynamic> gameStateData = jsonDecode(gameStateValue);
|
||||
GameState gameState = GameState.fromMap(gameStateData);
|
||||
ref.read(gameViewModelProvider.notifier).loadGameState(gameState);
|
||||
}
|
||||
|
||||
// After restoring all necessary states, proceed with the app
|
||||
setState(() {
|
||||
_isInitialized = true;
|
||||
});
|
||||
}
|
||||
|
||||
// Future<void> _restoreAppState() async {
|
||||
// await _initializeApp();
|
||||
// // Add additional restoration logic if needed, for example:
|
||||
// // Restore game state, user progress, etc., from the DataProvider.
|
||||
// // Example:
|
||||
// // var gameState = await _dataProvider.getGameState('current_state');
|
||||
// // Use the gameState to decide what to do next, e.g., navigate to a specific screen.
|
||||
|
||||
// if (_isInitialized != true) {
|
||||
// // If initialization is not done, try to initialize the app.
|
||||
// _isInitialized = await _initializeApp();
|
||||
// }
|
||||
|
||||
// if (!_isInitialized!) {
|
||||
// await _showRetryCloseDialog();
|
||||
// } else {
|
||||
// setState(() {
|
||||
// _isInitialized = true;
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<bool> _initializeApp() async {
|
||||
AppInitializer initializer = AppInitializer();
|
||||
|
||||
// Check if permissions are already granted
|
||||
bool permissionsAlreadyGranted = await initializer.permissionStatus();
|
||||
if (!permissionsAlreadyGranted) {
|
||||
await _showPermissionRequestMessage();
|
||||
}
|
||||
|
||||
// Initialize the app and return the success status.
|
||||
return await initializer.initializeApp();
|
||||
}
|
||||
|
||||
Future<void> _showPermissionRequestMessage() async {
|
||||
return showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
title: const Text('Permissions Required'),
|
||||
content: const Text(
|
||||
'This app requires certain permissions to function properly. Please grant these permissions in the next steps.'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Okay'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<bool> _requestPermissionsAndInitialize() async {
|
||||
AppInitializer initializer = AppInitializer();
|
||||
return await initializer.initializeApp();
|
||||
}
|
||||
|
||||
Future<void> _showRetryCloseDialog() async {
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
title: const Text('Initialization Failed'),
|
||||
content: const Text(
|
||||
'The app was unable to start properly due to missing permissions.'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: const Text('Close'),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
Navigator.of(context).pop();
|
||||
bool retrySuccess = await _requestPermissionsAndInitialize();
|
||||
if (!retrySuccess) {
|
||||
await _showRetryCloseDialog();
|
||||
} else {
|
||||
setState(() {
|
||||
_isInitialized = true;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: const Text('Retry'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
ErrorScreen({required Object error}) {}
|
||||
}
|
||||
109
lib/features/location/location_provider.dart
Normal file
109
lib/features/location/location_provider.dart
Normal file
@ -0,0 +1,109 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:rogapp/features/data/user_location.dart';
|
||||
import 'package:rogapp/features/state/game_view_model.dart';
|
||||
|
||||
/// The state for the location feature
|
||||
class LocationState {
|
||||
final Position? currentPosition;
|
||||
final bool isStreamPaused;
|
||||
|
||||
LocationState({
|
||||
this.currentPosition,
|
||||
this.isStreamPaused = false,
|
||||
});
|
||||
|
||||
LocationState copyWith({
|
||||
Position? currentPosition,
|
||||
bool? isStreamPaused,
|
||||
}) {
|
||||
return LocationState(
|
||||
currentPosition: currentPosition ?? this.currentPosition,
|
||||
isStreamPaused: isStreamPaused ?? this.isStreamPaused,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// A StateNotifier that manages the location state
|
||||
class LocationNotifier extends StateNotifier<LocationState> {
|
||||
final Ref ref;
|
||||
LocationNotifier(this.ref) : super(LocationState()) {
|
||||
startListening();
|
||||
startPeriodicUpdates();
|
||||
}
|
||||
|
||||
StreamSubscription<Position>? _positionSubscription;
|
||||
Position? _lastPosition;
|
||||
final double _distanceThreshold = 220.0;
|
||||
Timer? _periodicUpdateTimer;
|
||||
|
||||
void startPeriodicUpdates() {
|
||||
_periodicUpdateTimer?.cancel();
|
||||
_periodicUpdateTimer = Timer.periodic(Duration(seconds: 5), (timer) {
|
||||
if (state.currentPosition != null) {
|
||||
// Convert Position to UserLocation
|
||||
UserLocation userLocation =
|
||||
UserLocation.fromPosition(state.currentPosition!);
|
||||
ref.read(gameViewModelProvider.notifier).updateLocation(userLocation);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void startListening() {
|
||||
_positionSubscription =
|
||||
Geolocator.getPositionStream().listen((Position position) {
|
||||
if (_shouldUpdatePosition(position)) {
|
||||
state = state.copyWith(currentPosition: position);
|
||||
_lastPosition = position;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
bool _shouldUpdatePosition(Position newPosition) {
|
||||
if (_lastPosition == null) return true;
|
||||
|
||||
double distance = Geolocator.distanceBetween(
|
||||
_lastPosition!.latitude,
|
||||
_lastPosition!.longitude,
|
||||
newPosition.latitude,
|
||||
newPosition.longitude,
|
||||
);
|
||||
|
||||
return distance < _distanceThreshold;
|
||||
}
|
||||
|
||||
void stopListening() {
|
||||
_positionSubscription?.cancel();
|
||||
_positionSubscription = null;
|
||||
state = state.copyWith(
|
||||
currentPosition: null); // Reset the position state or handle as needed
|
||||
}
|
||||
|
||||
void pauseListening() {
|
||||
_positionSubscription?.pause();
|
||||
}
|
||||
|
||||
void resumeListening() {
|
||||
_positionSubscription?.resume();
|
||||
}
|
||||
|
||||
void updateCurrentPosition(Position? position) {
|
||||
state = state.copyWith(currentPosition: position);
|
||||
}
|
||||
|
||||
void updateStreamPaused(bool isPaused) {
|
||||
state = state.copyWith(isStreamPaused: isPaused);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_positionSubscription?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
final locationNotifierProvider =
|
||||
StateNotifierProvider<LocationNotifier, LocationState>((ref) {
|
||||
return LocationNotifier(ref); // Pass ref directly
|
||||
});
|
||||
14
lib/features/services/auth_repo.dart
Normal file
14
lib/features/services/auth_repo.dart
Normal file
@ -0,0 +1,14 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/features/data/user.dart';
|
||||
import 'package:rogapp/features/services/auth_service.dart';
|
||||
|
||||
final authProvider =
|
||||
FutureProvider.family<User?, String>((ref, credentials) async {
|
||||
// Assuming credentials is a combined string of "email|password"
|
||||
List<String> parts = credentials.split('|');
|
||||
String email = parts[0];
|
||||
String password = parts[1];
|
||||
|
||||
AuthService authService = AuthService();
|
||||
return await authService.userLogin(email, password);
|
||||
});
|
||||
44
lib/features/services/auth_service.dart
Normal file
44
lib/features/services/auth_service.dart
Normal file
@ -0,0 +1,44 @@
|
||||
import 'package:rogapp/features/data/user.dart';
|
||||
|
||||
import '../utils/const.dart';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
|
||||
class AuthService {
|
||||
Dio dio = Dio();
|
||||
|
||||
Future<User?> userLogin(String email, String password) async {
|
||||
final String serverUrl = ConstValues.currentServer();
|
||||
final String url = '$serverUrl/api/login/';
|
||||
|
||||
try {
|
||||
final response = await dio.post(
|
||||
url,
|
||||
data: {
|
||||
'email': email,
|
||||
'password': password,
|
||||
},
|
||||
options: Options(
|
||||
headers: {
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
if (response.statusCode == 200 && response.data != null) {
|
||||
final data = response.data;
|
||||
User user = User.fromMap(data["user"]);
|
||||
final String token = data["token"];
|
||||
user.auth_token = token;
|
||||
return user;
|
||||
}
|
||||
return null;
|
||||
} on DioException catch (e) {
|
||||
print("Dio error: ${e.response?.statusCode} - ${e.message}");
|
||||
return null;
|
||||
} catch (e) {
|
||||
print("Unexpected error: $e");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
32
lib/features/services/checkpoint_repo.dart
Normal file
32
lib/features/services/checkpoint_repo.dart
Normal file
@ -0,0 +1,32 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/features/data/checkpoint.dart';
|
||||
import 'package:rogapp/features/data/data_provider.dart';
|
||||
import 'package:rogapp/features/services/checkpoint_service.dart'; // Import your ApiService file
|
||||
|
||||
Future<void> storeFetchedFeatures(FeatureCollection featureCollection) async {
|
||||
final dataProvider =
|
||||
DataProvider(); // Ensure DataProvider is initialized appropriately
|
||||
|
||||
for (Feature feature in featureCollection.features) {
|
||||
await dataProvider.insertMarker(feature);
|
||||
}
|
||||
}
|
||||
|
||||
final checkpointProvider = FutureProvider<List<Feature>>((ref) async {
|
||||
final dataProvider =
|
||||
DataProvider(); // Assuming you create or access an instance here
|
||||
final markers = await dataProvider.getMarkers();
|
||||
return markers;
|
||||
});
|
||||
|
||||
final featureCheckpointCollectionProvider =
|
||||
FutureProvider<FeatureCollection>((ref) async {
|
||||
final apiService =
|
||||
ApiService(); // Ensure ApiService is initialized appropriately
|
||||
final featureCollection = await apiService.fetchFeatures();
|
||||
|
||||
// Store the fetched features in the local database
|
||||
await storeFetchedFeatures(featureCollection);
|
||||
|
||||
return featureCollection; // Return the fetched feature collection
|
||||
});
|
||||
27
lib/features/services/checkpoint_service.dart
Normal file
27
lib/features/services/checkpoint_service.dart
Normal file
@ -0,0 +1,27 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:rogapp/features/data/checkpoint.dart';
|
||||
|
||||
class ApiService {
|
||||
final Dio _dio = Dio();
|
||||
|
||||
Future<FeatureCollection> fetchFeatures() async {
|
||||
try {
|
||||
final tmp_url =
|
||||
"https://rogaining.sumasen.net/api/inbound?rog=True&grp=養老ロゲ&ln1=136.52675654298724&la1=35.19710769333327&ln2=136.52675654298724&la2=35.38264844179004&ln3=136.65061968584442&la3=35.38264844179004&ln4=136.65061968584442&la4=35.19710769333327";
|
||||
final response = await _dio.get(tmp_url);
|
||||
if (response.statusCode == 200) {
|
||||
return FeatureCollection.fromJson(response.data);
|
||||
} else {
|
||||
throw Exception('Failed to load features');
|
||||
}
|
||||
} on DioException catch (e) {
|
||||
// Handle Dio errors here
|
||||
print('Dio error: $e');
|
||||
throw Exception('Failed to load features');
|
||||
} catch (e) {
|
||||
// Handle any other errors
|
||||
print('General error: $e');
|
||||
throw Exception('Failed to load features');
|
||||
}
|
||||
}
|
||||
}
|
||||
98
lib/features/state/game_state.dart
Normal file
98
lib/features/state/game_state.dart
Normal file
@ -0,0 +1,98 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/features/data/checkpoint.dart';
|
||||
import 'package:rogapp/features/data/user_location.dart';
|
||||
|
||||
enum GameStatus {
|
||||
notStarted,
|
||||
started,
|
||||
inProgress,
|
||||
atCheckpoint,
|
||||
gameCompleted,
|
||||
}
|
||||
|
||||
enum PendingAction {
|
||||
none,
|
||||
checkInPhoto,
|
||||
receiptPhoto,
|
||||
endGamePhoto,
|
||||
}
|
||||
|
||||
@immutable
|
||||
class GameState {
|
||||
final GameStatus status;
|
||||
final List<Feature> markers;
|
||||
final UserLocation? currentLocation;
|
||||
final Set<Feature> visitedMarkers;
|
||||
final bool isWithinStartRadius;
|
||||
final bool hasLeftStartArea;
|
||||
final bool hasVisitedCheckpoint;
|
||||
final Feature? currentCheckpoint;
|
||||
final bool checkpointPhotoTaken;
|
||||
final bool receiptPhotoTaken;
|
||||
final PendingAction pendingAction;
|
||||
|
||||
const GameState({
|
||||
this.status = GameStatus.notStarted,
|
||||
this.markers = const [],
|
||||
this.currentLocation,
|
||||
this.visitedMarkers = const {},
|
||||
this.isWithinStartRadius = false,
|
||||
this.hasLeftStartArea = false,
|
||||
this.hasVisitedCheckpoint = false,
|
||||
this.currentCheckpoint,
|
||||
this.checkpointPhotoTaken = false,
|
||||
this.receiptPhotoTaken = false,
|
||||
this.pendingAction = PendingAction.none,
|
||||
});
|
||||
|
||||
LatLng? getUserLatLng() {
|
||||
return currentLocation != null
|
||||
? LatLng(currentLocation!.latitude, currentLocation!.longitude)
|
||||
: null;
|
||||
}
|
||||
|
||||
GameState.fromMap(Map<String, dynamic> map)
|
||||
: status = GameStatus.values[map['status']],
|
||||
markers =
|
||||
List<Feature>.from(map['markers'].map((x) => Feature.fromMap(x))),
|
||||
currentLocation = UserLocation.fromMap(map['currentLocation']),
|
||||
visitedMarkers = Set<Feature>.from(
|
||||
map['visitedMarkers'].map((x) => Feature.fromMap(x))),
|
||||
isWithinStartRadius = map['isWithinStartRadius'],
|
||||
hasLeftStartArea = map['hasLeftStartArea'],
|
||||
hasVisitedCheckpoint = map['hasVisitedCheckpoint'],
|
||||
currentCheckpoint = map['currentCheckpoint'] != null
|
||||
? Feature.fromMap(map['currentCheckpoint'])
|
||||
: null,
|
||||
checkpointPhotoTaken = map['checkpointPhotoTaken'],
|
||||
receiptPhotoTaken = map['receiptPhotoTaken'],
|
||||
pendingAction = PendingAction.values[map['pendingAction']];
|
||||
|
||||
GameState copyWith({
|
||||
GameStatus? status,
|
||||
List<Feature>? markers,
|
||||
UserLocation? currentLocation,
|
||||
Set<Feature>? visitedMarkers,
|
||||
bool? isWithinStartRadius,
|
||||
bool? hasLeftStartArea,
|
||||
bool? hasVisitedCheckpoint,
|
||||
Feature? currentCheckpoint,
|
||||
bool? checkpointPhotoTaken,
|
||||
bool? receiptPhotoTaken,
|
||||
PendingAction? pendingAction,
|
||||
}) {
|
||||
return GameState(
|
||||
status: status ?? this.status,
|
||||
markers: markers ?? this.markers,
|
||||
currentLocation: currentLocation ?? this.currentLocation,
|
||||
visitedMarkers: visitedMarkers ?? this.visitedMarkers,
|
||||
isWithinStartRadius: isWithinStartRadius ?? this.isWithinStartRadius,
|
||||
hasLeftStartArea: hasLeftStartArea ?? this.hasLeftStartArea,
|
||||
hasVisitedCheckpoint: hasVisitedCheckpoint ?? this.hasVisitedCheckpoint,
|
||||
currentCheckpoint: currentCheckpoint ?? this.currentCheckpoint,
|
||||
checkpointPhotoTaken: checkpointPhotoTaken ?? this.checkpointPhotoTaken,
|
||||
receiptPhotoTaken: receiptPhotoTaken ?? this.receiptPhotoTaken,
|
||||
pendingAction: pendingAction ?? this.pendingAction);
|
||||
}
|
||||
}
|
||||
199
lib/features/state/game_view_model.dart
Normal file
199
lib/features/state/game_view_model.dart
Normal file
@ -0,0 +1,199 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:rogapp/features/data/checkpoint.dart';
|
||||
import 'package:rogapp/features/data/data_provider.dart';
|
||||
import 'package:rogapp/features/data/user_location.dart';
|
||||
import 'package:rogapp/features/state/game_state.dart';
|
||||
import 'package:rogapp/features/utils/params.dart';
|
||||
|
||||
final gameViewModelProvider =
|
||||
StateNotifierProvider<GameViewModel, GameState>((ref) {
|
||||
final dataProvider = DataProvider();
|
||||
return GameViewModel(dataProvider);
|
||||
});
|
||||
|
||||
class GameViewModel extends StateNotifier<GameState> {
|
||||
final DataProvider _dataProvider;
|
||||
|
||||
GameViewModel(this._dataProvider) : super(const GameState()) {
|
||||
loadInitialData();
|
||||
}
|
||||
|
||||
Future<void> loadInitialData() async {
|
||||
List<Feature> markers = await _dataProvider.getMarkers();
|
||||
state = state.copyWith(markers: markers);
|
||||
}
|
||||
|
||||
void setMarkers(List<Feature> markers) {
|
||||
state = state.copyWith(markers: markers);
|
||||
}
|
||||
|
||||
void startGame() {
|
||||
if (state.isWithinStartRadius) {
|
||||
state = state.copyWith(status: GameStatus.started);
|
||||
}
|
||||
}
|
||||
|
||||
void updateLocation(UserLocation location) {
|
||||
Feature startMarker = state.markers.firstWhere(
|
||||
(marker) => marker.properties.cp == -1,
|
||||
orElse: () => Feature.empty());
|
||||
List<Feature> checkpoints =
|
||||
state.markers.where((marker) => marker.properties.cp != -1).toList();
|
||||
|
||||
bool isWithinStartRadius =
|
||||
_checkProximity(location, startMarker /* start marker location */
|
||||
);
|
||||
bool hasLeftArea =
|
||||
state.hasLeftStartArea || _checkHasLeftStartArea(location, startMarker);
|
||||
|
||||
Feature? atCheckpoint = _checkAtAnyCheckpoint(location, checkpoints);
|
||||
|
||||
// Check if at any checkpoint (except start point after game started)
|
||||
bool isAtCheckpoint =
|
||||
state.status == GameStatus.started && atCheckpoint != null;
|
||||
if (isAtCheckpoint) {
|
||||
_handleCheckpointArrival(location, atCheckpoint);
|
||||
}
|
||||
|
||||
// Update game state based on the new location
|
||||
state = state.copyWith(
|
||||
currentLocation: location,
|
||||
isWithinStartRadius: isWithinStartRadius,
|
||||
hasLeftStartArea: hasLeftArea,
|
||||
status: isAtCheckpoint ? GameStatus.atCheckpoint : state.status,
|
||||
);
|
||||
}
|
||||
|
||||
void _handleCheckpointArrival(UserLocation location, Feature marker) {
|
||||
// Directly set the current checkpoint; no need to check if the photo was taken here
|
||||
state = state.copyWith(currentCheckpoint: marker);
|
||||
|
||||
// If no checkpoint photo has been taken yet, set the pending action to take a checkpoint photo
|
||||
if (!state.checkpointPhotoTaken) {
|
||||
state = state.copyWith(pendingAction: PendingAction.checkInPhoto);
|
||||
}
|
||||
|
||||
// Additional actions specific to buy points can be prepared here, but it's usually better
|
||||
// to handle them after the checkpoint photo is submitted, not at the moment of arrival.
|
||||
}
|
||||
|
||||
void submitCheckInPhoto(String photoPath) {
|
||||
// Logic to save or upload the check-in photo...
|
||||
state = state.copyWith(checkpointPhotoTaken: true);
|
||||
|
||||
// Determine the next action based on the checkpoint type
|
||||
if (state.currentCheckpoint != null &&
|
||||
isBuyPoint(state.currentCheckpoint!)) {
|
||||
state = state.copyWith(pendingAction: PendingAction.receiptPhoto);
|
||||
} else {
|
||||
// If it's not a buy point, mark the checkpoint visit as complete
|
||||
_markCheckpointVisited(state.currentCheckpoint!);
|
||||
}
|
||||
}
|
||||
|
||||
void submitReceiptPhoto(String photoPath) {
|
||||
// Logic to save or upload the receipt photo...
|
||||
state = state.copyWith(receiptPhotoTaken: true);
|
||||
|
||||
// After submitting the receipt photo, mark the checkpoint visit as complete
|
||||
_markCheckpointVisited(state.currentCheckpoint!);
|
||||
}
|
||||
|
||||
void _markCheckpointVisited(Feature checkpoint) {
|
||||
state = state.copyWith(
|
||||
visitedMarkers: Set.from(state.visitedMarkers)..add(checkpoint),
|
||||
hasVisitedCheckpoint: true,
|
||||
pendingAction: PendingAction.none, // Reset the pending action
|
||||
);
|
||||
|
||||
// Additional logic to determine if the game is completed...
|
||||
}
|
||||
|
||||
bool isBuyPoint(Feature checkpoint) {
|
||||
if (checkpoint.properties.buyPoint != null) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool _checkProximity(UserLocation location, Feature startMarker) {
|
||||
const Distance distance = Distance();
|
||||
return distance(
|
||||
LatLng(location.latitude, location.longitude),
|
||||
LatLng(startMarker.geometry.latitude,
|
||||
startMarker.geometry.longitude)) <=
|
||||
startMinDistance;
|
||||
}
|
||||
|
||||
bool _checkHasLeftStartArea(UserLocation location, Feature startMarker) {
|
||||
const Distance distance = Distance();
|
||||
return distance(
|
||||
LatLng(location.latitude, location.longitude),
|
||||
LatLng(startMarker.geometry.latitude,
|
||||
startMarker.geometry.longitude)) >=
|
||||
minAwayfromStartDistance;
|
||||
}
|
||||
|
||||
Feature? _checkAtAnyCheckpoint(UserLocation location, List<Feature> markers) {
|
||||
const Distance distance = Distance();
|
||||
|
||||
for (Feature marker in markers) {
|
||||
final double distanceInMeters = distance(
|
||||
LatLng(location.latitude, location.longitude),
|
||||
LatLng(marker.geometry.latitude, marker.geometry.longitude),
|
||||
);
|
||||
if (marker.properties.checkinRadious != null &&
|
||||
marker.properties.checkinRadious! >= distanceInMeters) {
|
||||
return marker;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Feature? _getCheckpointFromLocation(UserLocation location) {
|
||||
const thresholdDistance = 50.0; // meters, adjust based on your game design
|
||||
const Distance distance = Distance();
|
||||
|
||||
for (final marker in state.markers) {
|
||||
final double distanceInMeters = distance(
|
||||
LatLng(location.latitude, location.longitude),
|
||||
LatLng(marker.geometry.latitude, marker.geometry.longitude),
|
||||
);
|
||||
|
||||
if (distanceInMeters <=
|
||||
(marker.properties.checkinRadious ?? thresholdDistance)) {
|
||||
return marker;
|
||||
}
|
||||
}
|
||||
|
||||
return null; // No checkpoint is close enough to the user's location
|
||||
}
|
||||
|
||||
bool _isBackAtStart(UserLocation location) {
|
||||
const startThresholdDistance = 150.0; // Define proximity threshold
|
||||
const Distance distance = Distance();
|
||||
|
||||
// Assuming the start point is the first marker
|
||||
// Adjust based on your game's logic
|
||||
final startPoint = state.markers.first;
|
||||
|
||||
final double distanceToStart = distance(
|
||||
LatLng(location.latitude, location.longitude),
|
||||
LatLng(startPoint.geometry.latitude, startPoint.geometry.longitude),
|
||||
);
|
||||
|
||||
// User is considered back at the start if within the threshold distance
|
||||
return distanceToStart <= startThresholdDistance;
|
||||
}
|
||||
|
||||
void endGame() {
|
||||
if (state.status == GameStatus.gameCompleted) {
|
||||
// Perform any end game actions
|
||||
}
|
||||
}
|
||||
|
||||
void loadGameState(GameState gameState) {
|
||||
state = gameState;
|
||||
}
|
||||
}
|
||||
18
lib/features/state/user_state.dart
Normal file
18
lib/features/state/user_state.dart
Normal file
@ -0,0 +1,18 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/features/data/user.dart';
|
||||
|
||||
class UserNotifier extends StateNotifier<User?> {
|
||||
UserNotifier() : super(null);
|
||||
|
||||
void setUser(User? user) {
|
||||
state = user;
|
||||
}
|
||||
|
||||
void clearUser() {
|
||||
state = null;
|
||||
}
|
||||
}
|
||||
|
||||
final userNotifierProvider = StateNotifierProvider<UserNotifier, User?>((ref) {
|
||||
return UserNotifier();
|
||||
});
|
||||
13
lib/features/utils/const.dart
Normal file
13
lib/features/utils/const.dart
Normal file
@ -0,0 +1,13 @@
|
||||
class ConstValues {
|
||||
static const container_svr = "http://container.intranet.sumasen.net:8100";
|
||||
static const server_uri = "https://rogaining.sumasen.net";
|
||||
static const dev_server = "http://localhost:8100";
|
||||
static const dev_ip_server = "http://192.168.8.100:8100";
|
||||
static const dev_home_ip_server = "http://172.20.10.9:8100";
|
||||
static const dev_home_ip_mserver = "http://192.168.1.10:8100";
|
||||
|
||||
static String currentServer() {
|
||||
//return dev_ip_server;
|
||||
return server_uri;
|
||||
}
|
||||
}
|
||||
29
lib/features/utils/distance_calculator.dart
Normal file
29
lib/features/utils/distance_calculator.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'dart:math';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
class DistanceCalculatorHS {
|
||||
static const int _radius = 6371; // Radius of the Earth in kilometers
|
||||
|
||||
static double _degreeToRadian(double degree) {
|
||||
return degree * pi / 180;
|
||||
}
|
||||
|
||||
static double calculateDistance(LatLng location1, LatLng location2) {
|
||||
double latDistance =
|
||||
_degreeToRadian(location2.latitude - location1.latitude);
|
||||
double lonDistance =
|
||||
_degreeToRadian(location2.longitude - location1.longitude);
|
||||
|
||||
double a = sin(latDistance / 2) * sin(latDistance / 2) +
|
||||
cos(_degreeToRadian(location1.latitude)) *
|
||||
cos(_degreeToRadian(location2.latitude)) *
|
||||
sin(lonDistance / 2) *
|
||||
sin(lonDistance / 2);
|
||||
|
||||
double c = 2 * atan2(sqrt(a), sqrt(1 - a));
|
||||
|
||||
double distance = _radius * c * 1000; // Convert to meters
|
||||
|
||||
return distance;
|
||||
}
|
||||
}
|
||||
17
lib/features/utils/error_reporter.dart
Normal file
17
lib/features/utils/error_reporter.dart
Normal file
@ -0,0 +1,17 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
final errorReportingProvider = Provider<ErrorReporter>((ref) {
|
||||
return ErrorReporterImpl();
|
||||
});
|
||||
|
||||
class ErrorReporter {
|
||||
void reportError(Object error, StackTrace stackTrace) {}
|
||||
}
|
||||
|
||||
class ErrorReporterImpl extends ErrorReporter {
|
||||
@override
|
||||
void reportError(Object error, StackTrace stackTrace) {
|
||||
// Send error and stackTrace to the server
|
||||
// Include app state if necessary
|
||||
}
|
||||
}
|
||||
2
lib/features/utils/params.dart
Normal file
2
lib/features/utils/params.dart
Normal file
@ -0,0 +1,2 @@
|
||||
int startMinDistance = 150;
|
||||
int minAwayfromStartDistance = 300;
|
||||
154
lib/main.dart
154
lib/main.dart
@ -1,147 +1,47 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
import 'package:rogapp/pages/index/index_binding.dart';
|
||||
import 'package:rogapp/routes/app_pages.dart';
|
||||
import 'package:rogapp/utils/location_controller.dart';
|
||||
import 'package:rogapp/utils/string_values.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
// import 'package:is_lock_screen/is_lock_screen.dart';
|
||||
import 'package:rogapp/features/landing/landing_page.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/features/utils/error_reporter.dart';
|
||||
|
||||
void saveGameState() async {
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
pref.setBool("is_in_rog", destinationController.isInRog.value);
|
||||
pref.setBool(
|
||||
"rogaining_counted", destinationController.rogainingCounted.value);
|
||||
pref.setBool("ready_for_goal", DestinationController.ready_for_goal);
|
||||
}
|
||||
|
||||
void restoreGame() async {
|
||||
SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
destinationController.skipGps = false;
|
||||
destinationController.isInRog.value = pref.getBool("is_in_rog") ?? false;
|
||||
destinationController.rogainingCounted.value =
|
||||
pref.getBool("rogaining_counted") ?? false;
|
||||
DestinationController.ready_for_goal =
|
||||
pref.getBool("ready_for_goal") ?? false;
|
||||
//print(
|
||||
// "--restored -- destinationController.isInRog.value ${pref.getBool("is_in_rog")} -- ${pref.getBool("rogaining_counted")}");
|
||||
void reportError(
|
||||
ProviderContainer container, Object error, StackTrace stackTrace) {
|
||||
// Log the error locally or report to a server
|
||||
print('Caught an error: $error');
|
||||
container.read(errorReportingProvider).reportError(error, stackTrace);
|
||||
}
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await FlutterMapTileCaching.initialise();
|
||||
final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
|
||||
await instanceA.manage.createAsync();
|
||||
await instanceA.metadata.addAsync(
|
||||
key: 'sourceURL',
|
||||
value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
||||
);
|
||||
await instanceA.metadata.addAsync(
|
||||
key: 'validDuration',
|
||||
value: '14',
|
||||
);
|
||||
await instanceA.metadata.addAsync(
|
||||
key: 'behaviour',
|
||||
value: 'cacheFirst',
|
||||
);
|
||||
runApp(const MyApp());
|
||||
final container = ProviderContainer();
|
||||
runZonedGuarded(() {
|
||||
runApp(UncontrolledProviderScope(container: container, child: const App()));
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
final error = details.exception;
|
||||
final stackTrace = details.stack ?? StackTrace.current;
|
||||
reportError(container, error, stackTrace);
|
||||
};
|
||||
}, (error, stackTrace) {
|
||||
reportError(container, error, stackTrace ?? StackTrace.current);
|
||||
});
|
||||
}
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({Key? key}) : super(key: key);
|
||||
class App extends StatelessWidget {
|
||||
const App({super.key});
|
||||
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
|
||||
class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// This widget is the root of your application.
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
if (context.mounted) {
|
||||
restoreGame();
|
||||
}
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// void saveGameState() async {
|
||||
// DestinationController destinationController = Get.find<DestinationController>();
|
||||
// SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// pref.setBool("is_in_rog", destinationController.is_in_rog.value);
|
||||
// pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
||||
// }
|
||||
|
||||
@override
|
||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
LocationController locationController = Get.find<LocationController>();
|
||||
|
||||
DestinationController destinationController =
|
||||
Get.find<DestinationController>();
|
||||
switch (state) {
|
||||
case AppLifecycleState.resumed:
|
||||
locationController.resumePositionStream();
|
||||
//print("RESUMED");
|
||||
restoreGame();
|
||||
break;
|
||||
case AppLifecycleState.inactive:
|
||||
locationController.resumePositionStream();
|
||||
//print("INACTIVE");
|
||||
break;
|
||||
case AppLifecycleState.paused:
|
||||
locationController.resumePositionStream();
|
||||
//print("PAUSED");
|
||||
saveGameState();
|
||||
break;
|
||||
case AppLifecycleState.detached:
|
||||
locationController.resumePositionStream();
|
||||
//print("DETACHED");
|
||||
saveGameState();
|
||||
break;
|
||||
case AppLifecycleState.hidden:
|
||||
locationController.resumePositionStream();
|
||||
//print("DETACHED");
|
||||
saveGameState();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return GetMaterialApp(
|
||||
translations: StringValues(),
|
||||
locale: const Locale('ja', 'JP'),
|
||||
//locale: const Locale('en', 'US'),
|
||||
fallbackLocale: const Locale('en', 'US'),
|
||||
title: 'ROGAINING',
|
||||
return MaterialApp(
|
||||
title: 'Flutter Demo',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color.fromARGB(255, 36, 135, 221)),
|
||||
seedColor: const Color.fromARGB(255, 0, 35, 140)), //Samurai Blue
|
||||
useMaterial3: true,
|
||||
),
|
||||
debugShowCheckedModeBanner: false,
|
||||
defaultTransition: Transition.cupertino,
|
||||
opaqueRoute: Get.isOpaqueRouteDefault,
|
||||
popGesture: Get.isPopGestureEnable,
|
||||
transitionDuration: const Duration(milliseconds: 230),
|
||||
initialBinding: IndexBinding(), //HomeBinding(),
|
||||
initialRoute: AppPages.PERMISSION,
|
||||
getPages: AppPages.routes,
|
||||
enableLog: true,
|
||||
home: const LandingPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
146
lib/main_mapsix.dart
Normal file
146
lib/main_mapsix.dart
Normal file
@ -0,0 +1,146 @@
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
// import 'package:get/get.dart';
|
||||
// import 'package:rogapp/pages/destination/destination_controller.dart';
|
||||
// import 'package:rogapp/pages/index/index_binding.dart';
|
||||
// import 'package:rogapp/routes/app_pages.dart';
|
||||
// import 'package:rogapp/utils/location_controller.dart';
|
||||
// import 'package:rogapp/utils/string_values.dart';
|
||||
// import 'package:shared_preferences/shared_preferences.dart';
|
||||
// // import 'package:is_lock_screen/is_lock_screen.dart';
|
||||
|
||||
// void saveGameState() async {
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
// SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// pref.setBool("is_in_rog", destinationController.isInRog.value);
|
||||
// pref.setBool(
|
||||
// "rogaining_counted", destinationController.rogainingCounted.value);
|
||||
// pref.setBool("ready_for_goal", DestinationController.ready_for_goal);
|
||||
// }
|
||||
|
||||
// void restoreGame() async {
|
||||
// SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
// destinationController.skipGps = false;
|
||||
// destinationController.isInRog.value = pref.getBool("is_in_rog") ?? false;
|
||||
// destinationController.rogainingCounted.value =
|
||||
// pref.getBool("rogaining_counted") ?? false;
|
||||
// DestinationController.ready_for_goal =
|
||||
// pref.getBool("ready_for_goal") ?? false;
|
||||
// //print(
|
||||
// // "--restored -- destinationController.isInRog.value ${pref.getBool("is_in_rog")} -- ${pref.getBool("rogaining_counted")}");
|
||||
// }
|
||||
|
||||
// void main() async {
|
||||
// WidgetsFlutterBinding.ensureInitialized();
|
||||
// await FlutterMapTileCaching.initialise();
|
||||
// final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
|
||||
// await instanceA.manage.createAsync();
|
||||
// await instanceA.metadata.addAsync(
|
||||
// key: 'sourceURL',
|
||||
// value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
||||
// );
|
||||
// await instanceA.metadata.addAsync(
|
||||
// key: 'validDuration',
|
||||
// value: '14',
|
||||
// );
|
||||
// await instanceA.metadata.addAsync(
|
||||
// key: 'behaviour',
|
||||
// value: 'cacheFirst',
|
||||
// );
|
||||
// runApp(const MyApp());
|
||||
// }
|
||||
|
||||
// class MyApp extends StatefulWidget {
|
||||
// const MyApp({Key? key}) : super(key: key);
|
||||
|
||||
// @override
|
||||
// State<MyApp> createState() => _MyAppState();
|
||||
// }
|
||||
|
||||
// class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// // This widget is the root of your application.
|
||||
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// if (context.mounted) {
|
||||
// restoreGame();
|
||||
// }
|
||||
// WidgetsBinding.instance.addObserver(this);
|
||||
// }
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// WidgetsBinding.instance.removeObserver(this);
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
// // void saveGameState() async {
|
||||
// // DestinationController destinationController = Get.find<DestinationController>();
|
||||
// // SharedPreferences pref = await SharedPreferences.getInstance();
|
||||
// // pref.setBool("is_in_rog", destinationController.is_in_rog.value);
|
||||
// // pref.setBool("rogaining_counted", destinationController.rogaining_counted.value);
|
||||
// // }
|
||||
|
||||
// @override
|
||||
// void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||
// LocationController locationController = Get.find<LocationController>();
|
||||
|
||||
// DestinationController destinationController =
|
||||
// Get.find<DestinationController>();
|
||||
// switch (state) {
|
||||
// case AppLifecycleState.resumed:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("RESUMED");
|
||||
// restoreGame();
|
||||
// break;
|
||||
// case AppLifecycleState.inactive:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("INACTIVE");
|
||||
// break;
|
||||
// case AppLifecycleState.paused:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("PAUSED");
|
||||
// saveGameState();
|
||||
// break;
|
||||
// case AppLifecycleState.detached:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("DETACHED");
|
||||
// saveGameState();
|
||||
// break;
|
||||
// case AppLifecycleState.hidden:
|
||||
// locationController.resumePositionStream();
|
||||
// //print("DETACHED");
|
||||
// saveGameState();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return GetMaterialApp(
|
||||
// translations: StringValues(),
|
||||
// locale: const Locale('ja', 'JP'),
|
||||
// //locale: const Locale('en', 'US'),
|
||||
// fallbackLocale: const Locale('en', 'US'),
|
||||
// title: 'ROGAINING',
|
||||
// theme: ThemeData(
|
||||
// colorScheme: ColorScheme.fromSeed(
|
||||
// seedColor: const Color.fromARGB(255, 36, 135, 221)),
|
||||
// useMaterial3: true,
|
||||
// ),
|
||||
// debugShowCheckedModeBanner: false,
|
||||
// defaultTransition: Transition.cupertino,
|
||||
// opaqueRoute: Get.isOpaqueRouteDefault,
|
||||
// popGesture: Get.isPopGestureEnable,
|
||||
// transitionDuration: const Duration(milliseconds: 230),
|
||||
// initialBinding: IndexBinding(), //HomeBinding(),
|
||||
// initialRoute: AppPages.PERMISSION,
|
||||
// getPages: AppPages.routes,
|
||||
// enableLog: true,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
@ -1,61 +1,61 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:rogapp/nrog/pages/permission_page.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
// import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
// import 'package:rogapp/nrog/pages/permission_page.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
// void main() async {
|
||||
// WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await FlutterMapTileCaching.initialise();
|
||||
final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
|
||||
await instanceA.manage.createAsync();
|
||||
await instanceA.metadata.addAsync(
|
||||
key: 'sourceURL',
|
||||
value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
||||
);
|
||||
await instanceA.metadata.addAsync(
|
||||
key: 'validDuration',
|
||||
value: '14',
|
||||
);
|
||||
await instanceA.metadata.addAsync(
|
||||
key: 'behaviour',
|
||||
value: 'cacheFirst',
|
||||
);
|
||||
runApp(
|
||||
const ProviderScope(child: MyApp()),
|
||||
);
|
||||
}
|
||||
// await FlutterMapTileCaching.initialise();
|
||||
// final StoreDirectory instanceA = FMTC.instance('OpenStreetMap (A)');
|
||||
// await instanceA.manage.createAsync();
|
||||
// await instanceA.metadata.addAsync(
|
||||
// key: 'sourceURL',
|
||||
// value: 'https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png',
|
||||
// );
|
||||
// await instanceA.metadata.addAsync(
|
||||
// key: 'validDuration',
|
||||
// value: '14',
|
||||
// );
|
||||
// await instanceA.metadata.addAsync(
|
||||
// key: 'behaviour',
|
||||
// value: 'cacheFirst',
|
||||
// );
|
||||
// runApp(
|
||||
// const ProviderScope(child: MyApp()),
|
||||
// );
|
||||
// }
|
||||
|
||||
class MyApp extends StatefulWidget {
|
||||
const MyApp({super.key});
|
||||
// class MyApp extends StatefulWidget {
|
||||
// const MyApp({super.key});
|
||||
|
||||
@override
|
||||
State<MyApp> createState() => _MyAppState();
|
||||
}
|
||||
// @override
|
||||
// State<MyApp> createState() => _MyAppState();
|
||||
// }
|
||||
|
||||
class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
}
|
||||
// class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
// @override
|
||||
// void initState() {
|
||||
// super.initState();
|
||||
// WidgetsBinding.instance.addObserver(this);
|
||||
// }
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// WidgetsBinding.instance.removeObserver(this);
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'Flutter Demo',
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: const Color.fromARGB(255, 124, 156, 9)),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const PermissionPage());
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return MaterialApp(
|
||||
// debugShowCheckedModeBanner: false,
|
||||
// title: 'Flutter Demo',
|
||||
// theme: ThemeData(
|
||||
// colorScheme: ColorScheme.fromSeed(
|
||||
// seedColor: const Color.fromARGB(255, 124, 156, 9)),
|
||||
// useMaterial3: true,
|
||||
// ),
|
||||
// home: const PermissionPage());
|
||||
// }
|
||||
// }
|
||||
|
||||
@ -95,7 +95,7 @@ class _HomePageState extends ConsumerState<HomePage> {
|
||||
// .hideAllPopups(), // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
const BaseLayer(),
|
||||
//const BaseLayer(),
|
||||
CurrentLocationLayer(
|
||||
followOnLocationUpdate: FollowOnLocationUpdate.once,
|
||||
turnOnHeadingUpdate: TurnOnHeadingUpdate.never,
|
||||
|
||||
@ -191,7 +191,8 @@ class CameraPage extends StatelessWidget {
|
||||
Get.back();
|
||||
destinationController.skipGps = false;
|
||||
Get.snackbar("目標が保存されました", "目標が正常に追加されました");
|
||||
destinationController.resetRogaining();
|
||||
destinationController.resetRogaining(
|
||||
isgoal: true);
|
||||
} else {
|
||||
//print("---- status ${value['status']} ---- ");
|
||||
Get.snackbar("目標が追加されていません", "please_try_again");
|
||||
|
||||
@ -6,6 +6,6 @@ class DestinationBinding extends Bindings {
|
||||
@override
|
||||
void dependencies() {
|
||||
Get.put<DestinationController>(DestinationController());
|
||||
restoreGame();
|
||||
//restoreGame();
|
||||
}
|
||||
}
|
||||
|
||||
@ -650,7 +650,7 @@ class DestinationController extends GetxController {
|
||||
}
|
||||
isInRog.value = true;
|
||||
|
||||
saveGameState();
|
||||
//saveGameState();
|
||||
}
|
||||
|
||||
Future<void> cancelBuyPoint(Destination destination) async {
|
||||
@ -782,7 +782,7 @@ class DestinationController extends GetxController {
|
||||
void handleLocationUpdate(LocationMarkerPosition? position) async {
|
||||
try {
|
||||
if (position != null) {
|
||||
if (distanceToStart() >= 1000) {
|
||||
if (distanceToStart() >= 150) {
|
||||
ready_for_goal = true;
|
||||
}
|
||||
|
||||
|
||||
@ -155,7 +155,7 @@ class DestinationMapPage extends StatelessWidget {
|
||||
interactiveFlags: InteractiveFlag.pinchZoom | InteractiveFlag.drag,
|
||||
),
|
||||
children: [
|
||||
const BaseLayer(),
|
||||
//const BaseLayer(),
|
||||
Obx(
|
||||
() => indexController.routePointLenght > 0
|
||||
? PolylineLayer(
|
||||
|
||||
@ -123,7 +123,7 @@ class _GpsPageState extends State<GpsPage> {
|
||||
onTap: (tapPos, cord) {}, // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
const BaseLayer(),
|
||||
//const BaseLayer(),
|
||||
MarkerLayer(
|
||||
markers: gpsData.map((i) {
|
||||
return Marker(
|
||||
|
||||
@ -116,8 +116,8 @@ class IndexController extends GetxController {
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
_connectivitySubscription =
|
||||
_connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
// _connectivitySubscription =
|
||||
// _connectivity.onConnectivityChanged.listen(_updateConnectionStatus);
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@ -133,16 +133,16 @@ class IndexController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> initConnectivity() async {
|
||||
late ConnectivityResult result;
|
||||
// Platform messages may fail, so we use a try/catch PlatformException.
|
||||
try {
|
||||
result = await _connectivity.checkConnectivity();
|
||||
} on PlatformException catch (_) {
|
||||
//print('Couldn\'t check connectivity status --- $e');
|
||||
return;
|
||||
}
|
||||
// late ConnectivityResult result;
|
||||
// // Platform messages may fail, so we use a try/catch PlatformException.
|
||||
// try {
|
||||
// //result = await _connectivity.checkConnectivity();
|
||||
// } on PlatformException catch (_) {
|
||||
// //print('Couldn\'t check connectivity status --- $e');
|
||||
// return;
|
||||
// }
|
||||
|
||||
return _updateConnectionStatus(result);
|
||||
// return _updateConnectionStatus(result);
|
||||
}
|
||||
|
||||
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
|
||||
|
||||
@ -107,7 +107,7 @@ class LocationService {
|
||||
'$serverUrl/api/inbound?ln1=$lon1&la1=$lat1&ln2=$lon2&la2=$lat2&ln3=$lon3&la3=$lat3&ln4=$lon4&la4=$lat4';
|
||||
}
|
||||
}
|
||||
//print('++++++++$url');
|
||||
print('++++++++$url');
|
||||
final response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
|
||||
@ -1,24 +1,24 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
// import 'package:flutter/material.dart';
|
||||
// import 'package:flutter_map/flutter_map.dart';
|
||||
// import 'package:flutter_map_tile_caching/flutter_map_tile_caching.dart';
|
||||
|
||||
class BaseLayer extends StatelessWidget {
|
||||
const BaseLayer({Key? key}) : super(key: key);
|
||||
// class BaseLayer extends StatelessWidget {
|
||||
// const BaseLayer({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TileLayer(
|
||||
urlTemplate: "https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",
|
||||
tileProvider: FMTC.instance('OpenStreetMap (A)').getTileProvider(
|
||||
settings: FMTCTileProviderSettings(
|
||||
behavior: CacheBehavior.values.byName('cacheFirst'),
|
||||
cachedValidDuration: const Duration(days: 14),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
// @override
|
||||
// Widget build(BuildContext context) {
|
||||
// return TileLayer(
|
||||
// urlTemplate: "https://cyberjapandata.gsi.go.jp/xyz/std/{z}/{x}/{y}.png",
|
||||
// tileProvider: FMTC.instance('OpenStreetMap (A)').getTileProvider(
|
||||
// settings: FMTCTileProviderSettings(
|
||||
// behavior: CacheBehavior.values.byName('cacheFirst'),
|
||||
// cachedValidDuration: const Duration(days: 14),
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
// var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
||||
// attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
|
||||
// });
|
||||
// // var Esri_WorldImagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
||||
// // attribution: 'Tiles © Esri — Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community'
|
||||
// // });
|
||||
@ -195,7 +195,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
destinationController.currentLon,
|
||||
destination.location_id!,
|
||||
);
|
||||
saveGameState();
|
||||
//saveGameState();
|
||||
await ExternalService().startRogaining();
|
||||
Get.back(); // Close the dialog and potentially navigate away
|
||||
},
|
||||
|
||||
@ -237,7 +237,7 @@ class _MapWidgetState extends State<MapWidget> {
|
||||
.hideAllPopups(), // Hide popup when the map is tapped.
|
||||
),
|
||||
children: [
|
||||
const BaseLayer(),
|
||||
//const BaseLayer(),
|
||||
Obx(
|
||||
() => indexController.routePointLenght > 0
|
||||
? PolylineLayer(
|
||||
|
||||
@ -7,16 +7,12 @@
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <file_selector_linux/file_selector_plugin.h>
|
||||
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
|
||||
#include <url_launcher_linux/url_launcher_plugin.h>
|
||||
|
||||
void fl_register_plugins(FlPluginRegistry* registry) {
|
||||
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
|
||||
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) isar_flutter_libs_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "IsarFlutterLibsPlugin");
|
||||
isar_flutter_libs_plugin_register_with_registrar(isar_flutter_libs_registrar);
|
||||
g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin");
|
||||
url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar);
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
file_selector_linux
|
||||
isar_flutter_libs
|
||||
url_launcher_linux
|
||||
)
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import Foundation
|
||||
import connectivity_plus
|
||||
import file_selector_macos
|
||||
import geolocator_apple
|
||||
import isar_flutter_libs
|
||||
import path_provider_foundation
|
||||
import shared_preferences_foundation
|
||||
import sqflite
|
||||
@ -18,7 +17,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
||||
ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
|
||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||
IsarFlutterLibsPlugin.register(with: registry.registrar(forPlugin: "IsarFlutterLibsPlugin"))
|
||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
|
||||
|
||||
@ -259,7 +259,7 @@
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastSwiftUpdateCheck = 0920;
|
||||
LastUpgradeCheck = 1430;
|
||||
LastUpgradeCheck = 1510;
|
||||
ORGANIZATIONNAME = "";
|
||||
TargetAttributes = {
|
||||
331C80D4294CF70F00263BE5 = {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "1430"
|
||||
LastUpgradeVersion = "1510"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
|
||||
412
pubspec.lock
412
pubspec.lock
@ -1,6 +1,22 @@
|
||||
# Generated by pub
|
||||
# See https://dart.dev/tools/pub/glossary#lockfile
|
||||
packages:
|
||||
_fe_analyzer_shared:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: _fe_analyzer_shared
|
||||
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "67.0.0"
|
||||
analyzer:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: analyzer
|
||||
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.4.1"
|
||||
animated_stack_widget:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -41,6 +57,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.1"
|
||||
build:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: build
|
||||
sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.1"
|
||||
built_collection:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_collection
|
||||
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.1.1"
|
||||
built_value:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: built_value
|
||||
sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.9.1"
|
||||
camera:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -53,18 +93,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: camera_android
|
||||
sha256: "351429510121d179b9aac5a2e8cb525c3cd6c39f4d709c5f72dfb21726e52371"
|
||||
sha256: "1100e527b44a96906987a91ef78c8dacb539e34612a8058de89023380acf67f1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.10.8+16"
|
||||
version: "0.10.8+18"
|
||||
camera_avfoundation:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: camera_avfoundation
|
||||
sha256: "7d0763dfcbf060f56aa254a68c103210280bee9e97bbe4fdef23e257a4f70ab9"
|
||||
sha256: "8b113e43ee4434c9244c03c905432a0d5956cedaded3cd7381abaab89ce50297"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.14"
|
||||
version: "0.9.14+1"
|
||||
camera_camera:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -77,10 +117,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: camera_platform_interface
|
||||
sha256: e971ebca970f7cfee396f76ef02070b5e441b4aa04942da9c108d725f57bbd32
|
||||
sha256: a250314a48ea337b35909a4c9d5416a208d736dcb01d0b02c6af122be66660b0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.7.2"
|
||||
version: "2.7.4"
|
||||
camera_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -129,6 +169,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.1.1"
|
||||
code_builder:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: code_builder
|
||||
sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.10.0"
|
||||
collection:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -165,10 +213,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: cross_file
|
||||
sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e
|
||||
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.3+8"
|
||||
version: "0.3.4+1"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -185,14 +233,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.6"
|
||||
dart_earcut:
|
||||
dart_style:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dart_earcut
|
||||
sha256: "2fd8dcc885fbe092dbd4e4496d07840a6cf396f4201677416752be6901c994e4"
|
||||
name: dart_style
|
||||
sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.1"
|
||||
version: "2.3.6"
|
||||
dbus:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -201,6 +249,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.7.10"
|
||||
dio:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dio
|
||||
sha256: "0978e9a3e45305a80a7210dbeaf79d6ee8bee33f70c8e542dc654c952070217f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.4.2+1"
|
||||
dio_cache_interceptor:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: dio_cache_interceptor
|
||||
sha256: fb7905c0d12075d8786a6b63bffd64ae062d053f682cfaf28d145a2686507308
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.5.0"
|
||||
dio_cache_interceptor_hive_store:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: dio_cache_interceptor_hive_store
|
||||
sha256: "449b36541216cb20543228081125ad2995eb9712ec35bd030d85663ea1761895"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.2.2"
|
||||
fake_async:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -213,10 +285,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: ffi
|
||||
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
|
||||
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
version: "2.1.2"
|
||||
file:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -290,10 +362,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_image
|
||||
sha256: "0fd3090d50f3bb5619905102f4e61995cce14cae8af8d116d55ae03ea744a1e4"
|
||||
sha256: a113b84279cbcb2579b5a269eeffc3ad03181cf5f94ea1665c4181b814d196b5
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.10"
|
||||
version: "4.1.11"
|
||||
flutter_keyboard_visibility:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -354,10 +426,10 @@ packages:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: flutter_lints
|
||||
sha256: e2a421b7e59244faef694ba7b30562e489c2b489866e505074eb005cd7060db7
|
||||
sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
flutter_map:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -366,22 +438,30 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
flutter_map_cache:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_map_cache
|
||||
sha256: "5539033bbfbc0a663f3a038f223a36b472974d6613ce8f84fe7762eeff38aa5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
flutter_map_location_marker:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_map_location_marker
|
||||
sha256: a13473c1c2924c023d97fbe93780833cf1656712a6dd72ceb514da569d9feb84
|
||||
sha256: "5873a47606b092bf181b6d17dd42a124e9a8d5d9caad58b5f98fc182e799994f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "8.0.4"
|
||||
version: "8.0.8"
|
||||
flutter_map_marker_cluster:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_map_marker_cluster
|
||||
sha256: "27360384a0ef5e1a72c3815baa0c3ca5f4e614b969dc0b58f7823346520eeeaf"
|
||||
sha256: "16fa4e8ca1b38b18229174b118f212436b7379c02fa33b71826a8d2c98f5f76c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.3.4"
|
||||
version: "1.3.5"
|
||||
flutter_map_marker_popup:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -390,14 +470,6 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.2"
|
||||
flutter_map_tile_caching:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_map_tile_caching
|
||||
sha256: ec3be7209accb7962cc1ca1b06708e1bad1511a48416f3bed3ffd680af5df856
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.0.0-dev.5"
|
||||
flutter_plugin_android_lifecycle:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -418,10 +490,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_riverpod
|
||||
sha256: da9591d1f8d5881628ccd5c25c40e74fc3eef50ba45e40c3905a06e1712412d5
|
||||
sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.9"
|
||||
version: "2.5.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
@ -431,10 +503,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_typeahead
|
||||
sha256: ef2dd5a505d2d95a5b4c571c81ad2d6e7955f583dddec49064fec57acffd7a96
|
||||
sha256: d64712c65db240b1057559b952398ebb6e498077baeebf9b0731dade62438a6d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.0.2"
|
||||
version: "5.2.0"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@ -444,66 +516,66 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: font_awesome_flutter
|
||||
sha256: "52671aea66da73b58d42ec6d0912b727a42248dd9a7c76d6c20f275783c48c08"
|
||||
sha256: "275ff26905134bcb59417cf60ad979136f1f8257f2f449914b2c3e05bbb4cd6f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.6.0"
|
||||
version: "10.7.0"
|
||||
geojson_vi:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: geojson_vi
|
||||
sha256: "4f2786db7159c7cbd116b10c29ff396be1e6dd890f27b08d2a4e61162d999d85"
|
||||
sha256: ffba1991df4d3f98cfd7fee02bcde00b76a39d4daa838ba8a0ba8b83cbff0705
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.1"
|
||||
version: "2.2.3"
|
||||
geolocator:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: geolocator
|
||||
sha256: e946395fc608842bb2f6c914807e9183f86f3cb787f6b8f832753e5251036f02
|
||||
sha256: "694ec58afe97787b5b72b8a0ab78c1a9244811c3c10e72c4362ef3c0ceb005cd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.1.0"
|
||||
version: "11.0.0"
|
||||
geolocator_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_android
|
||||
sha256: "30ff8fa384ab6d35965aecc15dfc980e5ebc5f823352c1adfc87dc3d000e8e24"
|
||||
sha256: f15d1536cd01b1399578f1da1eb5d566e7a718db6a3648f2c24d2e2f859f0692
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.5.0"
|
||||
version: "4.5.4"
|
||||
geolocator_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_apple
|
||||
sha256: "79babf44b692ec5e789d322dc736ef71586056e8e6828f747c9e005456b248bf"
|
||||
sha256: bc2aca02423ad429cb0556121f56e60360a2b7d694c8570301d06ea0c00732fd
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.5"
|
||||
version: "2.3.7"
|
||||
geolocator_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_platform_interface
|
||||
sha256: "6c8d494d6948757c56720b778af742f6973f31fca1f702a7539b8917e4a2468a"
|
||||
sha256: "009a21c4bc2761e58dccf07c24f219adaebe0ff707abdfd40b0a763d4003fab9"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.2.0"
|
||||
version: "4.2.2"
|
||||
geolocator_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_web
|
||||
sha256: "59083f7e0871b78299918d92bf930a14377f711d2d1156c558cd5ebae6c20d58"
|
||||
sha256: "49d8f846ebeb5e2b6641fe477a7e97e5dd73f03cbfef3fd5c42177b7300fb0ed"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "3.0.0"
|
||||
geolocator_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: geolocator_windows
|
||||
sha256: a92fae29779d5c6dc60e8411302f5221ade464968fe80a36d330e80a71f087af
|
||||
sha256: "53da08937d07c24b0d9952eb57a3b474e29aae2abf9dd717f7e1230995f13f0e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.2.2"
|
||||
version: "0.2.3"
|
||||
get:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -512,6 +584,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.6.6"
|
||||
glob:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: glob
|
||||
sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.2"
|
||||
google_api_availability:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -540,18 +620,26 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_fonts
|
||||
sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8
|
||||
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.0"
|
||||
version: "6.2.1"
|
||||
hive:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: hive
|
||||
sha256: "8dcf6db979d7933da8217edcec84e9df1bdb4e4edc7fc77dbd5aa74356d6d941"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.3"
|
||||
http:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: http
|
||||
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba
|
||||
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
version: "1.2.1"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -564,10 +652,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image
|
||||
sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d"
|
||||
sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.4"
|
||||
version: "4.1.7"
|
||||
image_gallery_saver:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -588,26 +676,26 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_android
|
||||
sha256: "39f2bfe497e495450c81abcd44b62f56c2a36a37a175da7d137b4454977b51b1"
|
||||
sha256: "42c098e7fb6334746be37cdc30369ade356ed4f14d48b7a0313f95a9159f4321"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.9+3"
|
||||
version: "0.8.9+5"
|
||||
image_picker_for_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_for_web
|
||||
sha256: e2423c53a68b579a7c37a1eda967b8ae536c3d98518e5db95ca1fe5719a730a3
|
||||
sha256: "6a1704fdd75022272e7e7a897a9068e9c2ff3cd6a66820bf3ded810633eac954"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
version: "3.0.3"
|
||||
image_picker_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_ios
|
||||
sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3
|
||||
sha256: "917a5cadd67d052554cfb258595e54217de53fac5b52939426e26319a02e6297"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.8.9+1"
|
||||
version: "0.8.9+2"
|
||||
image_picker_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -628,10 +716,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: image_picker_platform_interface
|
||||
sha256: fa4e815e6fcada50e35718727d83ba1c92f1edf95c0b4436554cec301b56233b
|
||||
sha256: "3d2c323daea9d60608f1caf30be32a938916f4975434b8352e6f73dae496da38"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.3"
|
||||
version: "2.9.4"
|
||||
image_picker_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -644,26 +732,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: intl
|
||||
sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d"
|
||||
sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.18.1"
|
||||
isar:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: isar
|
||||
sha256: "99165dadb2cf2329d3140198363a7e7bff9bbd441871898a87e26914d25cf1ea"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0+1"
|
||||
isar_flutter_libs:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: isar_flutter_libs
|
||||
sha256: bc6768cc4b9c61aabff77152e7f33b4b17d2fc93134f7af1c3dd51500fe8d5e8
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0+1"
|
||||
version: "0.19.0"
|
||||
js:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -692,10 +764,34 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: latlong2
|
||||
sha256: "18712164760cee655bc790122b0fd8f3d5b3c36da2cb7bf94b68a197fbb0811b"
|
||||
sha256: "98227922caf49e6056f91b6c56945ea1c7b166f28ffcd5fb8e72fc0b453cc8fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.9.0"
|
||||
version: "0.9.1"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.0"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -716,26 +812,34 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logger
|
||||
sha256: "6bbb9d6f7056729537a4309bda2e74e18e5d9f14302489cc1e93f33b3fe32cac"
|
||||
sha256: "8c94b8c219e7e50194efc8771cd0e9f10807d8d3e219af473d89b06cc2ee4e04"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.2+1"
|
||||
version: "2.2.0"
|
||||
logging:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: logging
|
||||
sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.0"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.8.0"
|
||||
material_design_icons_flutter:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -748,10 +852,10 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: meta
|
||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.11.0"
|
||||
mgrs_dart:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -768,14 +872,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.5"
|
||||
mockito:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
name: mockito
|
||||
sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.4.4"
|
||||
modal_bottom_sheet:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: modal_bottom_sheet
|
||||
sha256: "3bba63c62d35c931bce7f8ae23a47f9a05836d8cb3c11122ada64e0b2f3d718f"
|
||||
sha256: eac66ef8cb0461bf069a38c5eb0fa728cee525a531a8304bd3f7b2185407c67e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.0-pre"
|
||||
version: "3.0.0"
|
||||
nested:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -792,14 +904,22 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
package_config:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: package_config
|
||||
sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.0"
|
||||
path_provider:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -860,26 +980,26 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: permission_handler
|
||||
sha256: "45ff3fbcb99040fde55c528d5e3e6ca29171298a85436274d49c6201002087d6"
|
||||
sha256: "18bf33f7fefbd812f37e72091a15575e72d5318854877e0e4035a24ac1113ecb"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "11.2.0"
|
||||
version: "11.3.1"
|
||||
permission_handler_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_android
|
||||
sha256: "758284a0976772f9c744d6384fc5dc4834aa61e3f7aa40492927f244767374eb"
|
||||
sha256: "1acac6bae58144b442f11e66621c062aead9c99841093c38f5bcdcc24c1c3474"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "12.0.3"
|
||||
version: "12.0.5"
|
||||
permission_handler_apple:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_apple
|
||||
sha256: c6bf440f80acd2a873d3d91a699e4cc770f86e7e6b576dda98759e8b92b39830
|
||||
sha256: e9ad66020b89ff1b63908f247c2c6f931c6e62699b756ef8b3c4569350cd8662
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "9.3.0"
|
||||
version: "9.4.4"
|
||||
permission_handler_html:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -892,10 +1012,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: permission_handler_platform_interface
|
||||
sha256: "5c43148f2bfb6d14c5a8162c0a712afe891f2d847f35fcff29c406b37da43c3c"
|
||||
sha256: "48d4fcf201a1dad93ee869ab0d4101d084f49136ec82a8a06ed9cfeacab9fd20"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.1.0"
|
||||
version: "4.2.1"
|
||||
permission_handler_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -956,10 +1076,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: pointer_interceptor_web
|
||||
sha256: "9386e064097fd16419e935c23f08f35b58e6aaec155dd39bd6a003b88f9c14b4"
|
||||
sha256: a6237528b46c411d8d55cdfad8fcb3269fc4cbb26060b14bff94879165887d1e
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.10.1+2"
|
||||
version: "0.10.2"
|
||||
pointycastle:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -996,34 +1116,34 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: provider
|
||||
sha256: "9a96a0a19b594dbc5bf0f1f27d2bc67d5f95957359b461cd9feb44ed6ae75096"
|
||||
sha256: c8a055ee5ce3fd98d6fc872478b03823ffdb448699c6ebdbbc71d59b596fd48c
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.1.1"
|
||||
queue:
|
||||
version: "6.1.2"
|
||||
pub_semver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: queue
|
||||
sha256: "9a41ecadc15db79010108c06eae229a45c56b18db699760f34e8c9ac9b831ff9"
|
||||
name: pub_semver
|
||||
sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.1.0+2"
|
||||
version: "2.1.4"
|
||||
rename:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: rename
|
||||
sha256: "4d08eafe78e0787167c2fcdd5e32bbb0a6b2d8a7d23b38280f590df2a051415c"
|
||||
sha256: "6ef5daf4b11130e71d93630cfb70725e5a35b19039739cfcd2b272c834ba25fe"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
version: "3.0.2"
|
||||
riverpod:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: riverpod
|
||||
sha256: "942999ee48b899f8a46a860f1e13cee36f2f77609eb54c5b7a669bb20d550b11"
|
||||
sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.4.9"
|
||||
version: "2.5.1"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -1068,10 +1188,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: shared_preferences_web
|
||||
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
|
||||
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.2"
|
||||
version: "2.3.0"
|
||||
shared_preferences_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1085,6 +1205,14 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.99"
|
||||
source_gen:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: source_gen
|
||||
sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
source_span:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1105,18 +1233,18 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: sqflite
|
||||
sha256: c2c32eb0c74021d987336522acc3b6bf0082fbd0c540c36a9cf4ddb8ba891ddc
|
||||
sha256: a9016f495c927cb90557c909ff26a6d92d9bd54fc42ba92e19d4e79d61e798c6
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
version: "2.3.2"
|
||||
sqflite_common:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: sqflite_common
|
||||
sha256: "28d8c66baee4968519fb8bd6cdbedad982d6e53359091f0b74544a9f32ec72d5"
|
||||
sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.5.3"
|
||||
version: "2.5.4"
|
||||
stack_trace:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1225,26 +1353,26 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: url_launcher
|
||||
sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c
|
||||
sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.4"
|
||||
version: "6.2.5"
|
||||
url_launcher_android:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_android
|
||||
sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f"
|
||||
sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.2"
|
||||
version: "6.3.0"
|
||||
url_launcher_ios:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_ios
|
||||
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
|
||||
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "6.2.4"
|
||||
version: "6.2.5"
|
||||
url_launcher_linux:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1265,18 +1393,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_platform_interface
|
||||
sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f
|
||||
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.3.1"
|
||||
version: "2.3.2"
|
||||
url_launcher_web:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: url_launcher_web
|
||||
sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b
|
||||
sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.2.3"
|
||||
version: "2.3.0"
|
||||
url_launcher_windows:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1301,6 +1429,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: vm_service
|
||||
sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "13.0.0"
|
||||
watcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1313,18 +1449,18 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
version: "0.5.1"
|
||||
win32:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: win32
|
||||
sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8"
|
||||
sha256: "8cb58b45c47dcb42ab3651533626161d6b67a2921917d8d429791f76972b3480"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "5.2.0"
|
||||
version: "5.3.0"
|
||||
wkt_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -1358,5 +1494,5 @@ packages:
|
||||
source: hosted
|
||||
version: "3.1.2"
|
||||
sdks:
|
||||
dart: ">=3.2.3 <4.0.0"
|
||||
flutter: ">=3.16.6"
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
flutter: ">=3.19.2"
|
||||
|
||||
22
pubspec.yaml
22
pubspec.yaml
@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 1.0.32+32
|
||||
version: 1.0.33+33
|
||||
|
||||
environment:
|
||||
sdk: ">=3.1.0 <4.0.0"
|
||||
@ -36,7 +36,7 @@ dependencies:
|
||||
sqflite: ^2.0.1
|
||||
get: ^4.6.6
|
||||
flutter_map: ^6.0.1
|
||||
geolocator: ^10.1.0
|
||||
geolocator: ^11.0.0
|
||||
permission_handler: ^11.1.0
|
||||
google_api_availability: ^5.0.0
|
||||
tuple: ^2.0.0
|
||||
@ -49,36 +49,33 @@ dependencies:
|
||||
proj4dart: ^2.0.0
|
||||
meta: ^1.7.0
|
||||
collection: ^1.15.0
|
||||
path_provider: ^2.0.8
|
||||
flutter_map_location_marker: any
|
||||
path_provider: ^2.1.2
|
||||
flutter_map_location_marker: ^8.0.8
|
||||
flutter_map_marker_cluster: any
|
||||
material_design_icons_flutter: ^7.0.7296
|
||||
google_fonts: ^6.1.0
|
||||
keyboard_dismisser: ^3.0.0
|
||||
image_picker: ^1.0.4
|
||||
geojson_vi: ^2.2.1
|
||||
#geojson: ^1.0.0
|
||||
url_launcher: ^6.0.20
|
||||
flutter_breadcrumb: ^1.0.1
|
||||
timeline_tile: ^2.0.0
|
||||
# google_maps_flutter: ^2.5.0
|
||||
#flutter_map_marker_popup: any
|
||||
flutter_polyline_points: ^2.0.0
|
||||
#google_maps_webservice: ^0.0.20-nullsafety.5
|
||||
flutter_typeahead: ^5.0.1
|
||||
flutter_launcher_icons: ^0.13.1
|
||||
rename: ^3.0.1
|
||||
circular_menu: ^2.0.1
|
||||
camera_camera: ^3.0.0
|
||||
intl: ^0.18.1
|
||||
intl: ^0.19.0
|
||||
modal_bottom_sheet: ^3.0.0-pre
|
||||
connectivity_plus: ^5.0.2
|
||||
flutter_map_tile_caching: ^9.0.0-dev.5
|
||||
shared_preferences: ^2.0.15
|
||||
# gallery_saver: ^2.3.2
|
||||
image_gallery_saver: ^2.0.3
|
||||
flutter_riverpod: ^2.4.0
|
||||
http: ^1.1.0
|
||||
dio: ^5.4.1
|
||||
dio_cache_interceptor_hive_store: ^3.2.1
|
||||
flutter_map_cache: ^1.3.0
|
||||
connectivity_plus: ^5.0.2
|
||||
|
||||
flutter_icons:
|
||||
android: true
|
||||
@ -95,6 +92,7 @@ dev_dependencies:
|
||||
# package. See that file for information about deactivating specific lint
|
||||
# rules and activating additional ones.
|
||||
flutter_lints: ^3.0.1
|
||||
mockito: ^5.4.4
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
# following page: https://dart.dev/tools/pub/pubspec
|
||||
|
||||
1
test/features/services/auth_service_test.dart
Normal file
1
test/features/services/auth_service_test.dart
Normal file
@ -0,0 +1 @@
|
||||
|
||||
@ -1,30 +1 @@
|
||||
// This is a basic Flutter widget test.
|
||||
//
|
||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||
// utility that Flutter provides. For example, you can send tap and scroll
|
||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:rogapp/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(const MyApp());
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
expect(find.text('1'), findsNothing);
|
||||
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.byIcon(Icons.add));
|
||||
await tester.pump();
|
||||
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('0'), findsNothing);
|
||||
expect(find.text('1'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@
|
||||
#include <connectivity_plus/connectivity_plus_windows_plugin.h>
|
||||
#include <file_selector_windows/file_selector_windows.h>
|
||||
#include <geolocator_windows/geolocator_windows.h>
|
||||
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
|
||||
#include <permission_handler_windows/permission_handler_windows_plugin.h>
|
||||
#include <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
@ -20,8 +19,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
registry->GetRegistrarForPlugin("FileSelectorWindows"));
|
||||
GeolocatorWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||
IsarFlutterLibsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("IsarFlutterLibsPlugin"));
|
||||
PermissionHandlerWindowsPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin"));
|
||||
UrlLauncherWindowsRegisterWithRegistrar(
|
||||
|
||||
@ -6,7 +6,6 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
||||
connectivity_plus
|
||||
file_selector_windows
|
||||
geolocator_windows
|
||||
isar_flutter_libs
|
||||
permission_handler_windows
|
||||
url_launcher_windows
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user