Skip to content

Commit 9854e60

Browse files
committed
Fixed splash screen black page
1 parent 05cf1ac commit 9854e60

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

lib/controllers/auth/login.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ class LoginController {
99
static final _logger = LoggerService.getLogger('LoginController');
1010
static final AuthAPIHandler _authAPIHandler = AuthAPIHandler();
1111

12+
static bool validatedToken = false;
13+
1214
static Future<void> init() async {
1315
await XAuthTokenCacheHandler.init();
1416
await UserCacheHandler.init();
17+
await validateToken();
1518
}
1619

1720
static Future<Map<String, dynamic>?> login(
@@ -80,10 +83,12 @@ class LoginController {
8083
}
8184
}
8285

83-
static bool validatedToken = false;
84-
8586
static Future<bool> get isLoggedIn async {
8687
if (!(await XAuthTokenCacheHandler.hasToken)) return false;
88+
return await validateToken();
89+
}
90+
91+
static Future<bool> validateToken() async {
8792
if (validatedToken) return true;
8893

8994
try {

lib/views/widgets/app_info.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import '../../controllers/auth/login.dart';
99
import '../../controllers/toast/toast.dart';
1010
import '../localization/settings.dart';
1111

12-
const String appVersion = 'v1.1.5';
12+
const String appVersion = 'v1.1.6';
1313
final Uri devUri = Uri.parse('https://github.com/SmartShed');
14-
final Uri latestAppUri =
15-
Uri.parse('https://github.com/SmartShed/App/releases/latest');
14+
final Uri latestAppDownload = Uri.parse(
15+
'https://github.com/SmartShed/App/releases/latest/download/SmartShed.apk');
1616

1717
final Uri contactUsEmailUri = Uri(
1818
scheme: 'mailto',
@@ -340,13 +340,13 @@ class _AppInfoState extends State<AppInfo> {
340340
),
341341
onPressed: () async {
342342
try {
343-
await launchUrl(latestAppUri);
343+
await launchUrl(latestAppDownload);
344344
} catch (e) {
345345
if (!context.mounted) return;
346346
ToastController.error(context.formatString(
347347
Settings_LocaleData.could_not_launch_url
348348
.getString(context),
349-
[latestAppUri.toString()]));
349+
[latestAppDownload.toString()]));
350350
}
351351
},
352352
child: Row(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: smartshed
22
description: SmartShed Application for Diesel Loco Shed, Pune
33
publish_to: 'none'
44

5-
version: 1.1.5
5+
version: 1.1.6
66

77
environment:
88
sdk: '>=3.1.2 <4.0.0'

0 commit comments

Comments
 (0)