From 692a2b03f7e389b400c4386dcac6c1d20391caa2 Mon Sep 17 00:00:00 2001 From: MiaoMint <1981324730@qq.com> Date: Fri, 21 Jul 2023 01:01:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E6=97=A0=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/view.dart | 57 ++++++++++++++++++++-------------------- lib/pages/main/view.dart | 1 + 2 files changed, 30 insertions(+), 28 deletions(-) diff --git a/lib/pages/home/view.dart b/lib/pages/home/view.dart index a2d36ea6..a1109377 100644 --- a/lib/pages/home/view.dart +++ b/lib/pages/home/view.dart @@ -23,32 +23,33 @@ class _HomePageState extends State { } Widget _buildContent() { - return SingleChildScrollView( - child: Padding( - padding: const EdgeInsets.all(16), - child: Obx( - () { - if (c.resents.isEmpty && c.favorites.isEmpty) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - const SizedBox(height: 200), - const Image( - image: AssetImage("assets/icon/logo.png"), - width: 100, - ), - const SizedBox(height: 16), - Text( - "home.no-record".i18n, - ), - ], + return Obx( + () { + if (c.resents.isEmpty && c.favorites.isEmpty) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + "(>人<;)", + style: TextStyle( + fontSize: 50, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 20), + Text( + "home.no-record".i18n, ), - ); - } + ], + ), + ); + } - return Column( + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (c.resents.isNotEmpty) ...[ @@ -62,10 +63,10 @@ class _HomePageState extends State { data: c.favorites, ), ], - ); - }, - ), - ), + ), + ), + ); + }, ); } diff --git a/lib/pages/main/view.dart b/lib/pages/main/view.dart index 8b90294b..36fe31ef 100644 --- a/lib/pages/main/view.dart +++ b/lib/pages/main/view.dart @@ -191,6 +191,7 @@ class _AndroidMainPageState extends fluent.State { selectedIcon: const Icon(Icons.settings), ), ], + labelBehavior: NavigationDestinationLabelBehavior.onlyShowSelected, selectedIndex: c.selectedTab.value, onDestinationSelected: c.changeTab, ),