优化话题列表AppBar显示

hmxc
小赖 4 years ago
parent d0cf1b61e2
commit 6425e6956a

@ -22,7 +22,10 @@ import 'package:akuCommunity/utils/headers.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setSystemUIOverlayStyle( SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(statusBarColor: Colors.transparent), SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
systemNavigationBarColor: Colors.white,
),
); );
JPush jpush = new JPush(); JPush jpush = new JPush();
jpush.addEventHandler( jpush.addEventHandler(

@ -15,14 +15,8 @@ class _AgreementPageState extends State<AgreementPage> {
title: '用户协议', title: '用户协议',
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(16.w), padding: EdgeInsets.all(16.w),
child: Column( child: Text(
children: [ '''
Text(
'《用户协议》',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 35.w),
),
Text(
'''
使APP 使APP
使APP使 使APP使
@ -221,11 +215,9 @@ class _AgreementPageState extends State<AgreementPage> {
20201021 20201021
''', ''',
style: TextStyle( style: TextStyle(
fontSize: 30.w, fontSize: 30.w,
), ),
),
],
), ),
), ),
); );

@ -16,14 +16,8 @@ class _PrivacyPageState extends State<PrivacyPage> {
title: '隐私政策', title: '隐私政策',
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(16.sp), padding: EdgeInsets.all(16.sp),
child: Column( child: Text(
children: [ '''
Text(
'小蜜蜂智慧社区隐私政策',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 35.w),
),
Text(
'''
APPAPP便使使 APPAPP便使使
1. 1.
@ -124,11 +118,9 @@ class _PrivacyPageState extends State<PrivacyPage> {
20201020 20201020
''', ''',
style: TextStyle( style: TextStyle(
fontSize: 30.w, fontSize: 30.w,
), ),
),
],
), ),
), ),
); );

@ -99,6 +99,7 @@ class _TabNavigatorState extends State<TabNavigator>
bottomNavigationBar: StatefulBuilder(builder: (context, setFunc) { bottomNavigationBar: StatefulBuilder(builder: (context, setFunc) {
return BottomNavigationBar( return BottomNavigationBar(
items: _bottomNav, items: _bottomNav,
backgroundColor: Colors.white,
currentIndex: _currentIndex, currentIndex: _currentIndex,
selectedFontSize: 20.sp, selectedFontSize: 20.sp,
unselectedFontSize: 20.sp, unselectedFontSize: 20.sp,

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -31,57 +32,60 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
floatingActionButton: FloatingActionButton( value: SystemUiOverlayStyle.light,
heroTag: 'event_add', child: Scaffold(
onPressed: () async { floatingActionButton: FloatingActionButton(
if (LoginUtil.isNotLogin) return; heroTag: 'event_add',
bool result = await Get.to(() => AddNewEventPage.topic( onPressed: () async {
topicName: widget.model.summary, if (LoginUtil.isNotLogin) return;
initTopic: widget.model.id, bool result = await Get.to(() => AddNewEventPage.topic(
)); topicName: widget.model.summary,
}, initTopic: widget.model.id,
child: Icon(Icons.add), ));
), },
body: BeeListView( child: Icon(Icons.add),
convert: (model) { ),
return model.tableList body: BeeListView(
.map((e) => EventItemModel.fromJson(e)) convert: (model) {
.toList(); return model.tableList
}, .map((e) => EventItemModel.fromJson(e))
path: API.community.eventByTopicId, .toList();
extraParams: {'gambitId': widget.model.id}, },
controller: _refreshController, path: API.community.eventByTopicId,
builder: (items) { extraParams: {'gambitId': widget.model.id},
return CustomScrollView( controller: _refreshController,
slivers: [ builder: (items) {
SliverPersistentHeader( return CustomScrollView(
delegate: TopicSliverHeader( slivers: [
id: widget.model.id, SliverPersistentHeader(
title: widget.model.summary, delegate: TopicSliverHeader(
imgPath: widget.model.firstImg, id: widget.model.id,
subTitle: widget.model.content, title: widget.model.summary,
imgPath: widget.model.firstImg,
subTitle: widget.model.content,
),
pinned: true,
floating: true,
), ),
pinned: true, SliverList(
floating: true, delegate: SliverChildBuilderDelegate(
), (context, index) {
SliverList( final item = items[index] as EventItemModel;
delegate: SliverChildBuilderDelegate( return ChatCard(
(context, index) { model: item,
final item = items[index] as EventItemModel; onDelete: () {
return ChatCard( _refreshController.callRefresh();
model: item, },
onDelete: () { );
_refreshController.callRefresh(); },
}, childCount: items.length,
); ),
},
childCount: items.length,
), ),
), ],
], );
); },
}, ),
), ),
); );
} }

@ -26,7 +26,7 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
top: 0, top: 0,
bottom: 0, bottom: 0,
child: Material( child: Material(
color: Colors.white.withOpacity(0 + 0.5 * _offset(shrinkOffset)), color: Colors.black.withOpacity(0 + 0.5 * _offset(shrinkOffset)),
), ),
); );
} }
@ -35,7 +35,7 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
return Positioned( return Positioned(
left: 0, left: 0,
top: ScreenUtil().statusBarHeight, top: ScreenUtil().statusBarHeight,
child: BeeBackButton().material( child: BeeBackButton(color: Colors.white).material(
color: Colors.transparent, color: Colors.transparent,
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(24), borderRadius: BorderRadius.circular(24),
@ -47,7 +47,7 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
return Positioned( return Positioned(
bottom: 202.w - 195.w * _filterOffset(shrinkOffset), bottom: 202.w - 195.w * _filterOffset(shrinkOffset),
left: 32.w + (95.w - 32.w) * _offset(shrinkOffset), left: 32.w + (95.w - 32.w) * _offset(shrinkOffset),
child: '#$title'.text.bold.size(52.sp).make(), child: '#$title'.text.bold.white.size(52.sp).make(),
); );
} }
@ -57,7 +57,15 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
left: 32.w, left: 32.w,
child: Opacity( child: Opacity(
opacity: 1 - _offset(shrinkOffset), opacity: 1 - _offset(shrinkOffset),
child: subTitle.text.size(24.sp).make(), child: SizedBox(
width: 500.w,
child: subTitle.text
.size(24.sp)
.maxLines(2)
.white
.overflow(TextOverflow.ellipsis)
.make(),
),
), ),
); );
} }
@ -78,6 +86,13 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
Positioned(
left: 0,
right: 0,
top: 0,
bottom: 0,
child: Material(color: Colors.black.withOpacity(0.4)),
),
_buildOverlay(shrinkOffset), _buildOverlay(shrinkOffset),
_buildBackButton(), _buildBackButton(),
_buildTitle(shrinkOffset), _buildTitle(shrinkOffset),

Loading…
Cancel
Save