A small refactoring

This commit is contained in:
Nikolai Rodionov 2024-04-19 13:41:50 +02:00
parent ea658ffe96
commit ad259dc553
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD
2 changed files with 12 additions and 13 deletions

View File

@ -66,9 +66,7 @@ class _LoginFormState extends State<LoginForm> {
accountsGrpc.signIn(username, "", password).then((rs) { accountsGrpc.signIn(username, "", password).then((rs) {
window.localStorage["token"] = rs.token; window.localStorage["token"] = rs.token;
window.localStorage["uuid"] = rs.uuid; window.localStorage["uuid"] = rs.uuid;
setState(() { Navigator.of(context, rootNavigator: true).pop();
});
}).catchError((e) { }).catchError((e) {
print(e); print(e);
GrpcError error = e; GrpcError error = e;

View File

@ -27,13 +27,7 @@ class MyApp extends StatelessWidget {
return MaterialApp( return MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
title: 'Softplayer', title: 'Softplayer',
home: Scaffold( home: TestAlert(channel: channel),
body: TestAlert(channel: channel),
appBar: AppBar(),
floatingActionButton: FloatingActionButton(
onPressed: () => print("1"),
),
),
theme: ThemeData( theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true, useMaterial3: true,
@ -53,7 +47,8 @@ class TestAlert extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
if (!isSignedIn()) { if (!isSignedIn()) {
return Container( return Scaffold(
body: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/login_background.jpg"), image: AssetImage("assets/login_background.jpg"),
@ -61,9 +56,15 @@ class TestAlert extends StatelessWidget {
), ),
), ),
child: LoginForm(grpcChannel: channel), child: LoginForm(grpcChannel: channel),
); ));
} else { } else {
return EnvirnomentList(channel: channel); return Scaffold(
body: EnvirnomentList(channel: channel),
appBar: AppBar(),
floatingActionButton: FloatingActionButton(
onPressed: () => print("1"),
),
);
} }
} }
} }