Done login routine
This commit is contained in:
commit
f9b1b25e91
20 changed files with 983 additions and 0 deletions
52
lib/pages/checkup_page.dart
Normal file
52
lib/pages/checkup_page.dart
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
import 'package:animated_background/animated_background.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get_storage/get_storage.dart';
|
||||
|
||||
class CheckupPage extends StatefulWidget {
|
||||
const CheckupPage({super.key});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => _CheckupPageState();
|
||||
}
|
||||
|
||||
class _CheckupPageState extends State<CheckupPage>
|
||||
with TickerProviderStateMixin {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
final accessToken = GetStorage().read<String?>("accessToken");
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (accessToken == null) {
|
||||
Get.offAllNamed("/login");
|
||||
} else {
|
||||
Get.offAllNamed("/home");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AnimatedBackground(
|
||||
behaviour: RandomParticleBehaviour(),
|
||||
vsync: this,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'Checking credentials...',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
const SizedBox.square(
|
||||
dimension: 32,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue