From bf8753c22e5eeee56146c537db41504ce9fc98f0 Mon Sep 17 00:00:00 2001 From: LRC <991971966@qq.com> Date: Mon, 9 Oct 2023 09:16:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AF=E8=BF=90=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 52 ++++ .../lib/controller/CourseController.dart | 12 +- .../lib/controller/NetWorkController.dart | 17 +- .../lib/controller/TaskController.dart | 0 .../lib/controller/TeamController.dart | 19 +- .../lib/controller/UserController.dart | 32 ++- .../lib/controller/WorkController.dart | 0 src/timemanagerapp/lib/main.dart | 1 + .../lib/util/GetCourseByLogin.dart | 5 +- src/timemanagerapp/lib/util/dataUtil.dart | 118 +++++++- .../lib/wighets/HomeWighet.dart | 28 ++ .../lib/wighets/TestWidget.dart | 20 +- .../lib/wighets/TimetableWighet.dart | 270 +++++++++--------- src/timemanagerapp/pubspec.lock | 16 ++ src/timemanagerapp/pubspec.yaml | 1 + 15 files changed, 419 insertions(+), 172 deletions(-) create mode 100644 .gitignore create mode 100644 src/timemanagerapp/lib/controller/TaskController.dart create mode 100644 src/timemanagerapp/lib/controller/WorkController.dart create mode 100644 src/timemanagerapp/lib/wighets/HomeWighet.dart diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4bf53e4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,52 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +**/.history +**/.svn/ +**/migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +**/.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +**/vscode/ + +# Flutter/Dart/Pub related +**/src/timemanagerapp/.* +**/doc/api/ +**/build/ +**/ios/ +**/linux/ +**/macos/ +**/web/ +**/windows/ +**/android/ +**/.dart_tool/ +**/.flutter-plugins +**/.flutter-plugins-dependencies +**/.packages +**/.pub-cache/ +**/.pub/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + + diff --git a/src/timemanagerapp/lib/controller/CourseController.dart b/src/timemanagerapp/lib/controller/CourseController.dart index ce27c25..01c5677 100644 --- a/src/timemanagerapp/lib/controller/CourseController.dart +++ b/src/timemanagerapp/lib/controller/CourseController.dart @@ -1,3 +1,4 @@ +import 'package:timemanagerapp/controller/NetWorkController.dart'; import 'package:timemanagerapp/database/dao/CourseDao.dart'; import 'package:timemanagerapp/entity/Course.dart'; import 'package:timemanagerapp/entity/CourseForm.dart'; @@ -11,7 +12,10 @@ class CourseController { return new CourseController(); } + GetCourseByLogin getCourseByLogin = GetCourseByLogin(); + IdGenerator idGenerator = IdGenerator(); List courseList = []; //实时维护的courseList缓存 + NetWorkController netWorkController = NetWorkController(); DateTime termstartdate = Setting.startdate; //Setting.getStartDate(); @@ -50,10 +54,11 @@ class CourseController { hours: int.parse(raspiyane[courseForm.getEndTime() - 1][1].split(':')[0]), minutes: int.parse(raspiyane[courseForm.getEndTime() - 1][1].split(':')[1]), )); + int courseId = await idGenerator.generateId(); Course course = Course( name: courseForm.getCourse(), userId: Setting.user!.getId!, - courseId: generateId(), + courseId: courseId, teacher: courseForm.getTeacher(), location: courseForm.getLocation(), start: startDate, @@ -103,8 +108,9 @@ class CourseController { return result; } - Future autoImportCours(String jsonstr) async { - List courseList = await GetCourseByLogin().dealRawString(jsonstr); + Future autoImportCours(int stuid,String passwd,int year, int term) async { + String jsonstr = await netWorkController.getUserCoursejson(stuid, passwd, year, term); + List courseList = await getCourseByLogin.dealRawString(jsonstr); return await insertCourseList(courseList); } diff --git a/src/timemanagerapp/lib/controller/NetWorkController.dart b/src/timemanagerapp/lib/controller/NetWorkController.dart index 2f38806..6684252 100644 --- a/src/timemanagerapp/lib/controller/NetWorkController.dart +++ b/src/timemanagerapp/lib/controller/NetWorkController.dart @@ -15,12 +15,12 @@ class NetWorkController{ "appsecret":"mN3u09pY", }); - Future login(User user) async { - return true; + Future login(User user) async { + return Future(() => 1); } - Future register(User user) async { - return true; + Future register(User user) async { + return Future(() => 1); } Future> getSameFreeWork(int teamid){ @@ -62,6 +62,10 @@ class NetWorkController{ Future deleteTeamUser(int teamid,int userid) async { return true; } +//todo +// Future deleteTeamUser(int teamid,int userid) async { +// return true; +// } //app启动时调用,同步所有数据库 @@ -73,4 +77,9 @@ class NetWorkController{ return true; } + Future getUserCoursejson(int stuid,String passwd,int year, int term){ + String res = ""; + return Future(() => res); + } + } \ No newline at end of file diff --git a/src/timemanagerapp/lib/controller/TaskController.dart b/src/timemanagerapp/lib/controller/TaskController.dart new file mode 100644 index 0000000..e69de29 diff --git a/src/timemanagerapp/lib/controller/TeamController.dart b/src/timemanagerapp/lib/controller/TeamController.dart index f2d5887..5398cbc 100644 --- a/src/timemanagerapp/lib/controller/TeamController.dart +++ b/src/timemanagerapp/lib/controller/TeamController.dart @@ -11,6 +11,7 @@ class TeamController { Map> Wordmaplist = {}; NetWorkController netWorkController = NetWorkController(); + TeamController(int leaderid) { this.leaderid = leaderid; //TODO: 从服务器中根据leaderid获取teamList @@ -21,12 +22,12 @@ class TeamController { } } - Future>> getTeams(int userid) async { - return TeamDao().getTeams(); + Future> getTeams(int userid) async { + return await netWorkController.getTeamList(userid); } - Future insertTeam(Team team) async { - await TeamDao().insertTeam(team); + Future createTeam(Team team) async { + return await netWorkController.insertTeam(team); } Future insertTeamList(List teamList) async { @@ -39,16 +40,16 @@ class TeamController { await TeamDao().deleteAllTeams(); } - Future deleteTeam(int id) async { - await TeamDao().deleteTeamById(id); + Future deleteTeam(int teamid) async { + return await netWorkController.deleteTeam(teamid); } - Future updateTeam(Team team) async { - await TeamDao().updateTeam(team); + Future updateTeam(Team team) async { + return await netWorkController.updateTeam(team); } Future insertWork(Work work) async { - await WorkDao().insertWork(work); + // return await netWorkController.insertWork(work); } Future insertWorkList(List workList) async { diff --git a/src/timemanagerapp/lib/controller/UserController.dart b/src/timemanagerapp/lib/controller/UserController.dart index 711c0f4..95bd2bd 100644 --- a/src/timemanagerapp/lib/controller/UserController.dart +++ b/src/timemanagerapp/lib/controller/UserController.dart @@ -2,10 +2,15 @@ import 'package:timemanagerapp/database/dao/UserDao.dart'; import 'package:timemanagerapp/database/MyDatebase.dart'; import 'package:timemanagerapp/entity/User.dart'; +import '../setting/Setting.dart'; +import 'NetWorkController.dart'; + /** * 封装所有要用到的与用户相关的函数 */ class UserController { + NetWorkController netWorkController = NetWorkController(); + //对外暴露实例 static UserController getInstance() { return new UserController(); @@ -15,17 +20,32 @@ class UserController { return await UserDao.getInstance().getUsers(); } - Future insertUser(User user) async { - await UserDao.getInstance().insertUser(user); + Future login(User user) async { + int userid = await netWorkController.login(user); + user.id = userid; + await Setting.saveUser(user); + return true; } - Future deleteAllUsers() async { - await UserDao.getInstance().deleteAllUsers(); + Future register(User user) async { + int userid = await netWorkController.register(user); + user.id = userid; + await Setting.saveUser(user); + return true; } - Future deleteUser(int id) async { - await UserDao.getInstance().deleteUser(id); + Future insertUser(User user) async { + await UserDao.getInstance().insertUser(user); } + Future insertUserList(List userList) async { + for (User user in userList) { + await UserDao.getInstance().insertUser(user); + } + } + //deleteAllUsers + Future deleteAllUsers() async { + await UserDao.getInstance().deleteAllUsers(); + } } diff --git a/src/timemanagerapp/lib/controller/WorkController.dart b/src/timemanagerapp/lib/controller/WorkController.dart new file mode 100644 index 0000000..e69de29 diff --git a/src/timemanagerapp/lib/main.dart b/src/timemanagerapp/lib/main.dart index a1a9715..3de2afd 100644 --- a/src/timemanagerapp/lib/main.dart +++ b/src/timemanagerapp/lib/main.dart @@ -3,6 +3,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:timemanagerapp/setting/Setting.dart'; import 'package:timemanagerapp/util/GetCourseByLogin.dart'; import 'package:timemanagerapp/wighets/AddCourseFormWidget.dart'; +import 'package:timemanagerapp/wighets/HomeWighet.dart'; import 'package:timemanagerapp/wighets/LoginWidget.dart'; import 'package:timemanagerapp/wighets/TestWidget.dart'; import 'package:timemanagerapp/wighets/TimetableWighet.dart'; diff --git a/src/timemanagerapp/lib/util/GetCourseByLogin.dart b/src/timemanagerapp/lib/util/GetCourseByLogin.dart index 1d92903..d01f679 100644 --- a/src/timemanagerapp/lib/util/GetCourseByLogin.dart +++ b/src/timemanagerapp/lib/util/GetCourseByLogin.dart @@ -12,6 +12,7 @@ class GetCourseByLogin { String term = "1"; //学期 DateTime termstartdate = Setting.startdate; List courses = []; //获取的所有课程 + IdGenerator idGenerator = IdGenerator(); // GetCourseByLogin({this.id = "", this.passwd = "", this.year = "2021", this.term = "1"}); @@ -79,7 +80,7 @@ class GetCourseByLogin { return Future(() => res); } - dealRawString(String rawStr) { + dealRawString(String rawStr) async { rawStr = rawStr.replaceAll("'", "\""); // 解析 JSON 字符串 @@ -140,7 +141,7 @@ class GetCourseByLogin { final course = Course( id: int.parse(courseId), userId: Setting.user != null ? Setting.user!.id : null, - courseId: generateId(), + courseId: await idGenerator.generateId(), name: courseTitle, credit: courseData['credit'], teacher: courseData['teacher'], diff --git a/src/timemanagerapp/lib/util/dataUtil.dart b/src/timemanagerapp/lib/util/dataUtil.dart index 5cf6b5b..c7e1252 100644 --- a/src/timemanagerapp/lib/util/dataUtil.dart +++ b/src/timemanagerapp/lib/util/dataUtil.dart @@ -1,3 +1,115 @@ -int generateId() { - return DateTime.now().millisecondsSinceEpoch; -} \ No newline at end of file +import 'dart:io'; +import 'dart:math'; + +import 'package:device_info/device_info.dart'; +import 'package:flutter/services.dart'; + +//分布式雪花全局唯一id生成器 +class IdGenerator { + static const int EPOCH = 1609459200000; // 2021-01-01 00:00:00 + static const int WORKER_ID_BITS = 5; + static const int DATACENTER_ID_BITS = 5; + static const int SEQUENCE_BITS = 12; + + late int workerId; + late int datacenterId; + late var sequenceFuther ; + late int sequence = 0; + late int lastTimestamp = -1; + + IdGenerator() { + //workerId = Random().nextInt(pow(2, WORKER_ID_BITS)) % 4096; + var wordidrang = pow(2, WORKER_ID_BITS).toInt(); + workerId = Random().nextInt(wordidrang); + datacenterId = Random().nextInt(pow(2, DATACENTER_ID_BITS).toInt()); + sequenceFuther = generateSequenceFromMacAddress(); + if (workerId < 0 || workerId >= pow(2, WORKER_ID_BITS)) { + throw ArgumentError('Worker ID must be between 0 and ${pow(2, WORKER_ID_BITS) - 1}'); + } + if (datacenterId < 0 || datacenterId >= pow(2, DATACENTER_ID_BITS)) { + throw ArgumentError('Datacenter ID must be between 0 and ${pow(2, DATACENTER_ID_BITS) - 1}'); + } + } + + Future generateId() async{ + sequence = await sequenceFuther; + int timestamp = DateTime.now().millisecondsSinceEpoch - EPOCH; + + if (timestamp < lastTimestamp) { + throw Exception('Invalid system clock'); + } + + if (timestamp == lastTimestamp) { + sequence = (sequence + 1) & ((1 << SEQUENCE_BITS) - 1); + if (sequence == 0) { + timestamp = tilNextMillis(lastTimestamp); + } + } else { + sequence = 0; + } + + lastTimestamp = timestamp; + + int id = (timestamp << (WORKER_ID_BITS + DATACENTER_ID_BITS + SEQUENCE_BITS)) | + (datacenterId << (WORKER_ID_BITS + SEQUENCE_BITS)) | + (workerId << SEQUENCE_BITS) | + sequence; + + return id; + } + + int tilNextMillis(int lastTimestamp) { + int timestamp = DateTime.now().millisecondsSinceEpoch - EPOCH; + while (timestamp <= lastTimestamp) { + timestamp = DateTime.now().millisecondsSinceEpoch - EPOCH; + } + return timestamp; + } + + + Future generateSequenceFromMacAddress() async{ + String macAddress = await getMacAddress();; + // 移除冒号,并将MAC地址转为大写 + String sanitizedMacAddress = macAddress.replaceAll(':', '').toUpperCase(); + + // 将MAC地址的前6个字节转换为整数,并计算它们的总和 + int sum = int.parse(sanitizedMacAddress.substring(0, 12), radix: 16); + + // 将总和作为sequence + return sum % (1 << 12); + } + + Future getMacAddress() async { + DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); + if (Platform.isAndroid) { + AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; + return _getMacAddress(androidInfo); + } else if (Platform.isIOS) { + IosDeviceInfo iosInfo = await deviceInfo.iosInfo; + return iosInfo.identifierForVendor; + } + return ''; + } + + Future _getMacAddress(AndroidDeviceInfo androidInfo) async { + + DeviceInfoPlugin deviceInfo = DeviceInfoPlugin(); + + AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo; + + String macAddress = androidInfo.androidId; + print("get MAC address:" + macAddress); + return macAddress; + // 使用WifiManager获取MAC地址 + MethodChannel channel = MethodChannel('plugins.flutter.io/device_info'); + + try { + macAddress = await channel.invokeMethod('getWifiMacAddress'); + } catch (e) { + print('Failed to get MAC address: $e'); + } + return macAddress; + } + + +} diff --git a/src/timemanagerapp/lib/wighets/HomeWighet.dart b/src/timemanagerapp/lib/wighets/HomeWighet.dart new file mode 100644 index 0000000..951ca60 --- /dev/null +++ b/src/timemanagerapp/lib/wighets/HomeWighet.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; +import 'package:shared_preferences/shared_preferences.dart'; +import 'package:timemanagerapp/setting/Setting.dart'; +import 'package:timemanagerapp/util/GetCourseByLogin.dart'; +import 'package:timemanagerapp/wighets/AddCourseFormWidget.dart'; +import 'package:timemanagerapp/wighets/LoginWidget.dart'; +import 'package:timemanagerapp/wighets/TestWidget.dart'; +import 'package:timemanagerapp/wighets/TimetableWighet.dart'; + +class HomeWighet extends StatefulWidget { + const HomeWighet({Key? key}) : super(key: key); + + @override + _HomePageState createState() => _HomePageState(); +} + +class _HomePageState extends State { + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + return TimetableWidget(); + + } +} \ No newline at end of file diff --git a/src/timemanagerapp/lib/wighets/TestWidget.dart b/src/timemanagerapp/lib/wighets/TestWidget.dart index b5339f5..651a91b 100644 --- a/src/timemanagerapp/lib/wighets/TestWidget.dart +++ b/src/timemanagerapp/lib/wighets/TestWidget.dart @@ -82,9 +82,9 @@ class _HomePageState extends State { mainAxisSize: MainAxisSize.min, children: users .map((user) => ListTile( - title: Text(user['username']), - subtitle: Text(user.toString()), - )) + title: Text(user['username']), + subtitle: Text(user.toString()), + )) .toList(), ), ), @@ -143,9 +143,9 @@ class _HomePageState extends State { mainAxisSize: MainAxisSize.min, children: courses .map((course) => ListTile( - title: Text(course.getName), - subtitle: Text(course.toString()), - )) + title: Text(course.getName), + subtitle: Text(course.toString()), + )) .toList(), ), ), @@ -171,10 +171,10 @@ class _HomePageState extends State { child: Text('查看时间表'), ), AddCourseButton( - onCourseAdded: (jsonstr) { - // 在这里执行添加课程的逻辑,可以将课程名传递给你的 addCourse() 函数 - courseController.autoImportCours(jsonstr); - } + onCourseAdded: (jsonstr) { + // 在这里执行添加课程的逻辑,可以将课程名传递给你的 addCourse() 函数 + // courseController.autoImportCours(jsonstr); + } ) ], ), diff --git a/src/timemanagerapp/lib/wighets/TimetableWighet.dart b/src/timemanagerapp/lib/wighets/TimetableWighet.dart index 7e58504..46cf29e 100644 --- a/src/timemanagerapp/lib/wighets/TimetableWighet.dart +++ b/src/timemanagerapp/lib/wighets/TimetableWighet.dart @@ -147,45 +147,45 @@ class PageState extends State { child: Center( child: index == 0 ? Column( - //第一行显示第几周 - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - // height: 10, - // width: 6, - child: Text( - '第' + weekCount.toString() + '周', //显示周数 - style: TextStyle( - fontSize: 12, - color: currentWeek == - weekCount //如果是当前周,就显示蓝色 - ? Colors.amber - : Colors.black87)), - ), - ], - ) + //第一行显示第几周 + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // height: 10, + // width: 6, + child: Text( + '第' + weekCount.toString() + '周', //显示周数 + style: TextStyle( + fontSize: 12, + color: currentWeek == + weekCount //如果是当前周,就显示蓝色 + ? Colors.amber + : Colors.black87)), + ), + ], + ) : Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text(weekList[index - 1], //显示周数 - style: TextStyle( - fontSize: 14, - color: index == - currentWeekDayIndex //如果是当前周,就显示蓝色 - ? Colors.lightBlue - : Colors.black87)), - SizedBox( - height: 5, - ), - Text(dateListstr[index - 1], //显示日期 - style: TextStyle( - fontSize: 12, - color: index == - currentWeekDayIndex //如果是当前周,就显示蓝色 - ? Colors.lightBlue - : Colors.black87)), - ], - ), + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(weekList[index - 1], //显示周数 + style: TextStyle( + fontSize: 14, + color: index == + currentWeekDayIndex //如果是当前周,就显示蓝色 + ? Colors.lightBlue + : Colors.black87)), + SizedBox( + height: 5, + ), + Text(dateListstr[index - 1], //显示日期 + style: TextStyle( + fontSize: 12, + color: index == + currentWeekDayIndex //如果是当前周,就显示蓝色 + ? Colors.lightBlue + : Colors.black87)), + ], + ), ), ); }), @@ -193,92 +193,92 @@ class PageState extends State { //显示下面的界面中的两个stack,一个下层的时间轴,一个是上层课程或者人物的方块 Expanded( child: SingleChildScrollView( - child: Row( - children: [ - //借助两个stack重叠,实现效果 - Container( - width: 390, - height: 2000, - child: Stack( - alignment: Alignment.center, - children: [ - // 第一个Stack - Positioned( - top: 0, - left: 0, - child: Container( - width: 390, - height: 2000, - child: Stack( - children: List.generate( - //根据时间轴的长度,生成对应的时间轴 - positions.length, - (index) => Positioned( - top: positions[index].dy, - left: positions[index].dx, - child: Row( - children: [ - Text( - timePoints[index] + child: Row( + children: [ + //借助两个stack重叠,实现效果 + Container( + width: 390, + height: 2000, + child: Stack( + alignment: Alignment.center, + children: [ + // 第一个Stack + Positioned( + top: 0, + left: 0, + child: Container( + width: 390, + height: 2000, + child: Stack( + children: List.generate( + //根据时间轴的长度,生成对应的时间轴 + positions.length, + (index) => Positioned( + top: positions[index].dy, + left: positions[index].dx, + child: Row( + children: [ + Text( + timePoints[index] .hour .toString() .padLeft(2, '0') + - ':' + - timePoints[index] - .minute - .toString() - .padLeft(2, '0'), - ), - SizedBox(width: 5), - Container( - width: 10, - height: 10, - decoration: BoxDecoration( - shape: BoxShape.circle, - border: Border.all( - color: Colors.amber, - width: 2, + ':' + + timePoints[index] + .minute + .toString() + .padLeft(2, '0'), ), - ), - ), - Container( - width: 315, - height: 2, - color: const Color.fromARGB( - 255, 136, 61, 61), + SizedBox(width: 5), + Container( + width: 10, + height: 10, + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all( + color: Colors.amber, + width: 2, + ), + ), + ), + Container( + width: 315, + height: 2, + color: const Color.fromARGB( + 255, 136, 61, 61), + ), + ], ), - ], + ), ), ), - ), - ), - )), - //第二个Stack - Container( - constraints: + )), + //第二个Stack + Container( + constraints: BoxConstraints.expand(), // 使用constraints来自适应 - // width: 390, - // height: 2000, - child: Stack( - children: List.generate( - //根据课程的数量,生成对应的课程方块 - courseWeekMap.containsKey(weekCount) - ? courseWeekMap[weekCount]!.length - : 0, - ((index) => Positioned( + // width: 390, + // height: 2000, + child: Stack( + children: List.generate( + //根据课程的数量,生成对应的课程方块 + courseWeekMap.containsKey(weekCount) + ? courseWeekMap[weekCount]!.length + : 0, + ((index) => Positioned( top: courseWeekMap[weekCount]![index] - .getdy() + + .getdy() + 10, left: courseWeekMap[weekCount]![index] - .getdx() + + .getdx() + 50, child: SingleChildScrollView( child: Container( //课程方块 width: 40, height: - courseWeekMap[weekCount]![index] - .getHeight(), + courseWeekMap[weekCount]![index] + .getHeight(), decoration: BoxDecoration( color: Colors.tealAccent, // 设置颜色 @@ -292,71 +292,71 @@ class PageState extends State { children: [ Text( courseWeekMap[weekCount]![ - index] + index] .name, style: TextStyle( fontSize: 10, fontWeight: - FontWeight.bold), + FontWeight.bold), overflow: TextOverflow .clip, //name加粗 ), Text( courseWeekMap[weekCount]![ - index] + index] .teacher, style: - TextStyle(fontSize: 8), + TextStyle(fontSize: 8), overflow: TextOverflow.clip, ), Text( courseWeekMap[weekCount]![ - index] + index] .location, style: - TextStyle(fontSize: 10), + TextStyle(fontSize: 10), overflow: TextOverflow.clip, ), Text( courseWeekMap[weekCount]![ - index] - .start - .hour - .toString() + + index] + .start + .hour + .toString() + ':' + courseWeekMap[ - weekCount]![ - index] + weekCount]![ + index] .start .minute .toString(), style: - TextStyle(fontSize: 10), + TextStyle(fontSize: 10), overflow: TextOverflow.clip, ), Text( courseWeekMap[weekCount]![ - index] - .end - .hour - .toString() + + index] + .end + .hour + .toString() + ':' + courseWeekMap[ - weekCount]![ - index] + weekCount]![ + index] .end .minute .toString(), style: - TextStyle(fontSize: 10), + TextStyle(fontSize: 10), overflow: TextOverflow.clip, ), Text( courseWeekMap[weekCount]![ - index] + index] .remark, style: - TextStyle(fontSize: 10), + TextStyle(fontSize: 10), overflow: TextOverflow.clip, ), ], @@ -365,13 +365,13 @@ class PageState extends State { ), ), ))), - )) - ], - ), + )) + ], + ), + ), + ], ), - ], - ), - )) + )) ], ), ); diff --git a/src/timemanagerapp/pubspec.lock b/src/timemanagerapp/pubspec.lock index e439f14..9c5c20d 100644 --- a/src/timemanagerapp/pubspec.lock +++ b/src/timemanagerapp/pubspec.lock @@ -49,6 +49,22 @@ packages: url: "https://pub.flutter-io.cn" source: hosted version: "1.0.6" + device_info: + dependency: "direct main" + description: + name: device_info + sha256: f4a8156cb7b7480d969cb734907d18b333c8f0bc0b1ad0b342cdcecf30d62c48 + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.3" + device_info_platform_interface: + dependency: transitive + description: + name: device_info_platform_interface + sha256: b148e0bf9640145d09a4f8dea96614076f889e7f7f8b5ecab1c7e5c2dbc73c1b + url: "https://pub.flutter-io.cn" + source: hosted + version: "2.0.1" fake_async: dependency: transitive description: diff --git a/src/timemanagerapp/pubspec.yaml b/src/timemanagerapp/pubspec.yaml index 87d6217..55d922b 100644 --- a/src/timemanagerapp/pubspec.yaml +++ b/src/timemanagerapp/pubspec.yaml @@ -41,6 +41,7 @@ dependencies: path_provider: ^2.1.1 multi_select_flutter: 4.1.3 http: ^1.1.0 + device_info: dev_dependencies: