diff --git a/android/gradle.properties b/android/gradle.properties index 2bd6f4f..1441b1d 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,2 +1,3 @@ org.gradle.jvmargs=-Xmx1536M +android.enableR8=true diff --git a/assets/images/server.png b/assets/images/server.png new file mode 100644 index 0000000..cce6ad1 Binary files /dev/null and b/assets/images/server.png differ diff --git a/lib/bloc/position_bloc.dart b/lib/bloc/position_bloc.dart new file mode 100644 index 0000000..a83d1ae --- /dev/null +++ b/lib/bloc/position_bloc.dart @@ -0,0 +1,32 @@ +import 'package:geo_app/model/response.dart'; +import 'package:geo_app/model/setting.dart'; +import 'package:geo_app/repository/position_repository.dart'; +import 'package:rxdart/rxdart.dart'; + +class PositionBloc { + PositionRepository _repository; + final PublishSubject _subject = + PublishSubject(); + + SettingModel _settingModel; + + PositionBloc(this._settingModel) { + this._repository = PositionRepository(this._settingModel); + } + + dispose() { + _subject.close(); + } + + sendPosition(String lat, String lng) async { + ResponseModel response = await _repository.sendPosition(lat, lng); + _subject.sink.add(response); + } + + stopTracking(String lat, String lng) async { + ResponseModel response = await _repository.stopTracking(); + _subject.sink.add(response); + } + + PublishSubject get subject => _subject; +} diff --git a/lib/bloc/setting.dart b/lib/bloc/setting.dart new file mode 100644 index 0000000..91b69fb --- /dev/null +++ b/lib/bloc/setting.dart @@ -0,0 +1,38 @@ +import 'package:rxdart/rxdart.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:geo_app/model/setting.dart'; + +class SettingBloc { + PublishSubject _subject; + + final String _host = "host"; + final String _id = "id"; + + SettingBloc() { + this._subject = PublishSubject(); + } + + Future getSharedPreferences() async { + return await SharedPreferences.getInstance(); + } + + setSetting(SettingModel setting) async { + SharedPreferences sharedPreferences = await this.getSharedPreferences(); + sharedPreferences.setString(_host, setting.host); + sharedPreferences.setString(_id, setting.id); + this.getSetting(); + } + + getSetting() async { + SharedPreferences sharedPreferences = await this.getSharedPreferences(); + _subject.sink.add(new SettingModel( + sharedPreferences.getString(_host), + )); + } + + dispose() { + _subject.close(); + } + + PublishSubject get subject => _subject; +} diff --git a/lib/bloc/unique_id_bloc.dart b/lib/bloc/unique_id_bloc.dart new file mode 100644 index 0000000..86fa91a --- /dev/null +++ b/lib/bloc/unique_id_bloc.dart @@ -0,0 +1,27 @@ +import 'package:geo_app/model/setting.dart'; +import 'package:geo_app/model/unique_id_model.dart'; +import 'package:geo_app/repository/unique_id_repository.dart'; +import 'package:rxdart/rxdart.dart'; + +class UniqueIDBloc { + UniqueIDRepository _repository; + final PublishSubject _subject = + PublishSubject(); + + SettingModel _settingModel; + + UniqueIDBloc(this._settingModel) { + this._repository = UniqueIDRepository(this._settingModel); + } + + dispose() { + _subject.close(); + } + + getUniqueID() async { + UniqueIDModel response = await _repository.getUniqueID(); + _subject.sink.add(response); + } + + PublishSubject get subject => _subject; +} diff --git a/lib/component/loader.dart b/lib/component/loader.dart new file mode 100644 index 0000000..c50da34 --- /dev/null +++ b/lib/component/loader.dart @@ -0,0 +1,171 @@ +import 'package:flutter/material.dart'; +import 'dart:math'; + +enum DotType { square, circle, diamond, icon } + +class Loader extends StatefulWidget { + final Color dotOneColor; + final Color dotTwoColor; + final Color dotThreeColor; + final Duration duration; + final DotType dotType; + final Icon dotIcon; + + Loader( + {this.dotOneColor = Colors.redAccent, + this.dotTwoColor = Colors.green, + this.dotThreeColor = Colors.blueAccent, + this.duration = const Duration(milliseconds: 1000), + this.dotType = DotType.circle, + this.dotIcon = const Icon(Icons.blur_on)}); + + @override + _LoaderState createState() => _LoaderState(); +} + +class _LoaderState extends State with SingleTickerProviderStateMixin { + Animation animation_1; + Animation animation_2; + Animation animation_3; + AnimationController controller; + + @override + void initState() { + super.initState(); + + controller = AnimationController(duration: widget.duration, vsync: this); + + animation_1 = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation( + parent: controller, + curve: Interval(0.0, 0.80, curve: Curves.ease), + ), + ); + + animation_2 = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation( + parent: controller, + curve: Interval(0.1, 0.9, curve: Curves.ease), + ), + ); + + animation_3 = Tween(begin: 0.0, end: 1.0).animate( + CurvedAnimation( + parent: controller, + curve: Interval(0.2, 1.0, curve: Curves.ease), + ), + ); + + controller.addListener(() { + setState(() { + //print(animation_1.value); + }); + }); + + controller.repeat(); + } + + @override + Widget build(BuildContext context) { + return Container( + child: new Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + new Transform.translate( + offset: Offset( + 0.0, + -30 * + (animation_1.value <= 0.50 + ? animation_1.value + : 1.0 - animation_1.value), + ), + child: new Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Dot( + radius: 10.0, + color: widget.dotOneColor, + type: widget.dotType, + icon: widget.dotIcon, + ), + ), + ), + Transform.translate( + offset: Offset( + 0.0, + -30 * + (animation_2.value <= 0.50 + ? animation_2.value + : 1.0 - animation_2.value), + ), + child: new Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Dot( + radius: 10.0, + color: widget.dotTwoColor, + type: widget.dotType, + icon: widget.dotIcon, + ), + ), + ), + Transform.translate( + offset: Offset( + 0.0, + -30 * + (animation_3.value <= 0.50 + ? animation_3.value + : 1.0 - animation_3.value), + ), + child: new Padding( + padding: const EdgeInsets.only(right: 8.0), + child: Dot( + radius: 10.0, + color: widget.dotThreeColor, + type: widget.dotType, + icon: widget.dotIcon, + ), + ), + ), + ], + ), + ); + } + + @override + void dispose() { + controller.dispose(); + super.dispose(); + } +} + +class Dot extends StatelessWidget { + final double radius; + final Color color; + final DotType type; + final Icon icon; + + Dot({this.radius, this.color, this.type, this.icon}); + + @override + Widget build(BuildContext context) { + return new Center( + child: type == DotType.icon + ? Icon( + icon.icon, + color: color, + size: 1.3 * radius, + ) + : new Transform.rotate( + angle: type == DotType.diamond ? pi / 4 : 0.0, + child: Container( + width: radius, + height: radius, + decoration: BoxDecoration( + color: color, + shape: type == DotType.circle + ? BoxShape.circle + : BoxShape.rectangle), + ), + ), + ); + } +} diff --git a/lib/main.dart b/lib/main.dart index 708745c..ba7053b 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,149 +1,17 @@ -import 'dart:async'; - -import 'package:background_location/background_location.dart'; import 'package:flutter/material.dart'; -import 'package:geo_app/model/position.dart'; -import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:geo_app/page/startup.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { - // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Geo Smart App', theme: ThemeData( - // This is the theme of your application. - // - // Try running your application with "flutter run". You'll see the - // application has a blue toolbar. Then, without quitting the app, try - // changing the primarySwatch below to Colors.green and then invoke - // "hot reload" (press "r" in the console where you ran "flutter run", - // or simply save your changes to "hot reload" in a Flutter IDE). - // Notice that the counter didn't reset back to zero; the application - // is not restarted. primarySwatch: Colors.blue, ), - home: MyHomePage(title: 'Geo Smart App'), + home: Startup(), ); } } - -class MyHomePage extends StatefulWidget { - MyHomePage({Key key, this.title}) : super(key: key); - - // This widget is the home page of your application. It is stateful, meaning - // that it has a State object (defined below) that contains fields that affect - // how it looks. - - // This class is the configuration for the state. It holds the values (in this - // case the title) provided by the parent (in this case the App widget) and - // used by the build method of the State. Fields in a Widget subclass are - // always marked "final". - - final String title; - - @override - _MyHomePageState createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - Completer _controller = Completer(); - double latitude = 0.0; - double longitude = 0.0; - double altitude = 0.0; - double accuracy = 0.0; - double bearing = 0.0; - double speed = 0.0; - String message = "Connecting to Server"; - bool _finish = false; - Position _position; - - @override - void initState() { - super.initState(); - BackgroundLocation.startLocationService(); - message = "Connecting to Server"; - Position.getPosition().then((position) { - setState(() { - _position = position; - _finish = this._position.isValid(); - }); - }, onError: (error) { - message = "Something wrong"; - }); - } - - static final CameraPosition _kGooglePlex = CameraPosition( - target: LatLng(-6.914744, 107.609810), - zoom: 14.4746, - ); - - @override - Widget build(BuildContext context) { - return new Scaffold( - body: Stack( - children: [ - GoogleMap( - mapType: MapType.normal, - initialCameraPosition: _kGooglePlex, - myLocationEnabled: true, - myLocationButtonEnabled: true, - onMapCreated: (GoogleMapController controller) { - _controller.complete(controller); - BackgroundLocation.getLocationUpdates((location) async { - setState(() { - this.latitude = location.latitude; - this.longitude = location.longitude; - this.accuracy = location.accuracy; - this.altitude = location.altitude; - this.bearing = location.bearing; - this.speed = location.speed; - - if (this._position != null) { - if (this._position.isValid()) { - this._position.lat = this.latitude.toString(); - this._position.lng = this.longitude.toString(); - this._position.sendPosition(); - } - } - }); - // Make Camera Follow the Marker - // final GoogleMapController controller = await _controller.future; - // controller.animateCamera( - // CameraUpdate.newCameraPosition( - // new CameraPosition( - // target: LatLng(this.latitude, this.longitude), - // zoom: 19.151926040649414, - // ), - // ), - // ); - }); - }, - ), - Visibility( - visible: !_finish, - child: Container( - decoration: BoxDecoration( - color: Colors.black26.withOpacity(0.8), - ), - child: Center( - child: Text( - message, - style: TextStyle(color: Colors.white), - ), - ), - ), - ) - ], - ), - ); - } - - @override - void dispose() { - BackgroundLocation.stopLocationService(); - super.dispose(); - } -} diff --git a/lib/model/position.dart b/lib/model/position.dart index 38cb212..39afe44 100644 --- a/lib/model/position.dart +++ b/lib/model/position.dart @@ -2,7 +2,7 @@ import 'dart:convert'; import 'package:geo_app/config.dart'; import 'package:geo_app/model/response.dart'; -import 'package:geo_app/model/unique_id.dart'; +import 'package:geo_app/model/unique_id_model.dart'; import 'package:http/http.dart' as http; import 'package:shared_preferences/shared_preferences.dart'; @@ -41,9 +41,9 @@ class Position { lng: "0.0", ); if (spId == null) { - final response = await http.get(Config.api + "/unique/id"); + final response = await http.get(Config.api + "/id/get/unique"); if (response.statusCode == 200) { - position.id = UniqueId.fromJson(json.decode(response.body)).id; + position.id = UniqueIDModel.fromJson(json.decode(response.body)).id; } else { throw Exception("Something Error"); } @@ -56,14 +56,28 @@ class Position { return id != null; } - Future sendPosition() async { - Response result; + Future sendPosition() async { + ResponseModel result; final response = await http.post( - Config.api + "/set/point", + Config.api + "/point/set", body: json.encode(this.toJson()), ); if (response.statusCode == 200) { - result = Response.fromJson(json.decode(response.body)); + result = ResponseModel.fromJson(json.decode(response.body)); + } else { + throw Exception("Something Error"); + } + return result; + } + + Future stopPosition() async { + ResponseModel result; + final response = await http.post( + Config.api + "/point/unset", + body: json.encode(this.toJson()), + ); + if (response.statusCode == 200) { + result = ResponseModel.fromJson(json.decode(response.body)); } else { throw Exception("Something Error"); } diff --git a/lib/model/response.dart b/lib/model/response.dart index 73fccfc..8e85890 100644 --- a/lib/model/response.dart +++ b/lib/model/response.dart @@ -1,9 +1,9 @@ -class Response { +class ResponseModel { String status; - Response({this.status}); + ResponseModel({this.status}); - Response.fromJson(Map json) { + ResponseModel.fromJson(Map json) { status = json['status']; } diff --git a/lib/model/setting.dart b/lib/model/setting.dart new file mode 100644 index 0000000..3875178 --- /dev/null +++ b/lib/model/setting.dart @@ -0,0 +1,6 @@ +class SettingModel { + String host = ""; + String id = ""; + + SettingModel(this.host); +} diff --git a/lib/model/unique_id.dart b/lib/model/unique_id_model.dart similarity index 52% rename from lib/model/unique_id.dart rename to lib/model/unique_id_model.dart index 0837b58..c9cf8e8 100644 --- a/lib/model/unique_id.dart +++ b/lib/model/unique_id_model.dart @@ -1,12 +1,17 @@ -class UniqueId { +class UniqueIDModel { String id; + bool error = false; - UniqueId({this.id}); + UniqueIDModel({this.id}); - UniqueId.fromJson(Map json) { + UniqueIDModel.fromJson(Map json) { id = json['id']; } + UniqueIDModel.error() { + error = true; + } + Map toJson() { final Map data = new Map(); data['id'] = this.id; diff --git a/lib/page/map.dart b/lib/page/map.dart new file mode 100644 index 0000000..6104806 --- /dev/null +++ b/lib/page/map.dart @@ -0,0 +1,126 @@ +import 'dart:async'; + +import 'package:background_location/background_location.dart'; +import 'package:flutter/material.dart'; +import 'package:geo_app/bloc/position_bloc.dart'; +import 'package:geo_app/bloc/setting.dart'; +import 'package:geo_app/model/position.dart'; +import 'package:google_maps_flutter/google_maps_flutter.dart'; +import 'package:flutter_background_geolocation/flutter_background_geolocation.dart' + as bg; + +class Map extends StatefulWidget { + Map({Key key, this.title}) : super(key: key); + + final String title; + + @override + _MapState createState() => _MapState(); +} + +class _MapState extends State { + Completer _controller = Completer(); + double latitude = 0.0; + double longitude = 0.0; + double altitude = 0.0; + double accuracy = 0.0; + double bearing = 0.0; + double speed = 0.0; + Position _position; + PositionBloc _positionBloc; + SettingBloc _settingBloc; + + String id; + String host; + + @override + void initState() { + BackgroundLocation.startLocationService(); + super.initState(); + _settingBloc = new SettingBloc(); + + _settingBloc.getSetting(); + + _settingBloc.subject.listen((settingModel) { + this.id = settingModel.id; + this.host = settingModel.host; + + if (this.host != null && this.host != "") { + setState(() { + _positionBloc = new PositionBloc(settingModel); + }); + } + }); + bg.BackgroundGeolocation.onLocation((bg.Location location) { + print('[location] - $location'); + }); + bg.BackgroundGeolocation.ready( + bg.Config( + desiredAccuracy: bg.Config.DESIRED_ACCURACY_HIGH, + distanceFilter: 10.0, + stopOnTerminate: false, + startOnBoot: true, + debug: true, + logLevel: bg.Config.LOG_LEVEL_VERBOSE), + ).then((bg.State state) { + if (!state.enabled) { + bg.BackgroundGeolocation.start(); + } + }); + BackgroundLocation.getLocationUpdates((location) async { + print("Location Update"); + setState(() { + this.latitude = location.latitude; + this.longitude = location.longitude; + this.accuracy = location.accuracy; + this.altitude = location.altitude; + this.bearing = location.bearing; + this.speed = location.speed; + + if (this._position != null) { + if (this._position.isValid()) { + print("VALID"); + if (_positionBloc != null) { + print("SEND"); + _positionBloc.sendPosition( + this._position.lat.toString(), + this._position.lng.toString(), + ); + } + } + } + }); + }); + } + + static final CameraPosition _kGooglePlex = CameraPosition( + target: LatLng(-6.914744, 107.609810), + zoom: 14.4746, + ); + + @override + Widget build(BuildContext context) { + return new Scaffold( + body: Stack( + children: [ + GoogleMap( + mapType: MapType.normal, + initialCameraPosition: _kGooglePlex, + myLocationEnabled: true, + myLocationButtonEnabled: true, + onMapCreated: (GoogleMapController controller) { + _controller.complete(controller); + print("Map Created"); + }, + ), + ], + ), + ); + } + + @override + void dispose() { + BackgroundLocation.stopLocationService(); + super.dispose(); + } +} diff --git a/lib/page/setting.dart b/lib/page/setting.dart new file mode 100644 index 0000000..d2ebf58 --- /dev/null +++ b/lib/page/setting.dart @@ -0,0 +1,95 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:geo_app/bloc/setting.dart'; +import 'package:geo_app/bloc/unique_id_bloc.dart'; +import 'package:geo_app/model/setting.dart'; +import 'package:geo_app/page/map.dart'; + +class Setting extends StatefulWidget { + @override + State createState() { + return new _SettingState(); + } +} + +class _SettingState extends State { + final _hostController = TextEditingController(); + SettingBloc _settingBloc; + UniqueIDBloc _uniqueIDBloc; + String id; + String host; + + @override + void initState() { + _settingBloc = new SettingBloc(); + + _settingBloc.getSetting(); + + _settingBloc.subject.listen((settingModel) { + this.id = settingModel.id; + this.host = settingModel.host; + + _hostController.text = this.host; + + if (this.host != null && this.host != "") { + _uniqueIDBloc = new UniqueIDBloc(settingModel); + _uniqueIDBloc.getUniqueID(); + } + + if (_uniqueIDBloc != null) { + this._uniqueIDBloc.subject.listen((uniqueId) { + if (uniqueId.id != null && uniqueId.id != "") { + Navigator.of(context).pushReplacement(new MaterialPageRoute( + builder: (BuildContext context) => Map(), + )); + } + }); + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Container( + child: Center( + child: Container( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage("assets/images/server.png"), + ), + ), + height: 200, + ), + SizedBox( + height: 30, + ), + TextField( + controller: this._hostController, + decoration: InputDecoration( + labelText: "Host", + border: OutlineInputBorder(), + ), + ), + FlatButton( + onPressed: () { + this._settingBloc.setSetting( + new SettingModel(this._hostController.text), + ); + }, + child: Text("Save"), + ) + ], + ), + width: 200, + height: 400, + ), + ), + ), + ); + } +} diff --git a/lib/page/startup.dart b/lib/page/startup.dart new file mode 100644 index 0000000..ec2ddb2 --- /dev/null +++ b/lib/page/startup.dart @@ -0,0 +1,65 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:geo_app/bloc/setting.dart'; +import 'package:geo_app/component/loader.dart'; +import 'package:geo_app/page/setting.dart'; +import 'package:geo_app/page/map.dart'; + +class Startup extends StatefulWidget { + @override + State createState() { + return new _StartupState(); + } +} + +class _StartupState extends State { + SettingBloc _settingBloc; + + @override + void initState() { + _settingBloc = new SettingBloc(); + + _settingBloc.getSetting(); + + _settingBloc.subject.listen((settingModel) { + if ((settingModel.host == "" || settingModel.host == null) && + (settingModel.id == "" || settingModel.id == null)) { + Navigator.of(context).pushReplacement(new MaterialPageRoute( + builder: (BuildContext context) => Setting(), + )); + } else { + Navigator.of(context).pushReplacement(new MaterialPageRoute( + builder: (BuildContext context) => Map(), + )); + } + }); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Container( + child: Column( + children: [ + Loader(), + SizedBox( + height: 20.0, + ), + Text("Preparing System") + ], + ), + height: 50, + ), + ), + ); + } + + @override + void dispose() { + _settingBloc.dispose(); + super.dispose(); + } +} diff --git a/lib/provider/position_provider.dart b/lib/provider/position_provider.dart new file mode 100644 index 0000000..f9dd1a5 --- /dev/null +++ b/lib/provider/position_provider.dart @@ -0,0 +1,44 @@ +import 'package:dio/dio.dart'; +import 'package:geo_app/model/position.dart'; +import 'package:geo_app/model/response.dart'; +import 'package:geo_app/model/setting.dart'; + +class PositionProvider { + final Dio _dio = Dio(); + SettingModel _settingModel; + + PositionProvider(this._settingModel); + + Future sendPosition(String lat, String lng) async { + Position position = new Position( + id: this._settingModel.id, + type: "user", + lat: lat, + lng: lng, + ); + try { + Response response = await _dio.post( + this._settingModel.host + "/point/set", + data: position.toJson(), + ); + return ResponseModel.fromJson(response.data); + } on DioError catch (e) { + return ResponseModel.fromJson(e.response.data); + } + } + + Future stopTracking() async { + try { + Response response = await _dio.post( + this._settingModel.host + "/point/unset", + data: { + "id": this._settingModel.id, + "type": "user", + }, + ); + return ResponseModel.fromJson(response.data); + } on DioError catch (e) { + return ResponseModel.fromJson(e.response.data); + } + } +} diff --git a/lib/provider/unique_id_provider.dart b/lib/provider/unique_id_provider.dart new file mode 100644 index 0000000..3324899 --- /dev/null +++ b/lib/provider/unique_id_provider.dart @@ -0,0 +1,22 @@ +import 'package:dio/dio.dart'; +import 'package:geo_app/model/setting.dart'; +import 'package:geo_app/model/unique_id_model.dart'; + +class UniqueIDProvider { + final String _endpoint = "/id/get/unique"; + final Dio _dio = Dio(); + SettingModel _settingModel; + + UniqueIDProvider(this._settingModel); + + Future getUniqueID() async { + try { + Response response = await _dio.get( + this._settingModel.host + _endpoint, + ); + return UniqueIDModel.fromJson(response.data); + } on DioError catch (e) { + return UniqueIDModel.error(); + } + } +} diff --git a/lib/repository/position_repository.dart b/lib/repository/position_repository.dart new file mode 100644 index 0000000..6379a10 --- /dev/null +++ b/lib/repository/position_repository.dart @@ -0,0 +1,20 @@ +import 'package:geo_app/model/response.dart'; +import 'package:geo_app/model/setting.dart'; +import 'package:geo_app/provider/position_provider.dart'; + +class PositionRepository { + PositionProvider _provider; + SettingModel _settingModel; + + PositionRepository(this._settingModel) { + this._provider = PositionProvider(this._settingModel); + } + + Future sendPosition(String lat, String lng) { + return this._provider.sendPosition(lat, lng); + } + + Future stopTracking() { + return this._provider.stopTracking(); + } +} diff --git a/lib/repository/unique_id_repository.dart b/lib/repository/unique_id_repository.dart new file mode 100644 index 0000000..4c223fe --- /dev/null +++ b/lib/repository/unique_id_repository.dart @@ -0,0 +1,16 @@ +import 'package:geo_app/model/setting.dart'; +import 'package:geo_app/provider/unique_id_provider.dart'; +import 'package:geo_app/model/unique_id_model.dart'; + +class UniqueIDRepository { + UniqueIDProvider _uniqueIDProvider; + SettingModel _settingModel; + + UniqueIDRepository(this._settingModel) { + this._uniqueIDProvider = UniqueIDProvider(this._settingModel); + } + + Future getUniqueID() { + return this._uniqueIDProvider.getUniqueID(); + } +} diff --git a/pubspec.lock b/pubspec.lock index c9eb4bd..118a21c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -15,6 +15,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.38.5" + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" args: dependency: transitive description: @@ -28,14 +35,21 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.4.0" + background_fetch: + dependency: transitive + description: + name: background_fetch + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" background_location: dependency: "direct main" description: name: background_location url: "https://pub.dartlang.org" source: hosted - version: "0.0.7" + version: "0.0.9+1" boolean_selector: dependency: transitive description: @@ -49,7 +63,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.2.1" + version: "1.2.2" build_config: dependency: transitive description: @@ -105,7 +119,7 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "0.1.3" dart_style: dependency: transitive description: @@ -113,16 +127,35 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.3" + dio: + dependency: "direct main" + description: + name: dio + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.7" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" + flutter_background_geolocation: + dependency: "direct main" + description: + name: flutter_background_geolocation + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.5" flutter_test: dependency: "direct dev" description: flutter source: sdk version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" front_end: dependency: transitive description: @@ -143,7 +176,7 @@ packages: name: google_maps_flutter url: "https://pub.dartlang.org" source: hosted - version: "0.5.21+8" + version: "0.5.21+15" html: dependency: transitive description: @@ -165,6 +198,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.3" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" js: dependency: transitive description: @@ -206,14 +246,14 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.5" + version: "0.12.6" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.7" + version: "1.1.8" node_interop: dependency: transitive description: @@ -255,7 +295,14 @@ packages: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "3.3.0" + version: "4.0.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" pub_semver: dependency: transitive description: @@ -277,13 +324,41 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.5" + rxdart: + dependency: "direct main" + description: + name: rxdart + url: "https://pub.dartlang.org" + source: hosted + version: "0.23.1" shared_preferences: dependency: "direct main" description: name: shared_preferences url: "https://pub.dartlang.org" source: hosted - version: "0.5.4+3" + version: "0.5.6" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+2" sky_engine: dependency: transitive description: flutter @@ -337,7 +412,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.5" + version: "0.2.11" typed_data: dependency: transitive description: @@ -358,7 +433,14 @@ packages: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+12" + version: "0.9.7+13" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.5.0" yaml: dependency: transitive description: @@ -367,5 +449,5 @@ packages: source: hosted version: "2.2.0" sdks: - dart: ">=2.3.0 <3.0.0" - flutter: ">=1.6.7 <2.0.0" + dart: ">=2.6.0 <3.0.0" + flutter: ">=1.12.13+hotfix.4 <2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 4209ee7..b45659a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -24,11 +24,14 @@ dependencies: # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.2 google_maps_flutter: ^0.5.21+8 - background_location: ^0.0.7 + background_location: ^0.0.9+1 adhara_socket_io: ^0.4.1 http: ^0.12.0+2 json_serializable: ^3.2.3 shared_preferences: ^0.5.4+3 + rxdart: ^0.23.1 + dio: ^3.0.7 + flutter_background_geolocation: ^1.4.5 dev_dependencies: flutter_test: @@ -47,9 +50,8 @@ flutter: uses-material-design: true # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg + assets: + - assets/images/server.png # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware.