修复话题页面添加动态

hmxc
小赖 4 years ago
parent 5de81e360a
commit e3dd5ed9e3

@ -96,7 +96,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
child: ClipOval(
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
image: API.image(userProvider.userInfoModel.imgUrl),
image: API.image(userProvider.userInfoModel?.imgUrl ?? ''),
height: 56.w,
width: 56.w,
fit: BoxFit.cover,
@ -107,7 +107,7 @@ class _UserProfilePageState extends State<UserProfilePage> {
),
_buildTile(
'姓名',
userProvider.userInfoModel.name.text.make(),
(userProvider.userInfoModel?.name ?? '').text.make(),
onPressed: () {},
),
_buildTile(
@ -119,7 +119,9 @@ class _UserProfilePageState extends State<UserProfilePage> {
),
_buildTile(
'手机号',
TextUtil.hideNumber(userProvider.userInfoModel.tel).text.make(),
TextUtil.hideNumber(userProvider.userInfoModel?.tel ?? '')
.text
.make(),
onPressed: () {
Get.to(() => UpdateTelPage());
},

@ -18,7 +18,17 @@ import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:akuCommunity/widget/picker/grid_image_picker.dart';
class AddNewEventPage extends StatefulWidget {
AddNewEventPage({Key key}) : super(key: key);
final int initTopic;
final String topicName;
AddNewEventPage({Key key})
: initTopic = null,
topicName = null,
super(key: key);
AddNewEventPage.topic({
Key key,
@required this.initTopic,
@required this.topicName,
}) : super(key: key);
@override
_AddNewEventPageState createState() => _AddNewEventPageState();
@ -40,12 +50,17 @@ class _AddNewEventPageState extends State<AddNewEventPage> {
}
Map<String, dynamic> params = {
'gambitId': _hotTopicModel == null ? -1 : _hotTopicModel.id,
'content': content,
'isComment': _commentable ? 1 : 0,
'isPublic': 1,
'imgUrls': imgs,
};
if (widget.initTopic != null) {
params.putIfAbsent('gambitId', () => widget.initTopic);
} else {
params.putIfAbsent(
'gambitId', () => _hotTopicModel == null ? -1 : _hotTopicModel.id);
}
BaseModel baseModel = await NetUtil().post(
API.community.addEvent,
@ -187,7 +202,13 @@ class _AddNewEventPageState extends State<AddNewEventPage> {
_buildSelectable(),
Divider(height: 1.w),
28.hb,
_pickTopic(),
if (widget.initTopic == null) _pickTopic(),
Align(
alignment: Alignment.centerLeft,
child: _renderTopic(
HotTopicModel(name: widget.topicName, id: widget.initTopic),
),
),
],
).material(color: Colors.white),
);

@ -36,7 +36,10 @@ class _TopicDetailPageState extends State<TopicDetailPage> {
heroTag: 'event_add',
onPressed: () async {
if (LoginUtil.isNotLogin) return;
bool result = await Get.to(() => AddNewEventPage());
bool result = await Get.to(() => AddNewEventPage.topic(
topicName: widget.model.summary,
initTopic: widget.model.id,
));
},
child: Icon(Icons.add),
),

@ -345,7 +345,7 @@ class _ChatCardState extends State<ChatCard> {
shape: StadiumBorder(
side: BorderSide(),
),
),
).pOnly(top: 10.w),
Row(
children: [
64.hb,

Loading…
Cancel
Save