Skip to content

Commit

Permalink
⚡ 025
Browse files Browse the repository at this point in the history
  • Loading branch information
niuhuan committed Nov 2, 2023
1 parent 645093f commit f2f2ffd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
24 changes: 19 additions & 5 deletions lib/screens/calculator_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:jenny/configs/passed.dart';

import '../basic/web_dav_sync.dart';
import '../configs/login.dart';
import 'app_screen.dart';
import 'first_login_screen.dart';

class CalculatorScreen extends StatelessWidget {
const CalculatorScreen({Key? key}) : super(key: key);
Expand Down Expand Up @@ -556,11 +559,22 @@ class ContentBodyState extends State<ContentBody> {
btnclick(e) {
if (sums == "5686648") {
firstPassed().then((value) {
Navigator.pushReplacement(context, MaterialPageRoute(
builder: (BuildContext context) {
return const AppScreen();
},
));
if (loginStatus == LoginStatus.notSet) {
Future.delayed(Duration.zero, () async {
await webDavSyncAuto(context);
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (BuildContext context) {
return firstLoginScreen;
}),
);
});
} else {
Navigator.pushReplacement(context, MaterialPageRoute(
builder: (BuildContext context) {
return const AppScreen();
},
));
}
});
}
for (var element in list) {
Expand Down
14 changes: 12 additions & 2 deletions lib/screens/init_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'package:jenny/basic/commons.dart';
import 'package:jenny/basic/methods.dart';
import 'package:jenny/configs/configs.dart';
import 'package:jenny/configs/login.dart';
import 'package:jenny/configs/passed.dart';
import 'package:jenny/screens/calculator_screen.dart';

import '../basic/web_dav_sync.dart';
import 'app_screen.dart';
Expand Down Expand Up @@ -59,8 +61,16 @@ class _InitScreenState extends State<InitScreen> {
try {
await methods.init();
await initConfigs();
print("STATE : ${loginStatus}");
if (loginStatus == LoginStatus.notSet) {
if (!currentPassed()) {
Future.delayed(Duration.zero, () async {
await webDavSyncAuto(context);
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (BuildContext context) {
return const CalculatorScreen();
}),
);
});
} else if (loginStatus == LoginStatus.notSet) {
Future.delayed(Duration.zero, () async {
await webDavSyncAuto(context);
Navigator.of(context).pushReplacement(
Expand Down

0 comments on commit f2f2ffd

Please sign in to comment.