Skip to content

Instantly share code, notes, and snippets.

@vemarav
Created May 9, 2018 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vemarav/62ad99f573d182c8acefeee54ca41d14 to your computer and use it in GitHub Desktop.
Save vemarav/62ad99f573d182c8acefeee54ca41d14 to your computer and use it in GitHub Desktop.
2.02_add_bottom_app_bar-Solution gist for https://github.com/Aravind99/keeper
import 'package:flutter/material.dart';
class NoteForm extends StatefulWidget {
static String routeName = 'noteForm';
@override
State<StatefulWidget> createState() {
return new _NoteFormState();
}
}
class _NoteFormState extends State<NoteForm> {
GlobalKey<ScaffoldState> _scaffoldKey = new GlobalKey<ScaffoldState>();
TextEditingController _titleController,
_contentController;
@override
void initState() {
super.initState();
_titleController = new TextEditingController();
_contentController = new TextEditingController();
}
_goBack() {
Navigator.of(_scaffoldKey.currentContext).pop();
}
@override
Widget build(BuildContext context) {
return new Scaffold(
key: _scaffoldKey,
appBar: new AppBar(
backgroundColor: Colors.white,
leading: new IconButton(
icon: new Icon(
Icons.arrow_back,
color: Colors.grey.shade600,
),
onPressed: _goBack),
),
body: new Container(
margin: const EdgeInsets.all(20.0),
child: new Column(
children: <Widget>[
new TextField(
controller: _titleController,
style: new TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.black
),
decoration: new InputDecoration(
border: InputBorder.none,
hintText: 'Title',
hintStyle: new TextStyle(
fontSize: 20.0,
fontWeight: FontWeight.bold,
color: Colors.grey.shade500
)
),
),
new TextField(
controller: _contentController,
style: new TextStyle(
fontSize: 18.0,
color: Colors.black
),
maxLines: null,
decoration: new InputDecoration(
border: InputBorder.none,
hintText: 'Note...',
hintStyle: new TextStyle(
fontSize: 18.0,
color: Colors.grey.shade500
)
),
)
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment