Compare commits

..

27 Commits

Author SHA1 Message Date
cyx13 724c2c9084 Merge branch 'main' of https://bdgit.educoder.net/mbhvfy6mx/timemanager
2 years ago
cyx13 1b25e72066 修改
2 years ago
cyx13 b002999edd 修改
2 years ago
cyx13 745e0856a0 修改
2 years ago
p8fjyvg3u a9fdbfd46f Delete 'other/08_时间管理系统-181341940-邹兴云-实践总结报告.doc'
2 years ago
cyx13 5521601c51 修改
2 years ago
p8fjyvg3u f38367d9a0 ADD file via upload
2 years ago
gexinghai 5f4ce886ba 删除无关平台
2 years ago
beitingnanxu 699cea696a Merge branch 'main' of https://bdgit.educoder.net/mbhvfy6mx/timemanager
2 years ago
beitingnanxu 296e991eb0 aaa
2 years ago
gexinghai f659c521bf update
2 years ago
gexinghai 5a020ca86f update
2 years ago
ps9up4ig6 f37154949b Delete 'other/05_时间管理系统_软件工程课程设计汇报.pptx'
2 years ago
ps9up4ig6 74b02197d6 提交 海报
2 years ago
ps9up4ig6 06e5e2dcb3 提交 实践总结报告
2 years ago
p2jf6ytqz 6bb51db79a ADD file via upload
2 years ago
p2jf6ytqz acb0e58313 Delete 'other/08_时间管理系统_211440523_卫俊钢_实践总结报告.doc'
2 years ago
p2jf6ytqz a71deee59f ADD file via upload
2 years ago
p2jf6ytqz d0a134f5b9 Delete 'other/时间管理系统_211440523_卫俊钢_实践总结报告.doc'
2 years ago
p2jf6ytqz 936b6673bb ADD file via upload
2 years ago
cyx13 35feeaede2 Merge branch 'main' of https://bdgit.educoder.net/mbhvfy6mx/timemanager
2 years ago
beitingnanxu 242954c79f 格式修改
2 years ago
mszfy297n 36f98dbcd1 ADD file via upload
2 years ago
p8fjyvg3u c8481a2159 ADD file via upload
2 years ago
beitingnanxu 3a9145720c 格式修改
2 years ago
beitingnanxu 1332182777 格式修改
2 years ago
ps9up4ig6 1df09a5d59 计时器分类
2 years ago

@ -1,2 +0,0 @@
#Sat Nov 04 11:50:30 CST 2023
gradle.version=7.5

