Skip to content

Commit 08fac84

Browse files
committed
feat: buggy captcha support
1 parent 7174dc4 commit 08fac84

File tree

12 files changed

+365
-619
lines changed

12 files changed

+365
-619
lines changed

lib/main.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if you want to use.
1212

1313
import 'dart:io';
1414

15+
import 'package:alice/alice.dart';
1516
import 'package:cookie_jar/cookie_jar.dart';
1617

1718
import 'package:flutter/material.dart';
@@ -24,13 +25,18 @@ import 'package:watermeter/page/login.dart';
2425
import 'dart:developer' as developer;
2526
import 'package:get/get.dart';
2627

28+
Alice alice = Alice(
29+
//showNotification: true,
30+
);
31+
2732
void main() async {
2833
developer.log(
2934
"Watermeter, by BenderBlog, with dragon power.",
3035
name: "Watermeter",
3136
);
3237
// Make sure the library is initialized.
3338
WidgetsFlutterBinding.ensureInitialized();
39+
3440
// Loading cookiejar.
3541
Directory supportPath = await getApplicationSupportDirectory();
3642
SportCookieJar = PersistCookieJar(
@@ -63,10 +69,12 @@ class _MyAppState extends State<MyApp> {
6369
@override
6470
Widget build(BuildContext context) {
6571
return GetMaterialApp(
72+
navigatorKey: alice.getNavigatorKey(),
6673
title: 'WaterMeter Pre-Alpha',
6774
theme: ThemeData(
6875
useMaterial3: true,
69-
colorSchemeSeed: ColorSeed.values[int.parse(user["color"]!)].color,
76+
colorSchemeSeed:
77+
ColorSeed.values[int.parse(user["color"] ?? "0")].color,
7078
),
7179
home: widget.isFirst ? const LoginWindow() : const HomePage(),
7280
);

lib/model/user.dart

+5-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ Future<void> initUser() async {
2222
SharedPreferences prefs = await SharedPreferences.getInstance();
2323
user["idsAccount"] = prefs.getString("idsAccount");
2424
user["idsPassword"] = prefs.getString("idsPassword");
25-
if (user["idsAccount"] == null || user["idsPassword"] == null) {
25+
user["name"] = prefs.getString("name");
26+
if (user["idsAccount"] == null ||
27+
user["idsPassword"] == null ||
28+
user["name"] == null) {
2629
throw "有未注册用户,跳转至登录界面";
2730
}
2831

2932
user["sportPassword"] = prefs.getString("sportPassword");
3033
user["electricityPassword"] = prefs.getString("electricityPassword");
31-
user["name"] = prefs.getString("name");
34+
3235
user["sex"] = prefs.getString("sex");
3336
user["execution"] = prefs.getString("execution");
3437
user["institutes"] = prefs.getString("institutes");

lib/modified_library/sprt_sn_progress_dialog/completed.dart

-44
This file was deleted.

lib/modified_library/sprt_sn_progress_dialog/error.dart

-40
This file was deleted.

0 commit comments

Comments
 (0)