From a20b53725bc15d55da4391d28a92bdf5b84717f2 Mon Sep 17 00:00:00 2001 From: laiiihz Date: Mon, 2 Nov 2020 14:03:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0application=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/application/applications_page.dart | 57 +++++++++++++++++++ lib/ui/home/home_page.dart | 4 +- lib/ui/widgets/common/aku_scaffold.dart | 33 +++++------ 3 files changed, 77 insertions(+), 17 deletions(-) create mode 100644 lib/ui/home/application/applications_page.dart diff --git a/lib/ui/home/application/applications_page.dart b/lib/ui/home/application/applications_page.dart new file mode 100644 index 0000000..f1d3450 --- /dev/null +++ b/lib/ui/home/application/applications_page.dart @@ -0,0 +1,57 @@ +import 'package:aku_community_manager/const/resource.dart'; +import 'package:aku_community_manager/style/app_style.dart'; +import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_back_button.dart'; +import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart'; +import 'package:flutter/material.dart'; +import 'package:aku_community_manager/tools/screen_tool.dart'; + +class ApplicationPage extends StatefulWidget { + ApplicationPage({Key key}) : super(key: key); + + @override + _ApplicationPageState createState() => _ApplicationPageState(); +} + +class _ApplicationPageState extends State { + @override + Widget build(BuildContext context) { + return AkuScaffold( + appBar: AppBar( + elevation: 0, + backgroundColor: Colors.white, + leading: SizedBox( + width: 89.w, + child: AkuBackButton(), + ), + titleSpacing: 0, + title: Container( + margin: EdgeInsets.only(right: 37.w), + padding: EdgeInsets.symmetric(horizontal: 32.w), + height: 72.w, + child: Row( + children: [ + Image.asset( + R.ASSETS_HOME_IC_SEARCH_PNG, + height: 40.w, + width: 40.w, + ), + AkuBox.w(16), + Text( + '搜索应用', + style: TextStyle( + color: AppStyle.minorTextColor, + fontSize: 28.sp, + ), + ), + ], + ), + decoration: BoxDecoration( + color: Color(0xFFF9F9F9), + borderRadius: BorderRadius.circular(8.w), + ), + ), + ), + ); + } +} diff --git a/lib/ui/home/home_page.dart b/lib/ui/home/home_page.dart index 8d1958c..550f492 100644 --- a/lib/ui/home/home_page.dart +++ b/lib/ui/home/home_page.dart @@ -3,6 +3,7 @@ import 'package:aku_community_manager/provider/user_provider.dart'; import 'package:aku_community_manager/style/app_style.dart'; import 'package:aku_community_manager/tools/screen_tool.dart'; import 'package:aku_community_manager/tools/widget_tool.dart'; +import 'package:aku_community_manager/ui/home/application/applications_page.dart'; import 'package:aku_community_manager/ui/home/personal_draw.dart'; import 'package:aku_community_manager/ui/tool_pages/scan_page.dart'; import 'package:aku_ui/aku_ui.dart'; @@ -261,7 +262,8 @@ class _HomePageState extends State { _menuButton(Icons.wysiwyg, '一键报警', HomePage()), _menuButton(Icons.work, '访客管理', HomePage()), _menuButton(Icons.accessibility, '报事报修', HomePage()), - _menuButton(Icons.account_balance, '全部应用', HomePage()), + _menuButton( + Icons.account_balance, '全部应用', ApplicationPage()), ], ), ), diff --git a/lib/ui/widgets/common/aku_scaffold.dart b/lib/ui/widgets/common/aku_scaffold.dart index 613d514..9ab0f07 100644 --- a/lib/ui/widgets/common/aku_scaffold.dart +++ b/lib/ui/widgets/common/aku_scaffold.dart @@ -65,22 +65,23 @@ class _AkuScaffoldState extends State { Widget build(BuildContext context) { return Scaffold( backgroundColor: widget.backgroundColor, - appBar: AppBar( - backgroundColor: widget.appBarColor, - leading: widget.leading ?? AkuBackButton(), - brightness: widget.brightness, - elevation: 0, - centerTitle: true, - title: DefaultTextStyle( - style: widget.titleStyle ?? - TextStyle( - fontWeight: FontWeight.bold, - color: Color(0xFF333333), - fontSize: 36.sp, - ), - child: Text(widget.title ?? ''), - ), - ), + appBar: widget.appBar ?? + AppBar( + backgroundColor: widget.appBarColor, + leading: widget.leading ?? AkuBackButton(), + brightness: widget.brightness, + elevation: 0, + centerTitle: true, + title: DefaultTextStyle( + style: widget.titleStyle ?? + TextStyle( + fontWeight: FontWeight.bold, + color: Color(0xFF333333), + fontSize: 36.sp, + ), + child: Text(widget.title ?? ''), + ), + ), body: widget.body, bottomNavigationBar: widget.bottom, );