diff --git a/.gitignore b/.gitignore
index b8bbb6a..f053187 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,8 +3,12 @@
.DS_Store
.dart_tool/
+.flutter-plugins
+.flutter-plugins-dependencies
+
.packages
.pub/
pubspec.lock
build/
+
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 66f5f54..ae90e3a 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -5,7 +5,7 @@
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
-
+
-
+
+ android:value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />
-
-
+
+
-
-
+
+
+
+
-
+
\ No newline at end of file
diff --git a/example/android/app/src/main/kotlin/com/noeatsleepdev/geoflutterfireexample/MainActivity.kt b/example/android/app/src/main/kotlin/com/noeatsleepdev/geoflutterfireexample/MainActivity.kt
index 828dc5f..ffdbed9 100644
--- a/example/android/app/src/main/kotlin/com/noeatsleepdev/geoflutterfireexample/MainActivity.kt
+++ b/example/android/app/src/main/kotlin/com/noeatsleepdev/geoflutterfireexample/MainActivity.kt
@@ -1,13 +1,6 @@
package com.noeatsleepdev.geoflutterfireexample
-import android.os.Bundle
-
-import io.flutter.app.FlutterActivity
-import io.flutter.plugins.GeneratedPluginRegistrant
+import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- GeneratedPluginRegistrant.registerWith(this)
- }
}
diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml
index 00fa441..a73bb30 100644
--- a/example/android/app/src/main/res/values/styles.xml
+++ b/example/android/app/src/main/res/values/styles.xml
@@ -1,8 +1,18 @@
-
-
+
+
+
\ No newline at end of file
diff --git a/example/lib/main.dart b/example/lib/main.dart
index b66ef90..f129e9d 100644
--- a/example/lib/main.dart
+++ b/example/lib/main.dart
@@ -10,7 +10,7 @@ import 'streambuilder_test.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
- runApp(MaterialApp(
+ runApp(const MaterialApp(
title: 'Geo Flutter Fire example',
home: MyApp(),
debugShowCheckedModeBanner: false,
@@ -18,11 +18,13 @@ void main() async {
}
class MyApp extends StatefulWidget {
+ const MyApp({Key? key}) : super(key: key);
+
@override
- _MyAppState createState() => _MyAppState();
+ MyAppState createState() => MyAppState();
}
-class _MyAppState extends State {
+class MyAppState extends State {
GoogleMapController? _mapController;
TextEditingController? _latitudeController, _longitudeController;
@@ -82,7 +84,7 @@ class _MyAppState extends State {
: () {
_showHome();
},
- icon: Icon(Icons.home),
+ icon: const Icon(Icons.home),
)
],
),
@@ -92,7 +94,7 @@ class _MyAppState extends State {
return StreamTestWidget();
}));
},
- child: Icon(Icons.navigate_next),
+ child: const Icon(Icons.navigate_next),
),
body: Container(
child: Column(
@@ -101,7 +103,7 @@ class _MyAppState extends State {
Center(
child: Card(
elevation: 4,
- margin: EdgeInsets.symmetric(vertical: 8),
+ margin: const EdgeInsets.symmetric(vertical: 8),
child: SizedBox(
width: mediaQuery.size.width - 30,
height: mediaQuery.size.height * (1 / 3),
@@ -132,7 +134,7 @@ class _MyAppState extends State {
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
- Container(
+ SizedBox(
width: 100,
child: TextField(
controller: _latitudeController,
@@ -145,7 +147,7 @@ class _MyAppState extends State {
)),
),
),
- Container(
+ SizedBox(
width: 100,
child: TextField(
controller: _longitudeController,
@@ -236,23 +238,23 @@ class _MyAppState extends State {
void _addMarker(double lat, double lng) {
final id = MarkerId(lat.toString() + lng.toString());
- final _marker = Marker(
+ final marker = Marker(
markerId: id,
position: LatLng(lat, lng),
icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueViolet),
infoWindow: InfoWindow(title: 'latLng', snippet: '$lat,$lng'),
);
setState(() {
- markers[id] = _marker;
+ markers[id] = marker;
});
}
void _updateMarkers(List documentList) {
- documentList.forEach((DocumentSnapshot document) {
+ for (var document in documentList) {
final data = document.data() as Map;
final GeoPoint point = data['position']['geopoint'];
_addMarker(point.latitude, point.longitude);
- });
+ }
}
double _value = 20.0;
diff --git a/example/lib/streambuilder_test.dart b/example/lib/streambuilder_test.dart
index 1c502ce..5b842e6 100644
--- a/example/lib/streambuilder_test.dart
+++ b/example/lib/streambuilder_test.dart
@@ -41,7 +41,7 @@ class _StreamTestWidgetState extends State {
if (snapshots.connectionState == ConnectionState.active &&
snapshots.hasData) {
print('data ${snapshots.data}');
- return Container(
+ return SizedBox(
height: MediaQuery.of(context).size.height * 2 / 3,
child: ListView.builder(
itemBuilder: (context, index) {
@@ -57,7 +57,9 @@ class _StreamTestWidgetState extends State {
),
subtitle: Text('${point.latitude}, ${point.longitude}'),
trailing: Text(
- '${data['documentType'] == DocumentChangeType.added ? 'Added' : 'Modified'}'),
+ data['documentType'] == DocumentChangeType.added
+ ? 'Added'
+ : 'Modified'),
);
},
itemCount: snapshots.data!.length,
diff --git a/example/pubspec.yaml b/example/pubspec.yaml
index 4a8863f..50576ca 100644
--- a/example/pubspec.yaml
+++ b/example/pubspec.yaml
@@ -3,7 +3,7 @@ description: Demonstrates how to use the geoflutterfire plugin.
publish_to: "none"
environment:
- sdk: '>=2.12.0 <3.0.0'
+ sdk: ">=2.12.0 <3.0.0"
dependencies:
flutter:
@@ -20,8 +20,8 @@ dev_dependencies:
geoflutterfire:
path: ../
- cloud_firestore: ^3.1.6
- google_maps_flutter: ^2.1.1
+ cloud_firestore: ^4.0.2
+ google_maps_flutter: ^2.2.1
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec
diff --git a/pubspec.yaml b/pubspec.yaml
index 0d8921b..79c5dd8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -4,16 +4,17 @@ version: 3.0.3
homepage: https://github.com/DarshanGowda0/GeoFlutterFire
environment:
- sdk: '>=2.12.0 <3.0.0'
+ sdk: ">=2.12.0 <3.0.0"
flutter: ">=1.12.0"
dependencies:
flutter:
sdk: flutter
- cloud_firestore: ^3.1.6
- rxdart: ^0.27.3
- flutter_lints: ^1.0.0
+ cloud_firestore: ^4.0.2
+ rxdart: ^0.27.5
dev_dependencies:
flutter_test:
sdk: flutter
+
+ flutter_lints: ^2.0.1