Skip to content

Commit 71b7878

Browse files
committed
Chore: format
1 parent a6df93e commit 71b7878

File tree

10 files changed

+237
-453
lines changed

10 files changed

+237
-453
lines changed

lib/generated/intl/messages_all.dart

+3-5
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ MessageLookupByLibrary? _findExact(String localeName) {
3838

3939
/// User programs should call this before using [localeName] for messages.
4040
Future<bool> initializeMessages(String localeName) {
41-
var availableLocale = Intl.verifiedLocale(
42-
localeName, (locale) => _deferredLibraries[locale] != null,
43-
onFailure: (_) => null);
41+
var availableLocale =
42+
Intl.verifiedLocale(localeName, (locale) => _deferredLibraries[locale] != null, onFailure: (_) => null);
4443
if (availableLocale == null) {
4544
return new SynchronousFuture(false);
4645
}
@@ -60,8 +59,7 @@ bool _messagesExistFor(String locale) {
6059
}
6160

6261
MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) {
63-
var actualLocale =
64-
Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
62+
var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null);
6563
if (actualLocale == null) return null;
6664
return _findExact(actualLocale);
6765
}

lib/generated/intl/messages_en.dart

+147-284
Large diffs are not rendered by default.

lib/generated/intl/messages_zh_TW.dart

+54-108
Large diffs are not rendered by default.

lib/generated/l10n.dart

+3-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/connector/course_connector.dart

