How can I align a form in the center using Flutter? - flutter

I have a program written in Flutter and I would like to center the form in the middle of the screen but I can't get it.
I tried to use Align and I don't think I am using it correctly!
Someone can help me? Thanks
class _Defini extends State<Definicoes> {
GlobalKey<FormState> _formkey = GlobalKey<FormState>();
#override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar:
...
body: Container(
color: Colors.amber.withOpacity(0.80),
child: Align(
alignment: Alignment(0, 0),
child: Form(
key: _formkey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Container(
width: 300,
height: 300,
child: TextFormField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: "RaspberryPi",
labelStyle: TextStyle(color: Colors.white)),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 25.0),
validator: (value) {
if (value.isEmpty){
return "Insira";
}
},
),
),
Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
...
),
],
),
child: FlatButton(
color: Colors.white,
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.all(8.0),
splashColor: Colors.blueAccent,
onPressed: () {
if(_formkey.currentState.validate()){
}
},
child: Text(
"Ligar",
),
),
),
],
),
),
),
),
);
}
}

Align is used if you have only one child.
To make the Form be at the center, set the mainAxisAlignment property of your column to MainAxisAlignment.center
Check the code below:
class _Defini extends State<Definicoes> {
GlobalKey<FormState> _formkey = GlobalKey<FormState>();
#override
Widget build(BuildContext context) {
return Scaffold(
bottomNavigationBar:
...
body: Container(
color: Colors.amber.withOpacity(0.80),
child: Form(
key: _formkey,
child: Column(
// set the mainAxisAlignment property here
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
Container(
width: 300,
height: 300,
child: TextFormField(
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: "RaspberryPi",
labelStyle: TextStyle(color: Colors.white)),
textAlign: TextAlign.center,
style: TextStyle(color: Colors.white, fontSize: 25.0),
validator: (value) {
if (value.isEmpty){
return "Insira";
}
},
),
),
Container(
decoration: BoxDecoration(
boxShadow: [
BoxShadow(
...
),
],
),
child: FlatButton(
color: Colors.white,
textColor: Colors.white,
disabledColor: Colors.grey,
disabledTextColor: Colors.black,
padding: EdgeInsets.all(8.0),
splashColor: Colors.blueAccent,
onPressed: () {
if(_formkey.currentState.validate()){
}
},
child: Text(
"Ligar",
),
),
),
],
),
),
),
);
}
}

Related

converting a statelesswidget into statefulwidget or coding a checkbox in a statelesswidget

I want to use a checkbox for checking, if the user is an admin or a normal user.
I already tried to do a statefulwidget out of my statelesswidget, but it won't work at all.
How can I convert my authentification page into a statefulwidget?
The code for my checkbox would be:
Checkbox(
value: checkBoxValue,
onChanged: (bool value){
setState(() => checkBoxValue = value);
}),
Text("Admin",)
],
),
The problem is that "setState" isn't defined for a statelesswidget, so I need to convert my authentification page into a statefulwidge.
But how can I do this? I have already tried it a few times, but I always get a lot of errors.
Or is there maybe an other way to code the checkbox with using a statelesswidget?
authentication.dart code:
import 'package:bestfitnesstrackereu/pages/home/home_view.dart';
import 'package:bestfitnesstrackereu/routing/route_names.dart';
import 'package:flutter/material.dart';
class AuthenticationPage extends StatelessWidget {
const AuthenticationPage({Key key}) : super(key: key);
#override
Widget build(BuildContext context) {
bool checkBoxValue = false;
return Scaffold(
body: Center(
child: Container(
constraints: BoxConstraints(maxWidth: 400),
padding: EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Padding(
padding: EdgeInsets.only(right: 12),
child: Image.asset("assets/logo.png"),
),
Expanded(child: Container()),
],
),
SizedBox(
height: 30,
),
Row(
children: [
Text("Login",
style: TextStyle(
fontSize: 30, fontWeight: FontWeight.bold
)),
],
),
SizedBox(height: 10,),
Row(
children: [
Text(
"Welcome back to the admin panel",
style: TextStyle(
color: Colors.grey,))
],
),
SizedBox(height: 15,),
TextField(
decoration: InputDecoration(
labelText: "E-Mail",
hintText: "abc#domain.com",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20)
)
),
),
SizedBox(height: 15,),
TextField(
obscureText: true,
decoration: InputDecoration(
labelText: "Password",
hintText: "123",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(20)
)
),
),
SizedBox(height: 15,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
children: [
Checkbox(
value: checkBoxValue,
onChanged: (bool value){
setState(() => checkBoxValue = value);
}),
Text("Admin",)
],
),
Text(
"Forgot password",
style: TextStyle(
color: Colors.white,
))
],
),
SizedBox(height: 15,),
InkWell(
onTap: (){
Navigator.of(context).pushNamed(HomeRoute);
},
child: Container(
decoration: BoxDecoration(color: Colors.grey,
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
width: double.maxFinite,
padding: EdgeInsets.symmetric(vertical: 16),
child: Text(
"Login",
style: TextStyle(
color: Colors.black,
),)
)
),
SizedBox(height: 15,),
InkWell(
onTap: (){
Navigator.of(context).pushNamed(HomeRoute);
},
child: Container(
decoration: BoxDecoration(color: Colors.grey,
borderRadius: BorderRadius.circular(20)),
alignment: Alignment.center,
width: double.maxFinite,
padding: EdgeInsets.symmetric(vertical: 16),
child: Text(
"Teilnehmer werden",
style: TextStyle(
color: Colors.black,
),)
)
),
RichText(text: TextSpan(
children: [
TextSpan(text: "Do not have admin credentials?\n"),
TextSpan(text: "Request credentials!", style: TextStyle(color: Colors.black))
]
))
],
),
)
),
);
}
}
Depending on the IDE you are using, when you hover on the widget class name, there is a light bulb that show on the left side in the editor. When you click on the light bulb, there is an option to convert to a stateless widget.

