张萌 4 years ago
commit 79c161bab9

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@ -0,0 +1 @@
cwebp -q 60 -resize 1000 0 $1 -o ./assets/static_temp/$2

@ -1,4 +1,8 @@
class UserInfoModel {
String nickName;
String avatarPath;
UserInfoModel({
this.nickName,
this.avatarPath,
});
}

@ -1,18 +1,29 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/mock_models/users/user_info_model.dart';
import 'package:flutter/material.dart';
//
class UserProvider extends ChangeNotifier{
class UserProvider extends ChangeNotifier {
bool _isSigned = false;
bool _isSigned=false;
///
get isSigned=>_isSigned;
get isSigned => _isSigned;
///
setisSigned (bool state){
_isSigned=state;
notifyListeners();
setisSigned(bool state) {
_isSigned = state;
notifyListeners();
}
UserInfoModel _userInfoModel = UserInfoModel(
nickName: '李大海',
avatarPath: R.ASSETS_STATIC_TEMP_F3_WEBP,
);
UserInfoModel get userInfoModel => _userInfoModel;
}
setNickName(String name) {
_userInfoModel.nickName = name;
notifyListeners();
}
}

@ -1,11 +1,17 @@
import 'package:aku_community_manager/provider/user_provider.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/home/home_page.dart';
import 'package:aku_community_manager/ui/settings/setting_feedback_page.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
class SettingsPage extends StatefulWidget {
SettingsPage({Key key}) : super(key: key);
@ -17,6 +23,7 @@ class SettingsPage extends StatefulWidget {
class _SettingsPageState extends State<SettingsPage> {
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return AkuScaffold(
title: '设置',
body: ListView(
@ -49,6 +56,20 @@ class _SettingsPageState extends State<SettingsPage> {
arrow: true,
onTap: () => BotToast.showText(text: '缓存清理完成'),
),
AkuBox.h(320),
userProvider.isSigned
? Padding(
padding: EdgeInsets.symmetric(horizontal: 64.w),
child: AkuMaterialButton(
color: AppStyle.primaryColor,
onPressed: () {
userProvider.setisSigned(false);
Get.offAll(HomePage());
},
child: Text('退出登录'),
),
)
: SizedBox(),
],
),
);

@ -0,0 +1,107 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/fake_activity_model.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
class ActivityDetailPage extends StatefulWidget {
final FakeActivityManagerModel model;
ActivityDetailPage({Key key, @required this.model}) : super(key: key);
@override
_ActivityDetailPageState createState() => _ActivityDetailPageState();
}
class _ActivityDetailPageState extends State<ActivityDetailPage> {
static const String format = 'yyyy年MM月dd日HH:mm';
String get startDate =>
DateUtil.formatDate(widget.model.dateStart, format: format);
String get endDate =>
DateUtil.formatDate(widget.model.dateEnd, format: format);
String get checkInDate =>
DateUtil.formatDate(widget.model.checkInDate, format: format);
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '活动详情',
body: ListView(
children: [
Hero(
tag: widget.model.title,
child: Image.asset(
widget.model.imgPath,
height: 228.w,
fit: BoxFit.cover,
),
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 24.w,
horizontal: 32.w,
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
widget.model.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 36.sp,
fontWeight: FontWeight.bold,
),
),
AkuBox.h(16),
Text(
widget.model.article,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
),
),
AkuBox.h(40),
_buildTile('开始时间', startDate),
_buildTile('结束时间', endDate),
_buildTile('地点', widget.model.location),
_buildTile('参与人数', widget.model.people),
_buildTile('报名截止', checkInDate),
],
),
),
],
),
);
}
_buildTile(String title, String subTitle) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 6.w),
child: Row(
children: [
SizedBox(
width: 164.w,
child: Text(
title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
),
),
),
Expanded(
child: Text(
subTitle,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.w,
fontWeight: FontWeight.bold,
),
),
),
],
),
);
}
}

