diff --git a/android/app/build.gradle b/android/app/build.gradle
index cabca43..77305aa 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -37,13 +37,14 @@ android {
}
defaultConfig {
- // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "ar.com.p39.como_gasto"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
+ multiDexEnabled true
}
buildTypes {
@@ -62,6 +63,11 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ androidTestImplementation 'androidx.test:runner:1.2.1'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
+
+ implementation 'com.google.firebase:firebase-core:17.0.0'
+ implementation 'com.android.support:multidex:1.0.3'
}
+
+apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
diff --git a/android/app/google-services.json b/android/app/google-services.json
new file mode 100644
index 0000000..a180fff
--- /dev/null
+++ b/android/app/google-services.json
@@ -0,0 +1,55 @@
+{
+ "project_info": {
+ "project_number": "173215752753",
+ "firebase_url": "https://comogastoyt-bf4bb.firebaseio.com",
+ "project_id": "comogastoyt-bf4bb",
+ "storage_bucket": "comogastoyt-bf4bb.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:173215752753:android:957bb64f9e6aa927",
+ "android_client_info": {
+ "package_name": "ar.com.p39.como_gasto"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "173215752753-9oqdkfcniomj2otlaab0ti4v6gbd0c3m.apps.googleusercontent.com",
+ "client_type": 1,
+ "android_info": {
+ "package_name": "ar.com.p39.como_gasto",
+ "certificate_hash": "e408700297e4e8f89ebe9b5bd2d851a60213912f"
+ }
+ },
+ {
+ "client_id": "173215752753-sm27hsjfa9bdh4ko0itaf7539r31cl1c.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyA22xlzsq3xgI2gSocZM5f-AmCblT5X-L4"
+ }
+ ],
+ "services": {
+ "appinvite_service": {
+ "other_platform_oauth_client": [
+ {
+ "client_id": "173215752753-sm27hsjfa9bdh4ko0itaf7539r31cl1c.apps.googleusercontent.com",
+ "client_type": 3
+ },
+ {
+ "client_id": "173215752753-sfdf5d19ospsuphvgaclfsie0vp873lb.apps.googleusercontent.com",
+ "client_type": 2,
+ "ios_info": {
+ "bundle_id": "ar.com.p39.comoGasto"
+ }
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
index db77bb4..6e98ffe 100644
Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
index 17987b7..9d47f01 100644
Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
index 09d4391..7b891d8 100644
Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
index d5f1c8d..17bf634 100644
Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
index 4d6372e..71de40e 100644
Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/android/build.gradle b/android/build.gradle
index b7faad8..47638d2 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -1,13 +1,14 @@
buildscript {
- ext.kotlin_version = '1.2.71'
+ ext.kotlin_version = '1.3.31'
repositories {
google()
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.2.1'
+ classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ classpath 'com.google.gms:google-services:4.2.0'
}
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 8bd86f6..678cd62 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
+android.enableJetifier=true
+android.useAndroidX=true
\ No newline at end of file
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 2819f02..9b6616c 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
diff --git a/assets/launcher_icon_base.png b/assets/launcher_icon_base.png
new file mode 100644
index 0000000..f7091d0
Binary files /dev/null and b/assets/launcher_icon_base.png differ
diff --git a/assets/launcher_icon_ios.png b/assets/launcher_icon_ios.png
new file mode 100644
index 0000000..cd8fe8e
Binary files /dev/null and b/assets/launcher_icon_ios.png differ
diff --git a/assets/login_background.png b/assets/login_background.png
new file mode 100644
index 0000000..a15d36e
Binary files /dev/null and b/assets/login_background.png differ
diff --git a/ios/Podfile.lock b/ios/Podfile.lock
index 5860cb8..40c14c0 100644
--- a/ios/Podfile.lock
+++ b/ios/Podfile.lock
@@ -66,6 +66,8 @@ PODS:
- GoogleUtilities/Environment (~> 6.0)
- GoogleUtilities/UserDefaults (~> 6.0)
- Flutter (1.0.0)
+ - flutter_local_notifications (0.0.1):
+ - Flutter
- google_sign_in (0.0.1):
- Flutter
- GoogleSignIn (~> 4.0)
@@ -137,6 +139,7 @@ DEPENDENCIES:
- firebase_auth (from `.symlinks/plugins/firebase_auth/ios`)
- firebase_core (from `.symlinks/plugins/firebase_core/ios`)
- Flutter (from `.symlinks/flutter/ios`)
+ - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- google_sign_in (from `.symlinks/plugins/google_sign_in/ios`)
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
@@ -170,6 +173,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/firebase_core/ios"
Flutter:
:path: ".symlinks/flutter/ios"
+ flutter_local_notifications:
+ :path: ".symlinks/plugins/flutter_local_notifications/ios"
google_sign_in:
:path: ".symlinks/plugins/google_sign_in/ios"
shared_preferences:
@@ -188,6 +193,7 @@ SPEC CHECKSUMS:
FirebaseFirestore: 0537b2a960a4819fae2834e688e5daeb571c81d6
FirebaseInstanceID: 0e0348a3c00a734fa376a070f5ad4533ad975cb5
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
+ flutter_local_notifications: 9e4738ce2471c5af910d961a6b7eadcf57c50186
google_sign_in: 27e70a98b529f0b076d4b19f231b81da28b1750b
GoogleAppMeasurement: 7f028ea162b72c8f326daec74afc95d94f7a47d6
GoogleSignIn: 7ff245e1a7b26d379099d3243a562f5747e23d39
diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj
index 0d3df2b..6d3a8e3 100644
--- a/ios/Runner.xcodeproj/project.pbxproj
+++ b/ios/Runner.xcodeproj/project.pbxproj
@@ -256,6 +256,7 @@
"${BUILT_PRODUCTS_DIR}/GoogleToolboxForMac/GoogleToolboxForMac.framework",
"${BUILT_PRODUCTS_DIR}/GoogleUtilities/GoogleUtilities.framework",
"${BUILT_PRODUCTS_DIR}/Protobuf/Protobuf.framework",
+ "${BUILT_PRODUCTS_DIR}/flutter_local_notifications/flutter_local_notifications.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-C++/grpcpp.framework",
"${BUILT_PRODUCTS_DIR}/gRPC-Core/grpc.framework",
"${BUILT_PRODUCTS_DIR}/leveldb-library/leveldb.framework",
@@ -270,6 +271,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleToolboxForMac.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GoogleUtilities.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Protobuf.framework",
+ "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_local_notifications.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpcpp.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/grpc.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/leveldb.framework",
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
index 3d43d11..99620c1 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
index 28c6bf0..0052b34 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
index 2ccbfd9..0aa7f9c 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
index f091b6b..e125075 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
index 4cde121..c798c3a 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
index d0ef06e..662260b 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
index dcdc230..5043034 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
index 2ccbfd9..0aa7f9c 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
index c8f9ed8..f07bb03 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
index a6d6b86..3fc69fb 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
index a6d6b86..3fc69fb 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
index 75b2d16..a7da69f 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
index c4df70d..4393bdf 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
index 6a84f41..e57796b 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ
diff --git a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
index d0e1f58..d24992c 100644
Binary files a/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and b/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ
diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist
index a34ca09..9e5175e 100644
--- a/ios/Runner/Info.plist
+++ b/ios/Runner/Info.plist
@@ -41,5 +41,18 @@
UIViewControllerBasedStatusBarAppearance
+ CFBundleURLTypes
+
+
+ CFBundleTypeRole
+ Editor
+ CFBundleURLSchemes
+
+
+
+ com.googleusercontent.apps.173215752753-sfdf5d19ospsuphvgaclfsie0vp873lb
+
+
+
diff --git a/lib/pages/home_page.dart b/lib/pages/home_page.dart
index e7be914..e04f85a 100644
--- a/lib/pages/home_page.dart
+++ b/lib/pages/home_page.dart
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart';
import 'package:rect_getter/rect_getter.dart';
+import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import '../login_state.dart';
import '../utils.dart';
@@ -16,6 +17,7 @@ class HomePage extends StatefulWidget {
}
class _HomePageState extends State {
+ FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin;
var globalKey = RectGetter.createGlobalKey();
Rect buttonRect;
@@ -32,6 +34,8 @@ class _HomePageState extends State {
initialPage: currentPage,
viewportFraction: 0.4,
);
+
+ setupNotificationPlugin();
}
Widget _bottomAction(IconData icon, Function callback) {
@@ -209,4 +213,67 @@ class _HomePageState extends State {
),
);
}
+
+ void setupNotificationPlugin() {
+ flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin();
+
+ // initialise the plugin. app_icon needs to be a added as a drawable resource to the Android head project
+ var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon');
+ var initializationSettingsIOS = new IOSInitializationSettings(
+ onDidReceiveLocalNotification: onDidReceiveLocalNotification,
+ );
+ var initializationSettings = new InitializationSettings(
+ initializationSettingsAndroid,
+ initializationSettingsIOS,
+ );
+
+ flutterLocalNotificationsPlugin.initialize(
+ initializationSettings,
+ onSelectNotification: onSelectNotification,
+ ).then((init) {
+ setupNotification();
+ });
+ }
+
+ Future onSelectNotification(String payload) async {
+ if (payload != null) {
+ debugPrint('notification payload: ' + payload);
+ }
+ await Navigator.push(
+ context,
+ new MaterialPageRoute(builder: (context) => HomePage()),
+ );
+ }
+
+ Future onDidReceiveLocalNotification(
+ int id, String title, String body, String payload) async {
+ // display a dialog with the notification details, tap ok to go to another page
+ showDialog(
+ context: context,
+ builder: (context) => AlertDialog(
+ content: Text("Don't forget to add your expenses"),
+ actions: [
+ FlatButton(
+ child: Text('Ok'),
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ ],
+ ));
+ }
+
+ void setupNotification() async {
+ var time = new Time(16, 11, 0);
+ var androidPlatformChannelSpecifics = new AndroidNotificationDetails(
+ 'daily-notifications',
+ 'Daily Notifications',
+ 'Daily Notifications');
+ var iOSPlatformChannelSpecifics = new IOSNotificationDetails();
+ var platformChannelSpecifics = new NotificationDetails(
+ androidPlatformChannelSpecifics, iOSPlatformChannelSpecifics);
+
+ await flutterLocalNotificationsPlugin.showDailyAtTime(0, 'Spend-o-meter',
+ "Don't forget to add your expenses", time, platformChannelSpecifics);
+ }
}
diff --git a/lib/pages/login_page.dart b/lib/pages/login_page.dart
index 298fc0c..41f663a 100644
--- a/lib/pages/login_page.dart
+++ b/lib/pages/login_page.dart
@@ -1,29 +1,135 @@
+import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../login_state.dart';
-class LoginPage extends StatelessWidget {
+class LoginPage extends StatefulWidget {
+ @override
+ _LoginPageState createState() => _LoginPageState();
+}
+
+class _LoginPageState extends State {
+ TapGestureRecognizer _recognizer1;
+ TapGestureRecognizer _recognizer2;
+
@override
Widget build(BuildContext context) {
return Scaffold(
- body: Center(
- child: Consumer(
- builder: (BuildContext context, LoginState value, Widget child) {
- if (value.isLoading()) {
- return CircularProgressIndicator();
- } else {
- return child;
- }
- },
- child: RaisedButton(
- child: Text("Sign In"),
- onPressed: () {
- Provider.of(context).login();
- },
- ),
+ body: SafeArea(
+ child: Column(
+ children: [
+ Expanded(
+ flex: 1,
+ child: Container(),
+ ),
+ Text(
+ "Spend-o-meter",
+ style: Theme.of(context).textTheme.display1,
+ ),
+ Padding(
+ padding: const EdgeInsets.all(32.0),
+ child: Image.asset('assets/login_background.png'),
+ ),
+ Text(
+ "Your personal finance app",
+ style: Theme.of(context).textTheme.caption,
+ ),
+ Expanded(
+ flex: 1,
+ child: Container(),
+ ),
+ Consumer(
+ builder: (BuildContext context, LoginState value, Widget child) {
+ if (value.isLoading()) {
+ return CircularProgressIndicator();
+ } else {
+ return child;
+ }
+ },
+ child: RaisedButton(
+ child: Text("Sign in with Google"),
+ onPressed: () {
+ Provider.of(context).login();
+ },
+ ),
+ ),
+ Expanded(
+ child: Container(),
+ ),
+ Padding(
+ padding: const EdgeInsets.all(32.0),
+ child: RichText(
+ textAlign: TextAlign.center,
+ text: TextSpan(
+ style: Theme.of(context).textTheme.body1,
+ text: "To use this app you need to agree to our ",
+ children: [
+ TextSpan(
+ text: "Terms of Service",
+ recognizer: _recognizer1,
+ style: Theme.of(context)
+ .textTheme
+ .body1
+ .copyWith(fontWeight: FontWeight.bold),
+ ),
+ TextSpan(text: " and "),
+ TextSpan(
+ text: "Privacy Policy",
+ recognizer: _recognizer2,
+ style: Theme.of(context)
+ .textTheme
+ .body1
+ .copyWith(fontWeight: FontWeight.bold),
+ ),
+ ]),
+ ),
+ )
+ ],
),
),
);
}
+
+ @override
+ void initState() {
+ super.initState();
+
+ _recognizer1 = TapGestureRecognizer()
+ ..onTap = () {
+ showHelp(
+ "This service is provided AS IS and has no current warranty on how the"
+ " data and uptime is managed. The final terms will be released when the final version of the app"
+ " will be released.");
+ };
+ _recognizer2 = TapGestureRecognizer()
+ ..onTap = () {
+ showHelp(
+ "All your data is saved anonymously on Firebase Firestore database and will be remain that way."
+ " no other users will have access to it.");
+ };
+ }
+
+ @override
+ void dispose() {
+ super.dispose();
+ _recognizer1.dispose();
+ _recognizer2.dispose();
+ }
+
+ void showHelp(String s) {
+ showDialog(
+ context: context,
+ builder: (context) => AlertDialog(
+ content: Text(s),
+ actions: [
+ FlatButton(
+ child: Text('Ok'),
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ ],
+ ));
+ }
}
diff --git a/pubspec.lock b/pubspec.lock
index ca5c3d5..d7e1b6f 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1,6 +1,20 @@
# Generated by pub
# See https://www.dartlang.org/tools/pub/glossary#lockfile
packages:
+ archive:
+ dependency: transitive
+ description:
+ name: archive
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.10"
+ args:
+ dependency: transitive
+ description:
+ name: args
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "1.5.2"
async:
dependency: transitive
description:
@@ -50,6 +64,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
+ convert:
+ dependency: transitive
+ description:
+ name: convert
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.1"
+ crypto:
+ dependency: transitive
+ description:
+ name: crypto
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.0.6"
cupertino_icons:
dependency: "direct main"
description:
@@ -76,6 +104,20 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
+ flutter_launcher_icons:
+ dependency: "direct main"
+ description:
+ name: flutter_launcher_icons
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.7.2+1"
+ flutter_local_notifications:
+ dependency: "direct main"
+ description:
+ name: flutter_local_notifications
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.7.1+3"
flutter_test:
dependency: "direct dev"
description: flutter
@@ -95,6 +137,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1+3"
+ image:
+ dependency: transitive
+ description:
+ name: image
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.4"
intl:
dependency: transitive
description:
@@ -137,6 +186,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
+ petitparser:
+ dependency: transitive
+ description:
+ name: petitparser
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.1"
+ platform:
+ dependency: transitive
+ description:
+ name: platform
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.2.0"
provider:
dependency: "direct main"
description:
@@ -226,6 +289,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
+ xml:
+ dependency: transitive
+ description:
+ name: xml
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "3.4.1"
+ yaml:
+ dependency: transitive
+ description:
+ name: yaml
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "2.1.16"
sdks:
dart: ">=2.2.0 <3.0.0"
flutter: ">=1.2.0 <2.0.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index db3c584..62cbecc 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -31,11 +31,18 @@ dependencies:
firebase_auth: ^0.11.1
shared_preferences: ^0.5.2
rect_getter: ^0.0.1
+ flutter_launcher_icons: ^0.7.2+1
+ flutter_local_notifications: ^0.7.1+3
dev_dependencies:
flutter_test:
sdk: flutter
+flutter_icons:
+ android: true
+ ios: true
+ image_path: "assets/launcher_icon_base.png"
+ image_path_ios: "assets/launcher_icon_ios.png"
# For information on the generic Dart part of this file, see the
# following page: https://www.dartlang.org/tools/pub/pubspec