Flutter: How to align textfield to bottom center in a column?

I am building a chat app.
I have 2 items on the column. First one is information card which is on top of page,
I also have a textfield but I cant figure out how to place it on bottom center.
Here is the main code with the problem:
#override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
resizeToAvoidBottomPadding: true,
appBar: userMessageChatAppBar(context),
body: SingleChildScrollView(
child: Column(
children: [
userMessageChatInformationCard(context),
Positioned(
bottom: 20,
child: userMessageChatTextField())
],
),
),
);
TextField where chatting will occur:
Padding userMessageChatTextField() {
return Padding(
padding: const EdgeInsets.all(16.0),
child: TextField(
decoration: InputDecoration(
suffixIcon: RaisedButton.icon(
onPressed: () {},
icon: Icon(
Icons.send,
color: Colors.white,
),
color: Colors.blue,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20))),
label: Text(
"19.99₺",
style: TextStyle(color: Colors.white, fontSize: 18),
),
),
hintText: "Bir şeyler yaz",
border: new OutlineInputBorder(
borderSide: new BorderSide(color: Colors.teal)),
)),
);}
Information Card where user first sees:
Align userMessageChatInformationCard(BuildContext context) {
return Align(
alignment: Alignment.center,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Container(
decoration: new BoxDecoration(
boxShadow: [
new BoxShadow(
color: Colors.grey,
blurRadius: 10.0,
),
],
),
child: Card(
clipBehavior: Clip.antiAlias,
child: Column(
children: [
Padding(
padding: const EdgeInsets.all(16.0),
child: Text(
'fernando muslera mesajını bekliyor',textAlign: TextAlign.center,
style: TextStyle(fontSize: 20.0, color: Colors.blueGrey),
),
),
Padding(
padding: const EdgeInsets.only(left: 20,right: 20,bottom: 20),
child: Text(
'280 karakterlik mesaj için ödeme yaparsın ünlünün mesajı alabilmesi uzun sürebilir',
textAlign: TextAlign.center, style: TextStyle(
color: Colors.black.withOpacity(0.6)),
),
),
],
),
),
)));
}
#override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: true,
resizeToAvoidBottomPadding: true,
appBar: userMessageChatAppBar(context),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
userMessageChatInformationCard(context),
userMessageChatTextField()
],
),
);
}

Flutter: Deleting widget with delete icon from a list view in flutter

