parent
b12923fab9
commit
8463ab950c
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" name="Dart SDK" level="project" />
|
||||
<orderEntry type="library" name="Dart Packages" level="project" />
|
||||
</component>
|
||||
</module>
|
||||
@ -0,0 +1,204 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Dart Packages" type="DartPackagesLibraryType">
|
||||
<properties>
|
||||
<option name="packageNameToDirsMap">
|
||||
<entry key="async">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/async-2.11.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="boolean_selector">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="characters">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/characters-1.3.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="clock">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/clock-1.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="collection">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/collection-1.17.2/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="cupertino_icons">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.6/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="fake_async">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/fake_async-1.3.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/SDKs/Flutter/flutter_windows_3.13.2-stable/flutter/packages/flutter/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_lints">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/flutter_lints-2.0.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="flutter_test">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/SDKs/Flutter/flutter_windows_3.13.2-stable/flutter/packages/flutter_test/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="lints">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/lints-2.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="matcher">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/matcher-0.12.16/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="material_color_utilities">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/material_color_utilities-0.5.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="meta">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/meta-1.9.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="path">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/path-1.8.3/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="sky_engine">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/SDKs/Flutter/flutter_windows_3.13.2-stable/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="source_span">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/source_span-1.10.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stack_trace">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/stack_trace-1.11.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="stream_channel">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/stream_channel-2.1.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="string_scanner">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/string_scanner-1.2.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="term_glyph">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/term_glyph-1.2.1/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="test_api">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/test_api-0.6.0/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="vector_math">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/vector_math-2.1.4/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
<entry key="web">
|
||||
<value>
|
||||
<list>
|
||||
<option value="C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/web-0.1.4-beta/lib" />
|
||||
</list>
|
||||
</value>
|
||||
</entry>
|
||||
</option>
|
||||
</properties>
|
||||
<CLASSES>
|
||||
<root url="file://C:/SDKs/Flutter/flutter_windows_3.13.2-stable/flutter/bin/cache/pkg/sky_engine/lib" />
|
||||
<root url="file://C:/SDKs/Flutter/flutter_windows_3.13.2-stable/flutter/packages/flutter/lib" />
|
||||
<root url="file://C:/SDKs/Flutter/flutter_windows_3.13.2-stable/flutter/packages/flutter_test/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/async-2.11.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/characters-1.3.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/clock-1.1.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/collection-1.17.2/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/cupertino_icons-1.0.6/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/fake_async-1.3.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/flutter_lints-2.0.3/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/lints-2.1.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/matcher-0.12.16/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/material_color_utilities-0.5.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/meta-1.9.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/path-1.8.3/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/source_span-1.10.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/stack_trace-1.11.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/stream_channel-2.1.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/string_scanner-1.2.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/term_glyph-1.2.1/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/test_api-0.6.0/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/vector_math-2.1.4/lib" />
|
||||
<root url="file://C:/Users/L/AppData/Local/Pub/Cache/hosted/pub.flutter-io.cn/web-0.1.4-beta/lib" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,29 @@
|
||||
<component name="libraryTable">
|
||||
<library name="Dart SDK">
|
||||
<CLASSES>
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/async" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/cli" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/collection" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/convert" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/core" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/developer" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/ffi" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/html" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/indexed_db" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/io" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/isolate" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/js" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/js_interop" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/js_interop_unsafe" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/js_util" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/math" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/mirrors" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/svg" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/typed_data" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/web_audio" />
|
||||
<root url="file://E:/develop_environment/flutter-sdk/flutter/bin/cache/dart-sdk/lib/web_gl" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/TimeManager.iml" filepath="$PROJECT_DIR$/.idea/TimeManager.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@ -0,0 +1,17 @@
|
||||
class Clock {
|
||||
int id;
|
||||
int userId;
|
||||
String text;
|
||||
String img;
|
||||
String music;
|
||||
DateTime continueTime;
|
||||
|
||||
Clock({
|
||||
required this.id,
|
||||
required this.userId,
|
||||
required this.text,
|
||||
required this.img,
|
||||
required this.music,
|
||||
required this.continueTime,
|
||||
});
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
class Course {
|
||||
int id = -1;
|
||||
String name = "";
|
||||
double credit = -1;
|
||||
String teacher = "";
|
||||
String location = "";
|
||||
DateTime start = DateTime.now();
|
||||
DateTime end = DateTime.now();
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:timemanagerapp/wighets/AddCourseFormWidget.dart';
|
||||
|
||||
void main() {
|
||||
runApp(MyApp());
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
home: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('添加课程'),
|
||||
),
|
||||
body: AddCourseFormWidget(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,55 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:timemanagerapp/entity/Course.dart';
|
||||
|
||||
class GetCourseByLogin {
|
||||
String id = ""; //学号
|
||||
String passwd = ""; //密码
|
||||
String year = "2023"; //学年
|
||||
String term = "1"; //学期
|
||||
var courses = List<Course>; //获取的所有课程
|
||||
var pythonScriptPath =
|
||||
r'D:\Myprogramfile\Flutter\TimeManager\src\timemanagerapp\lib\util\GetCourseByLogin.dart'; //Python脚本的路径;
|
||||
|
||||
Future<String> getRawString() async {
|
||||
final file = File(pythonScriptPath);
|
||||
String res = "";
|
||||
if (!file.existsSync()) {
|
||||
print('Python脚本文件不存在: $pythonScriptPath');
|
||||
return "";
|
||||
}
|
||||
|
||||
final process = await Process.start('python', [pythonScriptPath]);
|
||||
|
||||
process.stdin.writeln('$id');
|
||||
process.stdin.writeln('$passwd');
|
||||
process.stdin.writeln('$year');
|
||||
process.stdin.writeln('$term');
|
||||
|
||||
process.stdout.transform(utf8.decoder).listen((data) {
|
||||
print('Python Output: $data');
|
||||
res += data;
|
||||
});
|
||||
|
||||
process.stderr.transform(utf8.decoder).listen((data) {
|
||||
// print('Python Error: $data');
|
||||
res += data;
|
||||
});
|
||||
|
||||
final exitCode = await process.exitCode;
|
||||
return res;
|
||||
}
|
||||
|
||||
dealRawString(String rawStr) {}
|
||||
|
||||
run() {
|
||||
getRawString().then((value) {
|
||||
dealRawString(value);
|
||||
});
|
||||
return courses;
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
GetCourseByLogin().run();
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
import zfnew
|
||||
import sys
|
||||
from zfnew import GetInfo, Login
|
||||
|
||||
sys.stdout.reconfigure(encoding='utf-8')
|
||||
|
||||
base_url = 'http://jwgl.cauc.edu.cn/xtgl/login_slogin.html'
|
||||
|
||||
lgn = Login(base_url=base_url)
|
||||
lgn.login(input(), input())
|
||||
cookies = lgn.cookies # cookies获取方法
|
||||
person = GetInfo(base_url=base_url, cookies=cookies)
|
||||
schedule = person.get_schedule(input(), input()) # eg. 2022年、第1学期(1 or 2)
|
||||
print(schedule)
|
||||
@ -0,0 +1,55 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
import 'package:timemanagerapp/entity/Course.dart';
|
||||
|
||||
class GetCourseByLogin {
|
||||
String id = ""; //学号
|
||||
String passwd = ""; //密码
|
||||
String year = "2023"; //学年
|
||||
String term = "1"; //学期
|
||||
var courses = List<Course>; //获取的所有课程
|
||||
var pythonScriptPath =
|
||||
r'D:\Myprogramfile\Flutter\timemanagerapp\lib\util\getschedule.py'; //Python脚本的路径;
|
||||
|
||||
Future<String> getRawString() async {
|
||||
final file = File(pythonScriptPath);
|
||||
String res = "";
|
||||
if (!file.existsSync()) {
|
||||
print('Python脚本文件不存在: $pythonScriptPath');
|
||||
return "";
|
||||
}
|
||||
|
||||
final process = await Process.start('python', [pythonScriptPath]);
|
||||
|
||||
process.stdin.writeln('$id');
|
||||
process.stdin.writeln('$passwd');
|
||||
process.stdin.writeln('$year');
|
||||
process.stdin.writeln('$term');
|
||||
|
||||
process.stdout.transform(utf8.decoder).listen((data) {
|
||||
print('Python Output: $data');
|
||||
res += data;
|
||||
});
|
||||
|
||||
process.stderr.transform(utf8.decoder).listen((data) {
|
||||
// print('Python Error: $data');
|
||||
res += data;
|
||||
});
|
||||
|
||||
final exitCode = await process.exitCode;
|
||||
return res;
|
||||
}
|
||||
|
||||
dealRawString(String rawStr) {}
|
||||
|
||||
run() {
|
||||
getRawString().then((value) {
|
||||
dealRawString(value);
|
||||
});
|
||||
return courses;
|
||||
}
|
||||
}
|
||||
|
||||
void main() {
|
||||
GetCourseByLogin().run();
|
||||
}
|
||||
@ -0,0 +1,30 @@
|
||||
// This is a basic Flutter widget test.
|
||||
//
|
||||
// To perform an interaction with a widget in your test, use the WidgetTester
|
||||
// utility in the flutter_test package. For example, you can send tap and scroll
|
||||
// gestures. You can also use WidgetTester to find child widgets in the widget
|
||||
// tree, read text, and verify that the values of widget properties are correct.
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:timemanagerapp/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Counter increments smoke test', (WidgetTester tester) async {
|
||||
// Build our app and trigger a frame.
|
||||
await tester.pumpWidget(MyApp());
|
||||
|
||||
// Verify that our counter starts at 0.
|
||||
expect(find.text('0'), findsOneWidget);
|
||||
expect(find.text('1'), findsNothing);
|
||||
|
||||
// Tap the '+' icon and trigger a frame.
|
||||
await tester.tap(find.byIcon(Icons.add));
|
||||
await tester.pump();
|
||||
|
||||
// Verify that our counter has incremented.
|
||||
expect(find.text('0'), findsNothing);
|
||||
expect(find.text('1'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
Loading…
Reference in new issue