diff --git a/.gitignore b/.gitignore index 0fa6b67..d577079 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +lib/firebase_options.dart # Miscellaneous *.class *.log @@ -8,7 +9,7 @@ .buildlog/ .history .svn/ - +key.properties # IntelliJ related *.iml *.ipr diff --git a/android/app/build.gradle b/android/app/build.gradle index f260d70..09dac3d 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -25,6 +25,12 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +def keystoreProperties = new Properties() +def keystorePropertiesFile = rootProject.file('key.properties') +if (keystorePropertiesFile.exists()) { + keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) +} + android { compileSdkVersion flutter.compileSdkVersion @@ -51,11 +57,17 @@ android { multiDexEnabled true } + signingConfigs { + release { + keyAlias keystoreProperties['keyAlias'] + keyPassword keystoreProperties['keyPassword'] + storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null + storePassword keystoreProperties['storePassword'] + } + } buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug + signingConfig signingConfigs.release } } } diff --git a/lib/firebase_options.dart b/lib/firebase_options.dart deleted file mode 100644 index 49e38b3..0000000 --- a/lib/firebase_options.dart +++ /dev/null @@ -1,60 +0,0 @@ -// File generated by FlutterFire CLI. -// ignore_for_file: lines_longer_than_80_chars -import 'package:firebase_core/firebase_core.dart' show FirebaseOptions; -import 'package:flutter/foundation.dart' - show defaultTargetPlatform, kIsWeb, TargetPlatform; - -/// Default [FirebaseOptions] for use with your Firebase apps. -/// -/// Example: -/// ```dart -/// import 'firebase_options.dart'; -/// // ... -/// await Firebase.initializeApp( -/// options: DefaultFirebaseOptions.currentPlatform, -/// ); -/// ``` -class DefaultFirebaseOptions { - static FirebaseOptions get currentPlatform { - if (kIsWeb) { - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for web - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - } - // ignore: missing_enum_constant_in_switch - switch (defaultTargetPlatform) { - case TargetPlatform.android: - return android; - case TargetPlatform.iOS: - return ios; - case TargetPlatform.macOS: - throw UnsupportedError( - 'DefaultFirebaseOptions have not been configured for macos - ' - 'you can reconfigure this by running the FlutterFire CLI again.', - ); - } - - throw UnsupportedError( - 'DefaultFirebaseOptions are not supported for this platform.', - ); - } - - static const FirebaseOptions android = FirebaseOptions( - apiKey: 'AIzaSyBbOlhxv5SV3YMjUDovhaT93YEJ2hfqixY', - appId: '1:877208178211:android:05e53b3ec20b460dd92b96', - messagingSenderId: '877208178211', - projectId: 'mynotes-flutter-project', - storageBucket: 'mynotes-flutter-project.appspot.com', - ); - - static const FirebaseOptions ios = FirebaseOptions( - apiKey: 'AIzaSyA4nrF7NuKhjCumrV2DBV67pXUCMdOgEqw', - appId: '1:877208178211:ios:1c169a82130d69a9d92b96', - messagingSenderId: '877208178211', - projectId: 'mynotes-flutter-project', - storageBucket: 'mynotes-flutter-project.appspot.com', - iosClientId: '877208178211-pkk6a4dfdsmh1tfm4ffhdss9lmmjl0mc.apps.googleusercontent.com', - iosBundleId: 'se.pixolity.mynotes', - ); -} diff --git a/lib/views/forgot_password_view.dart b/lib/views/forgot_password_view.dart index 40b53db..72e2f3e 100644 --- a/lib/views/forgot_password_view.dart +++ b/lib/views/forgot_password_view.dart @@ -49,37 +49,39 @@ class _ForgotPasswordViewState extends State { ), body: Padding( padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - const Text( - 'If you forgot your password, simply enter your email and we will send you a password reset link.'), - TextField( - keyboardType: TextInputType.emailAddress, - autocorrect: false, - autofocus: true, - controller: _controller, - decoration: const InputDecoration( - hintText: 'Your email address....', + child: SingleChildScrollView( + child: Column( + children: [ + const Text( + 'If you forgot your password, simply enter your email and we will send you a password reset link.'), + TextField( + keyboardType: TextInputType.emailAddress, + autocorrect: false, + autofocus: true, + controller: _controller, + decoration: const InputDecoration( + hintText: 'Your email address....', + ), ), - ), - TextButton( - onPressed: () { - final email = _controller.text; - context - .read() - .add(AuthEventForgotPassword(email: email)); - }, - child: const Text('Send me password reset link'), - ), - TextButton( - onPressed: () { - context.read().add( - const AuthEventLogOut(), - ); - }, - child: const Text('Back to login page'), - ), - ], + TextButton( + onPressed: () { + final email = _controller.text; + context + .read() + .add(AuthEventForgotPassword(email: email)); + }, + child: const Text('Send me password reset link'), + ), + TextButton( + onPressed: () { + context.read().add( + const AuthEventLogOut(), + ); + }, + child: const Text('Back to login page'), + ), + ], + ), ), ), ), diff --git a/lib/views/login_view.dart b/lib/views/login_view.dart index 43ec825..92c8119 100644 --- a/lib/views/login_view.dart +++ b/lib/views/login_view.dart @@ -56,58 +56,60 @@ class _LoginViewState extends State { ), body: Padding( padding: const EdgeInsets.all(16.0), - child: Column( - children: [ - const Text( - 'Please log in to your account in order to interact with and create notes!'), - TextField( - controller: _email, - enableSuggestions: false, - autocorrect: false, - keyboardType: TextInputType.emailAddress, - decoration: const InputDecoration( - hintText: 'Enter your email here', + child: SingleChildScrollView( + child: Column( + children: [ + const Text( + 'Please log in to your account in order to interact with and create notes!'), + TextField( + controller: _email, + enableSuggestions: false, + autocorrect: false, + keyboardType: TextInputType.emailAddress, + decoration: const InputDecoration( + hintText: 'Enter your email here', + ), ), - ), - TextField( - controller: _password, - obscureText: true, - enableSuggestions: false, - autocorrect: false, - decoration: const InputDecoration( - hintText: 'Enter your password here', + TextField( + controller: _password, + obscureText: true, + enableSuggestions: false, + autocorrect: false, + decoration: const InputDecoration( + hintText: 'Enter your password here', + ), ), - ), - TextButton( - onPressed: () async { - final email = _email.text; - final password = _password.text; - context.read().add( - AuthEventLogIn( - email, - password, - ), - ); - }, - child: const Text('Login'), - ), - TextButton( - onPressed: () { - context.read().add( - const AuthEventForgotPassword(), - ); - }, - child: const Text('I forgot my password'), - ), - TextButton( - onPressed: () { - context.read().add( - const AuthEventShouldRegister(), - ); - }, - child: const Text('Not registered yet? Register here!'), - ) - ], + TextButton( + onPressed: () async { + final email = _email.text; + final password = _password.text; + context.read().add( + AuthEventLogIn( + email, + password, + ), + ); + }, + child: const Text('Login'), + ), + TextButton( + onPressed: () { + context.read().add( + const AuthEventForgotPassword(), + ); + }, + child: const Text('I forgot my password'), + ), + TextButton( + onPressed: () { + context.read().add( + const AuthEventShouldRegister(), + ); + }, + child: const Text('Not registered yet? Register here!'), + ) + ], + ), ), ), ), diff --git a/lib/views/register_view.dart b/lib/views/register_view.dart index 4058af0..7e3dce5 100644 --- a/lib/views/register_view.dart +++ b/lib/views/register_view.dart @@ -55,57 +55,59 @@ class _RegisterViewState extends State { ), body: Padding( padding: const EdgeInsets.all(16.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const Text('Enter your email and password to see your notes!'), - TextField( - controller: _email, - enableSuggestions: false, - autocorrect: false, - autofocus: true, - keyboardType: TextInputType.emailAddress, - decoration: const InputDecoration( - hintText: 'Enter your email here', + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text('Enter your email and password to see your notes!'), + TextField( + controller: _email, + enableSuggestions: false, + autocorrect: false, + autofocus: true, + keyboardType: TextInputType.emailAddress, + decoration: const InputDecoration( + hintText: 'Enter your email here', + ), ), - ), - TextField( - controller: _password, - obscureText: true, - enableSuggestions: false, - autocorrect: false, - decoration: const InputDecoration( - hintText: 'Enter your password here', + TextField( + controller: _password, + obscureText: true, + enableSuggestions: false, + autocorrect: false, + decoration: const InputDecoration( + hintText: 'Enter your password here', + ), ), - ), - Center( - child: Column( - children: [ - TextButton( - onPressed: () async { - final email = _email.text; - final password = _password.text; - context.read().add( - AuthEventRegister( - email, - password, - ), - ); - }, - child: const Text('Register'), - ), - TextButton( - onPressed: () { - context.read().add( - const AuthEventLogOut(), - ); - }, - child: const Text('Already registered? Login here!'), - ), - ], + Center( + child: Column( + children: [ + TextButton( + onPressed: () async { + final email = _email.text; + final password = _password.text; + context.read().add( + AuthEventRegister( + email, + password, + ), + ); + }, + child: const Text('Register'), + ), + TextButton( + onPressed: () { + context.read().add( + const AuthEventLogOut(), + ); + }, + child: const Text('Already registered? Login here!'), + ), + ], + ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/views/verify_email_view.dart b/lib/views/verify_email_view.dart index d1f546a..f70e1ae 100644 --- a/lib/views/verify_email_view.dart +++ b/lib/views/verify_email_view.dart @@ -19,29 +19,31 @@ class _VerifyEmailViewState extends State { appBar: AppBar( title: const Text('Verify email'), ), - body: Column( - children: [ - const Text( - "We've sent you an email verification. Please open it to verify your account."), - const Text( - "If you haven't received a verification email yet, press the button below"), - TextButton( - onPressed: () { - context.read().add( - const AuthEventSendEmailVerification(), - ); - }, - child: const Text('Send email verification'), - ), - TextButton( - onPressed: () async { - context.read().add( - const AuthEventLogOut(), - ); - }, - child: const Text('Restart'), - ) - ], + body: SingleChildScrollView( + child: Column( + children: [ + const Text( + "We've sent you an email verification. Please open it to verify your account."), + const Text( + "If you haven't received a verification email yet, press the button below"), + TextButton( + onPressed: () { + context.read().add( + const AuthEventSendEmailVerification(), + ); + }, + child: const Text('Send email verification'), + ), + TextButton( + onPressed: () async { + context.read().add( + const AuthEventLogOut(), + ); + }, + child: const Text('Restart'), + ) + ], + ), ), ); }