diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies new file mode 100644 index 0000000..f414176 --- /dev/null +++ b/.flutter-plugins-dependencies @@ -0,0 +1 @@ +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"cloud_firestore","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.7+1/","dependencies":["firebase_core"]},{"name":"file_picker","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.3.8/","dependencies":[]},{"name":"firebase_auth","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+12/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.0+8/","dependencies":[]},{"name":"firebase_storage","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-3.0.6/","dependencies":["firebase_core"]},{"name":"flutter_facebook_login","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_login-2.0.1/","dependencies":[]},{"name":"flutter_local_notifications","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-0.7.1+3/","dependencies":[]},{"name":"flutter_twitter_login","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_twitter_login-1.1.0/","dependencies":[]},{"name":"google_maps_flutter","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.5.2/","dependencies":[]},{"name":"google_sign_in","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.0.4/","dependencies":[]},{"name":"image_picker","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.0+16/","dependencies":[]},{"name":"location","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-2.3.5/","dependencies":[]},{"name":"scheduled_notifications","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/scheduled_notifications-1.0.0/","dependencies":[]},{"name":"shared_preferences","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.3+4/","dependencies":[]}],"android":[{"name":"cloud_firestore","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.12.7+1/","dependencies":["firebase_core"]},{"name":"file_picker","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.3.8/","dependencies":[]},{"name":"firebase_auth","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_auth-0.11.1+12/","dependencies":["firebase_core"]},{"name":"firebase_core","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-0.4.0+8/","dependencies":[]},{"name":"firebase_storage","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_storage-3.0.6/","dependencies":["firebase_core"]},{"name":"flutter_facebook_login","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_facebook_login-2.0.1/","dependencies":[]},{"name":"flutter_local_notifications","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_local_notifications-0.7.1+3/","dependencies":[]},{"name":"flutter_twitter_login","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_twitter_login-1.1.0/","dependencies":[]},{"name":"google_maps_flutter","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_maps_flutter-0.5.2/","dependencies":[]},{"name":"google_sign_in","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/google_sign_in-4.0.4/","dependencies":[]},{"name":"image_picker","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/image_picker-0.6.0+16/","dependencies":[]},{"name":"location","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/location-2.3.5/","dependencies":[]},{"name":"scheduled_notifications","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/scheduled_notifications-1.0.0/","dependencies":[]},{"name":"shared_preferences","path":"/home/lucifermorningstar/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.5.3+4/","dependencies":[]}],"macos":[],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"cloud_firestore","dependencies":["firebase_core"]},{"name":"file_picker","dependencies":[]},{"name":"firebase_auth","dependencies":["firebase_core"]},{"name":"firebase_core","dependencies":[]},{"name":"firebase_storage","dependencies":["firebase_core"]},{"name":"flutter_facebook_login","dependencies":[]},{"name":"flutter_local_notifications","dependencies":[]},{"name":"flutter_twitter_login","dependencies":[]},{"name":"google_maps_flutter","dependencies":[]},{"name":"google_sign_in","dependencies":[]},{"name":"image_picker","dependencies":[]},{"name":"location","dependencies":[]},{"name":"scheduled_notifications","dependencies":[]},{"name":"shared_preferences","dependencies":[]}],"date_created":"2020-10-06 20:36:17.268798","version":"1.22.0"} \ No newline at end of file diff --git a/android/.gradle/5.4.1/executionHistory/executionHistory.bin b/android/.gradle/5.4.1/executionHistory/executionHistory.bin index 596a17b..14749b1 100644 Binary files a/android/.gradle/5.4.1/executionHistory/executionHistory.bin and b/android/.gradle/5.4.1/executionHistory/executionHistory.bin differ diff --git a/android/.gradle/5.4.1/executionHistory/executionHistory.lock b/android/.gradle/5.4.1/executionHistory/executionHistory.lock index a421bbe..8ae52d5 100644 Binary files a/android/.gradle/5.4.1/executionHistory/executionHistory.lock and b/android/.gradle/5.4.1/executionHistory/executionHistory.lock differ diff --git a/android/.gradle/5.4.1/fileHashes/fileHashes.bin b/android/.gradle/5.4.1/fileHashes/fileHashes.bin index bf39dc4..ba593da 100644 Binary files a/android/.gradle/5.4.1/fileHashes/fileHashes.bin and b/android/.gradle/5.4.1/fileHashes/fileHashes.bin differ diff --git a/android/.gradle/5.4.1/fileHashes/fileHashes.lock b/android/.gradle/5.4.1/fileHashes/fileHashes.lock index 5ea34d7..7ce5261 100644 Binary files a/android/.gradle/5.4.1/fileHashes/fileHashes.lock and b/android/.gradle/5.4.1/fileHashes/fileHashes.lock differ diff --git a/android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin b/android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin index d528698..2f207c0 100644 Binary files a/android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin and b/android/.gradle/5.4.1/fileHashes/resourceHashesCache.bin differ diff --git a/android/.gradle/5.4.1/javaCompile/classAnalysis.bin b/android/.gradle/5.4.1/javaCompile/classAnalysis.bin index 0815a78..d7f0794 100644 Binary files a/android/.gradle/5.4.1/javaCompile/classAnalysis.bin and b/android/.gradle/5.4.1/javaCompile/classAnalysis.bin differ diff --git a/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin b/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin index 406ecba..efd350f 100644 Binary files a/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin and b/android/.gradle/5.4.1/javaCompile/jarAnalysis.bin differ diff --git a/android/.gradle/5.4.1/javaCompile/javaCompile.lock b/android/.gradle/5.4.1/javaCompile/javaCompile.lock index b890ab8..87b590f 100644 Binary files a/android/.gradle/5.4.1/javaCompile/javaCompile.lock and b/android/.gradle/5.4.1/javaCompile/javaCompile.lock differ diff --git a/android/.gradle/5.4.1/javaCompile/taskHistory.bin b/android/.gradle/5.4.1/javaCompile/taskHistory.bin index ad7ebc7..61908ae 100644 Binary files a/android/.gradle/5.4.1/javaCompile/taskHistory.bin and b/android/.gradle/5.4.1/javaCompile/taskHistory.bin differ diff --git a/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock index daa4b4c..5b1804b 100644 Binary files a/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/android/.gradle/buildOutputCleanup/outputFiles.bin b/android/.gradle/buildOutputCleanup/outputFiles.bin index 5a6c0f0..b129bdb 100644 Binary files a/android/.gradle/buildOutputCleanup/outputFiles.bin and b/android/.gradle/buildOutputCleanup/outputFiles.bin differ diff --git a/android/app/build.gradle b/android/app/build.gradle index 1029b6e..062b021 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,6 +22,8 @@ if (flutterVersionName == null) { } apply plugin: 'com.android.application' +apply plugin: 'com.google.gms.google-services' +apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" def keystoreProperties = new Properties() diff --git a/android/app/src/main/java/com/example/todoapp/MainActivity.java b/android/app/src/main/java/com/example/todoapp/MainActivity.java index 5543848..4535cee 100644 --- a/android/app/src/main/java/com/example/todoapp/MainActivity.java +++ b/android/app/src/main/java/com/example/todoapp/MainActivity.java @@ -1,13 +1,7 @@ -package app.ionicfirebaseapp.todoproapp; +import io.flutter.embedding.android.FlutterActivity; + -import android.os.Bundle; -import io.flutter.app.FlutterActivity; -import io.flutter.plugins.GeneratedPluginRegistrant; public class MainActivity extends FlutterActivity { - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - GeneratedPluginRegistrant.registerWith(this); - } + } diff --git a/android/build.gradle b/android/build.gradle index a6c1097..89eaa4f 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,4 +1,5 @@ buildscript { + ext.kotlin_version = '1.3.50' repositories { mavenCentral() google() @@ -8,6 +9,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.google.gms:google-services:4.3.2' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } diff --git a/android/gradle.properties b/android/gradle.properties index e60119f..5df7cf5 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -2,3 +2,4 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +android.enableR8=true diff --git a/android/local.properties b/android/local.properties index cd4b6b7..9f85acd 100644 --- a/android/local.properties +++ b/android/local.properties @@ -1,5 +1,5 @@ -sdk.dir=/home/deepika/Android/Sdk -flutter.sdk=/home/deepika/flutter +sdk.dir=/home/lucifermorningstar/Android/Sdk +flutter.sdk=/home/lucifermorningstar/Documents/flutter flutter.buildMode=debug flutter.versionName=1.0.2 flutter.versionCode=3 \ No newline at end of file diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14f..c893196 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,5 +1,15 @@ include ':app' +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" + def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() def plugins = new Properties() diff --git a/ios/Runner/GeneratedPluginRegistrant.h b/ios/Runner/GeneratedPluginRegistrant.h index 3b700eb..ed9a5c6 100644 --- a/ios/Runner/GeneratedPluginRegistrant.h +++ b/ios/Runner/GeneratedPluginRegistrant.h @@ -7,8 +7,11 @@ #import +NS_ASSUME_NONNULL_BEGIN + @interface GeneratedPluginRegistrant : NSObject + (void)registerWithRegistry:(NSObject*)registry; @end +NS_ASSUME_NONNULL_END #endif /* GeneratedPluginRegistrant_h */ diff --git a/ios/Runner/GeneratedPluginRegistrant.m b/ios/Runner/GeneratedPluginRegistrant.m index 891c1a1..5dd44f2 100644 --- a/ios/Runner/GeneratedPluginRegistrant.m +++ b/ios/Runner/GeneratedPluginRegistrant.m @@ -3,20 +3,90 @@ // #import "GeneratedPluginRegistrant.h" + +#if __has_include() #import +#else +@import cloud_firestore; +#endif + +#if __has_include() #import +#else +@import file_picker; +#endif + +#if __has_include() #import +#else +@import firebase_auth; +#endif + +#if __has_include() #import +#else +@import firebase_core; +#endif + +#if __has_include() #import +#else +@import firebase_storage; +#endif + +#if __has_include() #import +#else +@import flutter_facebook_login; +#endif + +#if __has_include() #import +#else +@import flutter_local_notifications; +#endif + +#if __has_include() #import +#else +@import flutter_twitter_login; +#endif + +#if __has_include() #import +#else +@import google_maps_flutter; +#endif + +#if __has_include() #import +#else +@import google_sign_in; +#endif + +#if __has_include() #import +#else +@import image_picker; +#endif + +#if __has_include() #import +#else +@import location; +#endif + +#if __has_include() #import +#else +@import scheduled_notifications; +#endif + +#if __has_include() #import +#else +@import shared_preferences; +#endif @implementation GeneratedPluginRegistrant diff --git a/lib/screens/auth/login.dart b/lib/screens/auth/login.dart index fef1478..e926991 100644 --- a/lib/screens/auth/login.dart +++ b/lib/screens/auth/login.dart @@ -14,9 +14,9 @@ import 'package:firebase_auth/firebase_auth.dart'; import '../../common/constant.dart'; import 'dart:convert'; import '../../screens/auth/reset_password.dart'; -import 'dart:async'; -import 'package:cloud_firestore/cloud_firestore.dart'; -import 'package:firebase_auth/firebase_auth.dart'; +//import 'dart:async'; +//import 'package:cloud_firestore/cloud_firestore.dart'; +//import 'package:firebase_auth/firebase_auth.dart'; class Login extends StatefulWidget { static String tag = "login"; @@ -48,7 +48,6 @@ class _LoginState extends State { var errorText; var fbUser, fbEmail, fbProfile, fbId; - Future signInUser() async { SharedPreferences prefs = await SharedPreferences.getInstance(); @@ -72,7 +71,6 @@ class _LoginState extends State { loading = false; }); - print('onval $user'); Navigator.pushAndRemoveUntil( @@ -118,155 +116,161 @@ class _LoginState extends State { } } + fbLoginUser( + id, + namee, + email, + ) async { + var authData = {'facebookId': id, 'namee': namee, 'email': email}; + var dataa = json.encode(authData); + print(json.encode(authData)); + print("facebook..............................$dataa"); + } - fbLoginUser( - id, - namee, - email, - ) async { - var authData = { - 'facebookId': id, - 'namee': namee, - 'email': email - }; - var dataa= json.encode(authData); - print(json.encode(authData)); - print("facebook..............................$dataa"); - } + final FacebookLogin facebookSignIn = new FacebookLogin(); - final FacebookLogin facebookSignIn = new FacebookLogin(); + String message = 'Log in/out by pressing the buttons below.'; + bool fbLog = false; - String message = 'Log in/out by pressing the buttons below.'; - bool fbLog = false; + putData(accessToken, data) async { + SharedPreferences prefs = await SharedPreferences.getInstance(); - putData(accessToken, data) async { - SharedPreferences prefs = await SharedPreferences.getInstance(); + setState(() { + loading = true; + }); + await fbLoginUser(accessToken.userId, data['name'], data['email']) + .then((response) { + print("data......................$data" + "${data['name']}, ${data['id']} "); + + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute( + builder: (BuildContext context) => Landing(), + ), + (Route route) => false); + }); + setState(() { + loading = false; + }); + } - setState(() { - loading = true; - }); - await fbLoginUser(accessToken.userId, data['name'], data['email']) - .then((response) { - print("data......................$data" - "${data['name']}, ${data['id']} "); + facebookLog(accessToken) async { + SharedPreferences prefs = await SharedPreferences.getInstance(); + prefs.setString('loginType', 'fb'); + prefs.setBool('login', true); + await http + .get( + 'https://graph.facebook.com/me?access_token=${accessToken.token}&fields=id,name,email,picture.type(large)') + .then((res) { + // console.log('result ---' + JSON.stringify(res)); + //console.log('user image url==' + JSON.stringify(res.data.picture.data.url)); + String resp = res.body; + var data = json.decode(resp); + + putData(accessToken, data); + print('fb data---> $data '); + prefs.setString('fbUser', '${data['name']}'); + prefs.setString('fbEmail', '${data['email']}'); + prefs.setString('fbId', '${data['id']}'); + prefs.setString('fbProfile', '${data['picture']['data']['url']}'); + }); + } - Navigator.pushAndRemoveUntil( - context, - MaterialPageRoute( - builder: (BuildContext context) => Landing(), - ), - (Route route) => false); - }); - setState(() { - loading = false; - }); - } + Future _facebookLogin() async { + final FacebookLoginResult result = await facebookSignIn + .logInWithReadPermissions(['public_profile, email']); - facebookLog(accessToken) async { - SharedPreferences prefs = await SharedPreferences.getInstance(); - - prefs.setString('loginType', 'fb'); - prefs.setBool('login', true); - await http - .get( - 'https://graph.facebook.com/me?access_token=${accessToken.token}&fields=id,name,email,picture.type(large)') - .then((res) { - // console.log('result ---' + JSON.stringify(res)); - //console.log('user image url==' + JSON.stringify(res.data.picture.data.url)); - String resp = res.body; - var data = json.decode(resp); - - putData(accessToken, data); - print('fb data---> $data '); - prefs.setString('fbUser', '${data['name']}'); - prefs.setString('fbEmail', '${data['email']}'); - prefs.setString('fbId', '${data['id']}'); - prefs.setString('fbProfile', '${data['picture']['data']['url']}'); - }); - } + switch (result.status) { + case FacebookLoginStatus.loggedIn: + final FacebookAccessToken accessToken = result.accessToken; + print('token ........................$accessToken'); + setState(() { + fbLog = true; + }); + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: new Text( + "Oppsy... taking more time than expected", + style: subTitle(), + ), + content: Container( + height: 50.0, + child: Image.asset( + "lib/assets/gif/spinner.gif", + )), + actions: [ + new FlatButton( + child: new Text("Close"), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + await facebookLog(accessToken); - Future _facebookLogin() async { - final FacebookLoginResult result = await facebookSignIn - .logInWithReadPermissions(['public_profile, email']); - - switch (result.status) { - case FacebookLoginStatus.loggedIn: - final FacebookAccessToken accessToken = result.accessToken; - print('token ........................$accessToken'); - setState(() { - fbLog = true; - }); - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: new Text("Oppsy... taking more time than expected", style: subTitle(),), - content: Container(height: 50.0,child: Image.asset("lib/assets/gif/spinner.gif",)), - actions: [ - new FlatButton( - child: new Text("Close"), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - await facebookLog(accessToken); - - break; - case FacebookLoginStatus.cancelledByUser: - print('cancel ${result.errorMessage}'); - await facebookSignIn.logOut(); - _showMessage('Logged out.'); - setState(() { - fbLog = false; - }); - _showMessage('Login cancelled by the user.'); - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: new Text("Oops something gone wrong...!!!", style: subTitle()), - content: new Text("Try Login again", style: prefix0.category(),), - actions: [ - new FlatButton( - child: new Text("Close"), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - break; - case FacebookLoginStatus.error: - print('errrrrrrrrrrrrrrrrrrrrooooooooo ${result.errorMessage}'); - _showMessage('Something went wrong with the login process.\n' - 'Here\'s the error Facebook gave us: ${result.errorMessage}'); - showDialog( - context: context, - builder: (BuildContext context) { - return AlertDialog( - title: new Text("Oops something gone wrong...!!!"), - content: new Text("Try Login again"), - actions: [ - new FlatButton( - child: new Text("Close"), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - break; - } + break; + case FacebookLoginStatus.cancelledByUser: + print('cancel ${result.errorMessage}'); + await facebookSignIn.logOut(); + _showMessage('Logged out.'); + setState(() { + fbLog = false; + }); + _showMessage('Login cancelled by the user.'); + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: new Text("Oops something gone wrong...!!!", + style: subTitle()), + content: new Text( + "Try Login again", + style: prefix0.category(), + ), + actions: [ + new FlatButton( + child: new Text("Close"), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + break; + case FacebookLoginStatus.error: + print( + 'errrrrrrrrrrrrrrrrrrrrooooooooo ${result.errorMessage}'); + _showMessage('Something went wrong with the login process.\n' + 'Here\'s the error Facebook gave us: ${result.errorMessage}'); + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: new Text("Oops something gone wrong...!!!"), + content: new Text("Try Login again"), + actions: [ + new FlatButton( + child: new Text("Close"), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ], + ); + }, + ); + break; } + } void _showMessage(String message) { setState(() { @@ -293,8 +297,8 @@ class _LoginState extends State { case TwitterLoginStatus.loggedIn: newMessage = 'Logged in! username: ${result.session.username}'; - print('twitter.................. ${result.session.username} ${result.session.userId} '); - + print( + 'twitter.................. ${result.session.username} ${result.session.userId} '); print('resuttttttttttttttttt ${result.session}'); prefs.setString('twUser', '${result.session.username}'); @@ -305,7 +309,7 @@ class _LoginState extends State { MaterialPageRoute( builder: (BuildContext context) => Landing(), ), - (Route route) => false); + (Route route) => false); break; case TwitterLoginStatus.cancelledByUser: newMessage = 'Login cancelled by user.'; @@ -377,11 +381,12 @@ class _LoginState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - padding: EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 15.0), + padding: + EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 15.0), child: Stack( children: [ Container( - width: screenWidth(context)*0.83, + width: screenWidth(context) * 0.83, color: Colors.white, padding: EdgeInsets.only(left: 65.0), child: TextFormField( @@ -392,7 +397,8 @@ class _LoginState extends State { hintText: 'Email Id', hintStyle: hintStyleDark(), ), - initialValue: 'deepika@pietechsolution.com', + initialValue: + 'deepika@pietechsolution.com', style: hintStyleDark(), keyboardType: TextInputType.emailAddress, validator: (String value) { @@ -409,7 +415,7 @@ class _LoginState extends State { ), Positioned( top: -6.0, - right: (screenWidth(context) * 0.83) - 55.0, + right: (screenWidth(context) * 0.83) - 55.0, child: Stack( fit: StackFit.loose, alignment: AlignmentDirectional.center, @@ -432,11 +438,11 @@ class _LoginState extends State { ), Container( padding: - EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0), + EdgeInsets.fromLTRB(30.0, 0.0, 30.0, 0.0), child: Stack( children: [ Container( - width: screenWidth(context)*0.83, + width: screenWidth(context) * 0.83, color: Colors.white, padding: EdgeInsets.only(left: 65.0), child: TextFormField( @@ -491,7 +497,7 @@ class _LoginState extends State { left: 16.0, right: 30.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, children: [ Row( @@ -510,7 +516,8 @@ class _LoginState extends State { ), InkWell( onTap: () { - Navigator.of(context).pushNamed(ResetPassword.tag); + Navigator.of(context) + .pushNamed(ResetPassword.tag); }, child: Text( "Forget Password", @@ -550,10 +557,10 @@ class _LoginState extends State { ), loading ? new Image.asset( - 'lib/assets/gif/load.gif', - width: 19.0, - height: 19.0, - ) + 'lib/assets/gif/load.gif', + width: 19.0, + height: 19.0, + ) : new Text(''), ], ), @@ -597,16 +604,14 @@ class _LoginState extends State { onTap: _facebookLogin, child: Row( mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment.center, + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( height: 50.0, width: 50.0, decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), + borderRadius: BorderRadius.circular(8.0), color: Colors.white, ), child: new Icon( @@ -628,15 +633,12 @@ class _LoginState extends State { child: InkWell( onTap: _twitterLogin, child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(8.0), + borderRadius: BorderRadius.circular(8.0), color: Colors.white, ), height: 50.0, diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index cefbfe0..5f089e2 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -41,40 +41,46 @@ class _HomeState extends State { loginType = prefs.getString('loginType'); }); print("logintype ...................$loginType"); - if(loginType == 'fb'){ - setState(() { - fbUser = prefs.getString('fbUser'); - fbEmail = prefs.getString('fbEmail'); - fbId = prefs.getString('fbId'); - fbProfile = prefs.getString('fbProfile'); - }); - print('fbbuser $fbUser $fbProfile, $fbEmail, $fbId'); - }else if(loginType == 'tw'){ + if (loginType == 'fb') { + setState(() { + fbUser = prefs.getString('fbUser'); + fbEmail = prefs.getString('fbEmail'); + fbId = prefs.getString('fbId'); + fbProfile = prefs.getString('fbProfile'); + }); + print('fbbuser $fbUser $fbProfile, $fbEmail, $fbId'); + } else if (loginType == 'tw') { setState(() { twUser = prefs.getString('twUser'); twId = prefs.getString('twId'); }); print('twuser $twUser $twId'); - }else if(loginType == 'fs') { - final FirebaseUser userProfile = await FirebaseAuth.instance.currentUser(); - if (userProfile != null) { - userName = userProfile.displayName; - email = userProfile.email; + } else if (loginType == 'fs') { + final FirebaseUser userProfile = + await FirebaseAuth.instance.currentUser(); + if (userProfile != null) { + userName = userProfile.displayName; + email = userProfile.email; // photoUrl = userProfile.photoURL; // emailVerified = userProfile.emailVerified; - uid = userProfile.uid; - } - print('user name ....................$userName $email $uid'); - } - - getData(); + uid = userProfile.uid; + } + print('user name ....................$userName $email $uid'); + } + getData(); } - getData() async{ + getData() async { print("loginType 4444...................$loginType"); - crudObj.getData(loginType == 'fs'? uid : loginType == 'fb' ? fbId : twId).then((results) { - if(mounted){ + crudObj + .getData(loginType == 'fs' + ? uid + : loginType == 'fb' + ? fbId + : twId) + .then((results) { + if (mounted) { setState(() { tasks = results; }); @@ -109,10 +115,20 @@ class _HomeState extends State { Container( alignment: AlignmentDirectional.center, height: 30.0, - child: - loginType == 'fb' ? Text('"Dear $fbUser, May you be on Time "', style: smallAddressWhiteSI(),) : - loginType == 'fs' ? Text('"Dear $userName, May you be on Time "', style: smallAddressWhiteSI(),) : - Text('"Dear $twUser, May you be on Time "', style: smallAddressWhiteSI(),), + child: loginType == 'fb' + ? Text( + '"Dear $fbUser, May you be on Time "', + style: smallAddressWhiteSI(), + ) + : loginType == 'fs' + ? Text( + '"Dear $userName, May you be on Time "', + style: smallAddressWhiteSI(), + ) + : Text( + '"Dear $twUser, May you be on Time "', + style: smallAddressWhiteSI(), + ), color: grey.withOpacity(0.66), ), Container( @@ -127,19 +143,34 @@ class _HomeState extends State { items: [ BottomNavigationBarItem( backgroundColor: darkGrey, - icon: Text("Today", style: smallAddressWhite2SR(),), + icon: Text( + "Today", + style: smallAddressWhite2SR(), + ), title: Padding( padding: const EdgeInsets.only(top: 4.0), - child: Image.asset("lib/assets/icon/today.png", height: 25.0, width: 25.0,), + child: Image.asset( + "lib/assets/icon/today.png", + height: 25.0, + width: 25.0, + ), // Text(dateNow, style: subTitleWhiteSR()), ), ), BottomNavigationBarItem( backgroundColor: darkGrey, - icon: Text("Task Completed", style: smallAddressWhite2SR(),), + icon: Text( + "Task Completed", + style: smallAddressWhite2SR(), + ), title: Padding( padding: const EdgeInsets.only(top: 4.0), - child: Image.asset("lib/assets/icon/completed.png", height: 25.0, width: 25.0, color: Colors.white70,), + child: Image.asset( + "lib/assets/icon/completed.png", + height: 25.0, + width: 25.0, + color: Colors.white70, + ), // Text("2/10", style: subTitleWhiteSR()), ), ) @@ -154,14 +185,12 @@ class _HomeState extends State { } } - class TaskInProgress extends StatefulWidget { @override _TaskInProgressState createState() => _TaskInProgressState(); } class _TaskInProgressState extends State { - @override Widget build(BuildContext context) { return Container( @@ -189,7 +218,6 @@ class _TaskInProgressState extends State { } } - class TaskCompleted extends StatefulWidget { @override _TaskCompletedState createState() => _TaskCompletedState(); @@ -213,5 +241,3 @@ class _TaskCompletedState extends State { ); } } - - diff --git a/lib/screens/profile/profile.dart b/lib/screens/profile/profile.dart index 611a666..00c842c 100644 --- a/lib/screens/profile/profile.dart +++ b/lib/screens/profile/profile.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:todo_open/screens/priority_task/priority_task.dart'; -import 'package:todo_open/screens/settings/contact_us.dart'; +//import 'package:todo_open/screens/settings/contact_us.dart'; import 'package:todo_open/screens/task/task_list.dart'; import 'package:todo_open/style/style.dart' as prefix0; import '../../style/style.dart'; @@ -20,7 +20,6 @@ class Profile extends StatefulWidget { } class _ProfileState extends State { - crudMedthods crudObj = new crudMedthods(); @override @@ -42,7 +41,7 @@ class _ProfileState extends State { loginType = prefs.getString('loginType'); }); print("logintype ...................$loginType"); - if(loginType == 'fb'){ + if (loginType == 'fb') { setState(() { imageLoading = true; fbUser = prefs.getString('fbUser'); @@ -51,13 +50,13 @@ class _ProfileState extends State { fbProfile = prefs.getString('fbProfile'); }); print('fb user $fbUser $fbProfile, $fbEmail, $fbId'); - }else if(loginType == 'tw'){ + } else if (loginType == 'tw') { setState(() { twUser = prefs.getString('twUser'); twId = prefs.getString('twId'); }); print('twuser $twUser $twId'); - }else if(loginType == 'fs') { + } else if (loginType == 'fs') { FirebaseUser userProfile = await FirebaseAuth.instance.currentUser(); if (userProfile != null) { setState(() { @@ -87,11 +86,10 @@ class _ProfileState extends State { String fileName = path.basename(_imageFile.path); final StorageReference firebaseStorageRef = - FirebaseStorage.instance.ref().child(fileName); + FirebaseStorage.instance.ref().child(fileName); final StorageUploadTask task = firebaseStorageRef.putFile(_imageFile); print('pic $task'); - var taskSnapshot = - await (await task.onComplete).ref.getDownloadURL(); + var taskSnapshot = await (await task.onComplete).ref.getDownloadURL(); imageUrl = taskSnapshot.toString(); FirebaseAuth.instance.currentUser().then((val) { @@ -115,10 +113,9 @@ class _ProfileState extends State { String fileName = path.basename(_imageFile.path); final StorageReference firebaseStorageRef = - FirebaseStorage.instance.ref().child(fileName); + FirebaseStorage.instance.ref().child(fileName); final StorageUploadTask task = firebaseStorageRef.putFile(_imageFile); - var taskSnapshot = - await (await task.onComplete).ref.getDownloadURL(); + var taskSnapshot = await (await task.onComplete).ref.getDownloadURL(); imageUrl = taskSnapshot.toString(); FirebaseAuth.instance.currentUser().then((val) { @@ -134,11 +131,28 @@ class _ProfileState extends State { } Widget profileImage() { - return - imageUrl != null ? - ClipOval(child: Image.network(imageUrl, width: 100, height: 100, fit: BoxFit.cover,)) : - photoUrl != null ? ClipOval(child: Image.network(photoUrl, width: 100, height: 100, fit: BoxFit.cover,)): - Image.asset("lib/assets/icon/user.png", width: 100, height: 100, color: Colors.white,); + return imageUrl != null + ? ClipOval( + child: Image.network( + imageUrl, + width: 100, + height: 100, + fit: BoxFit.cover, + )) + : photoUrl != null + ? ClipOval( + child: Image.network( + photoUrl, + width: 100, + height: 100, + fit: BoxFit.cover, + )) + : Image.asset( + "lib/assets/icon/user.png", + width: 100, + height: 100, + color: Colors.white, + ); // new Image.asset( // 'lib/assets/gif/load.gif', // color: Colors.white, @@ -149,147 +163,110 @@ class _ProfileState extends State { Future _onWillPop() { return showDialog( - context: context, - builder: (context) => new AlertDialog( - title: InkWell( - onTap: () { - takeImage(); - Navigator.of(context).pop(false); - }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.camera_alt, size: 18.0, color: Colors.black), - Padding( - padding: EdgeInsets.only(left: 10.0), - ), - Text( - "Select Camera", - style: prefix0.address(), + context: context, + builder: (context) => new AlertDialog( + title: InkWell( + onTap: () { + takeImage(); + Navigator.of(context).pop(false); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.camera_alt, size: 18.0, color: Colors.black), + Padding( + padding: EdgeInsets.only(left: 10.0), + ), + Text( + "Select Camera", + style: prefix0.address(), + ), + ], ), - ], - ), - ), - content: InkWell( - onTap: () { - selectImage(); - Navigator.of(context).pop(false); - }, - child: Row( - mainAxisSize: MainAxisSize.min, - children: [ - Icon(Icons.image, size: 18.0, color: Colors.black), - Padding( - padding: EdgeInsets.only(left: 10.0), + ), + content: InkWell( + onTap: () { + selectImage(); + Navigator.of(context).pop(false); + }, + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon(Icons.image, size: 18.0, color: Colors.black), + Padding( + padding: EdgeInsets.only(left: 10.0), + ), + Text("Select Gallery", style: prefix0.address()), + ], ), - Text("Select Gallery", style: prefix0.address()), - ], + ), ), - ), - ), - ) ?? + ) ?? false; } - @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: prefix0.bgGrey, - drawer: DrawerList(), - appBar: AppBar( - elevation: 0.0, - title: Text("Profile", style: subBoldTitleWhite(),), - iconTheme: IconThemeData(color: Colors.white), - ), - body: ListView( - padding: EdgeInsets.all(20.0), - children: [ - Container( - height: 120.0, - child: Stack( - alignment: AlignmentDirectional.center, - children: [ - CircleAvatar( - radius: 50.0, - backgroundColor: primary.withOpacity(0.4), - child: loginType == 'fb' ? - ClipOval(child: Image.network(fbProfile, width: 100, height: 100, fit: BoxFit.cover,)) : - profileImage(), - ), - loginType == 'fs' ? Positioned( - right: prefix0.screenWidth(context)/3.4, - top: prefix0.screenHeight(context)/9, - child: Container( - height: 30.0, - width: 30.0, - child: new FloatingActionButton( - foregroundColor: Colors.black, - backgroundColor: Colors.white, - onPressed: () => _onWillPop(), - tooltip: 'Photo', - child: new Icon(Icons.camera_alt, size: 14.0,), - ), - ), - ) : Container(), - ], - ), + backgroundColor: prefix0.bgGrey, + drawer: DrawerList(), + appBar: AppBar( + elevation: 0.0, + title: Text( + "Profile", + style: subBoldTitleWhite(), ), - Container( - height: 70.0, - margin: EdgeInsets.only(top: 20.0, bottom: 14.0), - width: screenHeight(context), - padding: EdgeInsets.all(14.0), - decoration: new BoxDecoration( - color: Colors.white, - boxShadow: [ - new BoxShadow( - color: Colors.grey.shade300, - blurRadius: 8.0, - ), - ], - ), - child: Row( - children: [ - InkWell( - onTap: () => _onWillPop(), - child: CircleAvatar( - radius: 22.0, + iconTheme: IconThemeData(color: Colors.white), + ), + body: ListView( + padding: EdgeInsets.all(20.0), + children: [ + Container( + height: 120.0, + child: Stack( + alignment: AlignmentDirectional.center, + children: [ + CircleAvatar( + radius: 50.0, backgroundColor: primary.withOpacity(0.4), - child: loginType == 'fb' ? - ClipOval(child: Image.network(fbProfile, width: 100, height: 100, fit: BoxFit.cover,)) : - profileImage(), + child: loginType == 'fb' + ? ClipOval( + child: Image.network( + fbProfile, + width: 100, + height: 100, + fit: BoxFit.cover, + )) + : profileImage(), ), - ), - Flexible( - child: Padding( - padding: EdgeInsets.only(left: 10.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - loginType == 'fs' ? Text('$userName', style: textStyleOrangeSS(),) : - loginType == 'fb' ? Text('$fbUser', style: textStyleOrangeSS(),) : - Text('$twUser', style: textStyleOrangeSS(),), - loginType == 'fs' ? Text('$email', style: smallBoldDescription(),) : -// loginType == 'fb' && fbEmail != null ? Text('$fbEmail', style: smallBoldDescription(),) : - Text('', style: smallBoldDescription(),), - ], - ), - ), - ), - ], + loginType == 'fs' + ? Positioned( + right: prefix0.screenWidth(context) / 3.4, + top: prefix0.screenHeight(context) / 9, + child: Container( + height: 30.0, + width: 30.0, + child: new FloatingActionButton( + foregroundColor: Colors.black, + backgroundColor: Colors.white, + onPressed: () => _onWillPop(), + tooltip: 'Photo', + child: new Icon( + Icons.camera_alt, + size: 14.0, + ), + ), + ), + ) + : Container(), + ], + ), ), - ), - InkWell( - onTap: (){ - Navigator.of(context).pushNamed(PriorityTask.tag); - }, - child: Container( + Container( height: 70.0, + margin: EdgeInsets.only(top: 20.0, bottom: 14.0), width: screenHeight(context), - padding: EdgeInsets.all(8.0), - margin: EdgeInsets.only(bottom: 14.0), + padding: EdgeInsets.all(14.0), decoration: new BoxDecoration( color: Colors.white, boxShadow: [ @@ -300,51 +277,161 @@ class _ProfileState extends State { ], ), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - IconButton(icon: Image.asset("lib/assets/icon/timeline.png", height: 22.0, width: 22.0,)), - Text("Priority Tasks", style: textSmallStyleGreySS(),), - ], + InkWell( + onTap: () => _onWillPop(), + child: CircleAvatar( + radius: 22.0, + backgroundColor: primary.withOpacity(0.4), + child: loginType == 'fb' + ? ClipOval( + child: Image.network( + fbProfile, + width: 100, + height: 100, + fit: BoxFit.cover, + )) + : profileImage(), + ), + ), + Flexible( + child: Padding( + padding: EdgeInsets.only(left: 10.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + loginType == 'fs' + ? Text( + '$userName', + style: textStyleOrangeSS(), + ) + : loginType == 'fb' + ? Text( + '$fbUser', + style: textStyleOrangeSS(), + ) + : Text( + '$twUser', + style: textStyleOrangeSS(), + ), + loginType == 'fs' + ? Text( + '$email', + style: smallBoldDescription(), + ) + : +// loginType == 'fb' && fbEmail != null ? Text('$fbEmail', style: smallBoldDescription(),) : + Text( + '', + style: smallBoldDescription(), + ), + ], + ), + ), ), - IconButton(icon: Image.asset("lib/assets/icon/arrow.png", height: 22.0, width: 22.0,)), ], ), ), - ), - InkWell( - onTap: (){ - Navigator.of(context).pushNamed(TaskList.tag); - }, - child: Container( - height: 70.0, - width: screenHeight(context), - padding: EdgeInsets.all(8.0), - margin: EdgeInsets.only(bottom: 14.0), - decoration: new BoxDecoration( - color: Colors.white, - boxShadow: [ - new BoxShadow( - color: Colors.grey.shade300, - blurRadius: 8.0, - ), - ], + InkWell( + onTap: () { + Navigator.of(context).pushNamed(PriorityTask.tag); + }, + child: Container( + height: 70.0, + width: screenHeight(context), + padding: EdgeInsets.all(8.0), + margin: EdgeInsets.only(bottom: 14.0), + decoration: new BoxDecoration( + color: Colors.white, + boxShadow: [ + new BoxShadow( + color: Colors.grey.shade300, + blurRadius: 8.0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + IconButton( + icon: Image.asset( + "lib/assets/icon/timeline.png", + height: 22.0, + width: 22.0, + ), + onPressed: () {}, + ), + Text( + "Priority Tasks", + style: textSmallStyleGreySS(), + ), + ], + ), + IconButton( + icon: Image.asset( + "lib/assets/icon/arrow.png", + height: 22.0, + width: 22.0, + ), + onPressed: () {}, + ), + ], + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - IconButton(icon: Image.asset("lib/assets/icon/completed.png", height: 22.0, width: 22.0, color: Colors.black,)), - Text("Task List", style: textSmallStyleGreySS(),), - ], - ), - IconButton(icon: Image.asset("lib/assets/icon/arrow.png", height: 22.0, width: 22.0,)), - ], + ), + InkWell( + onTap: () { + Navigator.of(context).pushNamed(TaskList.tag); + }, + child: Container( + height: 70.0, + width: screenHeight(context), + padding: EdgeInsets.all(8.0), + margin: EdgeInsets.only(bottom: 14.0), + decoration: new BoxDecoration( + color: Colors.white, + boxShadow: [ + new BoxShadow( + color: Colors.grey.shade300, + blurRadius: 8.0, + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + IconButton( + icon: Image.asset( + "lib/assets/icon/completed.png", + height: 22.0, + width: 22.0, + color: Colors.black, + ), + onPressed: () {}, + ), + Text( + "Task List", + style: textSmallStyleGreySS(), + ), + ], + ), + IconButton( + icon: Image.asset( + "lib/assets/icon/arrow.png", + height: 22.0, + width: 22.0, + ), + onPressed: () {}, + ), + ], + ), ), ), - ), // InkWell( // onTap: (){ // Navigator.of(context).pushNamed(ContactUs.tag); @@ -371,8 +458,7 @@ class _ProfileState extends State { // ), // ), // ), - ], - ) - ); + ], + )); } } diff --git a/lib/screens/settings/settings.dart b/lib/screens/settings/settings.dart index 44a6f5f..77f90fb 100644 --- a/lib/screens/settings/settings.dart +++ b/lib/screens/settings/settings.dart @@ -1,11 +1,11 @@ import 'package:flutter/material.dart'; import 'package:todo_open/screens/auth/reset_password.dart'; -import 'package:todo_open/style/style.dart' as prefix0; +//import 'package:todo_open/style/style.dart' as prefix0; import '../../style/style.dart'; import '../../screens/home/drawer.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import '../../screens/profile/profile.dart'; -import '../../screens/settings/contact_us.dart'; +// import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +// import '../../screens/profile/profile.dart'; +// import '../../screens/settings/contact_us.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:firebase_auth/firebase_auth.dart'; @@ -43,7 +43,7 @@ class _SettingsState extends State { loginType = prefs.getString('loginType'); }); print("logintype ...................$loginType"); - if(loginType == 'fb'){ + if (loginType == 'fb') { setState(() { fbUser = prefs.getString('fbUser'); fbEmail = prefs.getString('fbEmail'); @@ -51,13 +51,13 @@ class _SettingsState extends State { fbProfile = prefs.getString('fbProfile'); }); print('fb user $fbUser $fbProfile, $fbEmail, $fbId'); - }else if(loginType == 'tw'){ + } else if (loginType == 'tw') { setState(() { twUser = prefs.getString('twUser'); twId = prefs.getString('twId'); }); print('twuser $twUser $twId'); - }else if(loginType == 'fs') { + } else if (loginType == 'fs') { FirebaseUser userProfile = await FirebaseAuth.instance.currentUser(); if (userProfile != null) { @@ -72,8 +72,6 @@ class _SettingsState extends State { } } - - @override Widget build(BuildContext context) { return Scaffold( @@ -81,7 +79,10 @@ class _SettingsState extends State { drawer: DrawerList(), appBar: AppBar( elevation: 0.0, - title: Text("Settings", style: subBoldTitleWhite(),), + title: Text( + "Settings", + style: subBoldTitleWhite(), + ), iconTheme: IconThemeData(color: Colors.white), ), body: ListView( @@ -105,10 +106,26 @@ class _SettingsState extends State { children: [ CircleAvatar( backgroundColor: primary.withOpacity(0.4), - child: photoUrl != null ? ClipOval(child: Image.network(photoUrl, width: 100, height: 100, fit: BoxFit.cover,)): - loginType == 'fb' ? - ClipOval(child: Image.network(fbProfile, width: 100, height: 100, fit: BoxFit.cover,)) : - Image.asset("lib/assets/icon/user.png", color: Colors.white,), + child: photoUrl != null + ? ClipOval( + child: Image.network( + photoUrl, + width: 100, + height: 100, + fit: BoxFit.cover, + )) + : loginType == 'fb' + ? ClipOval( + child: Image.network( + fbProfile, + width: 100, + height: 100, + fit: BoxFit.cover, + )) + : Image.asset( + "lib/assets/icon/user.png", + color: Colors.white, + ), ), Flexible( child: Padding( @@ -117,12 +134,31 @@ class _SettingsState extends State { mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - loginType == 'fs' ? Text('$userName', style: textStyleOrangeSS(),) : - loginType == 'fb' ? Text('$fbUser', style: textStyleOrangeSS(),) : - Text('$twUser', style: textStyleOrangeSS(),), - loginType == 'fs' ? Text('$email', style: smallBoldDescription(),) : + loginType == 'fs' + ? Text( + '$userName', + style: textStyleOrangeSS(), + ) + : loginType == 'fb' + ? Text( + '$fbUser', + style: textStyleOrangeSS(), + ) + : Text( + '$twUser', + style: textStyleOrangeSS(), + ), + loginType == 'fs' + ? Text( + '$email', + style: smallBoldDescription(), + ) + : // loginType == 'fb' && fbEmail != null ? Text('$fbEmail', style: smallBoldDescription(),) : - Text('', style: smallBoldDescription(),), + Text( + '', + style: smallBoldDescription(), + ), ], ), ), @@ -131,43 +167,53 @@ class _SettingsState extends State { ), ), Container( - height: 70.0, - width: screenHeight(context), - padding: EdgeInsets.all(8.0), - margin: EdgeInsets.only(bottom: 14.0), - decoration: new BoxDecoration( - color: Colors.white, - boxShadow: [ - new BoxShadow( - color: Colors.grey.shade300, - blurRadius: 8.0, - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - IconButton(icon: Image.asset("lib/assets/icon/notification.png", height: 22.0, width: 22.0, color: Colors.black,)), - Text("Push Notifications", style: textSmallStyleGreySS(),), - ], - ), - Container( - width: screenWidth(context)*0.3, - child: SwitchListTile( - value: _value, - onChanged: (bool value) { - onChanged(value); - }, - activeColor: primary, + height: 70.0, + width: screenHeight(context), + padding: EdgeInsets.all(8.0), + margin: EdgeInsets.only(bottom: 14.0), + decoration: new BoxDecoration( + color: Colors.white, + boxShadow: [ + new BoxShadow( + color: Colors.grey.shade300, + blurRadius: 8.0, ), - ), - ], - ) - ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + IconButton( + icon: Image.asset( + "lib/assets/icon/notification.png", + height: 22.0, + width: 22.0, + color: Colors.black, + ), + onPressed: () {}, + ), + Text( + "Push Notifications", + style: textSmallStyleGreySS(), + ), + ], + ), + Container( + width: screenWidth(context) * 0.3, + child: SwitchListTile( + value: _value, + onChanged: (bool value) { + onChanged(value); + }, + activeColor: primary, + ), + ), + ], + )), InkWell( - onTap: (){ + onTap: () { Navigator.of(context).pushNamed(ResetPassword.tag); }, child: Container( @@ -189,17 +235,34 @@ class _SettingsState extends State { children: [ Row( children: [ - IconButton(icon: Image.asset("lib/assets/icon/completed.png", height: 22.0, width: 22.0, color: Colors.black,)), - Text("Reset Password", style: textSmallStyleGreySS(),), + IconButton( + icon: Image.asset( + "lib/assets/icon/completed.png", + height: 22.0, + width: 22.0, + color: Colors.black, + ), + onPressed: () {}, + ), + Text( + "Reset Password", + style: textSmallStyleGreySS(), + ), ], ), - IconButton(icon: Image.asset("lib/assets/icon/arrow.png", height: 22.0, width: 22.0,)), + IconButton( + icon: Image.asset( + "lib/assets/icon/arrow.png", + height: 22.0, + width: 22.0, + ), + onPressed: () {}, + ), ], ), ), ), ], - ) - ); + )); } } diff --git a/lib/widgets/taskCard.dart b/lib/widgets/taskCard.dart index b6b7351..5180b7e 100644 --- a/lib/widgets/taskCard.dart +++ b/lib/widgets/taskCard.dart @@ -4,27 +4,31 @@ class CategoryButton extends StatefulWidget { final String title; final Color color; final bool selected; - CategoryButton({Key key, this.title, this.color, this.selected }) : super(key: key); + CategoryButton({Key key, this.title, this.color, this.selected}) + : super(key: key); @override _CategoryButtonState createState() => _CategoryButtonState(); } class _CategoryButtonState extends State { - @override Widget build(BuildContext context) { return Container( // margin: EdgeInsets.symmetric(horizontal: 12.0), child: RaisedButton( - child: new Text(widget.title, style: TextStyle( - fontWeight: FontWeight.w400, - fontSize: 14.0, - color: widget.selected ? Colors.white : Colors.black87, - letterSpacing: 1.0, - fontFamily: 'OpenSansSemiBold', - ),), + child: new Text( + widget.title, + style: TextStyle( + fontWeight: FontWeight.w400, + fontSize: 14.0, + color: widget.selected ? Colors.white : Colors.black87, + letterSpacing: 1.0, + fontFamily: 'OpenSansSemiBold', + ), + ), elevation: 0.0, color: widget.selected ? widget.color : Colors.grey.shade50, + onPressed: () {}, ), ); } diff --git a/pubspec.lock b/pubspec.lock index 64af9d0..a4c63f5 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,35 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.3.0" + version: "2.5.0-nullsafety.1" boolean_selector: dependency: transitive description: name: boolean_selector url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "2.1.0-nullsafety.1" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.3" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.1.2" + version: "1.2.0-nullsafety.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0-nullsafety.1" cloud_firestore: dependency: "direct dev" description: @@ -35,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.11" + version: "1.15.0-nullsafety.3" cupertino_icons: dependency: "direct main" description: @@ -43,6 +57,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0-nullsafety.1" file_picker: dependency: "direct dev" description: @@ -171,21 +192,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.5" + version: "0.12.10-nullsafety.1" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.1.7" + version: "1.3.0-nullsafety.3" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.6.4" + version: "1.8.0-nullsafety.1" pedantic: dependency: transitive description: @@ -200,13 +221,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.1" - quiver: - dependency: transitive - description: - name: quiver - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.5" scheduled_notifications: dependency: "direct dev" description: @@ -239,56 +253,56 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.5.5" + version: "1.8.0-nullsafety.2" stack_trace: dependency: transitive description: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.3" + version: "1.10.0-nullsafety.1" stream_channel: dependency: transitive description: name: stream_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0-nullsafety.1" string_scanner: dependency: transitive description: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.0.5" + version: "1.1.0-nullsafety.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0-nullsafety.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.5" + version: "0.2.19-nullsafety.2" typed_data: dependency: transitive description: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.1.6" + version: "1.3.0-nullsafety.3" vector_math: dependency: transitive description: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.1.0-nullsafety.3" sdks: - dart: ">=2.2.2 <3.0.0" + dart: ">=2.10.0-110 <2.11.0" flutter: ">=1.5.0 <2.0.0" diff --git a/test/widget_test.dart b/test/widget_test.dart index cb160ce..1690193 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -4,26 +4,27 @@ // find child widgets in the widget tree, read text, and verify that the values of widget properties // are correct. -//import 'package:flutter/material.dart'; -//import 'package:flutter_test/flutter_test.dart'; -// +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + //import 'package:todo_app/main.dart'; -// -//void main() { -// testWidgets('Counter increments smoke test', (WidgetTester tester) async { -// // Build our app and trigger a frame. -// await tester.pumpWidget(new MyApp()); -// -// // Verify that our counter starts at 0. -// expect(find.text('0'), findsOneWidget); -// expect(find.text('1'), findsNothing); -// -// // Tap the '+' icon and trigger a frame. -// await tester.tap(find.byIcon(Icons.add)); -// await tester.pump(); -// -// // Verify that our counter has incremented. -// expect(find.text('0'), findsNothing); -// expect(find.text('1'), findsOneWidget); -// }); -//} +import 'package:todo_open/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(new MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +}