Remove a lot and start from scratch
Signed-off-by: Nikolai Rodionov <nrodionov@eos-uptrade.de>
This commit is contained in:
@@ -4,9 +4,6 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:grpc/grpc_web.dart';
|
||||
import 'package:softplayer_web/api/grpc/accounts.dart';
|
||||
import 'package:softplayer_web/api/grpc/creds.dart';
|
||||
import 'package:softplayer_web/components/create_env_form.dart';
|
||||
import 'package:softplayer_web/components/environments.dart';
|
||||
import 'package:softplayer_web/components/login_form.dart';
|
||||
|
||||
void main() async {
|
||||
@@ -58,90 +55,22 @@ class _StateRootWidget extends State<RootWidget> {
|
||||
}
|
||||
|
||||
final GlobalKey<ScaffoldState> _key = GlobalKey(); // Create a key
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (!isSignedIn()) {
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/login_background.jpg"),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
child: LoginForm(
|
||||
grpcChannel: widget.channel,
|
||||
notifyParent: refresh,
|
||||
),
|
||||
));
|
||||
} else {
|
||||
EnvirnomentList envList = EnvirnomentList(channel: widget.channel);
|
||||
return DefaultTabController(
|
||||
length: 3,
|
||||
initialIndex: 0,
|
||||
child: Scaffold(
|
||||
key: _key,
|
||||
endDrawer: const Drawer(child: Text("text")),
|
||||
body: TabBarView(children: [envList, envList]),
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.grey,
|
||||
centerTitle: false,
|
||||
title: const Text("Softplayer"),
|
||||
bottom: const TabBar(
|
||||
tabs: <Widget>[
|
||||
Tab(
|
||||
icon: Icon(Icons.computer),
|
||||
text: "Environments",
|
||||
),
|
||||
Tab(
|
||||
icon: Icon(Icons.install_desktop),
|
||||
text: "Your applications",
|
||||
),
|
||||
Tab(
|
||||
icon: Icon(Icons.list),
|
||||
text: "Application Catalog",
|
||||
),
|
||||
],
|
||||
return Scaffold(
|
||||
body: Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
decoration: const BoxDecoration(
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/login_background.jpg"),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
PopupMenuButton(
|
||||
child: const Row(children: [
|
||||
Icon(Icons.account_circle),
|
||||
Text("account"),
|
||||
]),
|
||||
itemBuilder: (context) => [
|
||||
const PopupMenuItem(
|
||||
child: Row(
|
||||
children: [Icon(Icons.settings), Text("Settings")],
|
||||
),
|
||||
),
|
||||
const PopupMenuItem(
|
||||
child: Row(children: [
|
||||
Icon(Icons.monetization_on),
|
||||
Text("Invoices"),
|
||||
])),
|
||||
PopupMenuItem(
|
||||
child: const Row(
|
||||
children: [Icon(Icons.logout), Text("Sign out")]),
|
||||
onTap: () {
|
||||
SoftplayerCredsHelpers().cleanupLocalStorate();
|
||||
refresh();
|
||||
},
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.add),
|
||||
onPressed: () => showDialog(
|
||||
context: context,
|
||||
builder: (context) => CreateEnvForm(widget.channel),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
child: LoginForm(
|
||||
grpcChannel: widget.channel,
|
||||
notifyParent: refresh,
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user