咨询建议和投诉表扬新增页面添加默认值

hmxc
小赖 4 years ago
parent 28c9919f23
commit 5aef719471

@ -179,7 +179,10 @@ class _AdvicePageState extends State<AdvicePage> with TickerProviderStateMixin {
),
secondChild: BottomButton(
onPressed: () async {
bool needRefresh = await Get.to(NewAdvicePage(type: widget.type));
bool needRefresh = await Get.to(NewAdvicePage(
type: widget.type,
initType: _tabController.index,
));
if (needRefresh == true) {
_refreshController.callRefresh();
Get.dialog(CupertinoAlertDialog(

@ -25,14 +25,16 @@ import 'package:akuCommunity/widget/picker/grid_image_picker.dart';
class NewAdvicePage extends StatefulWidget {
final AdviceType type;
NewAdvicePage({Key key, @required this.type}) : super(key: key);
final int initType;
NewAdvicePage({Key key, @required this.type, @required this.initType})
: super(key: key);
@override
_NewAdvicePageState createState() => _NewAdvicePageState();
}
class _NewAdvicePageState extends State<NewAdvicePage> {
int _type = 0;
int _type;
List<File> _files = [];
TextEditingController _editingController = TextEditingController();
GlobalKey<FormState> _formKey = GlobalKey<FormState>();
@ -115,6 +117,12 @@ class _NewAdvicePageState extends State<NewAdvicePage> {
}
}
@override
void initState() {
super.initState();
_type = widget.initType;
}
@override
void dispose() {
_editingController.dispose();

Loading…
Cancel
Save