+9-24
Original file line numberDiff line numberDiff line change
@@ -438,11 +438,7 @@ class CourseConnector {
438438
static Future<Map<String, String>?> getDepartmentMap(int year, int semester) async {
439439
try {
440440
ConnectorParameter parameter = ConnectorParameter(_getCourseDepartmentUrl);
441-
parameter.data = {
442-
"format": "-2",
443-
"year": year.toString(),
444-
"sem": semester.toString()
445-
};
441+
parameter.data = {"format": "-2", "year": year.toString(), "sem": semester.toString()};
446442
String result = await Connector.getDataByGet(parameter);
447443

448444
Document tagNode = parse(result);
@@ -454,10 +450,7 @@ class CourseConnector {
454450
if (href == null) {
455451
continue;
456452
}
457-
String codeParameter = href.split("&").firstWhere((parameter) =>
458-
parameter.contains("code"),
459-
orElse: () => ""
460-
);
453+
String codeParameter = href.split("&").firstWhere((parameter) => parameter.contains("code"), orElse: () => "");
461454
if (codeParameter == "") {
462455
continue;
463456
}
@@ -467,8 +460,7 @@ class CourseConnector {
467460
}
468461

469462
return departmentMap;
470-
471-
} catch (e, stack){
463+
} catch (e, stack) {
472464
Log.eWithStack(e, stack);
473465
return null;
474466
}
@@ -477,11 +469,7 @@ class CourseConnector {
477469
static Future<Map<String, String>?> getTwoYearUndergraduateDepartmentMap(int year) async {
478470
try {
479471
ConnectorParameter parameter = ConnectorParameter(_creditUrl);
480-
parameter.data = {
481-
"format": "-3",
482-
"year": year,
483-
"matric": "6"
484-
};
472+
parameter.data = {"format": "-3", "year": year, "matric": "6"};
485473
String result = await Connector.getDataByGet(parameter);
486474

487475
Document tagNode = parse(result);
@@ -493,29 +481,26 @@ class CourseConnector {
493481
if (href == null) {
494482
continue;
495483
}
496-
String divisionParameter = href.split("&").firstWhere((parameter) =>
497-
parameter.contains("division"),
498-
orElse: () => ""
499-
);
484+
String divisionParameter =
485+
href.split("&").firstWhere((parameter) => parameter.contains("division"), orElse: () => "");
500486
if (divisionParameter == "") {
501487
continue;
502488
}
503489
String code = divisionParameter.split("=")[1];
504490
RegExp regExp = RegExp(".+【(.+)】");
505491
RegExpMatch? matches = regExp.firstMatch(element.text);
506-
if(matches == null || matches.groupCount == 0){
492+
if (matches == null || matches.groupCount == 0) {
507493
continue;
508494
}
509495
String? departmentName = matches.group(1);
510-
if(departmentName == null){
496+
if (departmentName == null) {
511497
continue;
512498
}
513499
departmentMap.putIfAbsent(code, () => departmentName);
514500
}
515501

516502
return departmentMap;
517-
518-
} catch (e, stack){
503+
} catch (e, stack) {
519504
Log.eWithStack(e, stack);
520505
return null;
521506
}

lib/src/connector/ischool_plus_connector.dart

+2-9
Original file line numberDiff line numberDiff line change
@@ -514,9 +514,7 @@ class ISchoolPlusConnector {
514514
for (int i = 0; i < nodes.length; i++) {
515515
html.Element node = nodes[i].querySelectorAll('td')[1];
516516

517-
String information = node
518-
.querySelector('div')
519-
.innerHtml;
517+
String information = node.querySelector('div').innerHtml;
520518
int splitIndex = information.indexOf(' ');
521519

522520
String studentId = information.substring(0, splitIndex);
@@ -527,11 +525,7 @@ class ISchoolPlusConnector {
527525
continue;
528526
}
529527

530-
CourseStudent courseStudent = CourseStudent(
531-
department: "",
532-
id: studentId,
533-
name: studentName
534-
);
528+
CourseStudent courseStudent = CourseStudent(department: "", id: studentId, name: studentName);
535529
courseStudents.add(courseStudent);
536530
}
537531

@@ -541,7 +535,6 @@ class ISchoolPlusConnector {
541535
returnResult.status = IPlusReturnStatus.success;
542536
returnResult.result = courseStudents;
543537
return returnResult;
544-
545538
} catch (e, stack) {
546539
Log.eWithStack(e, stack);
547540
final returnResult = ReturnWithStatus<List<CourseStudent>>();

lib/src/model/course/course_semester.g.dart

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/src/model/course/course_student.dart

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ class CourseStudent {
33
final String id;
44
final String name;
55

6-
CourseStudent.origin() : department = "", id = "", name = "";
6+
CourseStudent.origin()
7+
: department = "",
8+
id = "",
9+
name = "";
710
CourseStudent({required this.department, required this.id, required this.name});
8-
9-
10-
}
11+
}

lib/src/task/course/course_department_map_task.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ class CourseDepartmentMapTask extends CourseSystemTask<Map<String, String>> {
2323

2424
final collection = <String, String>{};
2525

26-
if(value != null) {
26+
if (value != null) {
2727
collection.addAll(value);
2828
}
29-
if(twoYearProgramDepartmentMap != null){
29+
if (twoYearProgramDepartmentMap != null) {
3030
collection.addAll(twoYearProgramDepartmentMap);
3131
}
3232

lib/ui/pages/coursedetail/screen/course_info_page.dart

+11-10
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
8787
List<CourseStudent> students = await _getCourseStudent();
8888
Map<String, String> departmentMap = await _getCourseDepartmentMap();
8989

90-
if(students.isNotEmpty){
90+
if (students.isNotEmpty) {
9191
listItem.add(
9292
Padding(
9393
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 0),
@@ -285,7 +285,8 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
285285
);
286286
}
287287

288-
Widget _buildClassmateInfo(int index, String departmentName, String studentId, String studentName, { bool isHeader = false }) {
288+
Widget _buildClassmateInfo(int index, String departmentName, String studentId, String studentName,
289+
{bool isHeader = false}) {
289290
double height = isHeader ? 25 : 50;
290291

291292
final color = (index % 2 == 1)
@@ -332,7 +333,7 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
332333
taskFlow.addTask(task);
333334
if (await taskFlow.start()) {
334335
List<CourseStudent>? students = task.result;
335-
if(students != null){
336+
if (students != null) {
336337
return students;
337338
}
338339
}
@@ -345,7 +346,7 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
345346
taskFlow.addTask(task);
346347
if (await taskFlow.start()) {
347348
Map<String, String>? departmentMap = task.result;
348-
if(departmentMap != null){
349+
if (departmentMap != null) {
349350
return departmentMap;
350351
}
351352
}
@@ -355,32 +356,32 @@ class _CourseInfoPageState extends State<CourseInfoPage> with AutomaticKeepAlive
355356
@override
356357
bool get wantKeepAlive => true;
357358

358-
String getDepartment(Map<String, String> departmentMap, String studentId){
359+
String getDepartment(Map<String, String> departmentMap, String studentId) {
359360
/*
360361
* Since we don't have official data to describe the following hard-coded rule is correct.
361362
* It may need to confirm or just leave it.
362363
*/
363-
if(studentId.substring(0, 1) == "4"){
364+
if (studentId.substring(0, 1) == "4") {
364365
return R.current.nationalTaipeiUniversity;
365366
}
366367

367-
if(studentId.substring(0, 1) == "B"){
368+
if (studentId.substring(0, 1) == "B") {
368369
return R.current.taipeiMedicineUniversity;
369370
}
370371

371-
if(studentId.substring(3, 6) == "054"){
372+
if (studentId.substring(3, 6) == "054") {
372373
return R.current.aduit;
373374
}
374375

375376
String? department = departmentMap[studentId.substring(3, 5)];
376377

377-
if(department != null){
378+
if (department != null) {
378379
return department;
379380
}
380381

381382
department = departmentMap[studentId.substring(3, 6)];
382383

383-
if(department != null){
384+
if (department != null) {
384385
return department;
385386
}
386387

0 commit comments

Comments
 (0)