@ -1,44 +0,0 @@
package io.flutter.plugins;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.Log;
import io.flutter.embedding.engine.FlutterEngine;
/**
* Generated file. Do not edit.
* This file is generated by the Flutter tool based on the
* plugins that support the Android platform.
*/
@Keep
public final class GeneratedPluginRegistrant {
private static final String TAG = "GeneratedPluginRegistrant";
public static void registerWith(@NonNull FlutterEngine flutterEngine) {
try {
flutterEngine.getPlugins().add(new dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin package_info_plus, dev.fluttercommunity.plus.packageinfo.PackageInfoPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin path_provider_android, io.flutter.plugins.pathprovider.PathProviderPlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin shared_preferences_android, io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin", e);
}
try {
flutterEngine.getPlugins().add(new com.tekartik.sqflite.SqflitePlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin sqflite, com.tekartik.sqflite.SqflitePlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e);
}
}
}

@ -1,40 +0,0 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
maven {url 'https://maven.aliyun.com/repository/google'}
maven {url 'https://maven.aliyun.com/repository/jcenter'}
maven {url 'https://maven.aliyun.com/repository/central'}
maven {url 'https://maven.aliyun.com/repository/public'}
maven {url 'https://maven.aliyun.com/repository/spring'}
maven {url 'https://maven.aliyun.com/repository/gradle-plugin'}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
maven {url 'https://maven.aliyun.com/repository/google'}
maven {url 'https://maven.aliyun.com/repository/jcenter'}
maven {url 'https://maven.aliyun.com/repository/central'}
maven {url 'https://maven.aliyun.com/repository/public'}
maven {url 'https://maven.aliyun.com/repository/spring'}
maven {url 'https://maven.aliyun.com/repository/gradle-plugin'}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

@ -1,5 +0,0 @@
sdk.dir=C:\\Users\\28749\\AppData\\Local\\Android\\sdk
flutter.sdk=C:\\flutter
flutter.buildMode=debug
flutter.versionName=1.0.0
flutter.versionCode=1

@ -1 +0,0 @@
CONTRIBUTORS.md  assetCONTRIBUTORS.md README.md  asset README.mdicon.svg  asseticon.svg2packages/cupertino_icons/assets/CupertinoIcons.ttf  asset2packages/cupertino_icons/assets/CupertinoIcons.ttf1packages/flutter_about_page/fonts/RobotoLight.ttf  asset1packages/flutter_about_page/fonts/RobotoLight.ttf2packages/flutter_about_page/fonts/RobotoMedium.ttf  asset2packages/flutter_about_page/fonts/RobotoMedium.ttf9packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf  asset9packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf:packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf  asset:packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf8packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf  asset8packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf

@ -1 +0,0 @@
{"CONTRIBUTORS.md":["CONTRIBUTORS.md"],"README.md":["README.md"],"icon.svg":["icon.svg"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"packages/flutter_about_page/fonts/RobotoLight.ttf":["packages/flutter_about_page/fonts/RobotoLight.ttf"],"packages/flutter_about_page/fonts/RobotoMedium.ttf":["packages/flutter_about_page/fonts/RobotoMedium.ttf"],"packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf":["packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf"],"packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf":["packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf"],"packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf":["packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf"]}

@ -1,7 +0,0 @@
| 姓名 | 知士荟 | 头歌 | Github |
| ------ | ----------------------------------------------------- | ------------------------------------------------ | ---------------------------------------- |
| 葛兴海 | [@葛兴海](https://www.learnerhub.net/#/users/12147/docs) | [@葛兴海](https://code.educoder.net/user/ps9up4ig6) | [@Sheeet](https://github.com/icesheeet) |
| 庞浩 | [@庞浩](https://www.learnerhub.net/#/users/12027/docs) | [@庞浩](https://code.educoder.net/user/mbhvfy6mx) | |
| 卫俊钢 | [@卫俊钢](https://www.learnerhub.net/#/users/12144/docs) | [@卫俊钢](https://www.educoder.net/users/p2jf6ytqz) | [@JungangWei](https://github.com/githubwjg) |
| 邹兴云 | [@邹兴云](https://www.learnerhub.net/#/users/12026/docs) | [@邹兴云](https://www.educoder.net/users/p8fjyvg3u) | |
| 蔡玉祥 | [@蔡玉祥](https://www.learnerhub.net/#/users/12015/docs) | [@蔡玉祥](https://www.educoder.net/users/mszfy297n) | |

@ -1 +0,0 @@
[{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]},{"family":"packages/cupertino_icons/CupertinoIcons","fonts":[{"asset":"packages/cupertino_icons/assets/CupertinoIcons.ttf"}]},{"family":"packages/flutter_about_page/RobotoMedium","fonts":[{"asset":"packages/flutter_about_page/fonts/RobotoMedium.ttf"}]},{"family":"packages/flutter_about_page/Roboto","fonts":[{"asset":"packages/flutter_about_page/fonts/RobotoLight.ttf"}]},{"family":"packages/font_awesome_flutter/FontAwesomeBrands","fonts":[{"weight":400,"asset":"packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf"}]},{"family":"packages/font_awesome_flutter/FontAwesomeRegular","fonts":[{"weight":400,"asset":"packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf"}]},{"family":"packages/font_awesome_flutter/FontAwesomeSolid","fonts":[{"weight":900,"asset":"packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf"}]}]

File diff suppressed because it is too large Load Diff

@ -1,3 +0,0 @@
# 时间管理
一个基于Flutter框架的APP

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
<?xml version="1.0" ?><svg id="OBJECT" viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><defs><style>.cls-1{fill:#bddbff;}.cls-2{fill:#3d9ae2;}.cls-3{fill:#fff;}</style></defs><title/><path class="cls-1" d="M484.5,206H423.74A173.54,173.54,0,0,0,410,172.75l43-43a20,20,0,0,0,0-28.28L410.5,59.07a20,20,0,0,0-28.28,0l-43,43A173.54,173.54,0,0,0,306,88.26V27.5a20,20,0,0,0-20-20H226a20,20,0,0,0-20,20V88.26A173.54,173.54,0,0,0,172.75,102l-43-43a20,20,0,0,0-28.28,0L59.07,101.5a20,20,0,0,0,0,28.28l43,43A173.54,173.54,0,0,0,88.26,206H27.5a20,20,0,0,0-20,20v60a20,20,0,0,0,20,20H88.26A173.54,173.54,0,0,0,102,339.25l-43,43a20,20,0,0,0,0,28.28l42.43,42.43a20,20,0,0,0,28.28,0l43-43A173.54,173.54,0,0,0,206,423.74V484.5a20,20,0,0,0,20,20h60a20,20,0,0,0,20-20V423.74A173.54,173.54,0,0,0,339.25,410l43,43a20,20,0,0,0,28.28,0l42.43-42.43a20,20,0,0,0,0-28.28l-43-43A173.54,173.54,0,0,0,423.74,306H484.5a20,20,0,0,0,20-20V226A20,20,0,0,0,484.5,206Z"/><path class="cls-2" d="M286,512H226a27.54,27.54,0,0,1-27.5-27.5V429.24a181.53,181.53,0,0,1-24.34-10.08l-39.08,39.07a27.53,27.53,0,0,1-38.89,0L53.77,415.81a27.53,27.53,0,0,1,0-38.89l39.07-39.08A181.53,181.53,0,0,1,82.76,313.5H27.5A27.54,27.54,0,0,1,0,286V226a27.54,27.54,0,0,1,27.5-27.5H82.76a181.53,181.53,0,0,1,10.08-24.34L53.77,135.08a27.53,27.53,0,0,1,0-38.89L96.19,53.77a27.53,27.53,0,0,1,38.89,0l39.08,39.07A181.53,181.53,0,0,1,198.5,82.76V27.5A27.54,27.54,0,0,1,226,0h60a27.54,27.54,0,0,1,27.5,27.5V82.76a181.53,181.53,0,0,1,24.34,10.08l39.08-39.07a27.53,27.53,0,0,1,38.89,0l42.42,42.42a27.53,27.53,0,0,1,0,38.89l-39.07,39.08a181.53,181.53,0,0,1,10.08,24.34H484.5A27.54,27.54,0,0,1,512,226v60a27.54,27.54,0,0,1-27.5,27.5H429.24a181.53,181.53,0,0,1-10.08,24.34l39.07,39.08a27.53,27.53,0,0,1,0,38.89l-42.42,42.42a27.53,27.53,0,0,1-38.89,0l-39.08-39.07a181.53,181.53,0,0,1-24.34,10.08V484.5A27.54,27.54,0,0,1,286,512ZM172.75,402.46a7.49,7.49,0,0,1,3.57.91,166.75,166.75,0,0,0,31.82,13.18,7.5,7.5,0,0,1,5.36,7.19V484.5A12.52,12.52,0,0,0,226,497h60a12.52,12.52,0,0,0,12.5-12.5V423.74a7.5,7.5,0,0,1,5.36-7.19,166.75,166.75,0,0,0,31.82-13.18,7.5,7.5,0,0,1,8.88,1.29l43,43a12.52,12.52,0,0,0,17.68,0l42.43-42.43a12.52,12.52,0,0,0,0-17.68l-43-43a7.5,7.5,0,0,1-1.29-8.88,166.75,166.75,0,0,0,13.18-31.82,7.5,7.5,0,0,1,7.19-5.36H484.5A12.52,12.52,0,0,0,497,286V226a12.52,12.52,0,0,0-12.5-12.5H423.74a7.5,7.5,0,0,1-7.19-5.36,166.75,166.75,0,0,0-13.18-31.82,7.5,7.5,0,0,1,1.29-8.88l43-43a12.52,12.52,0,0,0,0-17.68L405.2,64.37a12.52,12.52,0,0,0-17.68,0l-43,43a7.5,7.5,0,0,1-8.88,1.29,166.75,166.75,0,0,0-31.82-13.18,7.5,7.5,0,0,1-5.36-7.19V27.5A12.52,12.52,0,0,0,286,15H226a12.52,12.52,0,0,0-12.5,12.5V88.26a7.5,7.5,0,0,1-5.36,7.19,166.75,166.75,0,0,0-31.82,13.18,7.5,7.5,0,0,1-8.88-1.29l-43-43a12.52,12.52,0,0,0-17.68,0L64.37,106.8a12.52,12.52,0,0,0,0,17.68l43,43a7.5,7.5,0,0,1,1.29,8.88,166.75,166.75,0,0,0-13.18,31.82,7.5,7.5,0,0,1-7.19,5.36H27.5A12.52,12.52,0,0,0,15,226v60a12.52,12.52,0,0,0,12.5,12.5H88.26a7.5,7.5,0,0,1,7.19,5.36,166.75,166.75,0,0,0,13.18,31.82,7.5,7.5,0,0,1-1.29,8.88l-43,43a12.52,12.52,0,0,0,0,17.68l42.43,42.43a12.52,12.52,0,0,0,17.68,0l43-43A7.54,7.54,0,0,1,172.75,402.46Z"/><circle class="cls-3" cx="256" cy="256" r="140"/><path class="cls-2" d="M256,403.5c-81.33,0-147.5-66.17-147.5-147.5S174.67,108.5,256,108.5,403.5,174.67,403.5,256,337.33,403.5,256,403.5Zm0-280c-73.06,0-132.5,59.44-132.5,132.5S182.94,388.5,256,388.5,388.5,329.06,388.5,256,329.06,123.5,256,123.5Z"/><path class="cls-2" d="M296,303.5a7.5,7.5,0,0,1-5.32-2.21l-40-40.23a7.49,7.49,0,0,1-2.18-5.29V176a7.5,7.5,0,0,1,15,0v76.68l37.82,38A7.5,7.5,0,0,1,296,303.5Z"/><path class="cls-2" d="M146,263.5H116a7.5,7.5,0,0,1,0-15h30a7.5,7.5,0,0,1,0,15Z"/><path class="cls-2" d="M396,263.5H366a7.5,7.5,0,0,1,0-15h30a7.5,7.5,0,0,1,0,15Z"/><path class="cls-2" d="M171.15,178.65a7.48,7.48,0,0,1-5.31-2.2L151.7,162.31a7.5,7.5,0,0,1,10.61-10.61l14.14,14.14a7.51,7.51,0,0,1-5.3,12.81Z"/><path class="cls-2" d="M355,362.5a7.52,7.52,0,0,1-5.31-2.2l-14.14-14.14a7.5,7.5,0,0,1,10.61-10.61l14.14,14.14A7.51,7.51,0,0,1,355,362.5Z"/><path class="cls-2" d="M340.85,178.65a7.51,7.51,0,0,1-5.3-12.81l14.14-14.14a7.5,7.5,0,0,1,10.61,10.61l-14.14,14.14A7.48,7.48,0,0,1,340.85,178.65Z"/><path class="cls-2" d="M157,362.5a7.51,7.51,0,0,1-5.3-12.81l14.14-14.14a7.5,7.5,0,0,1,10.61,10.61L162.31,360.3A7.52,7.52,0,0,1,157,362.5Z"/><path class="cls-2" d="M256,153.5a7.5,7.5,0,0,1-7.5-7.5V116a7.5,7.5,0,0,1,15,0v30A7.5,7.5,0,0,1,256,153.5Z"/><path class="cls-2" d="M256,403.5a7.5,7.5,0,0,1-7.5-7.5V366a7.5,7.5,0,0,1,15,0v30A7.5,7.5,0,0,1,256,403.5Z"/></svg>

Before

Width:  |  Height:  |  Size: 4.4 KiB

@ -1,317 +0,0 @@
import 'package:flutter/material.dart';
class CourseScreen extends StatefulWidget {
const CourseScreen({super.key});
@override
State<StatefulWidget> createState() => CourseScreenState();
}
class CourseScreenState extends State<CourseScreen> {
var colorList = [
Colors.red,
Colors.lightBlueAccent,
Colors.grey,
Colors.cyan,
Colors.amber,
Colors.deepPurpleAccent,
Colors.purpleAccent
];
var infoList = ["高等数学-周某某教授@综合楼201", "大学英语-王某某讲师@行政楼501"];
var weekList = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
var dateList = [];
var currentWeekIndex = 0;
@override
void initState() {
super.initState();
var monday = 1;
var mondayTime = DateTime.now();
//
while (mondayTime.weekday != monday) {
mondayTime = mondayTime.subtract(Duration(days: 1));
}
for (int i = 0; i < 7; i++) {
dateList.add("${mondayTime.month}-${mondayTime.day}");
mondayTime = mondayTime.add(Duration(days: 1));
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: 8,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 8, childAspectRatio: 1 / 1),
itemBuilder: (BuildContext context, int index) {
return Container(
color: index == currentWeekIndex
? Color(0x00f7f7f7)
: Colors.white,
child: Center(
child: index == 0
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text("星期",
style: TextStyle(
fontSize: 14, color: Colors.black87)),
SizedBox(height: 5),
Text("日期", style: TextStyle(fontSize: 12)),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(weekList[index - 1],
style: TextStyle(
fontSize: 14,
color: index == currentWeekIndex
? Colors.lightBlue
: Colors.black87)),
SizedBox(height: 5),
Text(dateList[index - 1],
style: TextStyle(
fontSize: 12,
color: index == currentWeekIndex
? Colors.lightBlue
: Colors.black87)),
],
),
),
);
}),
),
Expanded(
child: SingleChildScrollView(
child: Row(
children: [
Expanded(
flex: 1,
child: GridView.builder(
shrinkWrap: true,
// physics:ClampingScrollPhysics(),
itemCount: 10,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1, childAspectRatio: 1 / 2),
itemBuilder: (BuildContext context, int index) {
return Container(
decoration: BoxDecoration(
color: Color(0x00ff5ff5),
// border: Border.all(color: Colors.black12, width: 0.5),
border: Border(
bottom: BorderSide(
color: Colors.black12, width: 0.5),
right: BorderSide(
color: Colors.black12, width: 0.5),
),
),
// width: 25,
// height:s 80,
child: Center(
child: Text(
(index + 1).toInt().toString(),
style: TextStyle(fontSize: 15),
),
));
}),
),
Expanded(
flex: 7,
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: 35,
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7, childAspectRatio: 1 / 4),
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
// onTap: () {
// //
// print('点击了课程');
// },
// onTap: () {
// // EditCoursePage
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => EditCoursePage(
// onSave: (String) {},
// )),
// );
// },
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EditCoursePage(
onSave: (courseInfo) {
//
setState(() {
//
infoList[index % 2] = courseInfo;
});
},
),
),
);
},
child: Stack(
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 1,
child: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: Colors.black12,
width: 0.5),
right: BorderSide(
color: Colors.black12,
width: 0.5),
),
)),
),
Flexible(
flex: 1,
child: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: Colors.black12,
width: 0.5),
right: BorderSide(
color: Colors.black12,
width: 0.5),
),
)),
),
],
),
if (index % 5 == 0 || index % 5 == 1)
Container(
margin: EdgeInsets.all(0.5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: colorList[index % 7],
),
child: Center(
child: Text(
infoList[index % 2],
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 11,
letterSpacing: 1),
),
),
)
],
),
);
}),
)
],
),
),
),
_bottomView
],
),
//
floatingActionButton: Container(
margin: EdgeInsets.only(left: 20),
color: Colors.blueAccent,
child: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
));
}
String pageTitle() => "我的课表";
final Widget _bottomView = SizedBox(
height: 30,
child: Row(
children: const [
//view
],
),
);
}
class EditCoursePage extends StatefulWidget {
final Function(String) onSave;
const EditCoursePage({super.key, required this.onSave});
@override
EditCoursePageState createState() => EditCoursePageState();
}
class EditCoursePageState extends State<EditCoursePage> {
final _formKey = GlobalKey<FormState>();
final _courseController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('编辑课程'),
),
body: Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
controller: _courseController,
decoration: InputDecoration(labelText: '课程信息'),
validator: (value) {
if (value == null || value.isEmpty) {
return '请输入课程信息';
}
return null;
},
),
ElevatedButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
widget.onSave(_courseController.text);
Navigator.pop(context);
}
},
child: Text('保存'),
),
],
),
),
);
}
}

