mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-11-08 20:50:04 +00:00
Added covid-19 example app and Updated the readme (#73)
This commit is contained in:
40
covid19_mobile_app/lib/widgets/drawer.dart
Normal file
40
covid19_mobile_app/lib/widgets/drawer.dart
Normal file
@@ -0,0 +1,40 @@
|
||||
import '../screens/home.dart';
|
||||
import '../screens/countrylist.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class DrawerWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Drawer(
|
||||
child: ListView(
|
||||
// Important: Remove any padding from the ListView.
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
child: Image.asset('assets/virus.gif'),
|
||||
),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Image.asset("assets/logo.png"),
|
||||
),
|
||||
title: Text('Home'),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(
|
||||
context, MaterialPageRoute(builder: (context) => Home()));
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: CircleAvatar(
|
||||
child: Image.asset("assets/logo.png"),
|
||||
),
|
||||
title: Text('Affected Countries'),
|
||||
onTap: () {
|
||||
Navigator.pushReplacement(context,
|
||||
MaterialPageRoute(builder: (context) => CountryList()));
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user