bio login
This commit is contained in:
1 parent
6acec998bc
commit
0ba83858fe
12 files changed
+522
-80
No files matched your search
+15
-6
@@ -1,21 +1,30 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'pages/login_page.dart';
|
||||
import 'entities/auth_token.dart';
|
||||
import 'pages/dashboard_page.dart';
|
||||
|
||||
void main() {
|
||||
runApp(const MyApp());
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
final authToken = AuthToken.instance;
|
||||
|
||||
final isLoggedIn = await authToken.loadTokenWithBiometric();
|
||||
//runApp(const MyApp());
|
||||
runApp(MyApp(startInDashboard: isLoggedIn));
|
||||
}
|
||||
|
||||
class MyApp extends StatelessWidget {
|
||||
const MyApp({super.key});
|
||||
final bool startInDashboard;
|
||||
const MyApp({super.key, required this.startInDashboard});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
title: 'Login App',
|
||||
title: 'Gestione Vigne',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.deepPurple,
|
||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.green),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const LoginPage(),
|
||||
home: startInDashboard ? const DashboardPage() : const LoginPage(),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user