Skip to content

Commit

Permalink
step-31
Browse files Browse the repository at this point in the history
  • Loading branch information
vandadnp committed Jan 22, 2022
1 parent e99ffff commit 0a66337
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 215 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
lib/firebase_options.dart
# Miscellaneous
*.class
*.log
Expand All @@ -8,7 +9,7 @@
.buildlog/
.history
.svn/

key.properties
# IntelliJ related
*.iml
*.ipr
Expand Down
18 changes: 15 additions & 3 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
}
}
Expand Down
60 changes: 0 additions & 60 deletions lib/firebase_options.dart

This file was deleted.

62 changes: 32 additions & 30 deletions lib/views/forgot_password_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,39 @@ class _ForgotPasswordViewState extends State<ForgotPasswordView> {
),
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<AuthBloc>()
.add(AuthEventForgotPassword(email: email));
},
child: const Text('Send me password reset link'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventLogOut(),
);
},
child: const Text('Back to login page'),
),
],
TextButton(
onPressed: () {
final email = _controller.text;
context
.read<AuthBloc>()
.add(AuthEventForgotPassword(email: email));
},
child: const Text('Send me password reset link'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventLogOut(),
);
},
child: const Text('Back to login page'),
),
],
),
),
),
),
Expand Down
102 changes: 52 additions & 50 deletions lib/views/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,58 +56,60 @@ class _LoginViewState extends State<LoginView> {
),
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<AuthBloc>().add(
AuthEventLogIn(
email,
password,
),
);
},
child: const Text('Login'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventForgotPassword(),
);
},
child: const Text('I forgot my password'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventShouldRegister(),
);
},
child: const Text('Not registered yet? Register here!'),
)
],
TextButton(
onPressed: () async {
final email = _email.text;
final password = _password.text;
context.read<AuthBloc>().add(
AuthEventLogIn(
email,
password,
),
);
},
child: const Text('Login'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventForgotPassword(),
);
},
child: const Text('I forgot my password'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventShouldRegister(),
);
},
child: const Text('Not registered yet? Register here!'),
)
],
),
),
),
),
Expand Down
98 changes: 50 additions & 48 deletions lib/views/register_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,57 +55,59 @@ class _RegisterViewState extends State<RegisterView> {
),
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<AuthBloc>().add(
AuthEventRegister(
email,
password,
),
);
},
child: const Text('Register'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().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<AuthBloc>().add(
AuthEventRegister(
email,
password,
),
);
},
child: const Text('Register'),
),
TextButton(
onPressed: () {
context.read<AuthBloc>().add(
const AuthEventLogOut(),
);
},
child: const Text('Already registered? Login here!'),
),
],
),
),
),
],
],
),
),
),
),
Expand Down
Loading

0 comments on commit 0a66337

Please sign in to comment.