|
|
@ -1,3 +1,5 @@
|
|
|
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
import 'package:akuCommunity/base/base_style.dart';
|
|
|
|
import 'package:akuCommunity/pages/personal/change_nick_name_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/personal/change_nick_name_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/personal/update_tel_page.dart';
|
|
|
|
import 'package:akuCommunity/pages/personal/update_tel_page.dart';
|
|
|
@ -8,6 +10,7 @@ import 'package:common_utils/common_utils.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
import 'package:get/get.dart';
|
|
|
|
|
|
|
|
import 'package:image_picker/image_picker.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
|
|
|
|
|
|
|
@ -52,6 +55,32 @@ class _UserProfilePageState extends State<UserProfilePage> {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_pickAvatar() async {
|
|
|
|
|
|
|
|
PickedFile file = await Get.bottomSheet(CupertinoActionSheet(
|
|
|
|
|
|
|
|
title: '选择头像'.text.isIntrinsic.make(),
|
|
|
|
|
|
|
|
actions: [
|
|
|
|
|
|
|
|
CupertinoDialogAction(
|
|
|
|
|
|
|
|
onPressed: () async => Get.back(
|
|
|
|
|
|
|
|
result: await ImagePicker().getImage(source: ImageSource.gallery),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: '相册'.text.isIntrinsic.make(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
CupertinoDialogAction(
|
|
|
|
|
|
|
|
onPressed: () async => Get.back(
|
|
|
|
|
|
|
|
result: await ImagePicker().getImage(source: ImageSource.camera),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: '相机'.text.isIntrinsic.make(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
cancelButton: CupertinoDialogAction(
|
|
|
|
|
|
|
|
onPressed: Get.back,
|
|
|
|
|
|
|
|
child: '取消'.text.isIntrinsic.make(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
if (file == null) return;
|
|
|
|
|
|
|
|
//TODO upload avatar.
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final userProvider = Provider.of<UserProvider>(context);
|
|
|
|
final userProvider = Provider.of<UserProvider>(context);
|
|
|
@ -59,11 +88,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
|
|
|
|
title: '个人资料',
|
|
|
|
title: '个人资料',
|
|
|
|
body: ListView(
|
|
|
|
body: ListView(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
_buildTile(
|
|
|
|
_buildTile('头像', CircleAvatar(), onPressed: _pickAvatar),
|
|
|
|
'头像',
|
|
|
|
|
|
|
|
CircleAvatar(),
|
|
|
|
|
|
|
|
onPressed: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
_buildTile(
|
|
|
|
_buildTile(
|
|
|
|
'姓名',
|
|
|
|
'姓名',
|
|
|
|
userProvider.userInfoModel.name.text.make(),
|
|
|
|
userProvider.userInfoModel.name.text.make(),
|
|
|
|