From 26692551f7dae893a751014e864919ca605a20e3 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Thu, 14 Sep 2023 16:39:56 +0800 Subject: [PATCH] Update home page --- lib/home.dart | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/home.dart b/lib/home.dart index 6ee0b74..7e7f46b 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -35,6 +35,33 @@ class HomePage extends HookWidget { buildMoreVertSettingsButon(context), ], ), + drawer: Drawer( + child: ListView.builder( + padding: EdgeInsets.zero, + itemCount: 2, + itemBuilder: (context, i) { + if (i == 0) { + return Row( + children: [ + Expanded(child: Container()), + IconButton( + onPressed: () => Scaffold.of(context).closeDrawer(), + icon: const Icon(Icons.close)) + ], + ); + } + if (i == 1) { + return ListTile( + leading: const Icon(Icons.collections), + title: Text(AppLocalizations.of(context)!.galleries), + onTap: () { + Scaffold.of(context).closeDrawer(); + context.push("/galleries"); + }, + ); + } + return Container(); + })), body: Center( child: TextButton( child: Text('Hello World!'),