Fix toolbar height and change in drawer UI (#63)

* fix import issues

* Fix toolbar height and made UI of drawer better
pull/71/head
Rishi Raj Singh 4 years ago committed by GitHub
parent 9174208c1d
commit 19f5b831f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 43
      app/lib/pages/home_page.dart

@ -64,7 +64,9 @@ class _HomePageState extends State<HomePage> {
), ),
actions: [], actions: [],
), ),
drawer: Material( drawer: Container(
constraints:
BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.7),
color: Colors.grey.shade800, color: Colors.grey.shade800,
child: _buildMenuBar(context), child: _buildMenuBar(context),
), ),
@ -96,7 +98,7 @@ class _HomePageState extends State<HomePage> {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
flex: 20, flex: 15,
child: Container( child: Container(
color: Colors.white, color: Colors.white,
padding: const EdgeInsets.only(left: 16.0, right: 16.0), padding: const EdgeInsets.only(left: 16.0, right: 16.0),
@ -127,10 +129,13 @@ class _HomePageState extends State<HomePage> {
), ),
), ),
), ),
Container( Expanded(
child: QuillToolbar.basic( child: Container(
controller: _controller, padding: EdgeInsets.symmetric(vertical: 16, horizontal: 8),
onImagePickCallback: _onImagePickCallback), child: QuillToolbar.basic(
controller: _controller,
onImagePickCallback: _onImagePickCallback),
),
), ),
], ],
), ),
@ -149,15 +154,33 @@ class _HomePageState extends State<HomePage> {
} }
Widget _buildMenuBar(BuildContext context) { Widget _buildMenuBar(BuildContext context) {
final itemStyle = TextStyle(color: Colors.white); Size size = MediaQuery.of(context).size;
return ListView( final itemStyle = TextStyle(
color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
);
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Divider(
thickness: 2,
color: Colors.white,
indent: size.width * 0.1,
endIndent: size.width * 0.1,
),
ListTile( ListTile(
title: Text('Read only demo', style: itemStyle), title: Center(child: Text('Read only demo', style: itemStyle)),
dense: true, dense: true,
visualDensity: VisualDensity.compact, visualDensity: VisualDensity.compact,
onTap: _readOnly, onTap: _readOnly,
) ),
Divider(
thickness: 2,
color: Colors.white,
indent: size.width * 0.1,
endIndent: size.width * 0.1,
),
], ],
); );
} }

Loading…
Cancel
Save