update settings page

hmxc
小赖 4 years ago
parent 166d957f9d
commit f251294677

@ -184,7 +184,6 @@ class _HomePageState extends State<HomePage> {
Icons.access_alarm,
size: 48.w,
),
SizedBox(height: 2.w),
Text(
'扫一扫',
style: TextStyle(
@ -208,7 +207,6 @@ class _HomePageState extends State<HomePage> {
Icons.access_time,
size: 48.w,
),
SizedBox(height: 2.w),
Text(
'消息',
style: TextStyle(

@ -54,7 +54,6 @@ class _PersonalDrawState extends State<PersonalDraw> {
Container(
margin: EdgeInsets.only(bottom: 80.w),
width: double.infinity,
height: 72.w,
child: Row(
children: [
SizedBox(width: 32.w),

@ -1,5 +1,8 @@
import 'package:aku_community_manager/ui/widgets/common/aku_scaffold.dart';
import 'package:aku_community_manager/ui/widgets/common/aku_tile.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
class SettingsPage extends StatefulWidget {
SettingsPage({Key key}) : super(key: key);
@ -12,8 +15,37 @@ class _SettingsPageState extends State<SettingsPage> {
@override
Widget build(BuildContext context) {
return AkuScaffold(
title: '设置',
body: Text('test'),
title: '设置',
body: ListView(
padding: EdgeInsets.symmetric(
vertical: 16.w,
),
children: [
AkuTile(
title: Text('是否接受信息通知'),
arrow: false,
suffix: CupertinoSwitch(
value: false,
onChanged: (value) {},
),
),
Divider(height: 1.w),
AkuTile(
title: Text('关于我们'),
arrow: true,
),
Divider(height: 1.w),
AkuTile(
title: Text('意见反馈'),
arrow: true,
),
Divider(height: 1.w),
AkuTile(
title: Text('清理缓存'),
arrow: true,
),
],
),
);
}
}

@ -0,0 +1,67 @@
import 'package:aku_ui/common_widgets/aku_material_button.dart';
import 'package:flutter/material.dart';
import 'package:aku_community_manager/tools/screen_tool.dart';
class AkuTile extends StatefulWidget {
final Widget prefix;
final Widget suffix;
final Widget title;
final bool arrow;
final Color color;
final double height;
final VoidCallback onTap;
AkuTile({
Key key,
this.prefix,
this.suffix,
this.title,
this.arrow = true,
this.onTap,
this.color = Colors.white,
this.height,
}) : super(key: key);
@override
_AkuTileState createState() => _AkuTileState();
}
class _AkuTileState extends State<AkuTile> {
double get height => widget.height ?? 96.w;
@override
Widget build(BuildContext context) {
return SizedBox(
height: height,
child: Material(
color: widget.color,
child: InkWell(
onTap: widget.onTap,
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: Row(
children: [
widget.prefix ?? SizedBox(),
DefaultTextStyle(
style: TextStyle(
color: Color(0xFF333333),
fontSize: 28.sp,
),
child: widget.title,
),
Spacer(),
widget.suffix ?? SizedBox(),
widget.arrow
? Icon(
Icons.arrow_forward_ios,
size: 24.w,
color: Color(0xFF999999),
)
: SizedBox(),
],
),
),
),
),
);
}
}
Loading…
Cancel
Save