fix home draw display

hmxc
小赖 4 years ago
parent a20b53725b
commit 8e12d18437

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -0,0 +1,4 @@
class UserInfoModel {
String nickName;
String avatarPath;
}

@ -1,10 +1,18 @@
import 'package:flutter/material.dart';
//
class UserProvider extends ChangeNotifier{
bool _isSigned=false;
///
get isSigned=>_isSigned;
///
setisSigned (bool state){
_isSigned=state;
notifyListeners();
}
}

@ -1,3 +1,4 @@
import 'package:aku_community_manager/const/resource.dart';
import 'package:aku_community_manager/provider/user_provider.dart';
import 'package:aku_community_manager/style/app_style.dart';
import 'package:aku_community_manager/ui/login/login_page.dart';
@ -18,17 +19,19 @@ class PersonalDraw extends StatefulWidget {
}
class _PersonalDrawState extends State<PersonalDraw> {
Widget _myListTile(IconData iconData, String text, {VoidCallback onPressed}) {
Widget _myListTile(String path, String text, {VoidCallback onPressed}) {
return AkuButton(
onPressed: onPressed,
child: Container(
width: double.infinity,
height: 96.w,
padding: EdgeInsets.only(left: 32.w, top: 28.w, bottom: 28.w),
child: Row(children: [
Icon(
iconData,
size: 40.w,
padding: EdgeInsets.only(left: 32.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Image.asset(
path,
width: 40.w,
height: 40.w,
),
SizedBox(width: 16.w),
Text(
@ -38,7 +41,8 @@ class _PersonalDrawState extends State<PersonalDraw> {
fontSize: 28.sp,
),
),
]),
],
),
),
);
}
@ -46,7 +50,9 @@ class _PersonalDrawState extends State<PersonalDraw> {
@override
Widget build(BuildContext context) {
final userProvider = Provider.of<UserProvider>(context);
return Drawer(
return SizedBox(
width: 465.w,
child: Drawer(
child: ListView(
children: [
SizedBox(
@ -110,7 +116,7 @@ class _PersonalDrawState extends State<PersonalDraw> {
),
),
_myListTile(
Icons.contact_page,
R.ASSETS_USER_IC_PERSON_PNG,
'个人信息',
onPressed: () {
userProvider.isSigned
@ -118,12 +124,13 @@ class _PersonalDrawState extends State<PersonalDraw> {
: Get.to(LoginPage());
},
),
_myListTile(Icons.supervised_user_circle, '联系客服'),
_myListTile(Icons.settings, '设置', onPressed: () {
_myListTile(R.ASSETS_USER_IC_KEFU_PNG, '联系客服'),
_myListTile(R.ASSETS_USER_IC_SETUP_PNG, '设置', onPressed: () {
Get.to(SettingsPage());
}),
],
),
),
);
}
}

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

Loading…
Cancel
Save