@ -0,0 +1,3 @@
|
||||
{
|
||||
"java.configuration.updateBuildConfiguration": "interactive"
|
||||
}
|
||||
@ -1,11 +1,7 @@
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
| 姓名 | 知士荟 | 头歌 | Github |
|
||||
| ------ | -------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------- |
|
||||
| 姓名 | 知士荟 | 头歌 | 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/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) | |
|
||||
>>>>>>> gxh_branch
|
||||
|
||||
| 邹兴云 | [@邹兴云](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,16 +1,3 @@
|
||||
# timemanage
|
||||
# 时间管理
|
||||
|
||||
A new Flutter project.
|
||||
|
||||
## Getting Started
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
一个基于Flutter框架的APP
|
||||
|
||||
Binary file not shown.
@ -0,0 +1,2 @@
|
||||
#Sat Nov 04 11:50:30 CST 2023
|
||||
gradle.version=7.5
|
||||
@ -0,0 +1,44 @@
|
||||
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,4 +1,4 @@
|
||||
package com.example.timemanage
|
||||
package com.example.timemaneger
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
sdk.dir=C:\\Users\\28749\\AppData\\Local\\Android\\sdk
|
||||
flutter.sdk=C:\\flutter
|
||||
flutter.buildMode=debug
|
||||
flutter.versionName=1.0.0
|
||||
flutter.versionCode=1
|
||||
@ -0,0 +1 @@
|
||||
{"inputs":[],"outputs":[]}
|
||||
@ -0,0 +1 @@
|
||||
{"inputs":[],"outputs":[]}
|
||||
@ -0,0 +1 @@
|
||||
{"inputs":[],"outputs":[]}
|
||||
Binary file not shown.
@ -0,0 +1 @@
|
||||
{"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"]}
|
||||
@ -0,0 +1,7 @@
|
||||
| 姓名 | 知士荟 | 头歌 | 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) | |
|
||||
@ -0,0 +1 @@
|
||||
[{"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
@ -0,0 +1,3 @@
|
||||
# 时间管理
|
||||
|
||||
一个基于Flutter框架的APP
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -0,0 +1,14 @@
|
||||
// This is a generated file; do not edit or check into version control.
|
||||
FLUTTER_ROOT=F:\study\school\ruanjian\flutter\flutter
|
||||
FLUTTER_APPLICATION_PATH=F:\study\school\ruanjian\timecop\timemanager
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_TARGET=lib\main.dart
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
EXCLUDED_ARCHS[sdk=iphonesimulator*]=i386
|
||||
EXCLUDED_ARCHS[sdk=iphoneos*]=armv7
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
export "FLUTTER_ROOT=F:\study\school\ruanjian\flutter\flutter"
|
||||
export "FLUTTER_APPLICATION_PATH=F:\study\school\ruanjian\timecop\timemanager"
|
||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
||||
export "FLUTTER_TARGET=lib\main.dart"
|
||||
export "FLUTTER_BUILD_DIR=build"
|
||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||
export "FLUTTER_BUILD_NUMBER=1"
|
||||
export "DART_OBFUSCATION=false"
|
||||
export "TRACK_WIDGET_CREATION=true"
|
||||
export "TREE_SHAKE_ICONS=false"
|
||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|
||||
@ -0,0 +1,19 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifndef GeneratedPluginRegistrant_h
|
||||
#define GeneratedPluginRegistrant_h
|
||||
|
||||
#import <Flutter/Flutter.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface GeneratedPluginRegistrant : NSObject
|
||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
#endif /* GeneratedPluginRegistrant_h */
|
||||
@ -0,0 +1,49 @@
|
||||
//
|
||||
// Generated file. Do not edit.
|
||||
//
|
||||
|
||||
// clang-format off
|
||||
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
|
||||
#if __has_include(<package_info_plus/FLTPackageInfoPlusPlugin.h>)
|
||||
#import <package_info_plus/FLTPackageInfoPlusPlugin.h>
|
||||
#else
|
||||
@import package_info_plus;
|
||||
#endif
|
||||
|
||||
#if __has_include(<path_provider_foundation/PathProviderPlugin.h>)
|
||||
#import <path_provider_foundation/PathProviderPlugin.h>
|
||||
#else
|
||||
@import path_provider_foundation;
|
||||
#endif
|
||||
|
||||
#if __has_include(<shared_preferences_foundation/SharedPreferencesPlugin.h>)
|
||||
#import <shared_preferences_foundation/SharedPreferencesPlugin.h>
|
||||
#else
|
||||
@import shared_preferences_foundation;
|
||||
#endif
|
||||
|
||||
#if __has_include(<sqflite/SqflitePlugin.h>)
|
||||
#import <sqflite/SqflitePlugin.h>
|
||||
#else
|
||||
@import sqflite;
|
||||
#endif
|
||||
|
||||
#if __has_include(<url_launcher_ios/FLTURLLauncherPlugin.h>)
|
||||
#import <url_launcher_ios/FLTURLLauncherPlugin.h>
|
||||
#else
|
||||
@import url_launcher_ios;
|
||||
#endif
|
||||
|
||||
@implementation GeneratedPluginRegistrant
|
||||
|
||||
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
|
||||
[FLTPackageInfoPlusPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTPackageInfoPlusPlugin"]];
|
||||
[PathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:@"PathProviderPlugin"]];
|
||||
[SharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:@"SharedPreferencesPlugin"]];
|
||||
[SqflitePlugin registerWithRegistrar:[registry registrarForPlugin:@"SqflitePlugin"]];
|
||||
[FLTURLLauncherPlugin registerWithRegistrar:[registry registrarForPlugin:@"FLTURLLauncherPlugin"]];
|
||||
}
|
||||
|
||||
@end
|
||||
@ -0,0 +1,115 @@
|
||||
import 'package:sqflite/sqflite.dart';
|
||||
import 'package:timemanage/model/timer_entry.dart';
|
||||
|
||||
class TimerEntryDatabase {
|
||||
static final TimerEntryDatabase instance = TimerEntryDatabase._init();
|
||||
|
||||
static Database? _database;
|
||||
|
||||
TimerEntryDatabase._init();
|
||||
|
||||
/// 以上暂时理解为固定格式
|
||||
|
||||
// 获取数据库
|
||||
Future<Database> get database async {
|
||||
if (_database != null) {
|
||||
return _database!;
|
||||
}
|
||||
|
||||
_database = await _initDB('timer_entry.db');
|
||||
return _database!;
|
||||
}
|
||||
|
||||
// 初始化数据库
|
||||
Future<Database> _initDB(String filePath) async {
|
||||
final dbPath = await getDatabasesPath();
|
||||
final path = dbPath + filePath;
|
||||
|
||||
// 打开数据库
|
||||
return await openDatabase(path, version: 1, onCreate: _createDB);
|
||||
}
|
||||
|
||||
// 创建数据库
|
||||
Future _createDB(Database db, int version) async {
|
||||
// 创建表
|
||||
const idType = 'INTEGER PRIMARY KEY AUTOINCREMENT';
|
||||
const textType = 'TEXT NOT NULL';
|
||||
const nullTextType = 'TEXT';
|
||||
|
||||
// 创建计时器表
|
||||
await db.execute('''
|
||||
CREATE TABLE $tableTimerEntry (
|
||||
${TimerEntryFields.id} $idType,
|
||||
${TimerEntryFields.name} $textType,
|
||||
${TimerEntryFields.createdAt} $textType,
|
||||
${TimerEntryFields.endAt} $nullTextType,
|
||||
${TimerEntryFields.isActive} $textType,
|
||||
${TimerEntryFields.stopWatch} $textType
|
||||
)
|
||||
''');
|
||||
}
|
||||
|
||||
/// CRUD
|
||||
|
||||
// 创建计时器
|
||||
Future<TimerEntry> create(TimerEntry timerEntry) async {
|
||||
final db = await instance.database;
|
||||
|
||||
// 获取计时器ID
|
||||
final id = await db.insert(tableTimerEntry, timerEntry.toJson());
|
||||
return timerEntry.copy(id: id);
|
||||
}
|
||||
|
||||
// 获取计时器
|
||||
Future<TimerEntry> read(int id) async {
|
||||
final db = await instance.database;
|
||||
final maps = await db.query(tableTimerEntry,
|
||||
columns: TimerEntryFields.values,
|
||||
where: '${TimerEntryFields.id} = ?',
|
||||
whereArgs: [id]);
|
||||
|
||||
if (maps.isNotEmpty) {
|
||||
return TimerEntry.fromJson(maps.first);
|
||||
} else {
|
||||
throw Exception('ID $id not found');
|
||||
}
|
||||
}
|
||||
|
||||
// 获取所有计时器
|
||||
Future<List<TimerEntry>> readAll() async {
|
||||
final db = await instance.database;
|
||||
|
||||
// 插入一条测试数据
|
||||
// await db.insert(
|
||||
// tableTimerEntry,
|
||||
// TimerEntry(
|
||||
// name: '测试计时器',
|
||||
// ).toJson());
|
||||
|
||||
final result = await db.query(tableTimerEntry);
|
||||
|
||||
return result.map((json) => TimerEntry.fromJson(json)).toList();
|
||||
}
|
||||
|
||||
// 更新计时器
|
||||
Future<int> update(TimerEntry timerEntry) async {
|
||||
final db = await instance.database;
|
||||
|
||||
return db.update(tableTimerEntry, timerEntry.toJson(),
|
||||
where: '${TimerEntryFields.id} = ?', whereArgs: [timerEntry.id]);
|
||||
}
|
||||
|
||||
// 删除计时器
|
||||
Future<int> delete(int id) async {
|
||||
final db = await instance.database;
|
||||
|
||||
return await db.delete(tableTimerEntry,
|
||||
where: '${TimerEntryFields.id} = ?', whereArgs: [id]);
|
||||
}
|
||||
|
||||
// 关闭数据库
|
||||
Future close() async {
|
||||
final db = await instance.database;
|
||||
db.close();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
|
||||
// 项目描述
|
||||
class ProjectDescriptionPair extends Equatable {
|
||||
final int? project;
|
||||
final String? description;
|
||||
|
||||
const ProjectDescriptionPair(this.project, this.description);
|
||||
|
||||
@override
|
||||
List<Object?> get props => [project, description];
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
// 设置每周的第一天从周日开始
|
||||
extension StartOfWeek on DateTime {
|
||||
DateTime startOfWeek({int startOfWeekDay = DateTime.sunday}) {
|
||||
int diff = (7 + (weekday - startOfWeekDay)) % 7;
|
||||
DateTime dt = add(Duration(days: -diff));
|
||||
return DateTime(dt.year, dt.month, dt.day);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
// TODO: 实现主题切换功能
|
||||
@ -0,0 +1,106 @@
|
||||
const String tableTimerEntry = 'timer_entry'; // 表名
|
||||
|
||||
// 数据库表结构
|
||||
class TimerEntryFields {
|
||||
static const String id = '_id';
|
||||
static const String name = 'name';
|
||||
static const String createdAt = 'createdAt';
|
||||
static const String endAt = 'endAt';
|
||||
static const String isActive = 'isActive';
|
||||
static const String stopWatch = 'stopWatch';
|
||||
|
||||
static final List<String> values = [
|
||||
/// Add all fields
|
||||
id, name, createdAt, endAt, isActive, stopWatch
|
||||
];
|
||||
}
|
||||
|
||||
class TimerEntry {
|
||||
int? id; // 计时器ID
|
||||
String name; // 计时器名称
|
||||
Stopwatch? stopwatch; // 计时器
|
||||
bool isActice; // 计时器是否在计时
|
||||
DateTime createdAt; // 计时器创建时间
|
||||
DateTime? endAt; // 计时器结束时间
|
||||
|
||||
// 构造函数
|
||||
TimerEntry({required this.name})
|
||||
: stopwatch = Stopwatch(),
|
||||
isActice = false,
|
||||
createdAt = DateTime.now(),
|
||||
endAt = DateTime.now();
|
||||
|
||||
bool get isActive => isActice;
|
||||
|
||||
num get stopWatch => stopWatch;
|
||||
|
||||
// 开始计时
|
||||
void start() {
|
||||
stopwatch!.start();
|
||||
isActice = true;
|
||||
}
|
||||
|
||||
// 暂停计时
|
||||
void pause() {
|
||||
stopwatch!.stop();
|
||||
isActice = false;
|
||||
}
|
||||
|
||||
// 停止计时
|
||||
void stop() {
|
||||
stopwatch!.stop();
|
||||
isActice = false;
|
||||
endAt = DateTime.now();
|
||||
}
|
||||
|
||||
// 重置计时
|
||||
void reset() {
|
||||
stopwatch!.reset();
|
||||
isActice = false;
|
||||
endAt = null;
|
||||
}
|
||||
|
||||
// 复制计时器
|
||||
TimerEntry copy({
|
||||
int? id,
|
||||
String? name,
|
||||
DateTime? createdAt,
|
||||
DateTime? endAt,
|
||||
bool? isActive,
|
||||
Stopwatch? stopwatch,
|
||||
}) =>
|
||||
TimerEntry(
|
||||
name: name ?? this.name,
|
||||
)
|
||||
..id = id ?? this.id
|
||||
..createdAt = createdAt ?? this.createdAt
|
||||
..endAt = endAt ?? this.endAt
|
||||
..isActice = isActive ?? this.isActice
|
||||
..stopwatch = stopwatch ?? this.stopwatch;
|
||||
|
||||
// fromJson
|
||||
static TimerEntry fromJson(Map<String, Object?> json) {
|
||||
return TimerEntry(
|
||||
name: json[TimerEntryFields.name] as String,
|
||||
)
|
||||
..id = json[TimerEntryFields.id] as int?
|
||||
..createdAt = DateTime.parse(json[TimerEntryFields.createdAt] as String)
|
||||
..endAt = json[TimerEntryFields.endAt] == null
|
||||
? null
|
||||
: DateTime.parse(json[TimerEntryFields.endAt] as String)
|
||||
..isActice = json[TimerEntryFields.isActive] == 1 ? true : false
|
||||
..stopwatch = Stopwatch();
|
||||
}
|
||||
|
||||
// toJson
|
||||
Map<String, Object?> toJson() {
|
||||
return {
|
||||
TimerEntryFields.id: id,
|
||||
TimerEntryFields.name: name,
|
||||
TimerEntryFields.createdAt: createdAt.toIso8601String(),
|
||||
TimerEntryFields.endAt: endAt?.toIso8601String(),
|
||||
TimerEntryFields.isActive: isActice ? 1 : 0,
|
||||
TimerEntryFields.stopWatch: stopwatch!.elapsed.inMilliseconds,
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:timemanage/screen/reports_screen.dart';
|
||||
import 'package:timemanage/screen/export_screen.dart';
|
||||
import 'package:timemanage/screen/settings_screen.dart';
|
||||
import 'package:timemanage/screen/about_screen.dart';
|
||||
import 'package:timemanage/screen/course_screen.dart';
|
||||
|
||||
class HomeMenuBar extends StatefulWidget {
|
||||
const HomeMenuBar({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
HomeMenuBarState createState() => HomeMenuBarState();
|
||||
}
|
||||
|
||||
class HomeMenuBarState extends State<HomeMenuBar> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MenuBar(
|
||||
children: <Widget>[
|
||||
SubmenuButton(
|
||||
menuChildren: <Widget>[
|
||||
MenuItemButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => CourseScreen()),
|
||||
);
|
||||
},
|
||||
child: const Text('课程表'),
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const ReportsScreen()),
|
||||
);
|
||||
},
|
||||
child: const Text('统计报告'),
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const ExportScreen()),
|
||||
);
|
||||
},
|
||||
child: const Text('导入和导出'),
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => const SettingsScreen()),
|
||||
);
|
||||
},
|
||||
child: const Text('设置'),
|
||||
),
|
||||
MenuItemButton(
|
||||
onPressed: () {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => const AboutScreen()),
|
||||
);
|
||||
},
|
||||
child: const Text('关于'),
|
||||
),
|
||||
],
|
||||
child: const Icon(Icons.menu),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
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: const Center(
|
||||
child: Text('导入与导出界面'),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -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('设置界面'),
|
||||
));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
// This is a generated file; do not edit or check into version control.
|
||||
FLUTTER_ROOT=F:\study\school\ruanjian\flutter\flutter
|
||||
FLUTTER_APPLICATION_PATH=F:\study\school\ruanjian\timecop\timemanager
|
||||
COCOAPODS_PARALLEL_CODE_SIGN=true
|
||||
FLUTTER_BUILD_DIR=build
|
||||
FLUTTER_BUILD_NAME=1.0.0
|
||||
FLUTTER_BUILD_NUMBER=1
|
||||
DART_OBFUSCATION=false
|
||||
TRACK_WIDGET_CREATION=true
|
||||
TREE_SHAKE_ICONS=false
|
||||
PACKAGE_CONFIG=.dart_tool/package_config.json
|
||||
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
# This is a generated file; do not edit or check into version control.
|
||||
export "FLUTTER_ROOT=F:\study\school\ruanjian\flutter\flutter"
|
||||
export "FLUTTER_APPLICATION_PATH=F:\study\school\ruanjian\timecop\timemanager"
|
||||
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
|
||||
export "FLUTTER_BUILD_DIR=build"
|
||||
export "FLUTTER_BUILD_NAME=1.0.0"
|
||||
export "FLUTTER_BUILD_NUMBER=1"
|
||||
export "DART_OBFUSCATION=false"
|
||||
export "TRACK_WIDGET_CREATION=true"
|
||||
export "TREE_SHAKE_ICONS=false"
|
||||
export "PACKAGE_CONFIG=.dart_tool/package_config.json"
|
||||
Loading…
Reference in new issue