import 'package:flutter_login/flutter_login.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'register.dart'; class WelcomePage extends StatefulWidget { WelcomePage({Key key, this.title}) : super(key: key); final String title; @override _WelcomePageState createState() => _WelcomePageState(); } class _WelcomePageState extends State { TextEditingController email; TextEditingController password; Widget _message(BuildContext context){ return RichText( textAlign: TextAlign.center, text: TextSpan( text: "Don't have an account?", style: GoogleFonts.cabin( fontSize: 18, color: Colors.black ) ), ); } Widget _title(BuildContext context){ return RichText( textAlign: TextAlign.center, text: TextSpan( text: "Welcome to FastMed", style: GoogleFonts.cabin( fontSize: 30, color: Colors.red ) ), ); } Widget _LoginField(String title, TextEditingController controller, {bool pass = false}){ return Container( padding: EdgeInsets.only(left: 0, top: 10, bottom: 10), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( title, style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15), ), SizedBox( height: 30 ), TextField( controller: controller, obscureText: pass, decoration: InputDecoration( border: ( UnderlineInputBorder( ) ), ), ), ] ), ); } Widget _Fills(){ return Column( children: [ _LoginField("Email", email), _LoginField("Password", password, pass: true), ] ); } // Widget _LogInButton(BuildContext context){ // return InkWell( // // onTap: () { // // Navigator.push(context, MaterialPageRoute(builder: (context)) => __LoginPage()) // // }, // child: Container( // // width: MediaQuery.of(context).size.width, // width: 200, // // height: , // padding: EdgeInsets.symmetric(vertical:8), // alignment: Alignment.center, // decoration: BoxDecoration( // color: Colors.red, // // shape: // // borderRadius: BorderRadius.circular(30), // ), // child: Text( // "Login", // style: TextStyle(fontSize: 25, color: Colors.white), // ), // // ) // ); // } Widget _RegisterButton(BuildContext context){ return InkWell( onTap: () { Navigator.push( context, MaterialPageRoute(builder: (context) => RegisterPage())); }, child: Container( // width: MediaQuery.of(context).size.width, width: 180, padding: EdgeInsets.symmetric(vertical:8), alignment: Alignment.center, decoration: BoxDecoration( color: Colors.red, // shape: borderRadius: BorderRadius.circular(30), ), child: Text( "Register", style: TextStyle(fontSize: 22, color: Colors.white), ), ) ); } @override Widget build(BuildContext context) { final height = MediaQuery.of(context).size.height; return Scaffold( body: Container( height: height, child:Container( width: MediaQuery.of(context).size.width, padding: EdgeInsets.symmetric(horizontal: 20), // height: MediaQuery.of(context).size.height, decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(4)), boxShadow: [ BoxShadow( color: Colors.white, offset: Offset(0,3), blurRadius: 5, spreadRadius: 2) ] ), child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ SizedBox( height: 80, ), _title(context), SizedBox( height: 150, ), // _LogInButton(context), _Fills(), SizedBox( height: 60, ), _message(context), SizedBox( height: 10, ), _RegisterButton(context), SizedBox( height: 10, ) ], ) ), ), ) ); } }