import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'drawer',
home:DrawerPager(),
);
}
}
class DrawerPager extends StatefulWidget {
@override
_DrawerPagerState createState() => _DrawerPagerState();
}
class _DrawerPagerState extends State<DrawerPager> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('drawer'),
),
body: Container(
child: Text('drawer'),
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: <Widget>[
Container(
color: Color.fromARGB(214, 12, 12, 34),
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
Text('1111'),
],
),
),
);
}
}
flutter_Drawer用法
最新推荐文章于 2024-07-03 23:56:41 发布