张萌 4 years ago
commit ea21cfb81e

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -108,3 +109,10 @@ class AppTheme {
); );
} }
} }
class SystemStyle {
static const lightStatusBar = SystemUiOverlayStyle(
statusBarIconBrightness: Brightness.light,
systemNavigationBarColor: Colors.white,
);
}

@ -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(

@ -1,3 +1,5 @@
import 'package:akuCommunity/model/common/img_model.dart';
class CommentMessageModel { class CommentMessageModel {
int id; int id;
int gambitThemeId; int gambitThemeId;
@ -8,7 +10,8 @@ class CommentMessageModel {
int sendStatus; int sendStatus;
String createName; String createName;
String createDate; String createDate;
List<ImgUrls> imgUrls; List<ImgModel> imgUrls;
List<ImgModel> headSculpture;
CommentMessageModel( CommentMessageModel(
{this.id, {this.id,
@ -20,7 +23,8 @@ class CommentMessageModel {
this.sendStatus, this.sendStatus,
this.createName, this.createName,
this.createDate, this.createDate,
this.imgUrls}); this.imgUrls,
this.headSculpture});
CommentMessageModel.fromJson(Map<String, dynamic> json) { CommentMessageModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
@ -33,9 +37,15 @@ class CommentMessageModel {
createName = json['createName']; createName = json['createName'];
createDate = json['createDate']; createDate = json['createDate'];
if (json['imgUrls'] != null) { if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>(); imgUrls = [];
json['imgUrls'].forEach((v) { json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v)); imgUrls.add(new ImgModel.fromJson(v));
});
}
if (json['headSculpture'] != null) {
headSculpture = [];
json['headSculpture'].forEach((v) {
headSculpture.add(new ImgModel.fromJson(v));
}); });
} }
} }
@ -57,31 +67,3 @@ class CommentMessageModel {
return data; return data;
} }
} }
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -1,3 +1,4 @@
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flustars/flustars.dart'; import 'package:flustars/flustars.dart';
@ -56,7 +57,8 @@ class _CommentMessagePageState extends State<CommentMessagePage> {
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: model.imgUrls.first.url, image: API.image(ImgModel.first(model.headSculpture)),
fit: BoxFit.cover,
), ),
), ),
10.wb, 10.wb,
@ -85,7 +87,8 @@ class _CommentMessagePageState extends State<CommentMessagePage> {
height: 160.w, height: 160.w,
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: model.imgUrls.first.url, image: API.image(ImgModel.first(model.imgUrls)),
fit: BoxFit.cover,
), ),
), ),
], ],

@ -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,

@ -203,12 +203,13 @@ class _AddNewEventPageState extends State<AddNewEventPage> {
Divider(height: 1.w), Divider(height: 1.w),
28.hb, 28.hb,
if (widget.initTopic == null) _pickTopic(), if (widget.initTopic == null) _pickTopic(),
Align( if (widget.initTopic != null)
alignment: Alignment.centerLeft, Align(
child: _renderTopic( alignment: Alignment.centerLeft,
HotTopicModel(name: widget.topicName, id: widget.initTopic), child: _renderTopic(
HotTopicModel(name: widget.topicName, id: widget.initTopic),
),
), ),
),
], ],
).material(color: Colors.white), ).material(color: Colors.white),
); );

@ -1,4 +1,6 @@
import 'package:akuCommunity/constants/app_theme.dart';
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 +33,60 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return AnnotatedRegion<SystemUiOverlayStyle>(
floatingActionButton: FloatingActionButton( value: SystemStyle.lightStatusBar,
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),

@ -82,21 +82,18 @@ class MyEventCard extends StatelessWidget {
tag: ImgModel.first(model.imgUrl), tag: ImgModel.first(model.imgUrl),
); );
}, },
child: Hero( child: Container(
tag: ImgModel.first(model.imgUrl), clipBehavior: Clip.antiAlias,
child: Container( decoration: BoxDecoration(
clipBehavior: Clip.antiAlias, color: Colors.black12,
decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.w),
color: Colors.black12, ),
borderRadius: BorderRadius.circular(8.w), child: FadeInImage.assetNetwork(
), placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
child: FadeInImage.assetNetwork( image: API.image(ImgModel.first(model.imgUrl)),
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, width: 152.w,
image: API.image(ImgModel.first(model.imgUrl)), height: 152.w,
width: 152.w, fit: BoxFit.cover,
height: 152.w,
fit: BoxFit.cover,
),
), ),
), ),
), ),

@ -100,7 +100,7 @@ class NoticeCard extends StatelessWidget {
tag: ImgModel.first(model.imgUrls), tag: ImgModel.first(model.imgUrls),
child: FadeInImage.assetNetwork( child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: ImgModel.first(model.imgUrls), image: API.image(ImgModel.first(model.imgUrls)),
width: 152.w, width: 152.w,
height: 152.w, height: 152.w,
fit: BoxFit.cover, fit: BoxFit.cover,

@ -19,7 +19,6 @@ class HomeNotification extends StatefulWidget {
} }
class _HomeNotificationState extends State<HomeNotification> { class _HomeNotificationState extends State<HomeNotification> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Row(
@ -38,8 +37,12 @@ class _HomeNotificationState extends State<HomeNotification> {
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
height: 85.w, height: 85.w,
child: AnimatedTextKit( child: AnimatedTextKit(
pause: Duration(milliseconds: 2000),
animatedTexts: widget.items animatedTexts: widget.items
.map((e) => RotateAnimatedText(e.title)) .map((e) => RotateAnimatedText(
e.title,
duration: Duration(milliseconds: 3000),
))
.toList(), .toList(),
repeatForever: true, repeatForever: true,
), ),

Loading…
Cancel
Save