fixed some issues

hmxc
张萌 4 years ago
parent 5f1299867e
commit d6a53a88b9

@ -1,6 +1,8 @@
// Flutter imports: // Flutter imports:
import 'package:akuCommunity/base/base_style.dart'; import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/widget/buttons/bottom_button.dart'; import 'package:akuCommunity/widget/buttons/bottom_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -143,6 +145,9 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
await ManagerFunc.voteDetail(widget.id) await ManagerFunc.voteDetail(widget.id)
.then((value) => _model = value); .then((value) => _model = value);
_isOnload = false; _isOnload = false;
setState(() {
});
}, },
header: MaterialHeader(), header: MaterialHeader(),
child: _isOnload child: _isOnload
@ -194,8 +199,18 @@ class _VotingDetailPageState extends State<VotingDetailPage> {
), ),
), ),
bottomNavi: BottomButton( bottomNavi: BottomButton(
onPressed: () { onPressed: () async {
if (_selectId == null) {
BotToast.showText(text: '请先选择候选人!');
} else {
BaseModel baseModel =
await ManagerFunc.vote(_selectId, widget.id);
if (baseModel.status) {
Get.dialog(_shouwVoteDialog()); Get.dialog(_shouwVoteDialog());
} else {
BotToast.showText(text: '${baseModel.message}');
}
}
}, },
child: '投票'.text.black.size(28.sp).bold.make()), child: '投票'.text.black.size(28.sp).bold.make()),
); );

@ -20,6 +20,7 @@ class _BeeSingleCheckState extends State<BeeSingleCheck> {
height: 40.w, height: 40.w,
width: 40.w, width: 40.w,
decoration: BoxDecoration( decoration: BoxDecoration(
color: kPrimaryColor.withOpacity(_selected ? 1 : 0),
border: Border.all( border: Border.all(
color: _selected ? kPrimaryColor : Color(0xFF979797), color: _selected ? kPrimaryColor : Color(0xFF979797),
width: 3.w, width: 3.w,
@ -34,9 +35,9 @@ class _BeeSingleCheckState extends State<BeeSingleCheck> {
curve: Curves.easeInOutCubic, curve: Curves.easeInOutCubic,
opacity: _selected ? 1 : 0, opacity: _selected ? 1 : 0,
child: Icon( child: Icon(
CupertinoIcons.chevron_up, CupertinoIcons.checkmark,
color: Colors.white, color: Colors.white,
size: 24.w, size: 28.w,
), ),
), ),
); );

Loading…
Cancel
Save