I have a form builder application, I have stateless widgets which get added to list view, each widget has a delete icon, I want to delete the widget and update the list view.
one of the code widget code is this
class HeaderTextWidget extends StatelessWidget {
final VoidCallback onDelete;
HeaderTextWidget({Key key, this.onDelete}) : super(key: key);
#override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(bottom: 12.0),
decoration: BoxDecoration(
color: Colors.blueGrey,
borderRadius: BorderRadius.only(
topRight: Radius.circular(15.0),
topLeft: Radius.circular(15.0),
),
),
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.all(6.0),
child: Text(
'Header',
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
),
),
),
Card(
elevation: 5.0,
color: Colors.blueGrey.shade50,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(15.0),
topRight: Radius.circular(15.0),
),
),
child: Column(
children: <Widget>[
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 10.0, 8.0, 10.0),
child: TextField(
textCapitalization: TextCapitalization.words,
keyboardType: TextInputType.text,
style: TextStyle(
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
decoration: InputDecoration(
hintText: 'untitled header',
hintStyle: TextStyle(
color: Colors.grey,
fontStyle: FontStyle.italic,
fontSize: 14.0,
),
),
),
),
Padding(
padding: const EdgeInsets.fromLTRB(8.0, 4.0, 8.0, 20.0),
child: TextField(
textCapitalization: TextCapitalization.words,
keyboardType: TextInputType.text,
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.normal,
),
decoration: InputDecoration(
hintText: 'Description (optional)',
hintStyle: TextStyle(
color: Colors.grey,
fontSize: 14.0,
),
),
),
),
Divider(
indent: 4.0,
endIndent: 4.0,
thickness: 2.0,
),
IntrinsicHeight(
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
IconButton(
icon: Icon(Icons.content_copy),
iconSize: 24.0,
color: Colors.blue,
onPressed: () {
Scaffold.of(context).showSnackBar(
SnackBar(
content: Text('COpy'),
),
);
},
),
IconButton(
icon: Icon(Icons.delete),
iconSize: 24.0,
color: Colors.red,
onPressed: this.onDelete,
),
VerticalDivider(
thickness: 2.0,
endIndent: 6.0,
indent: 4.0,
),
Padding(
padding: const EdgeInsets.only(right: 12.0),
child: SwitchWidget(),
),
],
),
),
],
),
),
],
),
);
}
}
This is my Listview builder
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
FormBuilder(
key: widget.fbKey,
autovalidate: true,
child: Expanded(
child: Padding(
padding: const EdgeInsets.all(10.0),
child: ListView.builder(
itemCount: widget.data.widgets.length,
controller: _scrollController,
itemBuilder: (context, index) {
return widget.data.widgets[index];
},
),
),
)),
],
),
);
This is how the widget is being added the view is getting changed from selected the widget to List view builder page, when clicked on that particular icon. Where should be the delete function be added, in the List view or in the widget itself ?
Scaffold(
appBar: AppBar(
title: Text('Form Widgets'),
),
body: LayoutBuilder(
builder:
(BuildContext context, BoxConstraints viewPointConstrainsts) {
return SingleChildScrollView(
padding: EdgeInsets.all(12.0),
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: viewPointConstrainsts.maxHeight,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
FormWidget(
key: UniqueKey(),
iconData: Icons.title,
widgetTxT: 'Header',
onTap: () {
setState(() {
widget.data.widgets.add(HeaderTextWidget());
widget.pickWidgetsView = false;
});
},
),
Try the following approach:
Store only the data, not the Widget itself in the list
List<DataModel> data = []
Create list view item using createListViewItem() which should return widget as the following
ListView.builder(
itemCount: widget.dataList.length,
controller: _scrollController,
itemBuilder: (context, index) {
return createListViewItem(index);
},
),
Now inside createListViewItem(index) you can create data as per widget.dataList[index] and delete the list item on click of delete icon
setState(){
widget.dataList.deleteAt(index);
}
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
DropdownButton(
items: _Mothe.map(
(String dropdownMenuItem) {
return DropdownMenuItem<String>(
value: dropdownMenuItem,
child: Text(dropdownMenuItem),
);
},
).toList(),
onChanged: (String? value) {
setState(
() {
name == value!;
},
);
},
value: name,
isExpanded: true,
icon: SizedBox(),
),
],
),
);
}

Move TextField containing widget to view-able area when keyboard pop up regardless of another widget in the bottom

