Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modified button #84

Merged
merged 1 commit into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Modified button
  • Loading branch information
Sayam06 committed Oct 1, 2021
commit 14503f40c9d5358d43cf1ee4bbe2faa30fc2a0df
5 changes: 1 addition & 4 deletions lib/screens/auth/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,7 @@ class _LoginScreenState extends State<LoginScreen> {
),
Text(
'Register',
style: GoogleFonts.muli(
color: const Color.fromRGBO(224, 39, 20, 1),
fontSize: 18,
fontWeight: FontWeight.w600),
style: GoogleFonts.muli(color: const Color.fromRGBO(224, 39, 20, 1), fontSize: 18, fontWeight: FontWeight.w600),
),
],
),
Expand Down
16 changes: 4 additions & 12 deletions lib/screens/initial_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ class _InitialScreenState extends State<InitialScreen> {
),
Text(
'Explr',
style: GoogleFonts.muli(
color: blackButton,
fontSize: 30,
fontWeight: FontWeight.w600),
style: GoogleFonts.muli(color: blackButton, fontSize: 30, fontWeight: FontWeight.w600),
),
const SizedBox(
height: 25,
Expand All @@ -69,10 +66,7 @@ class _InitialScreenState extends State<InitialScreen> {
key: formKey,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: const <Widget>[
EmailTextField(),
PasswordTextField()
],
children: const <Widget>[EmailTextField(), PasswordTextField()],
),
),
),
Expand All @@ -83,8 +77,7 @@ class _InitialScreenState extends State<InitialScreen> {
name: 'Sign in',
color: blackButton,
myFunction: () async {
final bool isFormValid =
formKey.currentState.validate();
final bool isFormValid = formKey.currentState.validate();
if (!isFormValid)
return;
else
Expand Down Expand Up @@ -169,8 +162,7 @@ class _InitialScreenState extends State<InitialScreen> {
width: 250,
child: ElevatedButton.icon(
style: ElevatedButton.styleFrom(
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
// primary: Color(0xFF246BFD),
primary: blackButton,
),
Expand Down
128 changes: 65 additions & 63 deletions lib/widgets/auth/social_media_handles.dart
Original file line number Diff line number Diff line change
@@ -1,75 +1,77 @@
import 'package:books_app/constants/routes.dart';
import 'package:books_app/services/auth.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:flutter_signin_button/flutter_signin_button.dart';

class SocialMediaHandles extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SizedBox(
height: 44,
width: 250,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SizedBox(
height: 44,
width: 110,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
side: const BorderSide(color: Colors.black87),
),
onPressed: () async {
print('Google Sign in presws');
try {
final dynamic res =
await FirebaseAuthService().signInWithGoogle();
return Container(
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(25)), color: Colors.white),
child: SizedBox(
height: 44,
width: 250,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
SizedBox(
height: 44,
width: 250,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
side: const BorderSide(color: Colors.black87),
),
onPressed: () async {
print('Google Sign in presws');
try {
final dynamic res = await FirebaseAuthService().signInWithGoogle();

print('This is the google response');
print(res);
if (res != null) {

print(res.toString());
Navigator.pushNamed(context, Routes.HOME);
}
} catch (e) {
print(e.toString());
}
},
child: const Icon(
FontAwesomeIcons.google,
color: Colors.red,
),
print('This is the google response');
print(res);
if (res != null) {
print(res.toString());
Navigator.pushNamed(context, Routes.HOME);
}
} catch (e) {
print(e.toString());
}
},
child: Container(
margin: EdgeInsets.only(left: 15),
child: SignInButton(
Buttons.Google,
),
)),
),
),
SizedBox(
height: 44,
width: 110,
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50),
),
side: const BorderSide(color: Colors.black87),
),
onPressed: () async {
FirebaseAuthService()
.signInWithFacebook()
.whenComplete(() {

Navigator.pushNamed(context, Routes.HOME);
});
},
child: const Icon(
FontAwesomeIcons.facebook,
color: Colors.blue,
),
),
),
],
// SizedBox(
// height: 44,
// width: 110,
// child: OutlinedButton(
// style: OutlinedButton.styleFrom(
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(50),
// ),
// side: const BorderSide(color: Colors.black87),
// ),
// onPressed: () async {
// FirebaseAuthService()
// .signInWithFacebook()
// .whenComplete(() {

// Navigator.pushNamed(context, Routes.HOME);
// });
// },
// child: const Icon(
// FontAwesomeIcons.facebook,
// color: Colors.blue,
// ),
// ),
// ),
],
),
),
);
}
Expand Down
9 changes: 8 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "4.2.1"
flutter_signin_button:
dependency: "direct main"
description:
name: flutter_signin_button
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -260,7 +267,7 @@ packages:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "8.12.0"
version: "9.1.0"
geocoder:
dependency: "direct main"
description:
Expand Down
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ environment:
sdk: ">=2.7.0 <3.0.0"

dependencies:
font_awesome_flutter: ^8.11.0
font_awesome_flutter: ^9.0.0
flutter:
sdk: flutter

Expand Down Expand Up @@ -53,6 +53,7 @@ dependencies:
pinput: ^1.2.0
chips_choice: ^2.0.1
quotes: ^0.0.2
flutter_signin_button: ^2.0.0
# geoflutterfire: ^2.2.2
#flutter_map also includes latlng
dev_dependencies:
Expand Down