mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-08-24 14:55:03 +08:00
41 lines
1.1 KiB
Dart
41 lines
1.1 KiB
Dart
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()));
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|