@ -1,138 +0,0 @@
import 'dart:convert';
import 'dart:developer';
import 'package:timemanage/model/timer_entry.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'package:timemanage/db/timer_entry_database.dart';
//
class ReportsScreen extends StatefulWidget {
const ReportsScreen({super.key});
@override
State<ReportsScreen> createState() => _ReportsScreenState();
}
//
class _ReportsScreenState extends State<ReportsScreen> {
//
Future<List<TimerEntry>> timers = TimerEntryDatabase.instance.readAll();
//
Map<String, int> persentMap = {'工作': 3, '学习': 2, '娱乐': 4, '运动': 1, '其他': 6};
@override
void initState() {
super.initState();
//
classifyTimers().then((value) {
value.forEach((key, value) {
if (persentMap.containsKey(key)) {
persentMap[key] = value;
} else {
persentMap[key] = value;
}
});
});
}
///
/// @return
Future<Map<String, int>> classifyTimers() async {
var timers = await TimerEntryDatabase.instance.readAll(); //
Map<String, int> presentMap = persentMap; //
for (var timer in timers) {
var response = await postData(timer.name); // API
await Future.delayed(
Duration(milliseconds: 500)); // 0.5API
var classification = jsonDecode(response.body)['item']['lv1_tag_list'][0]
['tag']; // API
// APIISO-8859-1
classification = utf8.decode(classification.runes.toList());
persentMap[classification] =
(persentMap[classification] ?? 0) + 1; //
log('name: ${timer.name}, classification: $classification, persent: ${persentMap[classification]}');
}
return persentMap;
}
/// API
/// @param name
/// @return API
Future<http.Response> postData(String name) async {
String API_KEY = "YGxSMNdWKO5Gpt12dNVY2nGq"; // APIAPI Key
String SECRET_KEY = "G5NBDTiRPhsBqMi1Od0XZw4RSMlFgeek"; // APISecret Key
String accessToken =
await getAccessToken(API_KEY, SECRET_KEY); // APIaccess token
http.Response response = await http.post(
Uri.parse(
'https://aip.baidubce.com/rpc/2.0/nlp/v1/topic?charset=UTF-8&access_token=$accessToken'),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
},
body: jsonEncode({
"title": name,
"content": name,
}),
); // API
return response; // API
}
Future<String> getAccessToken(String API_KEY, String SECRET_KEY) async {
var response = await http.post(
Uri.parse('https://aip.baidubce.com/oauth/2.0/token'),
body: {
'grant_type': 'client_credentials',
'client_id': API_KEY,
'client_secret': SECRET_KEY,
},
);
if (response.statusCode == 200) {
var data = jsonDecode(response.body);
return data['access_token'];
} else {
throw Exception('Failed to get access token');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('统计报告'),
),
body: FutureBuilder<Map<String, num>>(
future: classifyTimers(),
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.waiting) {
//
return Center(
//
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
CircularProgressIndicator(),
SizedBox(height: 20),
Text('正在统计,请稍后...'),
],
),
);
} else if (snapshot.hasError) {
return Text('Error: ${snapshot.error}');
} else {
// the Future has completed with data. Display the data.
//
return ListView.builder(
itemCount: persentMap.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(persentMap.keys.elementAt(index)),
subtitle: Text('${persentMap.values.elementAt(index)}'),
);
},
);
}
},
),
);
}
}

