Commit 54346956 by 吴春元

考试系统

提交
parent 81a72517
// ignore_for_file: constant_identifier_names // ignore_for_file: constant_identifier_names
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:special_equipment_flutter/ui/examine/exam/exam_history_page.dart';
import 'package:special_equipment_flutter/ui/examine/exam/exam_page.dart';
import 'package:special_equipment_flutter/ui/examine/exam/exam_result_page.dart';
import 'package:special_equipment_flutter/ui/examine/test/test_page.dart';
import 'package:special_equipment_flutter/ui/examine/test/test_result_page.dart';
import 'package:special_equipment_flutter/ui/examine/test/test_setting_page.dart';
import 'package:special_equipment_flutter/ui/login/login_page.dart'; import 'package:special_equipment_flutter/ui/login/login_page.dart';
import 'package:special_equipment_flutter/ui/main/tab_home_page.dart'; import 'package:special_equipment_flutter/ui/main/tab_home_page.dart';
import 'package:special_equipment_flutter/ui/main/unit/equipment_personnel_page.dart'; import 'package:special_equipment_flutter/ui/main/unit/equipment_personnel_page.dart';
import 'package:special_equipment_flutter/ui/overseer/equipment_list_page.dart';
import 'package:special_equipment_flutter/ui/overseer/overseer_list_page.dart';
import 'package:special_equipment_flutter/ui/overseer/overseer_settings_page.dart';
import 'package:special_equipment_flutter/ui/overseer/unit_list_page.dart';
import 'package:special_equipment_flutter/ui/register/address_page.dart'; import 'package:special_equipment_flutter/ui/register/address_page.dart';
import 'package:special_equipment_flutter/ui/register/register_page1.dart'; import 'package:special_equipment_flutter/ui/register/register_page1.dart';
import 'package:special_equipment_flutter/ui/register/register_page2.dart'; import 'package:special_equipment_flutter/ui/register/register_page2.dart';
...@@ -97,6 +107,36 @@ class RouteString { ...@@ -97,6 +107,36 @@ class RouteString {
///生产单位:日管控、周排查、月调度 已完成详情 ///生产单位:日管控、周排查、月调度 已完成详情
static const String COMPLETED_DETAIL_SC = "/CompletedDetailSc"; static const String COMPLETED_DETAIL_SC = "/CompletedDetailSc";
///考核做题
static const String EXAM_PAGE = "/ExamPage";
///考核结果
static const String EXAM_RESULT_PAGE = "/ExamResultPage";
///考核历史
static const String EXAM_HISTORY_PAGE = "/ExamHistoryPage";
///测试练习
static const String TEST_PAGE = "/TestPage";
///监察人员设置
static const String OVERSEER_SETTINGS_PAGE = "/OverseerSettingsPage";
///监察人-选择单位
static const String UNIT_LIST_PAGE = "/UnitListPage";
///监察人-选择设备
static const String EQUIPMENT_LIST_PAGE = "/EquipmentListPage";
///监察人-考核列表
static const String OVERSEER_LIST_PAGE = "/OverseerListPage";
///测试练习结果页面
static const String TEST_RESULT_PAGE = "/TestResultPage";
///测试练习设置
static const String TEST_SETTING_PAGE = "/TestSettingPage";
static final routes = [ static final routes = [
///登录 ///登录
GetPage(name: LOGIN, page: () => const LoginPage()), GetPage(name: LOGIN, page: () => const LoginPage()),
...@@ -163,6 +203,37 @@ class RouteString { ...@@ -163,6 +203,37 @@ class RouteString {
GetPage( GetPage(
name: MONTH_COMPLETED_DETAIL_SY, name: MONTH_COMPLETED_DETAIL_SY,
page: () => MonthCompletedDetailSyPage()), page: () => MonthCompletedDetailSyPage()),
///考核做题
GetPage(name: EXAM_PAGE, page: () => ExamPage()),
///考核历史
GetPage(name: EXAM_HISTORY_PAGE, page: () => ExamHistoryPage()),
///测试练习
GetPage(name: TEST_PAGE, page: () => TestPage()),
///考核结果
GetPage(name: EXAM_RESULT_PAGE, page: () => ExamResultPage()),
///监察人设置考核
GetPage(name: OVERSEER_SETTINGS_PAGE, page: () => OverseerSettingsPage()),
///监察人选择单位
GetPage(name: UNIT_LIST_PAGE, page: () => UnitListPage()),
///监察人选择设备
GetPage(name: EQUIPMENT_LIST_PAGE, page: () => EquipmentListPage()),
///考核列表
GetPage(name: OVERSEER_LIST_PAGE, page: () => OverseerListPage()),
///测试练习结果
GetPage(name: TEST_RESULT_PAGE, page: () => TestResultPage()),
///测试练习设置
GetPage(name: TEST_SETTING_PAGE, page: () => TestSettingPage()),
// GetPage( // GetPage(
// name: "/shop", // name: "/shop",
// page: () => const ShopPage(), // page: () => const ShopPage(),
......
// ignore_for_file: unnecessary_brace_in_string_interps, non_constant_identifier_names // ignore_for_file: unnecessary_brace_in_string_interps, non_constant_identifier_names
class Api { class Api {
static var IS_DEBUG = true; static var IS_DEBUG = false;
static String URL = // static String URL =
IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.215:8181/"; // IS_DEBUG ? "https://special.sxyztech.cn/" : "http://192.168.19.165:2212/";
///演示 ip ///演示 ip
// static String URL = "http://47.92.138.92:8009/"; // static String URL = "http://47.92.138.92:8009/";
// static String URL = "http://192.168.19.189:8181/"; static String URL = "http://192.168.19.164:8087/";
// static String URL = "http://192.168.19.215:8181/";
// static String URL = "http://192.168.19.165:2212/";
static String START_URL = "special/a/", static String START_URL = "special/a/",
END_URL = "__ajax=true&mobileLogin=true"; END_URL = "__ajax=true&mobileLogin=true";
...@@ -167,4 +168,61 @@ class Api { ...@@ -167,4 +168,61 @@ class Api {
/// 公司账户-首页-设备对比表格 获取使用单位设备数量 /// 公司账户-首页-设备对比表格 获取使用单位设备数量
static String FIND_COUNT = "${URL + START_URL}device/deviceInfo/findCount"; static String FIND_COUNT = "${URL + START_URL}device/deviceInfo/findCount";
/// 获取考核题库
static String EXAMINE_QUESTIONS =
"${URL + START_URL}exam/examPaper/getQuestions";
/// 考核交卷
static String EXAMINE_QUESTIONS_SUBMIT =
"${URL + START_URL}exam/examPaper/submitPaper";
/// 测试练习交卷
static String EXAMINE_TEST_SUBMIT =
"${URL + START_URL}/exam/practicePaper/submitPaper";
/// 获取测试练习题库
static String TEST_QUESTIONS =
"${URL + START_URL}exam/practicePaper/getQuestions";
/// 获取单位列表
static String GET_UNIT_LIST =
"${URL + START_URL}sys/office/findByGradeAndParentIds";
/// 获取单位列表 设备类型
static String GET_EQUIPMENT_LIST =
"${URL + START_URL}sys/office/findDtoByOfficeIdAndTypeIdAndDel";
/// 获取单位-人员(安全总监、安全员)
static String GET_UNIT_PERSON =
"${URL + START_URL}sys/user/selectByOfficeAndRole";
/// 验证登录人是否有考试按钮
static String CHECK_HAVE_EXAM =
"${URL + START_URL}exam/examPerson/checkHaveExam";
/// 获取默认题数
static String FIND_QUESTION_NUM =
"${URL + START_URL}exam/examQuestionNum/findQuestionNum";
/// 获取考核列表
static String GET_OVERSEER_LIST =
"${URL + START_URL}exam/examPerson/findListApp";
/// 获取考核列表 删除
static String GET_OVERSEER_DELETE =
"${URL + START_URL}exam/examPerson/deleteAllApp";
/// 获取考核提交
static String GET_OVERSEER_SAVE = "${URL + START_URL}exam/examPerson/saveApp";
/// 根据设备类型获取总题数
static String FINT_QUESTION_TYPE =
"${URL + START_URL}exam/examQuestion/fintQuestionByType";
/// 考核 是否显示答案
static String SHOW_ANSWER = "${URL + START_URL}sys/dict/showAnswer";
/// 获取考核信息
// static String EXAMINE_PERSON = "${URL + START_URL}/exam/examPerson/checkHaveExam";
} }
class EqQuestionBo {
EqQuestionBo({
this.data,
});
EqQuestionBo.fromJson(dynamic json) {
data = json['data'] != null ? DataEq.fromJson(json['data']) : null;
}
DataEq? data;
EqQuestionBo copyWith({
DataEq? data,
}) =>
EqQuestionBo(
data: data ?? this.data,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class DataEq {
DataEq({
this.num,
this.pdNum,
this.dxNum,
});
DataEq.fromJson(dynamic json) {
num = json['num'];
pdNum = json['pdNum'];
dxNum = json['dxNum'];
}
int? num;
int? pdNum;
int? dxNum;
DataEq copyWith({
int? num,
int? pdNum,
int? dxNum,
}) =>
DataEq(
num: num ?? this.num,
pdNum: pdNum ?? this.pdNum,
dxNum: dxNum ?? this.dxNum,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['num'] = num;
map['pdNum'] = pdNum;
map['dxNum'] = dxNum;
return map;
}
}
class EquipmentListBo {
EquipmentListBo({
this.list,
});
EquipmentListBo.fromJson(dynamic json) {
if (json['list'] != null) {
list = [];
json['list'].forEach((v) {
list?.add(EquiList.fromJson(v));
});
}
}
List<EquiList>? list;
EquipmentListBo copyWith({
List<EquiList>? list,
}) =>
EquipmentListBo(
list: list ?? this.list,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (list != null) {
map['list'] = list?.map((v) => v.toJson()).toList();
}
return map;
}
}
class EquiList {
EquiList({
this.id,
this.name,
});
EquiList.fromJson(dynamic json) {
id = json['id'];
name = json['NAME'];
}
String? id;
String? name;
EquiList copyWith({
String? id,
String? name,
}) =>
EquiList(
id: id ?? this.id,
name: name ?? this.name,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['NAME'] = name;
return map;
}
}
class ExamResultBo {
ExamResultBo({
this.data,
});
ExamResultBo.fromJson(dynamic json) {
data = json['data'] != null ? ExamResultData.fromJson(json['data']) : null;
}
ExamResultData? data;
ExamResultBo copyWith({
ExamResultData? data,
}) =>
ExamResultBo(
data: data ?? this.data,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class ExamResultData {
ExamResultData({
this.id,
this.name,
this.questionNum,
this.score,
this.ccuracy,
this.user,
this.inspectors,
this.correct,
this.error,
this.adopt,
this.unit,
this.dxNum,
this.pdNum,
});
ExamResultData.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
questionNum = json['questionNum'];
score = json['score'];
ccuracy = json['ccuracy'];
user = json['user'] != null ? User.fromJson(json['user']) : null;
inspectors = json['inspectors'] != null
? Inspectors.fromJson(json['inspectors'])
: null;
correct = json['correct'];
error = json['error'];
adopt = json['adopt'];
unit = json['unit'] != null ? Unit.fromJson(json['unit']) : null;
dxNum = json['dxNum'];
pdNum = json['pdNum'];
}
String? id;
String? name;
num? questionNum;
num? score;
num? ccuracy;
User? user;
Inspectors? inspectors;
num? correct;
num? error;
String? adopt;
Unit? unit;
num? dxNum;
num? pdNum;
ExamResultData copyWith({
String? id,
String? name,
num? questionNum,
num? score,
num? ccuracy,
User? user,
Inspectors? inspectors,
num? correct,
num? error,
String? adopt,
Unit? unit,
num? dxNum,
num? pdNum,
}) =>
ExamResultData(
id: id ?? this.id,
name: name ?? this.name,
questionNum: questionNum ?? this.questionNum,
score: score ?? this.score,
ccuracy: ccuracy ?? this.ccuracy,
user: user ?? this.user,
inspectors: inspectors ?? this.inspectors,
correct: correct ?? this.correct,
error: error ?? this.error,
adopt: adopt ?? this.adopt,
unit: unit ?? this.unit,
dxNum: dxNum ?? this.dxNum,
pdNum: pdNum ?? this.pdNum,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['questionNum'] = questionNum;
map['score'] = score;
map['ccuracy'] = ccuracy;
if (user != null) {
map['user'] = user?.toJson();
}
if (inspectors != null) {
map['inspectors'] = inspectors?.toJson();
}
map['correct'] = correct;
map['error'] = error;
map['adopt'] = adopt;
if (unit != null) {
map['unit'] = unit?.toJson();
}
map['dxNum'] = dxNum;
map['pdNum'] = pdNum;
return map;
}
}
class Unit {
Unit({
this.id,
this.name,
this.sort,
this.hasChildren,
this.parentId,
});
Unit.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
sort = json['sort'];
hasChildren = json['hasChildren'];
parentId = json['parentId'];
}
String? id;
String? name;
num? sort;
bool? hasChildren;
String? parentId;
Unit copyWith({
String? id,
String? name,
num? sort,
bool? hasChildren,
String? parentId,
}) =>
Unit(
id: id ?? this.id,
name: name ?? this.name,
sort: sort ?? this.sort,
hasChildren: hasChildren ?? this.hasChildren,
parentId: parentId ?? this.parentId,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['sort'] = sort;
map['hasChildren'] = hasChildren;
map['parentId'] = parentId;
return map;
}
}
class Inspectors {
Inspectors({
this.id,
this.loginFlag,
this.roleNames,
this.admin,
});
Inspectors.fromJson(dynamic json) {
id = json['id'];
loginFlag = json['loginFlag'];
roleNames = json['roleNames'];
admin = json['admin'];
}
String? id;
String? loginFlag;
String? roleNames;
bool? admin;
Inspectors copyWith({
String? id,
String? loginFlag,
String? roleNames,
bool? admin,
}) =>
Inspectors(
id: id ?? this.id,
loginFlag: loginFlag ?? this.loginFlag,
roleNames: roleNames ?? this.roleNames,
admin: admin ?? this.admin,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['loginFlag'] = loginFlag;
map['roleNames'] = roleNames;
map['admin'] = admin;
return map;
}
}
class User {
User({
this.id,
this.loginFlag,
this.roleNames,
this.admin,
});
User.fromJson(dynamic json) {
id = json['id'];
loginFlag = json['loginFlag'];
roleNames = json['roleNames'];
admin = json['admin'];
}
String? id;
String? loginFlag;
String? roleNames;
bool? admin;
User copyWith({
String? id,
String? loginFlag,
String? roleNames,
bool? admin,
}) =>
User(
id: id ?? this.id,
loginFlag: loginFlag ?? this.loginFlag,
roleNames: roleNames ?? this.roleNames,
admin: admin ?? this.admin,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['loginFlag'] = loginFlag;
map['roleNames'] = roleNames;
map['admin'] = admin;
return map;
}
}
class ExamSettingSubmitBo {
ExamSettingSubmitBo({
this.aqzgPdNum,
this.aqzgXzNum,
this.aqyPdNum,
this.aqyXzNum,
this.aqzgIds,
this.aqyIds,
this.type,
});
ExamSettingSubmitBo.fromJson(dynamic json) {
aqzgPdNum = json['aqzgPdNum'];
aqzgXzNum = json['aqzgXzNum'];
aqyPdNum = json['aqyPdNum'];
aqyXzNum = json['aqyXzNum'];
aqzgIds = json['aqzgIds'] != null ? json['aqzgIds'].cast<String>() : [];
aqyIds = json['aqyIds'] != null ? json['aqyIds'].cast<String>() : [];
type = json['type'];
}
int? aqzgPdNum;
int? aqzgXzNum;
int? aqyPdNum;
int? aqyXzNum;
List<String>? aqzgIds;
List<String>? aqyIds;
String? type;
ExamSettingSubmitBo copyWith({
int? aqzgPdNum,
int? aqzgXzNum,
int? aqyPdNum,
int? aqyXzNum,
List<String>? aqzgIds,
List<String>? aqyIds,
String? type,
}) =>
ExamSettingSubmitBo(
aqzgPdNum: aqzgPdNum ?? this.aqzgPdNum,
aqzgXzNum: aqzgXzNum ?? this.aqzgXzNum,
aqyPdNum: aqyPdNum ?? this.aqyPdNum,
aqyXzNum: aqyXzNum ?? this.aqyXzNum,
aqzgIds: aqzgIds ?? this.aqzgIds,
aqyIds: aqyIds ?? this.aqyIds,
type: type ?? this.type,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['aqzgPdNum'] = aqzgPdNum;
map['aqzgXzNum'] = aqzgXzNum;
map['aqyPdNum'] = aqyPdNum;
map['aqyXzNum'] = aqyXzNum;
map['aqzgIds'] = aqzgIds;
map['aqyIds'] = aqyIds;
map['type'] = type;
return map;
}
}
class ExamUnitList {
ExamUnitList({
this.officeList,
});
ExamUnitList.fromJson(dynamic json) {
if (json['officeList'] != null) {
officeList = [];
json['officeList'].forEach((v) {
officeList?.add(OfficeList.fromJson(v));
});
}
}
List<OfficeList>? officeList;
ExamUnitList copyWith({
List<OfficeList>? officeList,
}) =>
ExamUnitList(
officeList: officeList ?? this.officeList,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (officeList != null) {
map['officeList'] = officeList?.map((v) => v.toJson()).toList();
}
return map;
}
}
class OfficeList {
OfficeList({
this.id,
this.name,
this.sort,
this.hasChildren,
this.parentId,
});
OfficeList.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
sort = json['sort'];
hasChildren = json['hasChildren'];
parentId = json['parentId'];
}
String? id;
String? name;
num? sort;
bool? hasChildren;
String? parentId;
OfficeList copyWith({
String? id,
String? name,
num? sort,
bool? hasChildren,
String? parentId,
}) =>
OfficeList(
id: id ?? this.id,
name: name ?? this.name,
sort: sort ?? this.sort,
hasChildren: hasChildren ?? this.hasChildren,
parentId: parentId ?? this.parentId,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['sort'] = sort;
map['hasChildren'] = hasChildren;
map['parentId'] = parentId;
return map;
}
}
class ExaminePersonBo {
ExaminePersonBo({
this.data,
this.success,
});
ExaminePersonBo.fromJson(dynamic json) {
data =
json['data'] != null ? DataExaminePerson.fromJson(json['data']) : null;
success = json['success'];
}
DataExaminePerson? data;
bool? success;
ExaminePersonBo copyWith({
DataExaminePerson? data,
bool? success,
}) =>
ExaminePersonBo(
data: data ?? this.data,
success: success ?? this.success,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.toJson();
}
map['success'] = success;
return map;
}
}
class DataExaminePerson {
DataExaminePerson({
this.id,
this.inspectors,
this.user,
this.examDate,
this.pdNum,
this.xzNum,
this.type,
this.positionType,
});
DataExaminePerson.fromJson(dynamic json) {
id = json['id'];
inspectors = json['inspectors'] != null
? Inspectors.fromJson(json['inspectors'])
: null;
user = json['user'] != null ? User.fromJson(json['user']) : null;
examDate = json['examDate'];
pdNum = json['pdNum'];
xzNum = json['xzNum'];
type = json['type'] != null ? Type.fromJson(json['type']) : null;
positionType = json['positionType'];
}
String? id;
Inspectors? inspectors;
User? user;
String? examDate;
int? pdNum;
int? xzNum;
Type? type;
String? positionType;
DataExaminePerson copyWith({
String? id,
Inspectors? inspectors,
User? user,
String? examDate,
int? pdNum,
int? xzNum,
Type? type,
String? positionType,
}) =>
DataExaminePerson(
id: id ?? this.id,
inspectors: inspectors ?? this.inspectors,
user: user ?? this.user,
examDate: examDate ?? this.examDate,
pdNum: pdNum ?? this.pdNum,
xzNum: xzNum ?? this.xzNum,
type: type ?? this.type,
positionType: positionType ?? this.positionType,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
if (inspectors != null) {
map['inspectors'] = inspectors?.toJson();
}
if (user != null) {
map['user'] = user?.toJson();
}
map['examDate'] = examDate;
map['pdNum'] = pdNum;
map['xzNum'] = xzNum;
if (type != null) {
map['type'] = type?.toJson();
}
map['positionType'] = positionType;
return map;
}
}
class Type {
Type({
this.id,
this.name,
});
Type.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
}
String? id;
String? name;
Type copyWith({
String? id,
String? name,
}) =>
Type(
id: id ?? this.id,
name: name ?? this.name,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
return map;
}
}
class User {
User({
this.id,
this.loginFlag,
this.roleNames,
this.admin,
});
User.fromJson(dynamic json) {
id = json['id'];
loginFlag = json['loginFlag'];
roleNames = json['roleNames'];
admin = json['admin'];
}
String? id;
String? loginFlag;
String? roleNames;
bool? admin;
User copyWith({
String? id,
String? loginFlag,
String? roleNames,
bool? admin,
}) =>
User(
id: id ?? this.id,
loginFlag: loginFlag ?? this.loginFlag,
roleNames: roleNames ?? this.roleNames,
admin: admin ?? this.admin,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['loginFlag'] = loginFlag;
map['roleNames'] = roleNames;
map['admin'] = admin;
return map;
}
}
class Inspectors {
Inspectors({
this.id,
this.loginFlag,
this.roleNames,
this.admin,
});
Inspectors.fromJson(dynamic json) {
id = json['id'];
loginFlag = json['loginFlag'];
roleNames = json['roleNames'];
admin = json['admin'];
}
String? id;
String? loginFlag;
String? roleNames;
bool? admin;
Inspectors copyWith({
String? id,
String? loginFlag,
String? roleNames,
bool? admin,
}) =>
Inspectors(
id: id ?? this.id,
loginFlag: loginFlag ?? this.loginFlag,
roleNames: roleNames ?? this.roleNames,
admin: admin ?? this.admin,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['loginFlag'] = loginFlag;
map['roleNames'] = roleNames;
map['admin'] = admin;
return map;
}
}
class FindQuestionNum {
FindQuestionNum({
this.data,
});
FindQuestionNum.fromJson(dynamic json) {
data = json['data'] != null ? DataNum.fromJson(json['data']) : null;
}
DataNum? data;
FindQuestionNum copyWith({
DataNum? data,
}) =>
FindQuestionNum(
data: data ?? this.data,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class DataNum {
DataNum({
this.id,
this.aqzjPd,
this.aqzjDx,
this.aqyPd,
this.aqyDx,
});
DataNum.fromJson(dynamic json) {
id = json['id'];
aqzjPd = json['aqzjPd'];
aqzjDx = json['aqzjDx'];
aqyPd = json['aqyPd'];
aqyDx = json['aqyDx'];
}
String? id;
int? aqzjPd;
int? aqzjDx;
int? aqyPd;
int? aqyDx;
DataNum copyWith({
String? id,
int? aqzjPd,
int? aqzjDx,
int? aqyPd,
int? aqyDx,
}) =>
DataNum(
id: id ?? this.id,
aqzjPd: aqzjPd ?? this.aqzjPd,
aqzjDx: aqzjDx ?? this.aqzjDx,
aqyPd: aqyPd ?? this.aqyPd,
aqyDx: aqyDx ?? this.aqyDx,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['aqzjPd'] = aqzjPd;
map['aqzjDx'] = aqzjDx;
map['aqyPd'] = aqyPd;
map['aqyDx'] = aqyDx;
return map;
}
}
class ShowAnswerBo {
ShowAnswerBo({
this.data,
});
ShowAnswerBo.fromJson(dynamic json) {
data = json['data'];
}
String? data;
ShowAnswerBo copyWith({
String? data,
}) =>
ShowAnswerBo(
data: data ?? this.data,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['data'] = data;
return map;
}
}
class TestQuestion {
List<Question>? question;
TestQuestion({this.question});
TestQuestion.fromJson(Map<String, dynamic> json) {
if (json['question'] != null) {
question = <Question>[];
json['question'].forEach((v) {
question!.add(Question.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.question != null) {
data['question'] = this.question!.map((v) => v.toJson()).toList();
}
return data;
}
}
class Question {
int? id;
String? type;
String? name;
String? title;
String? image;
List<Option>? option;
Question(
{this.id, this.type, this.name, this.title, this.image, this.option});
Question.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
name = json['name'];
title = json['title'];
image = json['image'];
if (json['option'] != null) {
option = <Option>[];
json['option'].forEach((v) {
option!.add(new Option.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['name'] = this.name;
data['title'] = this.title;
data['image'] = this.image;
if (this.option != null) {
data['option'] = this.option!.map((v) => v.toJson()).toList();
}
return data;
}
}
class Option {
String? answer;
bool? isSelected;
String? id;
Option({this.answer, this.isSelected, this.id});
Option.fromJson(Map<String, dynamic> json) {
answer = json['answer'];
isSelected = json['isSelected'];
id = json['id'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['answer'] = this.answer;
data['isSelected'] = this.isSelected;
data['id'] = this.id;
return data;
}
}
Map<String, dynamic> testQuestionJson = {
"question": [
{
"id": 1001,
"type": "1",
"name": "多选",
"title": "休克早期的临床表现是",
"image":
"https://img.qingwk.com/images/resource/f14231625/2019/05/05/19531_1303148556_fd.jpg",
"option": [
{"answer": "精神紧张,烦躁不安,心率增快,尿量减少", "isSelected": false, "id": "A"},
{"answer": "表情淡漠,感觉迟钝,脉搏减慢", "isSelected": false, "id": "B"},
{"answer": "血压下降,出冷汗,无尿", "isSelected": false, "id": "C"},
{"answer": "表情淡漠,皮肤出现瘀斑,血压下降", "isSelected": false, "id": "D"},
{"answer": "出冷汗,软弱无力,血压下降,皮肤发绀", "isSelected": false, "id": "E"}
]
},
{
"id": 1002,
"type": "0",
"name": "单选",
"title": "护理评估腹泻患儿重度脱水的主要依据,错误的是:()",
"image":
"https://picnew12.photophoto.cn/20171010/chuangyihuiseduojiaojihetuxingsucai-28744986_1.jpg",
"option": [
{"answer": "四肢厥冷", "isSelected": false, "id": "A"},
{"answer": "皮肤发花", "isSelected": false, "id": "B"},
{"answer": "血压轻度升高", "isSelected": false, "id": "C"},
{"answer": "少尿或无尿等休克症状", "isSelected": false, "id": "D"}
]
},
{
"id": 1003,
"type": "3",
"name": "判断",
"title":
"糖尿病酮症酸中毒患者早期酮症阶段仅有多尿、多饮、疲乏等,继之出现食欲不振、恶心、呕吐、头痛、嗜睡、呼吸深大(Kussmaul呼吸),呼气中出现烂苹果味;后期脱水明显,尿少、皮肤干燥、血压下降、休克、昏迷,以至死亡。()",
"image":
"https://img.qingwk.com/images/resource/f16733122/2019/02/24/202988_67998812894_fd.jpg",
"option": [
{"answer": "是", "isSelected": false, "id": "A"},
{"answer": "否", "isSelected": false, "id": "B"}
]
},
{
"id": 1004,
"type": "3",
"name": "判断",
"title": "贫血的临床表现主要是缺氧的病理生理改变所引起。()",
"image":
"https://tp.tucengyun.com/wp-content/uploads/2021/03/20210304132545488.jpg",
"option": [
{"answer": "是", "isSelected": false, "id": "A"},
{"answer": "否", "isSelected": false, "id": "B"}
]
}
]
};
import 'package:special_equipment_flutter/model/exam/equipment_list_bo.dart';
class TestSubmitBo {
EquiList? mEquiList;
int? dxQuestionsNum;
int? pdQuestionsNum;
}
class UnitPersonListBo {
UnitPersonListBo({
this.userList,
});
UnitPersonListBo.fromJson(dynamic json) {
if (json['userList'] != null) {
userList = [];
json['userList'].forEach((v) {
userList?.add(UserLists.fromJson(v));
});
}
}
List<UserLists>? userList;
UnitPersonListBo copyWith({
List<UserLists>? userList,
}) =>
UnitPersonListBo(
userList: userList ?? this.userList,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (userList != null) {
map['userList'] = userList?.map((v) => v.toJson()).toList();
}
return map;
}
}
class UserLists {
UserLists({
this.id,
this.name,
this.loginFlag,
this.roleNames,
this.admin,
});
UserLists.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
loginFlag = json['loginFlag'];
roleNames = json['roleNames'];
admin = json['admin'];
}
String? id;
String? name;
String? loginFlag;
String? roleNames;
bool? admin;
bool? isChecked = false;
UserLists copyWith({
String? id,
String? name,
String? loginFlag,
String? roleNames,
bool? admin,
}) =>
UserLists(
id: id ?? this.id,
name: name ?? this.name,
loginFlag: loginFlag ?? this.loginFlag,
roleNames: roleNames ?? this.roleNames,
admin: admin ?? this.admin,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['loginFlag'] = loginFlag;
map['roleNames'] = roleNames;
map['admin'] = admin;
return map;
}
}
...@@ -10,6 +10,7 @@ class StandingConfig { ...@@ -10,6 +10,7 @@ class StandingConfig {
static const String SAFETY_OFFICER = "安全员"; static const String SAFETY_OFFICER = "安全员";
static const String SAFETY_DIRECTOR = "安全总监"; static const String SAFETY_DIRECTOR = "安全总监";
static const String PERSON_CHARGE = "主要负责人"; static const String PERSON_CHARGE = "主要负责人";
static const String INSPECTOR = "监察人员";
static const String SY_DEVICE = '客运索道,电梯,起重机械,锅炉,压力管道,压力容器,大型游乐设施,场车,气瓶'; static const String SY_DEVICE = '客运索道,电梯,起重机械,锅炉,压力管道,压力容器,大型游乐设施,场车,气瓶';
} }
...@@ -21,6 +22,14 @@ bool? isUnitRoles(rolesName) { ...@@ -21,6 +22,14 @@ bool? isUnitRoles(rolesName) {
} }
} }
bool? isInspectorRoles(rolesName) {
if (rolesName == StandingConfig.INSPECTOR) {
return true;
} else {
return false;
}
}
dynamic isRolesName(name) { dynamic isRolesName(name) {
switch (name) { switch (name) {
case '公司账户': case '公司账户':
...@@ -29,6 +38,8 @@ dynamic isRolesName(name) { ...@@ -29,6 +38,8 @@ dynamic isRolesName(name) {
return false; return false;
case '市场监管局': case '市场监管局':
return false; return false;
case StandingConfig.INSPECTOR:
return false;
default: default:
return true; return true;
} }
......
import 'package:flutter/material.dart';
/// 底部弹出Widget
/// 1、支持手势下拉关闭
/// 2、支持动画弹出收起
/// 3、支持弹出无法关闭
class DragBottomSheetWidget extends StatefulWidget {
DragBottomSheetWidget({
required Key key,
required this.builder,
this.duration,
this.childHeightRatio = 0.5,
this.onStateChange,
}) : super(key: key);
Function(bool)? onStateChange;
final double childHeightRatio;
final Duration? duration;
final ScrollableWidgetBuilder builder;
@override
State<DragBottomSheetWidget> createState() => DragBottomSheetWidgetState();
}
class DragBottomSheetWidgetState extends State<DragBottomSheetWidget>
with TickerProviderStateMixin {
final controller = DraggableScrollableController();
//是否可以关闭
bool isCanClose = true;
//是否展开
bool isExpand = false;
double verticalDistance = 0;
@override
void initState() {
super.initState();
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
Future show({bool isCanClose = true}) {
return controller
.animateTo(1,
duration: widget.duration ?? const Duration(milliseconds: 200),
curve: Curves.linear)
.then((value) {
if (!isCanClose) {
setState(() {
this.isCanClose = isCanClose;
});
}
});
}
void hide() {
controller.animateTo(
0,
duration: widget.duration ?? const Duration(milliseconds: 200),
curve: Curves.linear,
);
}
void _dragJumpTo(double y) {
var size = y / MediaQuery.of(context).size.height;
controller.jumpTo(widget.childHeightRatio - size);
}
void _dragEndChange() {
controller.size >= widget.childHeightRatio / 2
? controller.animateTo(
1,
duration: widget.duration ?? const Duration(milliseconds: 200),
curve: Curves.linear,
)
: hide();
}
@override
Widget build(BuildContext context) {
return NotificationListener<DraggableScrollableNotification>(
onNotification: (notification) {
if (notification.extent == widget.childHeightRatio) {
if (!isExpand) {
isExpand = true;
widget.onStateChange?.call(true);
}
} else if (notification.extent < 0.00001) {
if (isExpand) {
isExpand = false;
widget.onStateChange?.call(false);
}
}
return true;
},
child: DraggableScrollableSheet(
initialChildSize: isCanClose && !isExpand ? 0 : widget.childHeightRatio,
minChildSize: isCanClose ? 0 : widget.childHeightRatio,
maxChildSize: widget.childHeightRatio,
expand: true,
snap: true,
controller: controller,
builder: (BuildContext context, ScrollController scrollController) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onVerticalDragDown: (details) {
verticalDistance = 0;
},
onVerticalDragUpdate: (details) {
verticalDistance += details.delta.dy;
_dragJumpTo(verticalDistance);
},
onVerticalDragEnd: (details) {
_dragEndChange();
},
child: widget.builder.call(context, scrollController),
);
},
),
);
}
}
import 'package:flutter/material.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/model/exam/examine_questions_bo.dart';
///单选、多选item布局
class ChoiceItem extends StatefulWidget {
final ExamQuestionOptionList option;
const ChoiceItem({Key? key, required this.option}) : super(key: key);
@override
_ChoiceItemState createState() => _ChoiceItemState();
}
class _ChoiceItemState extends State<ChoiceItem> {
@override
Widget build(BuildContext context) {
var options = widget.option;
return Container(
margin: const EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
height: 30,
width: 30,
margin: const EdgeInsets.fromLTRB(0, 0, 15, 0),
decoration: BoxDecoration(
///设置当前选中选项圆圈背景为蓝色、未选中选项圆圈背景为白色
color:
options.isSelected! ? ColorConst.themeBgColor : Colors.white,
///设置圆圈为蓝色
border: Border.all(
color: options.isSelected!
? ColorConst.themeBgColor
: ColorConst.themeBgColor),
borderRadius: const BorderRadius.all(Radius.circular(90)),
),
child: Center(
///设置选项A、B、C、D
child: Text(options.options!,
style: TextStyle(
///设置当前选中选项字母为白色、未选中选项字母为蓝色
color: options.isSelected!
? Colors.white
: ColorConst.themeBgColor,
//fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
),
Flexible(
child: Text(
options.isAcquiesceSelected!
? '${options.content!}.'
: options.content!,
style: const TextStyle(fontSize: 14),
),
),
],
),
);
}
}
// import 'package:flutter/material.dart';
// import 'package:special_equipment_flutter/common/color_const.dart';
// import 'package:special_equipment_flutter/model/exam/examine_questions_bo.dart';
// import 'package:special_equipment_flutter/model/exam/test_question_bo.dart';
// import 'package:special_equipment_flutter/ui/examine/exam/custom/choice_item.dart';
//
// ///多选题
// class MultipleOption extends StatefulWidget {
// final ExamQuestionList question;
//
// const MultipleOption({Key? key, required this.question}) : super(key: key);
//
// @override
// _MultipleOptionState createState() => _MultipleOptionState();
// }
//
// class _MultipleOptionState extends State<MultipleOption> {
// @override
// Widget build(BuildContext context) {
// var question = widget.question;
// return ListView.builder(
// scrollDirection: Axis.vertical,
// shrinkWrap: true,
// itemCount: widget.question.examQuestionOptionList?.length,
// itemBuilder: (BuildContext context, int index) {
// var options = question.examQuestionOptionList![index];
// return InkWell(
// splashColor: ColorConst.themeBgColor,
// onTap: () {
// setState(() {
// options.isSelected!
// ? options.isSelected = false
// : options.isSelected = true;
// });
// },
// child: ChoiceItem(option: question.examQuestionOptionList![index]),
// );
// },
// );
// }
// }
import 'package:flutter/material.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/model/exam/examine_questions_bo.dart';
import 'package:special_equipment_flutter/ui/examine/exam/custom/choice_item.dart';
///单选(单选题、判断题)
class SingleOption extends StatefulWidget {
final ExamQuestionList question;
final PageController pageController;
final int index;
const SingleOption(
{Key? key,
required this.question,
required this.pageController,
required this.index})
: super(key: key);
@override
_SingleOptionState createState() => _SingleOptionState();
}
class _SingleOptionState extends State<SingleOption> {
@override
Widget build(BuildContext context) {
var question = widget.question;
return ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: widget.question.examQuestionOptionList?.length,
itemBuilder: (BuildContext context, int index) {
var options = question.examQuestionOptionList![index];
return InkWell(
splashColor: ColorConst.themeBgColor,
onTap: () {
setState(() {
//将其他选项全部置为false
question.examQuestionOptionList!
.forEach((element) => element.isSelected = false);
//将当前选项置为true
options.isSelected = true;
question.result = options.options;
//延时1秒
Future.delayed(const Duration(milliseconds: 500), () {
widget.pageController.jumpToPage(widget.index + 1);
});
});
},
child: ChoiceItem(option: options),
);
},
);
}
}
import 'package:flutter/material.dart';
///考核历史页面
class ExamHistoryPage extends StatefulWidget {
const ExamHistoryPage({super.key});
@override
State<ExamHistoryPage> createState() => _ExamHistoryPageState();
}
class _ExamHistoryPageState extends State<ExamHistoryPage> {
@override
Widget build(BuildContext context) {
return Container();
}
}
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/common/route_string.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/exam/exam_result_bo.dart';
import 'package:special_equipment_flutter/model/exam/examine_person_bo.dart';
import 'package:special_equipment_flutter/utils/eventbus_utils.dart';
import 'package:special_equipment_flutter/utils/toast_utils.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar_back.dart';
import 'package:special_equipment_flutter/widgets/custom_button.dart';
///考核结果页面
class ExamResultPage extends StatefulWidget {
var arguments = Get.arguments;
// Data2? examResultDataBo;
ExamResultPage({super.key});
// ExamResultPage({super.key, this.examResultDataBo});
@override
State<ExamResultPage> createState() => _ExamResultPageState();
}
class _ExamResultPageState extends State<ExamResultPage> {
ExamResultData? examResultDataBo;
@override
void initState() {
// TODO: implement initState
super.initState();
// examResultDataBo = widget.examResultDataBo;
examResultDataBo = widget.arguments['examResultDataBo'];
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[100],
appBar: AppBarCustom(
text: '考核结果',
height: 50,
leading: IconButton(
iconSize: 20,
icon: const Icon(Icons.arrow_back_ios),
color: ColorConst.whiteColor,
onPressed: () {
Get.back();
},
///这里设置了按钮的内边距为零,可以消除默认的16像素间距
padding: EdgeInsets.zero,
),
),
body: Container(
height: 300,
width: double.infinity,
margin: const EdgeInsets.only(top: 15, left: 15, right: 15, bottom: 15),
padding: const EdgeInsets.all(10),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Column(
children: [
const SizedBox(height: 10),
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'—————— ',
style: TextStyle(color: ColorConst.grayf5Color),
),
Text('本次考核成绩'),
Text(
' ——————',
style: TextStyle(color: ColorConst.grayf5Color),
)
],
),
const SizedBox(height: 10),
Text(
examResultDataBo!.score!.round().toString(),
style: TextStyle(
color:
examResultDataBo!.score! < 90 ? Colors.red : Colors.green,
fontSize: 20,
fontWeight: FontWeight.bold),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (examResultDataBo!.adopt == '1') ...[
Image.asset(
'assets/examine/pass_icon.png',
width: 100,
height: 100,
),
] else ...[
Image.asset(
'assets/examine/no_pass_icon.png',
width: 100,
height: 100,
),
],
Container(
height: 100,
width: 1,
color: ColorConst.grayf5Color,
margin: const EdgeInsets.only(left: 20, right: 40)),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "答对 ",
style:
TextStyle(fontSize: 14, color: Colors.grey)),
TextSpan(
text: "${examResultDataBo!.correct.toString()}题",
style: const TextStyle(
fontSize: 14, color: Colors.black87)),
])),
const SizedBox(height: 20),
Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "答错 ",
style:
TextStyle(fontSize: 14, color: Colors.grey)),
TextSpan(
text: "${examResultDataBo!.error.toString()}题",
style: const TextStyle(
fontSize: 14, color: Colors.black87)),
])),
const SizedBox(height: 20),
Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "总题 ",
style:
TextStyle(fontSize: 14, color: Colors.grey)),
TextSpan(
text:
"${examResultDataBo!.questionNum.toString()}题",
style: const TextStyle(
fontSize: 14, color: Colors.black87)),
])),
],
)
],
),
const SizedBox(height: 40),
GradientButton(
tapCallback: () {
if (examResultDataBo!.adopt == '1') {
//发出通知
EventBusUtils.getInstance()?.fire("1");
Get.back(result: true);
} else {
Get.back(result: true);
getClickQuestionsPerson();
}
},
width: 300,
height: 40,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(10)),
disable: false,
colors: const [ColorConst.blueColor, ColorConst.blue1Color],
child: Text(
examResultDataBo!.adopt == '1' ? "关闭" : '继续答题',
style: const TextStyle(
fontSize: 14, color: ColorConst.whiteColor),
))
],
),
),
);
}
ExaminePersonBo? mExaminePersonBo;
///获取考核试卷
void getClickQuestionsPerson() {
HttpUtils.getExaminePerson(context).then((value) {
mExaminePersonBo = value;
if (mounted) {
setState(() {
if (mExaminePersonBo!.success!) {
Get.toNamed(RouteString.EXAM_PAGE,
arguments: {'mExaminePersonBo': mExaminePersonBo!.data})
?.then((value) {});
} else {
ToastUtils.showCenter('您目前暂无考核内容');
}
});
}
});
}
}
import 'package:flutter/material.dart';
/// 底部弹出Widget
/// 1、支持手势下拉关闭
/// 2、支持动画弹出收起
/// 3、支持弹出无法关闭
class DragBottomSheetWidget extends StatefulWidget {
DragBottomSheetWidget({
required Key key,
required this.builder,
this.duration,
this.childHeightRatio = 0.5,
this.onStateChange,
}) : super(key: key);
Function(bool)? onStateChange;
final double childHeightRatio;
final Duration? duration;
final ScrollableWidgetBuilder builder;
@override
State<DragBottomSheetWidget> createState() => DragBottomSheetWidgetState();
}
class DragBottomSheetWidgetState extends State<DragBottomSheetWidget>
with TickerProviderStateMixin {
final controller = DraggableScrollableController();
//是否可以关闭
bool isCanClose = true;
//是否展开
bool isExpand = false;
double verticalDistance = 0;
@override
void initState() {
super.initState();
}
@override
void dispose() {
controller.dispose();
super.dispose();
}
Future show({bool isCanClose = true}) {
return controller
.animateTo(1,
duration: widget.duration ?? const Duration(milliseconds: 200),
curve: Curves.linear)
.then((value) {
if (!isCanClose) {
setState(() {
this.isCanClose = isCanClose;
});
}
});
}
void hide() {
controller.animateTo(
0,
duration: widget.duration ?? const Duration(milliseconds: 200),
curve: Curves.linear,
);
}
void _dragJumpTo(double y) {
var size = y / MediaQuery.of(context).size.height;
controller.jumpTo(widget.childHeightRatio - size);
}
void _dragEndChange() {
controller.size >= widget.childHeightRatio / 2
? controller.animateTo(
1,
duration: widget.duration ?? const Duration(milliseconds: 200),
curve: Curves.linear,
)
: hide();
}
@override
Widget build(BuildContext context) {
return NotificationListener<DraggableScrollableNotification>(
onNotification: (notification) {
if (notification.extent == widget.childHeightRatio) {
if (!isExpand) {
isExpand = true;
widget.onStateChange?.call(true);
}
} else if (notification.extent < 0.00001) {
if (isExpand) {
isExpand = false;
widget.onStateChange?.call(false);
}
}
return true;
},
child: DraggableScrollableSheet(
initialChildSize: isCanClose && !isExpand ? 0 : widget.childHeightRatio,
minChildSize: isCanClose ? 0 : widget.childHeightRatio,
maxChildSize: widget.childHeightRatio,
expand: true,
snap: true,
controller: controller,
builder: (BuildContext context, ScrollController scrollController) {
return GestureDetector(
behavior: HitTestBehavior.translucent,
onVerticalDragDown: (details) {
verticalDistance = 0;
},
onVerticalDragUpdate: (details) {
verticalDistance += details.delta.dy;
_dragJumpTo(verticalDistance);
},
onVerticalDragEnd: (details) {
_dragEndChange();
},
child: widget.builder.call(context, scrollController),
);
},
),
);
}
}
import 'package:flutter/material.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/model/exam/examine_questions_bo.dart';
import 'package:special_equipment_flutter/model/exam/test_questions_bo.dart';
///单选、多选item布局
class ChoiceItem extends StatefulWidget {
final ExamQuestionTestOptionList option;
const ChoiceItem({Key? key, required this.option}) : super(key: key);
@override
_ChoiceItemState createState() => _ChoiceItemState();
}
class _ChoiceItemState extends State<ChoiceItem> {
@override
Widget build(BuildContext context) {
var options = widget.option;
return Container(
margin: const EdgeInsets.fromLTRB(15, 10, 15, 10),
child: Row(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
height: 30,
width: 30,
margin: const EdgeInsets.fromLTRB(0, 0, 15, 0),
decoration: BoxDecoration(
///设置当前选中选项圆圈背景为蓝色、未选中选项圆圈背景为白色
color: bgColors(options.flag!),
///设置圆圈为蓝色
border: Border.all(color: bgColors3(options.flag!)!),
borderRadius: const BorderRadius.all(Radius.circular(90)),
),
child: Center(
///设置选项A、B、C、D
child: Text(optionsStr(options.flag!, options.options!)!,
style: TextStyle(
///设置当前选中选项字母为白色、未选中选项字母为蓝色
color: bgColors2(options.flag!),
//fontWeight: FontWeight.bold,
fontSize: 16.0)),
),
),
Flexible(
child: Text(
options.content!,
style: const TextStyle(fontSize: 14),
),
),
],
),
);
}
String? optionsStr(String flag, String options) {
if (flag == "1") {
return '✓';
} else if (flag == "0") {
return '✗';
} else {
return options;
}
}
Color? bgColors(String flag) {
if (flag == "1") {
return ColorConst.themeBgColor;
} else if (flag == "0") {
return ColorConst.red1BgColor;
} else {
return Colors.white;
}
}
Color? bgColors2(String flag) {
if (flag == "1") {
return Colors.white;
} else if (flag == "0") {
return Colors.white;
} else {
return ColorConst.themeBgColor;
}
}
Color? bgColors3(String flag) {
if (flag == "1") {
return ColorConst.themeBgColor;
} else if (flag == "0") {
return ColorConst.red1BgColor;
} else {
return ColorConst.themeBgColor;
}
}
}
import 'package:flutter/material.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/model/exam/test_questions_bo.dart';
import 'package:special_equipment_flutter/ui/examine/test/custom/choice_item.dart';
///单选(单选题、判断题)
class SingleOption extends StatefulWidget {
final ExamQuestionTestList question;
final PageController pageController;
final int index;
const SingleOption(
{Key? key,
required this.question,
required this.pageController,
required this.index})
: super(key: key);
@override
_SingleOptionState createState() => _SingleOptionState();
}
class _SingleOptionState extends State<SingleOption> {
@override
Widget build(BuildContext context) {
var question = widget.question;
return ListView.builder(
scrollDirection: Axis.vertical,
shrinkWrap: true,
itemCount: widget.question.examQuestionOptionList?.length,
itemBuilder: (BuildContext context, int index) {
var options = question.examQuestionOptionList![index];
return InkWell(
splashColor: ColorConst.themeBgColor,
onTap: () {
setState(() {
if (question.result == null) {
//将其他选项全部置为false
question.examQuestionOptionList!
.forEach((element) => element.flag = '-1');
// //将当前选项置为true
// options.isSelected = true;
if (question.answer == options.options) {
options.flag = '1';
} else {
options.flag = '0';
}
question.result = options.options;
//延时1秒
// Future.delayed(const Duration(milliseconds: 500), () {
// widget.pageController.jumpToPage(widget.index + 1);
// });
}
});
},
child: ChoiceItem(option: options),
);
},
);
}
}
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/model/exam/exam_result_bo.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar_back.dart';
import 'package:special_equipment_flutter/widgets/custom_button.dart';
///测试结果页面
class TestResultPage extends StatefulWidget {
var arguments = Get.arguments;
TestResultPage({super.key});
@override
State<TestResultPage> createState() => _TestResultPageState();
}
class _TestResultPageState extends State<TestResultPage> {
ExamResultData? testResultDataBo;
@override
void initState() {
// TODO: implement initState
super.initState();
testResultDataBo = widget.arguments['testResultDataBo'];
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.grey[100],
appBar: AppBarCustom(
text: '测试练习结果',
height: 50,
leading: IconButton(
iconSize: 20,
icon: const Icon(Icons.arrow_back_ios),
color: ColorConst.whiteColor,
onPressed: () {
Get.back();
},
///这里设置了按钮的内边距为零,可以消除默认的16像素间距
padding: EdgeInsets.zero,
),
),
body: Container(
height: 300,
width: double.infinity,
margin: const EdgeInsets.only(top: 15, left: 15, right: 15, bottom: 15),
padding: const EdgeInsets.all(10),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Column(
children: [
const SizedBox(height: 10),
const Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'—————— ',
style: TextStyle(color: ColorConst.grayf5Color),
),
Text('本次考核成绩'),
Text(
' ——————',
style: TextStyle(color: ColorConst.grayf5Color),
)
],
),
const SizedBox(height: 10),
Text(
testResultDataBo!.score!.toString(),
style: TextStyle(
color:
testResultDataBo!.score! < 90 ? Colors.red : Colors.green,
fontSize: 20,
fontWeight: FontWeight.bold),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (testResultDataBo!.adopt == '1') ...[
Image.asset(
'assets/examine/pass_icon.png',
width: 100,
height: 100,
),
] else ...[
Image.asset(
'assets/examine/no_pass_icon.png',
width: 100,
height: 100,
),
],
Container(
height: 100,
width: 1,
color: ColorConst.grayf5Color,
margin: const EdgeInsets.only(left: 20, right: 40)),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "答对 ",
style:
TextStyle(fontSize: 14, color: Colors.grey)),
TextSpan(
text: "${testResultDataBo!.correct.toString()}题",
style: const TextStyle(
fontSize: 14, color: Colors.black87)),
])),
const SizedBox(height: 20),
Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "答错 ",
style:
TextStyle(fontSize: 14, color: Colors.grey)),
TextSpan(
text: "${testResultDataBo!.error.toString()}题",
style: const TextStyle(
fontSize: 14, color: Colors.black87)),
])),
const SizedBox(height: 20),
Text.rich(
softWrap: true,
TextSpan(children: [
const TextSpan(
text: "总题 ",
style:
TextStyle(fontSize: 14, color: Colors.grey)),
TextSpan(
text:
"${testResultDataBo!.questionNum.toString()}题",
style: const TextStyle(
fontSize: 14, color: Colors.black87)),
])),
],
)
],
),
const SizedBox(height: 40),
GradientButton(
tapCallback: () {
Get.back();
},
width: 300,
height: 40,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
topRight: Radius.circular(20),
bottomLeft: Radius.circular(20),
bottomRight: Radius.circular(10)),
disable: false,
colors: const [ColorConst.blueColor, ColorConst.blue1Color],
child: const Text(
"关闭",
style: TextStyle(fontSize: 14, color: ColorConst.whiteColor),
))
],
),
),
);
}
}
...@@ -100,9 +100,7 @@ class EditTextState extends State<EditTextWidget> ...@@ -100,9 +100,7 @@ class EditTextState extends State<EditTextWidget>
}); });
phoneController.value = phoneController.value.copyWith( phoneController.value = phoneController.value.copyWith(
text: Api.IS_DEBUG text: Api.IS_DEBUG ? StorageUtil.getInstance().getUserName() : 'tyjcr');
? StorageUtil.getInstance().getUserName()
: '15201506331');
passController.value = passController.value =
passController.value.copyWith(text: Api.IS_DEBUG ? '' : 'Aa123456.'); passController.value.copyWith(text: Api.IS_DEBUG ? '' : 'Aa123456.');
super.initState(); super.initState();
......
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/exam/equipment_list_bo.dart';
import 'package:special_equipment_flutter/model/exam/exam_unit_list.dart';
import 'package:special_equipment_flutter/utils/storage_util.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar.dart';
///设备选择
class EquipmentListPage extends StatefulWidget {
var arguments = Get.arguments;
EquipmentListPage({super.key});
@override
State<EquipmentListPage> createState() => _EquipmentListPageState();
}
class _EquipmentListPageState extends State<EquipmentListPage> {
List<EquiList>? officeLists = [];
List<EquiList>? filterOfficeLists = [];
var officeId = '';
@override
void initState() {
super.initState();
officeId = widget.arguments['officeId'];
getEquipmentList();
}
///获取设备类型
void getEquipmentList() {
HttpUtils.getEquipmentList(context, officeId).then((value) {
EquipmentListBo listBo = value;
if (mounted) {
setState(() {
officeLists = listBo.list;
filterOfficeLists = officeLists;
});
}
});
}
void _filterData(String query) {
setState(() {
filterOfficeLists = officeLists!.where((EquiList item) {
return item.name!.toLowerCase().contains(query.toLowerCase());
}).toList();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarCustom(text: '选择设备', height: 50),
body: Column(
children: [
const SizedBox(height: 10),
Container(
margin: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
IconButton(
icon: const Icon(Icons.search),
onPressed: () {
// 处理搜索逻辑
},
),
Expanded(
child: TextField(
onChanged: (value) {
_filterData(value);
},
decoration: const InputDecoration(
hintText: '请输入搜索关键字',
border: InputBorder.none,
),
),
),
],
),
),
const SizedBox(height: 10),
Flexible(
child: ListView.builder(
shrinkWrap: true,
padding:
const EdgeInsets.only(top: 0, left: 0, bottom: 0, right: 0),
itemCount: filterOfficeLists!.length,
// 列表项数量
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
Get.back(result: filterOfficeLists![index]);
});
},
child: Container(
padding: const EdgeInsets.only(
left: 30, right: 15, top: 10, bottom: 10),
child: Text(
filterOfficeLists![index].name!,
style: const TextStyle(fontSize: 18),
),
),
);
},
),
),
],
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/common/edgeInsets_const.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/day_control_list_sy_bo.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar.dart';
import 'package:special_equipment_flutter/widgets/divider_custom.dart';
///设置的考核列表
class OverseerListPage extends StatefulWidget {
const OverseerListPage({super.key});
@override
State<OverseerListPage> createState() => _OverseerListPageState();
}
class _OverseerListPageState extends State<OverseerListPage> {
final EasyRefreshController _controller = EasyRefreshController();
List<TaskDayList> list = [];
@override
void initState() {
super.initState();
// getData();
}
void getData() {
HttpUtils.getOverseerList(context, '0', '', '').then((value) {
DayControlListSyBo listBo = value;
if (mounted) {
setState(() {
var taskDayList = listBo.taskDayList;
list.clear();
list.addAll(taskDayList!);
_controller.finishRefresh();
});
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarCustom(text: '考核列表', height: 50),
backgroundColor: Colors.grey[100],
body: Column(
children: [
Expanded(
flex: 1,
child: EasyRefresh(
firstRefresh: true,
enableControlFinishRefresh: true,
// enableControlFinishLoad: true,
// firstRefreshWidget: const FirstRefreshWidget(),
// emptyWidget: list.isEmpty
// ? EmptyImgWidget(
// title: '暂无数据,点击刷新',
// onTap: () {
// getData();
// })
// : null,
controller: _controller,
onRefresh: () async {
// page = 1;
// getData();
},
// onLoad: () async {
// page++;
// getList();
// },
child: buildBody(),
)),
],
),
);
}
Column buildBody() {
return Column(
children: [
//文章列表
ListView.separated(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(
horizontal: EdgeInsetsConst.padding_horizontal),
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return buildItem(index, context);
},
itemCount: 4,
separatorBuilder: (BuildContext context, int index) {
return const SizedBox(
height: 0,
);
},
),
],
);
}
InkWell buildItem(int index, BuildContext context) {
return InkWell(
onTap: () {
// Get.toNamed(RouteString.DAY_INSPECT_SUBMIT_SY,
// arguments: {'argsData': widget.args, 'listBo': list(index)})
// ?.then((value) {
// if (value != null && value) {
// getData();
// }
// });
},
child: buildCard(context, index),
);
}
Card buildCard(BuildContext context, int index) {
return Card(
elevation: 3,
margin: const EdgeInsets.only(left: 0, right: 0, top: 15, bottom: 0),
color: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Container(
padding:
const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
child: Column(
children: <Widget>[
const Column(
children: [
Text('山西盈中科技有限公司山西盈中科技有限公司',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Colors.black87)),
Text('2024-05-21',
style: TextStyle(fontSize: 14, color: Colors.grey)),
],
),
///分割线
DividerCustom(Colors.grey[300], 8, 8, 0, 0),
Container(
margin:
const EdgeInsets.only(left: 8, top: 0, right: 0, bottom: 0),
child: const Row(children: [
Text('设备类型:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('电梯,锅炉', style: TextStyle()),
]),
),
Container(
padding:
const EdgeInsets.only(left: 10, top: 5, right: 5, bottom: 5),
margin:
const EdgeInsets.only(left: 0, top: 10, right: 0, bottom: 0),
decoration: const BoxDecoration(
color: ColorConst.grayf5Color,
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(children: [
Text('安全总监:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('张三,李四', style: TextStyle()),
]),
const SizedBox(height: 5),
Container(
padding: const EdgeInsets.only(
left: 0, top: 0, right: 5, bottom: 0),
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('总题数:20',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('单选题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('判断题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
],
),
),
],
),
),
Container(
padding:
const EdgeInsets.only(left: 10, top: 5, right: 5, bottom: 5),
margin:
const EdgeInsets.only(left: 0, top: 10, right: 0, bottom: 0),
decoration: const BoxDecoration(
color: ColorConst.grayf5Color,
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(children: [
Text('安全员:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('张三,李四', style: TextStyle()),
]),
const SizedBox(height: 5),
Container(
padding: const EdgeInsets.only(
left: 0, top: 0, right: 5, bottom: 0),
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('总题数:20',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('单选题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('判断题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
],
),
),
],
),
),
const SizedBox(
height: 5,
)
// buildSubmits(context, index),
],
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/exam/exam_unit_list.dart';
import 'package:special_equipment_flutter/utils/storage_util.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar.dart';
///单位选择
class UnitListPage extends StatefulWidget {
const UnitListPage({super.key});
@override
State<UnitListPage> createState() => _UnitListPageState();
}
class _UnitListPageState extends State<UnitListPage> {
List<OfficeList>? officeLists = [];
List<OfficeList>? filterOfficeLists = [];
@override
void initState() {
super.initState();
getUnitList();
}
///获取单位列表
void getUnitList() {
HttpUtils.getUnitList(context, StorageUtil.getInstance().getOfficeId())
.then((value) {
ExamUnitList listBo = value;
if (mounted) {
setState(() {
officeLists = listBo.officeList;
filterOfficeLists = officeLists;
});
}
});
}
void _filterData(String query) {
setState(() {
filterOfficeLists = officeLists!.where((OfficeList item) {
return item.name!.toLowerCase().contains(query.toLowerCase());
}).toList();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarCustom(text: '选择单位', height: 50),
body: Column(
children: [
const SizedBox(height: 10),
Container(
margin: const EdgeInsets.only(left: 10, right: 10),
decoration: BoxDecoration(
color: Colors.grey[200],
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
IconButton(
icon: const Icon(Icons.search),
onPressed: () {
// 处理搜索逻辑
},
),
Expanded(
child: TextField(
onChanged: (value) {
_filterData(value);
},
decoration: const InputDecoration(
hintText: '请输入搜索关键字',
border: InputBorder.none,
),
),
),
],
),
),
const SizedBox(height: 10),
Flexible(
child: ListView.builder(
shrinkWrap: true,
padding:
const EdgeInsets.only(top: 0, left: 0, bottom: 0, right: 0),
itemCount: filterOfficeLists!.length,
// 列表项数量
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
Get.back(result: filterOfficeLists![index]);
});
},
child: Container(
padding: const EdgeInsets.only(
left: 30, right: 15, top: 10, bottom: 10),
child: Text(
filterOfficeLists![index].name!,
style: const TextStyle(fontSize: 18),
),
),
);
},
),
),
],
),
);
}
}
...@@ -344,7 +344,11 @@ class _UserSettingsPageState extends State<UserSettingsPage> { ...@@ -344,7 +344,11 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
GestureDetector( GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
if (newList[index].name == '公司账户') {
newList[index].check = !newList[index].check!; newList[index].check = !newList[index].check!;
} else {
newList[index].check = !newList[index].check!;
}
///如果取消身份勾选,将当前身份下的已选中设备全部取消勾选 ///如果取消身份勾选,将当前身份下的已选中设备全部取消勾选
if (!newList[index].check!) { if (!newList[index].check!) {
...@@ -641,10 +645,14 @@ class _UserSettingsPageState extends State<UserSettingsPage> { ...@@ -641,10 +645,14 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
if (!roleNames().contains('公司账户')) {
setState(() { setState(() {
if (!roleNames().contains('公司账户')) {
if (editList!.roleDtoList![index].name == '公司账户') {
editList!.roleDtoList![index].check = false;
} else {
editList!.roleDtoList![index].check = editList!.roleDtoList![index].check =
!editList!.roleDtoList![index].check!; !editList!.roleDtoList![index].check!;
}
///如果取消身份勾选,将当前身份下的已选中设备全部取消勾选 ///如果取消身份勾选,将当前身份下的已选中设备全部取消勾选
if (!editList!.roleDtoList![index].check!) { if (!editList!.roleDtoList![index].check!) {
...@@ -653,8 +661,8 @@ class _UserSettingsPageState extends State<UserSettingsPage> { ...@@ -653,8 +661,8 @@ class _UserSettingsPageState extends State<UserSettingsPage> {
item.check = false; item.check = false;
} }
} }
});
} }
});
}, },
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
......
import 'package:event_bus/event_bus.dart';
///event bus
class EventBusUtils {
static EventBus? _eventBus;
static EventBus? getInstance() {
_eventBus ??= EventBus();
return _eventBus;
}
}
...@@ -12,7 +12,7 @@ class AppBarCustom extends StatelessWidget implements PreferredSizeWidget { ...@@ -12,7 +12,7 @@ class AppBarCustom extends StatelessWidget implements PreferredSizeWidget {
///标题颜色 ///标题颜色
var textColor; var textColor;
///背景色 ///背景色
var bgColor; var bgColor;
///icon颜色 ///icon颜色
......
// ignore_for_file: prefer_typing_uninitialized_variables, must_be_immutable
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
///全局统一appbar
class AppBarCustom extends StatelessWidget implements PreferredSizeWidget {
Widget? leading;
///标题内容
var text;
///标题颜色
var textColor;
///背景色
var bgColor;
///icon颜色
var iconColor;
double height;
List<Widget>? actions = [];
PreferredSizeWidget? bottom;
AppBarCustom(
{super.key,
this.leading,
this.text,
this.textColor,
this.bgColor,
this.iconColor,
required this.height,
this.bottom,
this.actions});
@override
Widget build(BuildContext context) {
return buildAppBar(context);
}
AppBar buildAppBar(BuildContext context) {
return AppBar(
backgroundColor: bgColor ?? ColorConst.blueColor,
leading: leading,
elevation: 0,
shadowColor: ColorConst.greyF8Color,
actions: actions,
/// 这里设置标题的左边距为零
titleSpacing: 0.0,
title: Container(
alignment: Alignment.centerLeft,
child: Text(
text,
style: TextStyle(
color: textColor ?? ColorConst.whiteColor, fontSize: 18),
),
),
bottom: bottom,
);
}
@override
Size get preferredSize => Size(100, height); //写啥没差,自动采用子视图尺寸
}
...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.4+4 version: 1.0.5+5
environment: environment:
sdk: '>=3.1.3 <4.0.0' sdk: '>=3.1.3 <4.0.0'
...@@ -55,6 +55,8 @@ dependencies: ...@@ -55,6 +55,8 @@ dependencies:
flutter_treeview: ^1.0.7+1 flutter_treeview: ^1.0.7+1
flutter_image_compress: ^2.1.0 flutter_image_compress: ^2.1.0
flutter_bmflocation: ^3.5.0 flutter_bmflocation: ^3.5.0
sliding_up_panel: ^2.0.0+1
event_bus: ^2.0.0
# geolocator: ^7.1.0 # geolocator: ^7.1.0
...@@ -123,6 +125,17 @@ flutter: ...@@ -123,6 +125,17 @@ flutter:
- assets/home/select_check_blue.png - assets/home/select_check_blue.png
- assets/home/select_check_orange.png - assets/home/select_check_orange.png
- assets/spalsh.jpeg - assets/spalsh.jpeg
- assets/examine/examine_history_icon.png
- assets/examine/examine_icon.png
- assets/examine/examine_test_icon.png
- assets/examine/exam_title_icon.png
- assets/examine/check_title_icon.png
- assets/examine/answer_sheet_icon.png
- assets/examine/answer_sheet_black_icon.png
- assets/examine/pass_icon.png
- assets/examine/no_pass_icon.png
- assets/examine/examine_gary_icon.png
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware # https://flutter.dev/assets-and-images/#resolution-aware
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment