优化话题列表AppBar显示

hmxc
小赖 4 years ago
parent d0cf1b61e2
commit 6425e6956a

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

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

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

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

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

@ -26,7 +26,7 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
top: 0,
bottom: 0,
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(
left: 0,
top: ScreenUtil().statusBarHeight,
child: BeeBackButton().material(
child: BeeBackButton(color: Colors.white).material(
color: Colors.transparent,
clipBehavior: Clip.antiAlias,
borderRadius: BorderRadius.circular(24),
@ -47,7 +47,7 @@ class TopicSliverHeader extends SliverPersistentHeaderDelegate {
return Positioned(
bottom: 202.w - 195.w * _filterOffset(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,
child: Opacity(
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,
),
),
Positioned(
left: 0,
right: 0,
top: 0,
bottom: 0,
child: Material(color: Colors.black.withOpacity(0.4)),
),
_buildOverlay(shrinkOffset),
_buildBackButton(),
_buildTitle(shrinkOffset),

Loading…
Cancel
Save