What am trying to achieve is move my TextField to view-able area when keyboard pop up, also I want a widget(Text widget) that is aligned bottom center to remain in there and get hidden by keyboard.
My Code:
#override
Widget build(BuildContext context) {
//databaseHelper.initializeDatabase();
return Scaffold(
resizeToAvoidBottomPadding: false,
appBar: AppBar(
title: Text('BOM'),
),
body: Builder(builder: (BuildContext context) {
return Container(
child: Stack(children: <Widget>[
//SingleChildScrollView widget tried here, result was a failure
Container(
margin: EdgeInsets.only(bottom: 100.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.only(bottom: 50.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
onTap: () {
setState(() {
selection = '5-co';
});
},
child: Container(
width: 130.0,
padding: EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: selection == '5-co'
? Colors.green
: Colors.black45,
borderRadius:
BorderRadius.all(Radius.circular(5.0))),
child: Center(
child: Text(
'COMPONENTS',
style: TextStyle(
color: Colors.white,
fontSize: 13.0,
fontWeight: FontWeight.bold),
)),
),
),
Container(
width: 30.0,
),
GestureDetector(
onTap: () {
setState(() {
selection = '5-nl';
});
},
child: Container(
width: 130.0,
padding: EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: selection == '5-nl'
? Colors.blue
: Colors.black45,
borderRadius:
BorderRadius.all(Radius.circular(5.0))),
child: Center(
child: Text(
'REXIN',
style: TextStyle(
color: Colors.white,
fontSize: 13.0,
fontWeight: FontWeight.bold),
)),
),
)
],
),
),
// SizedBox(height: 50,),
Padding(
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
child: TextField(
controller: controller,
decoration: InputDecoration(
labelText: 'Enter article:',
hintText: 'eg: 3290-BR',
prefixIcon: Icon(Icons.local_offer),
suffixIcon: IconButton(
icon: Icon(Icons.search),
onPressed: () {
//if (value.length >= 4) {
navigateToList(controller.text, selection);
// } else
// Scaffold.of(context).showSnackBar(SnackBar(
// content:
//
}),
/*enabledBorder:
OutlineInputBorder(borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide(color: Colors.green)),*/
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0)),
),
onSubmitted: (value) {
//if (value.length >= 4) {
navigateToList(value, selection);
// } else
// Scaffold.of(context).showSnackBar(SnackBar(
// content:
// Text('Oops, please give me more details !')));
},
),
),
]),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Text(' P A N D U',
style: TextStyle(
color: Colors.green,
fontSize: 30.0,
fontWeight: FontWeight.bold)),
))
]));
}));
}
Currently my TextField containing widget is in a container under stack widget and is aligned to center by column widget attribs.
WHAT I TRIED:
I referred some questions in here and tried SingleChildScrollView widget under my stack, and result was my container under the SingleChildScrollView widget loses its column axis attribs and get aligned to top of body.
What I didn't tried to solve my issue is with animations to move widget up. I will go for it if there isn't any other method, cause I gotta learn about those widgets which is still in que. ;')
I made SingleChildScrollView widget under my stack for all my widgets except the bottom wText widget, which I don't want to see when keyboard pops up. And then I just hide my Text widget using flutter's Visibility widget when keyboard comes in screen. This completely solved my problem (I used keyboard_visibility: ^0.5.5 library to get keyboard info, that tells when to hide or show my Text widget in the bottom ).
For reference my unsorted whole code:
bool _visible = true;
#override
void initState() {
super.initState();
KeyboardVisibilityNotification().addNewListener(
onChange: (bool keyvisible) {
//print('keyboard $visible');
setState(() {
_visible = !keyvisible;
});
},
);
}
#override
Widget build(BuildContext context) {
//databaseHelper.initializeDatabase();
return Scaffold(
//resizeToAvoidBottomPadding: false,
appBar: AppBar(
title: Text('BOM'),
),
body: Builder(builder: (BuildContext context) {
return Center(
child: Stack(children: <Widget>[
SingleChildScrollView(
padding: EdgeInsets.all(8.0),
//margin: EdgeInsets.only(bottom: 100.0),
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(
height: 200.0,
),
Container(
margin: EdgeInsets.only(bottom: 50.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
GestureDetector(
onTap: () {
setState(() {
selection = '5-co';
});
},
child: Container(
width: 130.0,
padding: EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: selection == '5-co'
? Colors.green
: Colors.black45,
borderRadius:
BorderRadius.all(Radius.circular(5.0))),
child: Center(
child: Text(
'COMPONENTS',
style: TextStyle(
color: Colors.white,
fontSize: 13.0,
fontWeight: FontWeight.bold),
)),
),
),
Container(
width: 30.0,
),
GestureDetector(
onTap: () {
setState(() {
selection = '5-nl';
});
},
child: Container(
width: 130.0,
padding: EdgeInsets.all(15.0),
decoration: BoxDecoration(
color: selection == '5-nl'
? Colors.blue
: Colors.black45,
borderRadius:
BorderRadius.all(Radius.circular(5.0))),
child: Center(
child: Text(
'REXIN',
style: TextStyle(
color: Colors.white,
fontSize: 13.0,
fontWeight: FontWeight.bold),
)),
),
)
],
),
),
// SizedBox(height: 50,),
Padding(
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
child: TextField(
textInputAction: TextInputAction.search,
controller: controller,
decoration: InputDecoration(
labelText: 'Enter article:',
hintText: 'eg: 3290-BR',
prefixIcon: Icon(Icons.local_offer),
suffixIcon: IconButton(
icon: Icon(Icons.search),
onPressed: () {
//if (value.length >= 4) {
navigateToList(controller.text, selection);
// } else
// Scaffold.of(context).showSnackBar(SnackBar(
// content:
//
}),
/*enabledBorder:
OutlineInputBorder(borderRadius: BorderRadius.circular(8.0), borderSide: BorderSide(color: Colors.green)),*/
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0)),
),
onSubmitted: (value) {
//if (value.length >= 4) {
navigateToList(value, selection);
// } else
// Scaffold.of(context).showSnackBar(SnackBar(
// content:
// Text('Oops, please give me more details !')));
},
),
),
]),
),
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.all(10.0),
child: Visibility(
visible: _visible,
child: RichText(
text: TextSpan(children: <TextSpan>[
TextSpan(
text: ' P A N D U',
style: TextStyle(
color: Colors.green,
fontSize: 30.0,
fontWeight: FontWeight.bold)),
TextSpan(text: '\t v', style: TextStyle(color: Colors.white70, fontSize: 10.0, fontWeight: FontWeight.bold)),
TextSpan(text: '0.02.05', style: TextStyle(color: Colors.white70, fontSize: 11.0, fontStyle: FontStyle.italic))
])),
),
))
]));
}));
}