@ -1,66 +0,0 @@
import 'package:flutter/material.dart';
class SettingsScreen extends StatefulWidget {
const SettingsScreen({super.key});
@override
_SettingsScreenState createState() => _SettingsScreenState();
}
class _SettingsScreenState extends State<SettingsScreen> {
bool _notifications = false;
bool _darkTheme = false;
String _language = 'English';
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('设置'),
),
body: ListView(
children: <Widget>[
SwitchListTile(
title: const Text('接收通知'),
value: _notifications,
onChanged: (bool value) {
setState(() {
_notifications = value;
});
},
),
SwitchListTile(
title: const Text('深色主题'),
value: _darkTheme,
onChanged: (bool value) {
setState(() {
_darkTheme = value;
});
},
),
ListTile(
title: const Text('语言'),
trailing: DropdownButton<String>(
value: _language,
onChanged: (String? newValue) {
if (newValue != null) {
setState(() {
_language = newValue;
});
}
},
items: <String>['English', '中文']
.map<DropdownMenuItem<String>>((String value) {
return DropdownMenuItem<String>(
value: value,
child: Text(value),
);
}).toList(),
),
),
//
],
),
);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

@ -19,9 +19,7 @@ migrate_working_dir/
# 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/
./idea/
./dart_tool/
#.vscode/
# Flutter/Dart/Pub related
**/doc/api/

