diff --git a/lib/buttons/simple_round_icon_button.dart b/lib/buttons/simple_round_icon_button.dart index 535b9e3..0defce6 100644 --- a/lib/buttons/simple_round_icon_button.dart +++ b/lib/buttons/simple_round_icon_button.dart @@ -45,19 +45,29 @@ class SimpleRoundIconButton extends StatelessWidget { offset: Offset(-10.0, 0.0), child: new Container( padding: const EdgeInsets.all(5.0), - child: FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(28.0)), - splashColor: Colors.white, - color: Colors.white, + child: + // FlatButton( + // shape: new RoundedRectangleBorder( + // borderRadius: + // new BorderRadius.circular(28.0)), + // splashColor: Colors.white, + // color: Colors.white, + // child: Icon( + // icon.icon, + // color: iconColor == null + // ? backgroundColor + // : iconColor, + // ), + // onPressed: () => {}, + // ), + TextButton( + onPressed: () {}, child: Icon( icon.icon, color: iconColor == null ? backgroundColor : iconColor, ), - onPressed: () => {}, ), ), ) @@ -78,19 +88,39 @@ class SimpleRoundIconButton extends StatelessWidget { offset: Offset(10.0, 0.0), child: new Container( padding: const EdgeInsets.all(5.0), - child: FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(28.0)), - splashColor: Colors.white, - color: Colors.white, + child: + // FlatButton( + // shape: new RoundedRectangleBorder( + // borderRadius: + // new BorderRadius.circular(28.0)), + // splashColor: Colors.white, + // color: Colors.white, + // child: Icon( + // icon.icon, + // color: iconColor == null + // ? backgroundColor + // : iconColor, + // ), + // onPressed: () => {}, + // ), + TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: + new BorderRadius.circular(28.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.white), + ), + onPressed: () {}, child: Icon( icon.icon, color: iconColor == null ? backgroundColor : iconColor, ), - onPressed: () => {}, ), ), ) diff --git a/lib/buttons/simple_round_only_icon_button.dart b/lib/buttons/simple_round_only_icon_button.dart index 11e6dd3..21525d8 100644 --- a/lib/buttons/simple_round_only_icon_button.dart +++ b/lib/buttons/simple_round_only_icon_button.dart @@ -129,17 +129,33 @@ class SimpleRoundOnlyIconButton extends StatelessWidget { right: 5.0, top: 10.0, bottom: 10.0), - child: FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: - new BorderRadius.circular(28.0)), - splashColor: Colors.white, - color: Colors.white, - child: Icon( - icon!.icon, - color: this.iconColor, + child: + // FlatButton( + // shape: new RoundedRectangleBorder( + // borderRadius: + // new BorderRadius.circular(28.0)), + // splashColor: Colors.white, + // color: Colors.white, + // child: Icon( + // icon!.icon, + // color: this.iconColor, + // ), + // onPressed: () => {}, + // ), + TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: + new BorderRadius.circular(28.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.white), ), - onPressed: () => {}, + onPressed: () {}, + child: + Icon(icon!.icon, color: this.iconColor), ), ), ) diff --git a/lib/loaders/color_loader_3.dart b/lib/loaders/color_loader_3.dart index 88eb671..e654ad9 100644 --- a/lib/loaders/color_loader_3.dart +++ b/lib/loaders/color_loader_3.dart @@ -13,9 +13,9 @@ class ColorLoader3 extends StatefulWidget { class _ColorLoader3State extends State with SingleTickerProviderStateMixin { - late Animation animation_rotation; - late Animation animation_radius_in; - late Animation animation_radius_out; + late Animation animationRotation; + late Animation animationRadiusIn; + late Animation animationRadiusOut; late AnimationController controller; late double radius; @@ -36,21 +36,21 @@ class _ColorLoader3State extends State duration: const Duration(milliseconds: 3000), vsync: this); - animation_rotation = Tween(begin: 0.0, end: 1.0).animate( + animationRotation = Tween(begin: 0.0, end: 1.0).animate( CurvedAnimation( parent: controller, curve: Interval(0.0, 1.0, curve: Curves.linear), ), ); - animation_radius_in = Tween(begin: 1.0, end: 0.0).animate( + animationRadiusIn = Tween(begin: 1.0, end: 0.0).animate( CurvedAnimation( parent: controller, curve: Interval(0.75, 1.0, curve: Curves.elasticIn), ), ); - animation_radius_out = Tween(begin: 0.0, end: 1.0).animate( + animationRadiusOut = Tween(begin: 0.0, end: 1.0).animate( CurvedAnimation( parent: controller, curve: Interval(0.0, 0.25, curve: Curves.elasticOut), @@ -60,9 +60,9 @@ class _ColorLoader3State extends State controller.addListener(() { setState(() { if (controller.value >= 0.75 && controller.value <= 1.0) - radius = widget.radius * animation_radius_in.value; + radius = widget.radius * animationRadiusIn.value; else if (controller.value >= 0.0 && controller.value <= 0.25) - radius = widget.radius * animation_radius_out.value; + radius = widget.radius * animationRadiusOut.value; }); }); @@ -81,8 +81,7 @@ class _ColorLoader3State extends State //color: Colors.black12, child: new Center( child: new RotationTransition( - - turns: animation_rotation, + turns: animationRotation, child: new Container( //color: Colors.limeAccent, child: new Center( @@ -186,7 +185,6 @@ class _ColorLoader3State extends State @override void dispose() { - controller.dispose(); super.dispose(); } @@ -205,7 +203,6 @@ class Dot extends StatelessWidget { width: radius, height: radius, decoration: BoxDecoration(color: color, shape: BoxShape.circle), - ), ); } diff --git a/lib/login_screen_1.dart b/lib/login_screen_1.dart index 1d3e746..b1c3d30 100644 --- a/lib/login_screen_1.dart +++ b/lib/login_screen_1.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class LoginScreen1 extends StatelessWidget { @@ -17,7 +16,7 @@ class LoginScreen1 extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( body: SingleChildScrollView( - child: new Container( + child: Container( height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: this.backgroundColor, @@ -25,13 +24,13 @@ class LoginScreen1 extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.max, - children: [ + children: [ Expanded( - child: new ClipPath( + child: ClipPath( clipper: MyClipper(), child: Container( decoration: BoxDecoration( - image: new DecorationImage( + image: DecorationImage( image: this.backgroundImage, fit: BoxFit.cover, ), @@ -39,14 +38,20 @@ class LoginScreen1 extends StatelessWidget { alignment: Alignment.center, padding: EdgeInsets.only(top: 100.0, bottom: 100.0), child: Column( - children: [ + children: [ Text( "DEMO", - style: TextStyle(fontSize: 50.0, fontWeight: FontWeight.bold, color: this.primaryColor), + style: TextStyle( + fontSize: 50.0, + fontWeight: FontWeight.bold, + color: this.primaryColor), ), Text( "Login Screen 1", - style: TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold, color: this.primaryColor), + style: TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + color: this.primaryColor), ), ], ), @@ -68,11 +73,13 @@ class LoginScreen1 extends StatelessWidget { ), borderRadius: BorderRadius.circular(20.0), ), - margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0), + margin: const EdgeInsets.symmetric( + vertical: 10.0, horizontal: 20.0), child: Row( - children: [ - new Padding( - padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0), + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 15.0), child: Icon( Icons.person_outline, color: Colors.grey, @@ -84,7 +91,7 @@ class LoginScreen1 extends StatelessWidget { color: Colors.grey.withOpacity(0.5), margin: const EdgeInsets.only(left: 00.0, right: 10.0), ), - new Expanded( + Expanded( child: TextField( decoration: InputDecoration( border: InputBorder.none, @@ -111,11 +118,13 @@ class LoginScreen1 extends StatelessWidget { ), borderRadius: BorderRadius.circular(20.0), ), - margin: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 20.0), + margin: const EdgeInsets.symmetric( + vertical: 10.0, horizontal: 20.0), child: Row( - children: [ - new Padding( - padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 15.0), + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0, horizontal: 15.0), child: Icon( Icons.lock_open, color: Colors.grey, @@ -127,7 +136,7 @@ class LoginScreen1 extends StatelessWidget { color: Colors.grey.withOpacity(0.5), margin: const EdgeInsets.only(left: 00.0, right: 10.0), ), - new Expanded( + Expanded( child: TextField( decoration: InputDecoration( border: InputBorder.none, @@ -142,33 +151,46 @@ class LoginScreen1 extends StatelessWidget { Container( margin: const EdgeInsets.only(top: 20.0), padding: const EdgeInsets.only(left: 20.0, right: 20.0), - child: new Row( - children: [ - new Expanded( - child: FlatButton( - shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)), - splashColor: this.primaryColor, - color: this.primaryColor, - child: new Row( - children: [ - new Padding( + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(this.primaryColor), + ), + child: Row( + children: [ + Padding( padding: const EdgeInsets.only(left: 20.0), child: Text( "LOGIN", style: TextStyle(color: Colors.white), ), ), - new Expanded( + Expanded( child: Container(), ), - new Transform.translate( + Transform.translate( offset: Offset(15.0, 0.0), - child: new Container( + child: Container( padding: const EdgeInsets.all(5.0), - child: FlatButton( - shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(28.0)), - splashColor: Colors.white, - color: Colors.white, + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(28.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.white), + ), child: Icon( Icons.arrow_forward, color: this.primaryColor, @@ -188,35 +210,50 @@ class LoginScreen1 extends StatelessWidget { Container( margin: const EdgeInsets.only(top: 10.0), padding: const EdgeInsets.only(left: 20.0, right: 20.0), - child: new Row( - children: [ - new Expanded( - child: FlatButton( - shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)), - splashColor: Color(0xFF3B5998), - color: Color(0xff3B5998), - child: new Row( - children: [ - new Padding( + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: MaterialStateProperty.all( + Color(0xff3B5998), + ), + ), + child: Row( + children: [ + Padding( padding: const EdgeInsets.only(left: 20.0), child: Text( "LOGIN WITH FACEBOOK", style: TextStyle(color: Colors.white), ), ), - new Expanded( + Expanded( child: Container(), ), - new Transform.translate( + Transform.translate( offset: Offset(15.0, 0.0), - child: new Container( + child: Container( padding: const EdgeInsets.all(5.0), - child: FlatButton( - shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(28.0)), - splashColor: Colors.white, - color: Colors.white, + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: + BorderRadius.circular(28.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.white), + ), child: Icon( - const IconData(0xea90, fontFamily: 'icomoon'), + const IconData(0xea90, + fontFamily: 'icomoon'), color: Color(0xff3b5998), ), onPressed: () => {}, @@ -234,12 +271,19 @@ class LoginScreen1 extends StatelessWidget { Container( margin: const EdgeInsets.only(top: 20.0), padding: const EdgeInsets.only(left: 20.0, right: 20.0), - child: new Row( - children: [ - new Expanded( - child: FlatButton( - shape: new RoundedRectangleBorder(borderRadius: new BorderRadius.circular(30.0)), - color: Colors.transparent, + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.transparent), + ), child: Container( padding: const EdgeInsets.only(left: 20.0), alignment: Alignment.center, @@ -265,7 +309,7 @@ class LoginScreen1 extends StatelessWidget { class MyClipper extends CustomClipper { @override Path getClip(Size size) { - Path p = new Path(); + Path p = Path(); p.lineTo(size.width, 0.0); p.lineTo(size.width, size.height * 0.85); p.arcToPoint( diff --git a/lib/login_screen_2.dart b/lib/login_screen_2.dart index 06e62bc..0fa4208 100644 --- a/lib/login_screen_2.dart +++ b/lib/login_screen_2.dart @@ -21,12 +21,17 @@ class LoginScreen2 extends StatelessWidget { return Scaffold( body: SingleChildScrollView( child: Container( - decoration: new BoxDecoration( - gradient: new LinearGradient( + decoration: BoxDecoration( + gradient: LinearGradient( begin: Alignment.centerLeft, - end: new Alignment(1.0, 0.0), // 10% of the width, so there are ten blinds. - colors: [this.backgroundColor1!, this.backgroundColor2!], // whitish to gray - tileMode: TileMode.repeated, // repeats the gradient over the canvas + end: Alignment( + 1.0, 0.0), // 10% of the width, so there are ten blinds. + colors: [ + this.backgroundColor1!, + this.backgroundColor2! + ], // whitish to gray + tileMode: + TileMode.repeated, // repeats the gradient over the canvas ), ), height: MediaQuery.of(context).size.height, @@ -35,16 +40,16 @@ class LoginScreen2 extends StatelessWidget { Container( padding: const EdgeInsets.only(top: 110.0, bottom: 50.0), child: Center( - child: new Column( + child: Column( children: [ Container( height: 128.0, width: 128.0, - child: new CircleAvatar( + child: CircleAvatar( backgroundColor: Colors.transparent, foregroundColor: this.foregroundColor, radius: 100.0, - child: new Text( + child: Text( "S", style: TextStyle( fontSize: 50.0, @@ -61,9 +66,9 @@ class LoginScreen2 extends StatelessWidget { //image: DecorationImage(image: this.logo) ), ), - new Padding( + Padding( padding: const EdgeInsets.all(16.0), - child: new Text( + child: Text( "Samarth Agarwal", style: TextStyle(color: this.foregroundColor), ), @@ -72,28 +77,32 @@ class LoginScreen2 extends StatelessWidget { ), ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0), alignment: Alignment.center, decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: this.foregroundColor!, width: 0.5, style: BorderStyle.solid), + bottom: BorderSide( + color: this.foregroundColor!, + width: 0.5, + style: BorderStyle.solid), ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - new Padding( - padding: EdgeInsets.only(top: 10.0, bottom: 10.0, right: 00.0), + Padding( + padding: + EdgeInsets.only(top: 10.0, bottom: 10.0, right: 00.0), child: Icon( Icons.alternate_email, color: this.foregroundColor, ), ), - new Expanded( + Expanded( child: TextField( textAlign: TextAlign.center, decoration: InputDecoration( @@ -106,28 +115,33 @@ class LoginScreen2 extends StatelessWidget { ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, - margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), + margin: + const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, decoration: BoxDecoration( border: Border( - bottom: BorderSide(color: this.foregroundColor!, width: 0.5, style: BorderStyle.solid), + bottom: BorderSide( + color: this.foregroundColor!, + width: 0.5, + style: BorderStyle.solid), ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - new Padding( - padding: EdgeInsets.only(top: 10.0, bottom: 10.0, right: 00.0), + Padding( + padding: + EdgeInsets.only(top: 10.0, bottom: 10.0, right: 00.0), child: Icon( Icons.lock_open, color: this.foregroundColor, ), ), - new Expanded( + Expanded( child: TextField( obscureText: true, textAlign: TextAlign.center, @@ -141,63 +155,89 @@ class LoginScreen2 extends StatelessWidget { ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, - margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 30.0), + margin: + const EdgeInsets.only(left: 40.0, right: 40.0, top: 30.0), alignment: Alignment.center, - child: new Row( + child: Row( children: [ - new Expanded( - child: new FlatButton( - padding: const EdgeInsets.symmetric(vertical: 20.0, horizontal: 20.0), - color: this.highlightColor, + Expanded( + child: TextButton( + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(this.highlightColor)), onPressed: () => {}, - child: Text( - "Log In", - style: TextStyle(color: this.foregroundColor), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 20.0, + horizontal: 20.0, + ), + child: Text( + "Log In", + style: TextStyle(color: this.foregroundColor), + ), ), ), ), ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, - margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), + margin: + const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, - child: new Row( + child: Row( children: [ - new Expanded( - child: new FlatButton( - padding: const EdgeInsets.symmetric(vertical: 20.0, horizontal: 20.0), - color: Colors.transparent, + Expanded( + child: TextButton( + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(Colors.transparent), + ), onPressed: () => {}, - child: Text( - "Forgot your password?", - style: TextStyle(color: this.foregroundColor!.withOpacity(0.5)), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 20.0, + horizontal: 20.0, + ), + child: Text( + "Forgot your password?", + style: TextStyle( + color: this.foregroundColor!.withOpacity(0.5)), + ), ), ), ), ], ), ), - new Expanded( + Expanded( child: Divider(), ), - new Container( + Container( width: MediaQuery.of(context).size.width, - margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0, bottom: 20.0), + margin: const EdgeInsets.only( + left: 40.0, right: 40.0, top: 10.0, bottom: 20.0), alignment: Alignment.center, - child: new Row( + child: Row( children: [ - new Expanded( - child: new FlatButton( - padding: const EdgeInsets.symmetric(vertical: 20.0, horizontal: 20.0), - color: Colors.transparent, + Expanded( + child: TextButton( + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(Colors.transparent), + ), onPressed: () => {}, - child: Text( - "Don't have an account? Create One", - style: TextStyle(color: this.foregroundColor!.withOpacity(0.5)), + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 20.0, horizontal: 20.0), + child: Text( + "Don't have an account? Create One", + style: TextStyle( + color: this.foregroundColor!.withOpacity(0.5)), + ), ), ), ), diff --git a/lib/login_screen_3.dart b/lib/login_screen_3.dart index 8a3a38f..e78b89b 100644 --- a/lib/login_screen_3.dart +++ b/lib/login_screen_3.dart @@ -2,12 +2,11 @@ import 'package:flutter/material.dart'; class LoginScreen3 extends StatefulWidget { @override - _LoginScreen3State createState() => new _LoginScreen3State(); + _LoginScreen3State createState() => _LoginScreen3State(); } class _LoginScreen3State extends State with TickerProviderStateMixin { - //The code is commented because instead of manual scrolling with animation, //Now PageView is being used @@ -80,24 +79,24 @@ class _LoginScreen3State extends State //Now PageView is being used /* - controller_minus1To0 = new AnimationController( + controller_minus1To0 = AnimationController( vsync: this, duration: const Duration(milliseconds: 500), lowerBound: -1.0, upperBound: 0.0, ); - controller_0To1 = new AnimationController( + controller_0To1 = AnimationController( vsync: this, duration: const Duration(milliseconds: 500), lowerBound: 0.0, upperBound: 1.0, ); - anim_minus1To0 = new CurvedAnimation( + anim_minus1To0 = CurvedAnimation( parent: controller_minus1To0, curve: Interval(0.10, 0.90, curve: Curves.bounceInOut), ); - anim_0To1 = new CurvedAnimation( + anim_0To1 = CurvedAnimation( parent: controller_0To1, curve: Interval(0.10, 0.90, curve: Curves.bounceInOut), ); @@ -116,20 +115,20 @@ class _LoginScreen3State extends State */ } - Widget HomePage() { - return new Container( + Widget homePage() { + return Container( height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: Colors.redAccent, image: DecorationImage( - colorFilter: new ColorFilter.mode( + colorFilter: ColorFilter.mode( Colors.black.withOpacity(0.1), BlendMode.dstATop), image: AssetImage('assets/images/mountains.jpg'), fit: BoxFit.cover, ), ), - child: new Column( - children: [ + child: Column( + children: [ Container( padding: EdgeInsets.only(top: 250.0), child: Center( @@ -142,9 +141,9 @@ class _LoginScreen3State extends State ), Container( padding: EdgeInsets.only(top: 20.0), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ + children: [ Text( "Awesome", style: TextStyle( @@ -162,28 +161,34 @@ class _LoginScreen3State extends State ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 150.0), alignment: Alignment.center, - child: new Row( - children: [ - new Expanded( - child: new OutlineButton( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0)), - color: Colors.redAccent, - highlightedBorderColor: Colors.white, + child: Row( + children: [ + Expanded( + child: OutlinedButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + side: BorderSide(color: Colors.redAccent), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.redAccent), + ), onPressed: () => gotoSignup(), - child: new Container( + child: Container( padding: const EdgeInsets.symmetric( vertical: 20.0, horizontal: 20.0, ), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Expanded( + children: [ + Expanded( child: Text( "SIGN UP", textAlign: TextAlign.center, @@ -200,27 +205,32 @@ class _LoginScreen3State extends State ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 30.0), alignment: Alignment.center, - child: new Row( - children: [ - new Expanded( - child: new FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0)), - color: Colors.white, + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: MaterialStateProperty.all(Colors.white), + ), onPressed: () => gotoLogin(), - child: new Container( + child: Container( padding: const EdgeInsets.symmetric( vertical: 20.0, horizontal: 20.0, ), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Expanded( + children: [ + Expanded( child: Text( "LOGIN", textAlign: TextAlign.center, @@ -242,20 +252,20 @@ class _LoginScreen3State extends State ); } - Widget LoginPage() { - return new Container( + Widget loginPage() { + return Container( height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: Colors.white, image: DecorationImage( - colorFilter: new ColorFilter.mode( + colorFilter: ColorFilter.mode( Colors.black.withOpacity(0.05), BlendMode.dstATop), image: AssetImage('assets/images/mountains.jpg'), fit: BoxFit.cover, ), ), - child: new Column( - children: [ + child: Column( + children: [ Container( padding: EdgeInsets.all(100.0), child: Center( @@ -266,12 +276,12 @@ class _LoginScreen3State extends State ), ), ), - new Row( - children: [ - new Expanded( - child: new Padding( + Row( + children: [ + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 40.0), - child: new Text( + child: Text( "EMAIL", style: TextStyle( fontWeight: FontWeight.bold, @@ -283,7 +293,7 @@ class _LoginScreen3State extends State ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, @@ -296,11 +306,11 @@ class _LoginScreen3State extends State ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, - children: [ - new Expanded( + children: [ + Expanded( child: TextField( obscureText: true, textAlign: TextAlign.left, @@ -317,12 +327,12 @@ class _LoginScreen3State extends State Divider( height: 24.0, ), - new Row( - children: [ - new Expanded( - child: new Padding( + Row( + children: [ + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 40.0), - child: new Text( + child: Text( "PASSWORD", style: TextStyle( fontWeight: FontWeight.bold, @@ -334,7 +344,7 @@ class _LoginScreen3State extends State ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, @@ -347,11 +357,11 @@ class _LoginScreen3State extends State ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, - children: [ - new Expanded( + children: [ + Expanded( child: TextField( obscureText: true, textAlign: TextAlign.left, @@ -368,13 +378,13 @@ class _LoginScreen3State extends State Divider( height: 24.0, ), - new Row( + Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ Padding( padding: const EdgeInsets.only(right: 20.0), - child: new FlatButton( - child: new Text( + child: TextButton( + child: Text( "Forgot Password?", style: TextStyle( fontWeight: FontWeight.bold, @@ -383,33 +393,38 @@ class _LoginScreen3State extends State ), textAlign: TextAlign.end, ), - onPressed: () => {}, + onPressed: () {}, ), ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 10.0), alignment: Alignment.center, - child: new Row( - children: [ - new Expanded( - child: new FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0), + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.redAccent), ), - color: Colors.redAccent, - onPressed: () => {}, - child: new Container( + onPressed: () {}, + child: Container( padding: const EdgeInsets.symmetric( vertical: 20.0, horizontal: 20.0, ), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Expanded( + children: [ + Expanded( child: Text( "LOGIN", textAlign: TextAlign.center, @@ -426,14 +441,14 @@ class _LoginScreen3State extends State ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 10.0), alignment: Alignment.center, child: Row( - children: [ - new Expanded( - child: new Container( + children: [ + Expanded( + child: Container( margin: EdgeInsets.all(8.0), decoration: BoxDecoration(border: Border.all(width: 0.25)), ), @@ -445,8 +460,8 @@ class _LoginScreen3State extends State fontWeight: FontWeight.bold, ), ), - new Expanded( - child: new Container( + Expanded( + child: Container( margin: EdgeInsets.all(8.0), decoration: BoxDecoration(border: Border.all(width: 0.25)), ), @@ -454,53 +469,61 @@ class _LoginScreen3State extends State ], ), ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 20.0), - child: new Row( - children: [ - new Expanded( - child: new Container( + child: Row( + children: [ + Expanded( + child: Container( margin: EdgeInsets.only(right: 8.0), alignment: Alignment.center, - child: new Row( - children: [ - new Expanded( - child: new FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0), + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: MaterialStateProperty.all( + Color(0Xff3B5998), + ), ), - color: Color(0Xff3B5998), - onPressed: () => {}, - child: new Container( - child: new Row( + onPressed: () {}, + child: Container( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Expanded( - child: new FlatButton( - onPressed: ()=>{}, - padding: EdgeInsets.only( - top: 20.0, - bottom: 20.0, - ), - child: new Row( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Icon( - const IconData(0xea90, - fontFamily: 'icomoon'), - color: Colors.white, - size: 15.0, - ), - Text( - "FACEBOOK", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - ), - ], + children: [ + Expanded( + child: TextButton( + onPressed: () {}, + child: Padding( + padding: EdgeInsets.only( + top: 20.0, + bottom: 20.0, + ), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Icon( + const IconData(0xea90, + fontFamily: 'icomoon'), + color: Colors.white, + size: 15.0, + ), + Text( + "FACEBOOK", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold), + ), + ], + ), ), ), ), @@ -513,48 +536,53 @@ class _LoginScreen3State extends State ), ), ), - new Expanded( - child: new Container( + Expanded( + child: Container( margin: EdgeInsets.only(left: 8.0), alignment: Alignment.center, - child: new Row( - children: [ - new Expanded( - child: new FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0), + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Color(0Xffdb3236)), ), - color: Color(0Xffdb3236), - onPressed: () => {}, - child: new Container( - child: new Row( + onPressed: () {}, + child: Container( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Expanded( - child: new FlatButton( - onPressed: ()=>{}, - padding: EdgeInsets.only( - top: 20.0, - bottom: 20.0, - ), - child: new Row( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Icon( - const IconData(0xea88, - fontFamily: 'icomoon'), - color: Colors.white, - size: 15.0, - ), - Text( - "GOOGLE", - textAlign: TextAlign.center, - style: TextStyle( - color: Colors.white, - fontWeight: FontWeight.bold), - ), - ], + children: [ + Expanded( + child: TextButton( + onPressed: () {}, + child: Padding( + padding: const EdgeInsets.only( + top: 20.0, bottom: 20.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Icon( + const IconData(0xea88, + fontFamily: 'icomoon'), + color: Colors.white, + size: 15.0, + ), + Text( + "GOOGLE", + textAlign: TextAlign.center, + style: TextStyle( + color: Colors.white, + fontWeight: FontWeight.bold), + ), + ], + ), ), ), ), @@ -575,21 +603,21 @@ class _LoginScreen3State extends State ); } - Widget SignupPage() { + Widget signupPage() { return SingleChildScrollView( - child: new Container( + child: Container( height: MediaQuery.of(context).size.height, decoration: BoxDecoration( color: Colors.white, image: DecorationImage( - colorFilter: new ColorFilter.mode( + colorFilter: ColorFilter.mode( Colors.black.withOpacity(0.05), BlendMode.dstATop), image: AssetImage('assets/images/mountains.jpg'), fit: BoxFit.cover, ), ), - child: new Column( - children: [ + child: Column( + children: [ Container( padding: EdgeInsets.all(100.0), child: Center( @@ -600,12 +628,12 @@ class _LoginScreen3State extends State ), ), ), - new Row( - children: [ - new Expanded( - child: new Padding( + Row( + children: [ + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 40.0), - child: new Text( + child: Text( "EMAIL", style: TextStyle( fontWeight: FontWeight.bold, @@ -617,7 +645,7 @@ class _LoginScreen3State extends State ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, @@ -630,11 +658,11 @@ class _LoginScreen3State extends State ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, - children: [ - new Expanded( + children: [ + Expanded( child: TextField( obscureText: true, textAlign: TextAlign.left, @@ -648,17 +676,15 @@ class _LoginScreen3State extends State ], ), ), - Divider( height: 24.0, ), - - new Row( - children: [ - new Expanded( - child: new Padding( + Row( + children: [ + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 40.0), - child: new Text( + child: Text( "PASSWORD", style: TextStyle( fontWeight: FontWeight.bold, @@ -670,7 +696,7 @@ class _LoginScreen3State extends State ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, @@ -683,11 +709,11 @@ class _LoginScreen3State extends State ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, - children: [ - new Expanded( + children: [ + Expanded( child: TextField( obscureText: true, textAlign: TextAlign.left, @@ -704,12 +730,12 @@ class _LoginScreen3State extends State Divider( height: 24.0, ), - new Row( - children: [ - new Expanded( - child: new Padding( + Row( + children: [ + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 40.0), - child: new Text( + child: Text( "CONFIRM PASSWORD", style: TextStyle( fontWeight: FontWeight.bold, @@ -721,7 +747,7 @@ class _LoginScreen3State extends State ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 40.0, right: 40.0, top: 10.0), alignment: Alignment.center, @@ -734,11 +760,11 @@ class _LoginScreen3State extends State ), ), padding: const EdgeInsets.only(left: 0.0, right: 10.0), - child: new Row( + child: Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.start, - children: [ - new Expanded( + children: [ + Expanded( child: TextField( obscureText: true, textAlign: TextAlign.left, @@ -755,13 +781,13 @@ class _LoginScreen3State extends State Divider( height: 24.0, ), - new Row( + Row( mainAxisAlignment: MainAxisAlignment.end, - children: [ + children: [ Padding( padding: const EdgeInsets.only(right: 20.0), - child: new FlatButton( - child: new Text( + child: TextButton( + child: Text( "Already have an account?", style: TextStyle( fontWeight: FontWeight.bold, @@ -770,33 +796,38 @@ class _LoginScreen3State extends State ), textAlign: TextAlign.end, ), - onPressed: () => {}, + onPressed: () {}, ), ), ], ), - new Container( + Container( width: MediaQuery.of(context).size.width, margin: const EdgeInsets.only(left: 30.0, right: 30.0, top: 10.0), alignment: Alignment.center, - child: new Row( - children: [ - new Expanded( - child: new FlatButton( - shape: new RoundedRectangleBorder( - borderRadius: new BorderRadius.circular(30.0), + child: Row( + children: [ + Expanded( + child: TextButton( + style: ButtonStyle( + shape: MaterialStateProperty.all( + RoundedRectangleBorder( + borderRadius: BorderRadius.circular(30.0), + ), + ), + backgroundColor: + MaterialStateProperty.all(Colors.redAccent), ), - color: Colors.redAccent, - onPressed: () => {}, - child: new Container( + onPressed: () {}, + child: Container( padding: const EdgeInsets.symmetric( vertical: 20.0, horizontal: 20.0, ), - child: new Row( + child: Row( mainAxisAlignment: MainAxisAlignment.center, - children: [ - new Expanded( + children: [ + Expanded( child: Text( "SIGN UP", textAlign: TextAlign.center, @@ -837,28 +868,29 @@ class _LoginScreen3State extends State ); } - PageController _controller = new PageController(initialPage: 1, viewportFraction: 1.0); + PageController _controller = + PageController(initialPage: 1, viewportFraction: 1.0); @override Widget build(BuildContext context) { return Container( height: MediaQuery.of(context).size.height, -// child: new GestureDetector( +// child: GestureDetector( // onHorizontalDragStart: _onHorizontalDragStart, // onHorizontalDragUpdate: _onHorizontalDragUpdate, // onHorizontalDragEnd: _onHorizontalDragEnd, // behavior: HitTestBehavior.translucent, // child: Stack( -// children: [ -// new FractionalTranslation( +// children: [ +// FractionalTranslation( // translation: Offset(-1 - (scrollPercent / (1 / numCards)), 0.0), // child: SignupPage(), // ), -// new FractionalTranslation( +// FractionalTranslation( // translation: Offset(0 - (scrollPercent / (1 / numCards)), 0.0), // child: HomePage(), // ), -// new FractionalTranslation( +// FractionalTranslation( // translation: Offset(1 - (scrollPercent / (1 / numCards)), 0.0), // child: LoginPage(), // ), @@ -867,8 +899,8 @@ class _LoginScreen3State extends State // ), child: PageView( controller: _controller, - physics: new AlwaysScrollableScrollPhysics(), - children: [LoginPage(), HomePage(), SignupPage()], + physics: AlwaysScrollableScrollPhysics(), + children: [loginPage(), homePage(), signupPage()], scrollDirection: Axis.horizontal, )); } diff --git a/pubspec.lock b/pubspec.lock index c8baac6..1603750 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,7 +7,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.8.2" boolean_selector: dependency: transitive description: @@ -21,14 +21,14 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: @@ -49,7 +49,7 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "0.1.2" + version: "1.0.4" fake_async: dependency: transitive description: @@ -73,14 +73,21 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.7.0" path: dependency: transitive description: @@ -99,7 +106,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" stack_trace: dependency: transitive description: @@ -134,7 +141,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.4.8" typed_data: dependency: transitive description: @@ -148,6 +155,6 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.1" sdks: - dart: ">=2.12.0 <3.0.0" + dart: ">=2.15.1 <3.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 6e3e476..3bcd354 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,14 +2,14 @@ name: flutter_login_screens description: A new Flutter application. version: "1.0.0+1" environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.15.1 <3.0.0' dependencies: flutter: sdk: flutter # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^0.1.2 + cupertino_icons: ^1.0.2 dev_dependencies: flutter_test: diff --git a/test/widget_test.dart b/test/widget_test.dart index 813de75..f03eda5 100644 --- a/test/widget_test.dart +++ b/test/widget_test.dart @@ -6,10 +6,9 @@ // tree, read text, and verify that the values of widget properties are correct. import 'package:flutter/material.dart'; +import 'package:flutter_login_screens/main.dart'; import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_screens/main.dart'; - void main() { testWidgets('Counter increments smoke test', (WidgetTester tester) async { // Build our app and trigger a frame.