From ea4071332d005507b2361003d6b69649f8732c4a Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Fri, 15 Jan 2021 17:42:02 +0800 Subject: [PATCH 1/2] update message icon --- lib/pages/community/community_index.dart | 44 +++++++++++++----------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/lib/pages/community/community_index.dart b/lib/pages/community/community_index.dart index 282459f0..49d5a37e 100644 --- a/lib/pages/community/community_index.dart +++ b/lib/pages/community/community_index.dart @@ -1,12 +1,11 @@ +import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/pages/community/note_create_page.dart'; +import 'package:akuCommunity/widget/bee_scaffold.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; -import 'package:flutter_icons/flutter_icons.dart'; import 'package:akuCommunity/utils/headers.dart'; -import 'package:akuCommunity/widget/app_bar_action.dart'; -import 'package:akuCommunity/routers/page_routers.dart'; -import 'package:get/get.dart'; import 'widget/tab_list.dart'; +import 'package:velocity_x/velocity_x.dart'; class CommunityIndex extends StatefulWidget { CommunityIndex({Key key}) : super(key: key); @@ -28,10 +27,6 @@ class _CommunityIndexState extends State {'name': '我的', 'id': 'new'}, ]; - List> actionsList = [ - {'title': '消息', 'icon': AntDesign.bells, 'funtion': null} - ]; - @override void initState() { super.initState(); @@ -44,12 +39,21 @@ class _CommunityIndexState extends State } List _listActions() { - return actionsList - .map((item) => AppBarAction( - title: item['title'], - icon: item['icon'], - )) - .toList(); + return [ + FlatButton( + minWidth: 48.w + 27.w * 2, + onPressed: () {}, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Icon( + CupertinoIcons.bell, + size: 48.w, + ), + '消息'.text.black.size(20.sp).make(), + ], + )) + ]; } AppBar _appBar() { @@ -108,12 +112,12 @@ class _CommunityIndexState extends State appBar: _appBar(), floatingActionButton: _floatingActionButton(), body: TabBarView( - controller: _tabController, - children: List.generate( - tabs.length, - (index) => TabList(index: index), - ), - ), + controller: _tabController, + children: List.generate( + tabs.length, + (index) => TabList(index: index), + ), + ), ); } } From c55cd145c29780f453bec95ec0b4c3e8553b2a47 Mon Sep 17 00:00:00 2001 From: zhang <494089941@qq.com> Date: Fri, 15 Jan 2021 18:06:07 +0800 Subject: [PATCH 2/2] replace scafflod --- lib/pages/community/community_index.dart | 47 +++++++++++++++++++++--- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/lib/pages/community/community_index.dart b/lib/pages/community/community_index.dart index 49d5a37e..947be355 100644 --- a/lib/pages/community/community_index.dart +++ b/lib/pages/community/community_index.dart @@ -107,17 +107,54 @@ class _CommunityIndexState extends State @override Widget build(BuildContext context) { super.build(context); - return Scaffold( - backgroundColor: Colors.white, - appBar: _appBar(), - floatingActionButton: _floatingActionButton(), - body: TabBarView( + return BeeScaffold( + title: '社区', + actions: _listActions(), + body: Column( + children: [ + Material( + color: kForeGroundColor, + child: PreferredSize( + preferredSize: Size.fromHeight(kToolbarHeight), + child: Align( + alignment: Alignment.centerLeft, + child: TabBar( + indicatorPadding: EdgeInsets.zero, + controller: _tabController, + isScrollable: true, + indicatorColor: Color(0xffFFd000), + indicatorWeight: 2.w, + indicatorSize: TabBarIndicatorSize.label, + unselectedLabelStyle: TextStyle( + color: Color(0xFF333333), + fontSize: 28.sp, + ), + labelStyle: TextStyle( + fontSize: 28.sp, + color: Color(0xff333333), + fontWeight: FontWeight.bold, + ), + tabs: List.generate( + tabs.length, + (index) => Tab( + text: tabs[index]['name'], + ), + ), + ), + ), + ), + ), + Expanded( + child: TabBarView( controller: _tabController, children: List.generate( tabs.length, (index) => TabList(index: index), ), ), + ), + ], + ), ); } }