@ -15,7 +15,7 @@ migration:
- platform: root
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
- platform: web
- platform: android
create_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a
base_revision: ff5b5b5fa6f35b717667719ddfdb1521d8bdd05a

@ -0,0 +1,31 @@
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:timemanage/screen/dashboard/dashboard_screen.dart';
///
/// dartdoc/** */
/// dartdoc/** */
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {

@ -50,7 +50,7 @@ class TimerEntry {
void stop() {
stopwatch!.stop();
isActice = false;
endAt = createdAt.add(stopwatch!.elapsed);
endAt = DateTime.now();
}
//

@ -0,0 +1,305 @@
import 'package:flutter/material.dart';
class CourseScreen extends StatefulWidget {
const CourseScreen({super.key});
@override
State<StatefulWidget> createState() => CourseScreenState();
}
class CourseScreenState extends State<CourseScreen> {
var colorList = [
Colors.red,
Colors.lightBlueAccent,
Colors.grey,
Colors.cyan,
Colors.amber,
Colors.deepPurpleAccent,
Colors.purpleAccent
];
var infoList = ["高等数学-周某某教授@综合楼201", "大学英语-王某某讲师@行政楼501"];
var weekList = ['周一', '周二', '周三', '周四', '周五', '周六', '周日'];
var dateList = [];
var currentWeekIndex = 0;
@override
void initState() {
super.initState();
var monday = 1;
var mondayTime = DateTime.now();
//
while (mondayTime.weekday != monday) {
mondayTime = mondayTime.subtract(Duration(days: 1));
}
for (int i = 0; i < 7; i++) {
dateList.add("${mondayTime.month}-${mondayTime.day}");
mondayTime = mondayTime.add(Duration(days: 1));
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SizedBox(
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: 8,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 8, childAspectRatio: 1 / 1),
itemBuilder: (BuildContext context, int index) {
return Container(
color: index == currentWeekIndex
? Color(0x00f7f7f7)
: Colors.white,
child: Center(
child: index == 0
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text("星期",
style: TextStyle(
fontSize: 14, color: Colors.black87)),
SizedBox(height: 5),
Text("日期", style: TextStyle(fontSize: 12)),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(weekList[index - 1],
style: TextStyle(
fontSize: 14,
color: index == currentWeekIndex
? Colors.lightBlue
: Colors.black87)),
SizedBox(height: 5),
Text(dateList[index - 1],
style: TextStyle(
fontSize: 12,
color: index == currentWeekIndex
? Colors.lightBlue
: Colors.black87)),
],
),
),
);
}),
),
Expanded(
child: SingleChildScrollView(
child: Row(
children: [
Expanded(
flex: 1,
child: GridView.builder(
shrinkWrap: true,
// physics:ClampingScrollPhysics(),
itemCount: 10,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 1, childAspectRatio: 1 / 2),
itemBuilder: (BuildContext context, int index) {
return Container(
decoration: BoxDecoration(
color: Color(0x00ff5ff5),
// border: Border.all(color: Colors.black12, width: 0.5),
border: Border(
bottom: BorderSide(
color: Colors.black12, width: 0.5),
right: BorderSide(
color: Colors.black12, width: 0.5),
),
),
// width: 25,
// height:s 80,
child: Center(
child: Text(
(index + 1).toInt().toString(),
style: TextStyle(fontSize: 15),
),
));
}),
),
Expanded(
flex: 7,
child: GridView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: 35,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 7, childAspectRatio: 1 / 4),
itemBuilder: (BuildContext context, int index) {
return GestureDetector(
// onTap: () {
// //
// print('点击了课程');
// },
// onTap: () {
// // EditCoursePage
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => EditCoursePage(
// onSave: (String) {},
// )),
// );
// },
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EditCoursePage(
onSave: (courseInfo) {
//
setState(() {
//
infoList[index % 2] = courseInfo;
});
},
),
),
);
},
child: Stack(
children: [
Column(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Flexible(
flex: 1,
child: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: Colors.black12,
width: 0.5),
right: BorderSide(
color: Colors.black12,
width: 0.5),
),
)),
),
Flexible(
flex: 1,
child: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
border: Border(
bottom: BorderSide(
color: Colors.black12,
width: 0.5),
right: BorderSide(
color: Colors.black12,
width: 0.5),
),
)),
),
],
),
if (index % 5 == 0 || index % 5 == 1)
Container(
margin: EdgeInsets.all(0.5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
color: colorList[index % 7],
),
child: Center(
child: Text(
infoList[index % 2],
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 11,
letterSpacing: 1),
),
),
)
],
),
);
}),
)
],
),
),
),
_bottomView
],
),
);
}
String pageTitle() => "我的课表";
final Widget _bottomView = SizedBox(
height: 30,
child: Row(
children: const [
//view
],
),
);
}
class EditCoursePage extends StatefulWidget {
final Function(String) onSave;
const EditCoursePage({super.key, required this.onSave});
@override
EditCoursePageState createState() => EditCoursePageState();
}
class EditCoursePageState extends State<EditCoursePage> {
final _formKey = GlobalKey<FormState>();
final _courseController = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('编辑课程'),
),
body: Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
controller: _courseController,
decoration: InputDecoration(labelText: '课程信息'),
validator: (value) {
if (value == null || value.isEmpty) {
return '请输入课程信息';
}
return null;
},
),
ElevatedButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
widget.onSave(_courseController.text);
Navigator.pop(context);
}
},
child: Text('保存'),
),
],
),
),
);
}
}