@ -0,0 +1,113 @@
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/tools/widget_tool.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_detail_page.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/fake_activity_model.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
import 'package:get/route_manager.dart';
class ActivityManagerCard extends StatelessWidget {
String get startDate =>
DateUtil.formatDate(model.dateStart, format: 'yyyy-MM-dd');
String get endDate =>
DateUtil.formatDate(model.dateEnd, format: 'yyyy-MM-dd');
final FakeActivityManagerModel model;
const ActivityManagerCard({Key key, @required this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: GestureDetector(
onTap: () {
Get.to(ActivityDetailPage(model: model));
},
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
ClipRRect(
borderRadius: BorderRadius.vertical(top: Radius.circular(8.w)),
child: Container(
height: 228.w,
width: double.infinity,
child: Hero(
tag: model.title,
child: Image.asset(
model.imgPath,
fit: BoxFit.cover,
),
),
),
),
Container(
padding: EdgeInsets.all(24.w),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.title,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 28.sp,
fontWeight: FontWeight.bold,
),
),
AkuBox.h(12),
_buildTile('主办方:', model.hostName),
_buildTile('地点:', model.location),
_buildTile('报名时间:', '$startDate\$endDate'),
],
),
),
],
),
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.w),
border: Border.all(
color: Color(0xFFE8E8E8),
width: 2.w,
),
boxShadow: [
BoxShadow(
offset: Offset(0, 2.w),
blurRadius: 20.w,
color: Color(0xFFEFEFEF),
)
],
),
);
}
_buildTile(String title, String subTitle) {
return Row(
children: [
SizedBox(
width: 120.w,
child: Text(
title,
style: TextStyle(
color: AppStyle.minorTextColor,
fontSize: 24.sp,
),
),
),
Expanded(
child: Text(
subTitle,
style: TextStyle(
color: AppStyle.primaryTextColor,
fontSize: 24.sp,
),
),
),
],
);
}
}

@ -1,3 +1,5 @@
import 'package:aku_community_manager/ui/sub_pages/activity_manager/activity_manager_card.dart';
import 'package:aku_community_manager/ui/sub_pages/activity_manager/fake_activity_model.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:flutter/material.dart';
@ -13,10 +15,12 @@ class _ActivityManagerPageState extends State<ActivityManagerPage> {
Widget build(BuildContext context) {
return AkuScaffold(
title: '活动管理',
body: ListView(
children: [
Text('a'),
],
body: ListView.builder(
itemBuilder: (context, index) {
final model = fakeAcitivityManagerModels[index];
return ActivityManagerCard(model: model);
},
itemCount: fakeAcitivityManagerModels.length,
),
);
}

@ -0,0 +1,57 @@
import 'package:aku_community_manager/const/resource.dart';
class FakeActivityManagerModel {
String title;
String imgPath;
String location;
String hostName;
String article;
String people;
DateTime dateStart;
DateTime dateEnd;
DateTime checkInDate;
FakeActivityManagerModel({
this.title,
this.imgPath,
this.location,
this.hostName,
this.article,
this.people,
this.dateStart,
this.dateEnd,
this.checkInDate,
});
}
List<FakeActivityManagerModel> fakeAcitivityManagerModels = [
FakeActivityManagerModel(
title: '华茂悦峰社区第三届六一亲子活动',
imgPath: R.ASSETS_STATIC_TEMP_F1_WEBP,
location: '中央活动区',
hostName: '深圳万科物业有限公司',
article:
'''为丰富文化体育生活,不断增进小区凝聚力和人与人之间的协作能力,市委政法委机关党办、机关工会联合举办“我参与、我健康、我快乐”系列主题活动。
姿
''',
people: '不限',
dateStart: DateTime(2020, 4, 12, 12, 0),
dateEnd: DateTime(2020, 4, 15, 12, 0),
checkInDate: DateTime(2020, 4, 13, 12, 0),
),
FakeActivityManagerModel(
title: '宁化社区第一届煎蛋比赛报名开始',
imgPath: R.ASSETS_STATIC_TEMP_F5_WEBP,
location: '中央活动区',
hostName: '深圳万科物业有限公司',
article:
'''为丰富文化体育生活,不断增进小区凝聚力和人与人之间的协作能力,市委政法委机关党办、机关工会联合举办“我参与、我健康、我快乐”系列主题活动。
姿
''',
people: '不限',
dateStart: DateTime(2020, 4, 12, 12, 0),
dateEnd: DateTime(2020, 4, 15, 12, 0),
checkInDate: DateTime(2020, 4, 13, 12, 0),
),
];

@ -70,6 +70,8 @@ flutter:
- assets/home/
- assets/user/
- assets/message/
- assets/static_temp/
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg

Loading…
Cancel
Save