Place Text widget at the bottom-center of a column which is embedded in a SingleScrollView

I am designing a login screen with a login and password TextFormfields, and also an Inkwell, which navigates to a Register page. I am basically trying to place a container which has a text widget('My Apps Version Number') at the bottom of my screen, But it doesn't seem to be working. My widgets are in a Column which are embedded in a SingleScrollView. The issue seems to be creeping from the Expanded widget. Some help would be humbly welcome.
#override
Widget build(BuildContext context) {
return new WillPopScope(
onWillPop: _onWillPop,
child: new Scaffold(
key: _scaffoldKey,
resizeToAvoidBottomPadding: false,
body: Container(
color: Colors.blueGrey[900],
child: Center(
child: SingleChildScrollView(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Image.asset(
'assets/images/op.png',
height: 60.0,
color: Colors.blueGrey[100],
),
new Container(
margin: EdgeInsets.all(40.0),
child: new Column(children: [
Form(
key: this.formKey,
child: new Column(children: <Widget>[
//Username Field
Container(
margin: EdgeInsets.only(bottom: 20.0),
child: new TextFormField(
// Retrieve the text the user has typed in using our TextEditingController
controller: myEmailController,
keyboardType: TextInputType.emailAddress,
style: TextStyle(
fontSize: 18.0,
color: Colors.blueGrey[100]),
decoration: new InputDecoration(
labelText: 'Email address',
hintStyle: TextStyle(
color: Colors.blueGrey[100],
)),
validator: (val) =>
validateEmail(val.trim()),
onSaved: (val) => _email = val.trim(),
),
),
//Password Field
new TextFormField(
// Retrieve the password the user has typed in using our TextEditingController
controller: myPasswordController,
obscureText: true,
style: TextStyle(
fontSize: 18.0,
color: Colors.blueGrey[100]),
decoration: new InputDecoration(
labelText: 'Password',
hintStyle: TextStyle(
color: Colors.blueGrey[100],
)),
validator: validatePassword,
onSaved: (val) => _password = val,
),
new Container(
width: 350,
height: 50,
margin: EdgeInsets.only(top: 50.0),
child: new FlatButton(
color: Colors.blueGrey[800],
child: new Text(
"Sign In",
style: TextStyle(
color: Colors.blueGrey[200],
fontSize: 18),
),
onPressed: () {
_submit(context);
},
shape: new RoundedRectangleBorder(
// side: BorderSide(color: Colors.white),
borderRadius:
new BorderRadius.circular(30.0))),
),
new Container(
margin: EdgeInsets.only(top: 20.0),
padding: EdgeInsets.all(15.0),
child: new InkWell(
onTap: () {
Navigator.of(context)
.pushNamed('/register');
},
child: new Center(
child: new Text(
'New User? Sign Up...',
style: new TextStyle(
fontSize: 16.0,
color: Colors.blueGrey[200]),
),
),
),
),
])),
]),
),
new Expanded(
child: new Align(
alignment: Alignment.bottomCenter,
child: new Container(
color: Colors.red,
margin: const EdgeInsets.all(0.0),
child: new Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
new Align(
alignment: Alignment.bottomCenter,
child: new Container(
padding: EdgeInsets.all(15),
child: new Text(
"Version - " + version,
style: TextStyle(
fontSize: 15,
color:
Colors.blueGrey[200]))))
],
),
),
))
])))))));
}