@ -14,7 +14,6 @@ class DashBoardScreen extends StatefulWidget {
class DashBoardScreenState extends State<DashBoardScreen> {
late List<TimerEntry> timers; //
bool isLoading = false; //
String _searchQuery = '';
//
@override
@ -39,7 +38,7 @@ class DashBoardScreenState extends State<DashBoardScreen> {
timers = await TimerEntryDatabase.instance.readAll();
setState(() {
timers = timers.where((timer) => timer.name.contains(_searchQuery)).toList();
timers = timers;
isLoading = false;
});
}
@ -105,42 +104,10 @@ class DashBoardScreenState extends State<DashBoardScreen> {
actions: [
//
// TODO:
//
IconButton(
icon: const Icon(Icons.search),
onPressed: () {
showDialog<String>(
context: context,
builder: (context) => AlertDialog(
title: const Text('搜索计时器'),
content: TextField(
onChanged: (value) {
setState(() {
_searchQuery = value;
});
refreshTimers();
},
),
actions: [
TextButton(
onPressed: () {
setState(() {
_searchQuery = '';
});
refreshTimers();
Navigator.pop(context, 'Cancel');
},
child: const Text('取消搜索'),
),
TextButton(
onPressed: () => Navigator.pop(context, 'OK'),
child: const Text('确定'),
IconButton(
icon: const Icon(Icons.search),
onPressed: () {},
),
],
),
);
},
),
// //
// IconButton(
// icon: const Icon(Icons.filter_alt),
@ -244,4 +211,4 @@ IconButton(
},
);
}
}
}

@ -2,20 +2,14 @@ import 'package:flutter/material.dart';
class ExportScreen extends StatelessWidget {
const ExportScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('导入与导出'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Text('导入与导出'),
],
),
body: const Center(
child: Text('导入与导出界面'),
),
);
}

