Skip to content

Commit

Permalink
Merge pull request #21 from Kounslr/development
Browse files Browse the repository at this point in the history
Bug fixes
  • Loading branch information
Carlton Aikins authored Aug 22, 2021
2 parents 70a9f44 + fe3c03e commit 42b18db
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 171 deletions.
60 changes: 30 additions & 30 deletions ios/Runner/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,35 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>91108883702-ug83g83thr14k8skkbn25tovbn9mni2s.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.91108883702-ug83g83thr14k8skkbn25tovbn9mni2s</string>
<key>ANDROID_CLIENT_ID</key>
<string>91108883702-73vru76uudnr4jk8smufl1p3hh8djacg.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyABVvlF-bhW9xx62h2HTA4ANnT2rANH35Q</string>
<key>GCM_SENDER_ID</key>
<string>91108883702</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.kounslr.mobileApp</string>
<key>PROJECT_ID</key>
<string>kounslr-3c7f3</string>
<key>STORAGE_BUCKET</key>
<string>kounslr-3c7f3.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:91108883702:ios:a583601926ee4c562740d7</string>
<key>CLIENT_ID</key>
<string>91108883702-fs5rhi4tgu2hiq8ud1ld7ajtlu61eup4.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.91108883702-fs5rhi4tgu2hiq8ud1ld7ajtlu61eup4</string>
<key>ANDROID_CLIENT_ID</key>
<string>91108883702-73vru76uudnr4jk8smufl1p3hh8djacg.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyABVvlF-bhW9xx62h2HTA4ANnT2rANH35Q</string>
<key>GCM_SENDER_ID</key>
<string>91108883702</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>com.kounslr.app</string>
<key>PROJECT_ID</key>
<string>kounslr-3c7f3</string>
<key>STORAGE_BUCKET</key>
<string>kounslr-3c7f3.appspot.com</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:91108883702:ios:6cb52b913b4726e52740d7</string>
</dict>
</plist>
11 changes: 11 additions & 0 deletions lib/src/ui/styled_components/journal_entry_tag_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ class _JournalEntryTagCardState extends State<JournalEntryTagCard> {
},
child: Container(
padding: MediaQuery.of(context).viewInsets,
decoration: ShapeDecoration(
color: MediaQuery.of(context).platformBrightness ==
Brightness.dark
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).canvasColor,
shape: SquircleBorder(
radius: BorderRadius.circular(50),
),
),
child: FractionallySizedBox(
heightFactor: 0.45,
child: SingleChildScrollView(
Expand All @@ -108,6 +117,8 @@ class _JournalEntryTagCardState extends State<JournalEntryTagCard> {
'Rename Tag',
style: Theme.of(context).textTheme.headline5,
),
const SizedBox(height: 7.5),
const Divider(),
const SizedBox(height: 20),
Container(
margin: const EdgeInsets.symmetric(horizontal: 17),
Expand Down
198 changes: 106 additions & 92 deletions lib/src/ui/styled_components/sign_in_with_studentvue_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:canton_design_system/canton_design_system.dart';
import 'package:flutter_phoenix/flutter_phoenix.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:kounslr/src/ui/providers/authentication_providers/authentication_service_provider.dart';
import 'package:kounslr/src/ui/styled_components/sign_out_button.dart';

class SignInWithStudentVueCard extends StatefulWidget {
const SignInWithStudentVueCard({Key? key}) : super(key: key);
Expand Down Expand Up @@ -43,20 +44,7 @@ class _SignInWithStudentVueCardState extends State<SignInWithStudentVueCard> {
onPressed: () => _showStudentVueSignInBottomSheet(),
),
const SizedBox(height: 20),
GestureDetector(
onTap: () {
context.read(authenticationServiceProvider).signOut();
},
child: Container(
padding: const EdgeInsets.all(8.0),
child: Text(
'Sign out',
style: Theme.of(context).textTheme.headline6?.copyWith(
color: Theme.of(context).primaryColor,
),
),
),
)
SignOutButton(),
],
);
}
Expand All @@ -75,86 +63,112 @@ class _SignInWithStudentVueCardState extends State<SignInWithStudentVueCard> {
builder: (context, setState) {
return Consumer(
builder: (context, watch, child) {
return Padding(
padding:
const EdgeInsets.symmetric(vertical: 15, horizontal: 27),
child: FractionallySizedBox(
heightFactor: 0.45,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 5,
width: 50,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Theme.of(context).colorScheme.secondary,
),
),
const SizedBox(height: 15),
Text(
'Sign in to StudentVue',
style: Theme.of(context).textTheme.headline5,
),
const SizedBox(height: 20),
CantonTextInput(
isTextFormField: true,
obscureText: false,
hintText: 'Email',
textInputType: TextInputType.emailAddress,
controller: _emailController,
),
const SizedBox(height: 15),
CantonTextInput(
isTextFormField: true,
obscureText: true,
hintText: 'Password',
textInputType: TextInputType.visiblePassword,
controller: _passwordController,
),
const SizedBox(height: 15),
CantonPrimaryButton(
onPressed: () async {
await watch(authenticationServiceProvider)
.studentVueSignIn(
email: _emailController.text,
password: _passwordController.text,
)
.then((value) {
if (value != 'success') {
setState(() {
hasResult = false;
});
} else {
hasResult = true;
}
return GestureDetector(
onTap: () {
CantonMethods.defocusTextfield(context);
},
child: Container(
decoration: ShapeDecoration(
color: MediaQuery.of(context).platformBrightness ==
Brightness.dark
? Theme.of(context).colorScheme.onSecondary
: Theme.of(context).canvasColor,
shape: SquircleBorder(
radius: BorderRadius.circular(50),
),
),
padding: MediaQuery.of(context).viewInsets,
child: FractionallySizedBox(
heightFactor: 0.45,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Container(
height: 5,
width: 50,
margin: const EdgeInsets.symmetric(vertical: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Theme.of(context).colorScheme.secondary,
),
),
Text(
'Sign in to StudentVue',
style: Theme.of(context).textTheme.headline5,
),
const SizedBox(height: 7.5),
const Divider(),
const SizedBox(height: 20),
Container(
margin:
const EdgeInsets.symmetric(horizontal: 17),
child: CantonTextInput(
isTextFormField: true,
obscureText: false,
hintText: 'Email',
textInputType: TextInputType.emailAddress,
controller: _emailController,
),
),
const SizedBox(height: 15),
Container(
margin:
const EdgeInsets.symmetric(horizontal: 17),
child: CantonTextInput(
isTextFormField: true,
obscureText: true,
hintText: 'Password',
textInputType: TextInputType.visiblePassword,
controller: _passwordController,
),
),
const SizedBox(height: 15),
CantonPrimaryButton(
onPressed: () async {
await watch(authenticationServiceProvider)
.studentVueSignIn(
email: _emailController.text,
password: _passwordController.text,
)
.then((value) {
if (value != 'success') {
setState(() {
hasResult = false;
});
} else {
hasResult = true;
}

if (hasResult) {
Phoenix.rebirth(context);
}
});
},
buttonText: 'Sign in',
textColor: CantonColors.white,
containerWidth: MediaQuery.of(context).size.width / 4,
containerHeight: 47,
padding: const EdgeInsets.all(10),
if (hasResult) {
Phoenix.rebirth(context);
}
});
},
buttonText: 'Sign in',
containerWidth:
MediaQuery.of(context).size.width / 4,
containerHeight: 47,
padding: const EdgeInsets.all(10),
),
const SizedBox(height: 20),
hasResult == false
? Text(
'Incorrect email or password',
style: Theme.of(context)
.textTheme
.bodyText1
?.copyWith(
color: Theme.of(context)
.colorScheme
.error,
),
)
: Container(),
],
),
const SizedBox(height: 20),
hasResult == false
? Text(
'Incorrect email or password',
style: Theme.of(context)
.textTheme
.bodyText1
?.copyWith(
color:
Theme.of(context).colorScheme.error,
),
)
: Container(),
],
),
),
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,15 @@ class SignOutButton extends StatelessWidget {

@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
return CantonPrimaryButton(
buttonText: 'Sign Out',
textColor: Theme.of(context).primaryColor,
color: CantonColors.transparent,
alignment: MainAxisAlignment.center,
containerWidth: MediaQuery.of(context).size.width / 2 - 5,
onPressed: () {
context.read(authenticationServiceProvider).signOut();
Navigator.of(context).pop();
},
child: Container(
padding: const EdgeInsets.all(8.0),
child: Text(
'Sign Out',
style: Theme.of(context).textTheme.headline6?.copyWith(
color: Theme.of(context).primaryColor,
),
),
),
);
}
}
4 changes: 1 addition & 3 deletions lib/src/ui/styled_components/something_went_wrong.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ class SomethingWentWrong extends StatelessWidget {
const SizedBox(height: 20),
CantonPrimaryButton(
buttonText: 'Sign out',
textColor: CantonColors.white,
color: Theme.of(context).primaryColor,
containerWidth: MediaQuery.of(context).size.width / 2 - 34,
containerWidth: MediaQuery.of(context).size.width / 2,
onPressed: () {
context.read(authenticationServiceProvider).signOut();
},
Expand Down
1 change: 0 additions & 1 deletion lib/src/ui/views/authentication_views/sign_in_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class _SignInViewState extends State<SignInView> {
return CantonPrimaryButton(
buttonText: 'Sign In',
color: Theme.of(context).primaryColor,
textColor: CantonColors.white,
onPressed: () async {
var res = await context
.read(authenticationServiceProvider)
Expand Down
1 change: 0 additions & 1 deletion lib/src/ui/views/authentication_views/sign_up_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ class _SignUpViewState extends State<SignUpView> {
CantonPrimaryButton(
buttonText: 'Sign Up',
color: Theme.of(context).primaryColor,
textColor: CantonColors.white,
onPressed: () async {
await context.read(authenticationServiceProvider).signUp(
email: _emailController.text.trim(),
Expand Down
Loading

0 comments on commit 42b18db

Please sign in to comment.