parent
e52b704972
commit
14a5fda462
@ -0,0 +1,50 @@
|
|||||||
|
// class QuestionnaireSubmitModel {
|
||||||
|
// int id;
|
||||||
|
// List<AppQuestionnaireAnswerSubmits> appQuestionnaireAnswerSubmits;
|
||||||
|
|
||||||
|
// QuestionnaireSubmitModel({this.id, this.appQuestionnaireAnswerSubmits});
|
||||||
|
|
||||||
|
// QuestionnaireSubmitModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
// id = json['id'];
|
||||||
|
// if (json['appQuestionnaireAnswerSubmits'] != null) {
|
||||||
|
// appQuestionnaireAnswerSubmits = new List<AppQuestionnaireAnswerSubmits>();
|
||||||
|
// json['appQuestionnaireAnswerSubmits'].forEach((v) {
|
||||||
|
// appQuestionnaireAnswerSubmits
|
||||||
|
// .add(new AppQuestionnaireAnswerSubmits.fromJson(v));
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Map<String, dynamic> toJson() {
|
||||||
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
// data['id'] = this.id;
|
||||||
|
// if (this.appQuestionnaireAnswerSubmits != null) {
|
||||||
|
// data['appQuestionnaireAnswerSubmits'] =
|
||||||
|
// this.appQuestionnaireAnswerSubmits.map((v) => v.toJson()).toList();
|
||||||
|
// }
|
||||||
|
// return data;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
class AppQuestionnaireAnswerSubmits {
|
||||||
|
int topicId;
|
||||||
|
List<int> choiceAnswer;
|
||||||
|
String shortAnswer;
|
||||||
|
|
||||||
|
AppQuestionnaireAnswerSubmits(
|
||||||
|
{this.topicId, this.choiceAnswer, this.shortAnswer});
|
||||||
|
|
||||||
|
AppQuestionnaireAnswerSubmits.fromJson(Map<String, dynamic> json) {
|
||||||
|
topicId = json['topicId'];
|
||||||
|
choiceAnswer = json['choiceAnswer'].cast<int>();
|
||||||
|
shortAnswer = json['shortAnswer'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['topicId'] = this.topicId;
|
||||||
|
data['choiceAnswer'] = this.choiceAnswer;
|
||||||
|
data['shortAnswer'] = this.shortAnswer;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,69 @@
|
|||||||
|
import 'package:akuCommunity/widget/buttons/bee_single_check.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:velocity_x/velocity_x.dart';
|
||||||
|
import 'package:akuCommunity/utils/headers.dart';
|
||||||
|
|
||||||
|
class QuestionnaireTruefalse extends StatefulWidget {
|
||||||
|
final String title;
|
||||||
|
final int selected;
|
||||||
|
final Function(int id) onPressed;
|
||||||
|
QuestionnaireTruefalse({Key key, this.title, this.selected, this.onPressed})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_QuestionnaireTruefalseState createState() => _QuestionnaireTruefalseState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _QuestionnaireTruefalseState extends State<QuestionnaireTruefalse> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
widget.title.text.black.size(32.sp).bold.make(),
|
||||||
|
64.w.heightBox,
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 96.w),
|
||||||
|
child: Flex(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
widget.onPressed(1);
|
||||||
|
},
|
||||||
|
child: BeeSingleCheck(
|
||||||
|
value: 1,
|
||||||
|
groupValue: widget.selected,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
16.w.widthBox,
|
||||||
|
'正确'.text.black.size(28.sp).make(),
|
||||||
|
],
|
||||||
|
).expand(flex: 1),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
widget.onPressed(0);
|
||||||
|
},
|
||||||
|
child: BeeSingleCheck(
|
||||||
|
value: 0,
|
||||||
|
groupValue: widget.selected,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
16.w.widthBox,
|
||||||
|
'错误'.text.black.size(28.sp).make(),
|
||||||
|
],
|
||||||
|
).expand(flex: 1),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue