Commit 01cb3088 authored by R.Sai Nikhila's avatar R.Sai Nikhila

main page beside navigator

parent 5b01728d
import 'package:flutter/material.dart';
import 'package:flutter_examples/utils/Constraints.dart';
class Home extends StatefulWidget {
@override
_HomeState createState() => _HomeState();
}
class _HomeState extends State<Home> {
List<String> choices = ['moodle', 'chatbot'];
_select(String selected) {
print('selected Option');
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text('Test1'),
actions: <Widget>[
PopupMenuButton(
onSelected: _select,
itemBuilder: (BuildContext context) {
return choices.map((String choice) {
return PopupMenuItem(
value: choice,
child: Text(choice),
);
}).toList();
},
),
],
),
drawer: Drawer(
child: ListView(
// Important: Remove any padding from the ListView.
padding: EdgeInsets.zero,
children: <Widget>[
DrawerHeader(
child: new Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
// Image.network(
// 'https://avatars1.githubusercontent.com/u/14101776',
// width: 60.0,
// height: 60.0,
// ),
Text(
'Hostel Application',
style: TextStyle(color: Colors.white, fontSize: 24.0),
),
new SizedBox(height: 10.0),
Text(
'Debugs',
style: TextStyle(color: Colors.white),
)
],
),
decoration: BoxDecoration(
color: Colors.deepPurpleAccent,
),
),
ListTile(
title: Text('Home'),
onTap: () {
Navigator.pushNamed(context, Constraints.ROUTE_HOME);
},
),
ListTile(
title: Text('My Account'),
onTap: () {
Navigator.pushNamed(context, Constraints.ROUTE_SETTINGS);
},
),
ListTile(
title: Text('Total Issued Problems'),
onTap: () {
Navigator.pushNamed(context, Constraints.ROUTE_CATEGORY);
},
),
],
),
),
body: new Container(
child: new Text("Debugs Application Beta version"),
),
);
}
}
class MyCustomRoute<T> extends MaterialPageRoute<T> {
MyCustomRoute({WidgetBuilder builder, RouteSettings settings})
: super(builder: builder, settings: settings);
@override
Widget buildTransitions(BuildContext context, Animation<double> animation,
Animation<double> secondaryAnimation, Widget child) {
if (settings.isInitialRoute) return child;
// Fades between routes. (If you don't want any animation,
// just return child.)
return new FadeTransition(opacity: animation, child: child);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment