A small refactoring
This commit is contained in:
		@@ -66,9 +66,7 @@ class _LoginFormState extends State<LoginForm> {
 | 
			
		||||
      accountsGrpc.signIn(username, "", password).then((rs) {
 | 
			
		||||
        window.localStorage["token"] = rs.token;
 | 
			
		||||
        window.localStorage["uuid"] = rs.uuid;
 | 
			
		||||
        setState(() {
 | 
			
		||||
                  
 | 
			
		||||
                });
 | 
			
		||||
        Navigator.of(context, rootNavigator: true).pop();
 | 
			
		||||
      }).catchError((e) {
 | 
			
		||||
        print(e);
 | 
			
		||||
        GrpcError error = e;
 | 
			
		||||
 
 | 
			
		||||
@@ -27,13 +27,7 @@ class MyApp extends StatelessWidget {
 | 
			
		||||
    return MaterialApp(
 | 
			
		||||
      debugShowCheckedModeBanner: false,
 | 
			
		||||
      title: 'Softplayer',
 | 
			
		||||
      home: Scaffold(
 | 
			
		||||
        body: TestAlert(channel: channel),
 | 
			
		||||
        appBar: AppBar(),
 | 
			
		||||
        floatingActionButton: FloatingActionButton(
 | 
			
		||||
          onPressed: () => print("1"),
 | 
			
		||||
        ),
 | 
			
		||||
      ),
 | 
			
		||||
      home: TestAlert(channel: channel),
 | 
			
		||||
      theme: ThemeData(
 | 
			
		||||
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
 | 
			
		||||
        useMaterial3: true,
 | 
			
		||||
@@ -53,7 +47,8 @@ class TestAlert extends StatelessWidget {
 | 
			
		||||
  @override
 | 
			
		||||
  Widget build(BuildContext context) {
 | 
			
		||||
    if (!isSignedIn()) {
 | 
			
		||||
      return Container(
 | 
			
		||||
      return Scaffold( 
 | 
			
		||||
        body: Container(
 | 
			
		||||
        decoration: const BoxDecoration(
 | 
			
		||||
          image: DecorationImage(
 | 
			
		||||
            image: AssetImage("assets/login_background.jpg"),
 | 
			
		||||
@@ -61,9 +56,15 @@ class TestAlert extends StatelessWidget {
 | 
			
		||||
          ),
 | 
			
		||||
        ),
 | 
			
		||||
        child: LoginForm(grpcChannel: channel),
 | 
			
		||||
      );
 | 
			
		||||
      ));
 | 
			
		||||
    } else {
 | 
			
		||||
      return EnvirnomentList(channel: channel);
 | 
			
		||||
      return Scaffold(
 | 
			
		||||
        body: EnvirnomentList(channel: channel),
 | 
			
		||||
        appBar: AppBar(),
 | 
			
		||||
        floatingActionButton: FloatingActionButton(
 | 
			
		||||
          onPressed: () => print("1"),
 | 
			
		||||
        ),
 | 
			
		||||
      );
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user