Skip to content

Instantly share code, notes, and snippets.

@rpsnaik
Created October 8, 2019 19:11
Show Gist options
  • Save rpsnaik/41407406967a529b3201e0067796496f to your computer and use it in GitHub Desktop.
Save rpsnaik/41407406967a529b3201e0067796496f to your computer and use it in GitHub Desktop.
class AuthUI extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset('./images/spotify_logo_banner_black.png', height: MediaQuery.of(context).size.height*0.12,),
Text("Millions of songs. \n Free on Spotify.", style: TextStyle(
fontFamily: 'Proxima Nova',
fontSize: 30.0,
fontWeight: FontWeight.w900,
),),
Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text("Continue with", style: TextStyle(
fontWeight: FontWeight.w900,
fontSize: 18.0,
),),
SizedBox(
height: 10.0,
),
MaterialButton(
onPressed: (){
Navigator.push(context, MaterialPageRoute(builder: (context)=>SignupOrLogin()));
},
child: Container(
padding: EdgeInsets.all(10.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(100.0),
),
margin: EdgeInsets.fromLTRB(50.0, 0.0, 50.0, 0.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(Icons.mail_outline, color: Colors.black,),
SizedBox(
width: 5.0,
),
Text("EMAIL", style: TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 16.0,
),),
],
),
)
)
],
),
),
],
),
);
}
}
class SignupOrLogin extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Color.fromRGBO(255, 0, 254, 100),
Color.fromRGBO(51, 51, 153, 100),
],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
)
),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
elevation: 0.0,
backgroundColor: Colors.transparent,
),
body: Container(
alignment: Alignment.center,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Text("Email", style: TextStyle(
fontSize: 30.0,
fontFamily: 'Proxima Nova Bold',
),),
SizedBox(
height: 20.0,
),
MaterialButton(
onPressed: (){
Navigator.push(context, MaterialPageRoute(builder: (context)=>Material(
child: MultiProvider(
providers: [
ChangeNotifierProvider(builder: (_)=>CreateUserAccount(),),
ChangeNotifierProvider(builder: (_)=>ShowCustomAlertDialog(),),
],
child: CreateAccount(),
),
)));
},
child: Container(
alignment: Alignment.center,
width: 300.0,
padding: EdgeInsets.all(12.0),
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 2),
borderRadius: BorderRadius.circular(100.0),
),
child: Text("SIGN UP FREE", style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.0,
),),
),
),
Container(
margin: EdgeInsets.all(20.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
alignment: Alignment.center,
color: Colors.grey,
height: 2.0,
width: MediaQuery.of(context).size.width*0.35,
),
Text("OR", style: TextStyle(
color: Colors.grey,
),),
Container(
alignment: Alignment.center,
color: Colors.grey,
height: 2.0,
width: MediaQuery.of(context).size.width*0.35,
)
],
),
),
MaterialButton(
onPressed: (){
Navigator.push(context, MaterialPageRoute(builder: (context)=>Material(
child: MultiProvider(
providers: [
ChangeNotifierProvider(builder: (_)=>LoginLogic(),),
ChangeNotifierProvider(builder: (_)=>ShowCustomAlertDialog(),),
],
child: LoginPage(),
),
)));
},
child: Container(
width: 300.0,
padding: EdgeInsets.all(12.0),
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey, width: 2),
borderRadius: BorderRadius.circular(100.0),
),
child: Text("LOG IN", style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14.0,
),),
),
),
],
),
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment