mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 16:25:17 +00:00
Initial commit
This commit is contained in:
14
lib/helpers/account_credentials_helper.dart
Normal file
14
lib/helpers/account_credentials_helper.dart
Normal file
@ -0,0 +1,14 @@
|
||||
/// Accounts credentials helper
|
||||
///
|
||||
/// Stores current account tokens
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class AccountCredentialsHelper {
|
||||
|
||||
/// Checkout whether current user is signed in or not
|
||||
Future<bool> signedIn() async {
|
||||
return false; // TODO : implement
|
||||
}
|
||||
|
||||
}
|
33
lib/main.dart
Normal file
33
lib/main.dart
Normal file
@ -0,0 +1,33 @@
|
||||
import 'package:comunic/helpers/account_credentials_helper.dart';
|
||||
import 'package:comunic/ui/login_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Main file of the application
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
void main() {
|
||||
runApp(ComunicApplication());
|
||||
}
|
||||
|
||||
class ComunicApplication extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp(
|
||||
// We need to know whether the user is signed in or not to continue
|
||||
home: FutureBuilder(
|
||||
future: AccountCredentialsHelper().signedIn(),
|
||||
builder: (b, AsyncSnapshot<bool> c){
|
||||
if(!c.hasData)
|
||||
return CircularProgressIndicator();
|
||||
|
||||
else
|
||||
if(c.data)
|
||||
throw "Not supported yet !";
|
||||
else
|
||||
return LoginRoute();
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
17
lib/ui/login_route.dart
Normal file
17
lib/ui/login_route.dart
Normal file
@ -0,0 +1,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
/// Login route
|
||||
///
|
||||
/// @author Pierre HUBERT
|
||||
|
||||
class LoginRoute extends StatefulWidget {
|
||||
@override
|
||||
State<StatefulWidget> createState() => _LoginRouteState();
|
||||
}
|
||||
|
||||
class _LoginRouteState extends State<LoginRoute> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Text("Hello world");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user