@ -0,0 +1,110 @@
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:timemanage/db/timer_entry_database.dart';
class ReportsScreen extends StatefulWidget {
const ReportsScreen({super.key});
@override
State<ReportsScreen> createState() => _ReportsScreenState();
}
//
class _ReportsScreenState extends State<ReportsScreen> {
//
var timers = TimerEntryDatabase.instance.readAll();
Map<String, num> persentMap = {};
@override
void initState() {
super.initState();
classifyTimers().then((value) {
setState(() {
persentMap = value;
});
});
for (var key in persentMap.keys) {
log(key);
}
}
Future<Map<String, num>> classifyTimers() async {
var timers = await TimerEntryDatabase.instance.readAll();
Map<String, num> persentMap = {};
for (var timer in timers) {
var response = await postData(timer.name);
var classification =
jsonDecode(response.body)['item']['lv1_tag_list'][0]['tag'];
// APIISO-8859-1
classification = utf8.decode(classification.runes.toList());
persentMap[classification] = timer.stopWatch;
log('classification: $classification');
}
return persentMap;
}
// API
Future<http.Response> postData(String name) async {
// ignore: non_constant_identifier_names
var API_KEY = "YGxSMNdWKO5Gpt12dNVY2nGq";
// ignore: non_constant_identifier_names
var SECRET_KEY = "G5NBDTiRPhsBqMi1Od0XZw4RSMlFgeek";
var accessToken = await getAccessToken(API_KEY, SECRET_KEY);
var url = Uri.parse(
'https://aip.baidubce.com/rpc/2.0/nlp/v1/topic?charset=UTF-8&access_token=$accessToken');
var payload = jsonEncode({
"title": name,
"content": name,
});
var headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};
var response = await http.post(
url,
headers: headers,
body: payload,
);
return response;
}
// ignore: non_constant_identifier_names
Future<String> getAccessToken(String API_KEY, String SECRET_KEY) async {
var url = 'https://aip.baidubce.com/oauth/2.0/token';
var params = {
'grant_type': 'client_credentials',
'client_id': API_KEY,
'client_secret': SECRET_KEY,
};
var response = await http.post(
Uri.parse(url),
body: params,
);
if (response.statusCode == 200) {
var data = jsonDecode(response.body);
return data['access_token'];
} else {
throw Exception('Failed to get access token');
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('统计报告'),
),
body: ListView.builder(
itemCount: persentMap.length,
itemBuilder: (context, index) => ListTile(
title: Text(persentMap.keys.toList()[index]),
subtitle: Text(persentMap.values.toList()[index].toString()),
),
),
);
}
}

@ -0,0 +1,15 @@
import 'package:flutter/material.dart';
class SettingsScreen extends StatelessWidget {
const SettingsScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('设置'),
),
body: const Center(
child: Text('设置界面'),
));
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 917 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

@ -1,59 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="timemaneger">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>timemaneger</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
<script src="flutter.js" defer></script>
</head>
<body>
<script>
window.addEventListener('load', function(ev) {
// Download main.dart.js
_flutter.loader.loadEntrypoint({
serviceWorker: {
serviceWorkerVersion: serviceWorkerVersion,
},
onEntrypointLoaded: function(engineInitializer) {
engineInitializer.initializeEngine().then(function(appRunner) {
appRunner.runApp();
});
}
});
});
</script>
</body>
</html>

@ -1,35 +0,0 @@
{
"name": "timemaneger",
"short_name": "timemaneger",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
"theme_color": "#0175C2",
"description": "A new Flutter project.",
"orientation": "portrait-primary",
"prefer_related_applications": false,
"icons": [
{
"src": "icons/Icon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/Icon-512.png",
"sizes": "512x512",
"type": "image/png"
},
{
"src": "icons/Icon-maskable-192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "icons/Icon-maskable-512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
]
}
Loading…
Cancel
Save