From 9aa6666d77d0cbb41f11382b4a02be41cf32a412 Mon Sep 17 00:00:00 2001 From: Supan Adit Pratama Date: Mon, 16 Dec 2019 07:18:09 +0700 Subject: [PATCH] Change to RxDart and Big Changes --- android/gradle.properties | 1 + assets/images/server.png | Bin 0 -> 13190 bytes lib/bloc/position_bloc.dart | 32 ++++ lib/bloc/setting.dart | 38 ++++ lib/bloc/unique_id_bloc.dart | 27 +++ lib/component/loader.dart | 171 ++++++++++++++++++ lib/main.dart | 136 +------------- lib/model/position.dart | 28 ++- lib/model/response.dart | 6 +- lib/model/setting.dart | 6 + .../{unique_id.dart => unique_id_model.dart} | 11 +- lib/page/map.dart | 126 +++++++++++++ lib/page/setting.dart | 95 ++++++++++ lib/page/startup.dart | 65 +++++++ lib/provider/position_provider.dart | 44 +++++ lib/provider/unique_id_provider.dart | 22 +++ lib/repository/position_repository.dart | 20 ++ lib/repository/unique_id_repository.dart | 16 ++ pubspec.lock | 108 +++++++++-- pubspec.yaml | 10 +- 20 files changed, 798 insertions(+), 164 deletions(-) create mode 100644 assets/images/server.png create mode 100644 lib/bloc/position_bloc.dart create mode 100644 lib/bloc/setting.dart create mode 100644 lib/bloc/unique_id_bloc.dart create mode 100644 lib/component/loader.dart create mode 100644 lib/model/setting.dart rename lib/model/{unique_id.dart => unique_id_model.dart} (52%) create mode 100644 lib/page/map.dart create mode 100644 lib/page/setting.dart create mode 100644 lib/page/startup.dart create mode 100644 lib/provider/position_provider.dart create mode 100644 lib/provider/unique_id_provider.dart create mode 100644 lib/repository/position_repository.dart create mode 100644 lib/repository/unique_id_repository.dart 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 0000000000000000000000000000000000000000..cce6ad16ff3c994a8d7a9fcf162d84ee35728da9 GIT binary patch literal 13190 zcm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cJF?d!f>)c2lqe0V;4p;r@pg9)@=I#QwwQ%|>Rb;zJg zl<3uAc!#@2e0(3UUM>Og&Qg?;l81vb?B z#Z;P|_mjzQ>+swtd?z0iYG&o*3!JZ0R+nXYv2TBsdy#FfRLmr+qRYmFT6Kpw%MgO|FCkeM?$McqWstF9a5X5P_L;iB1Ej@J%E2o%kAt!|` zRTDmKW;4y*DbnRlb3vS-6YJ>^lAE6zrMf6Q-whpJm{Z)Ns^(ABzZ;{W8bopT(bwoJ zxDh)tcnyTs*3x^ebm8#A1*_dKiz!B(bJ3N7>|J+85azEa`Ig58d)M*5w8N z8YTEjb=6gGJe=a* zGPA(nt-q(!U-SJ~kT{C@EQr(l`61Li@Mg`L2BD*g4q7oIR+po3xq~yQu8`w!r(uF< zi9>{Ezx{ZH*WOktg@fDeAEELCt5j(G+82xAnnor!KDbg7ugG49=uvP=OZ2p^Jz3y-OwEwe74L@6H#k35F&1EhetAS3uYC_;F-g;;N8AIMK#;ali- zVBh zG^x>EZe)Z;{sL2nd!Xq(2RYQpdqfi<2}Bt(BVmL_vPQ|}3GxDAw?!G+E z`*ud7M|epv`v0VvnSdHBL=-_W0x?n0^71s;_)lRtGsrl-O^+NB@Floyj-3IFI#Gs=1_=JtZ%u78$Q4z1b~{dwo=Ir H+Xw$2AQr=* literal 0 HcmV?d00001 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.