From 347151307b9cea2484ccc6e02ebee40fd7d61a23 Mon Sep 17 00:00:00 2001 From: Patrick Niemeyer Date: Tue, 27 Feb 2024 15:07:35 -0600 Subject: [PATCH] gai: Cleanup in main --- gai-frontend/lib/main.dart | 102 ++----------------------------------- 1 file changed, 3 insertions(+), 99 deletions(-) diff --git a/gai-frontend/lib/main.dart b/gai-frontend/lib/main.dart index 367387ac2..e76239e81 100644 --- a/gai-frontend/lib/main.dart +++ b/gai-frontend/lib/main.dart @@ -1,26 +1,9 @@ import 'package:flutter/material.dart'; -//import 'guid_orchid/lib/common/app_buttons.dart'; -import 'dart:async'; -import 'dart:isolate'; -import 'package:web_socket_channel/web_socket_channel.dart'; -import 'package:web_socket_channel/status.dart' as status; -import 'package:stream_channel/isolate_channel.dart'; -import 'dart:convert'; - -import 'package:orchid/gui-orchid/lib/orchid/orchid_action_button.dart'; -import 'package:orchid/gui-orchid/lib/orchid/orchid_asset.dart'; -import 'package:orchid/gui-orchid/lib/orchid/orchid_gradients.dart'; -import 'package:orchid/gui-orchid/lib/orchid/orchid_logo.dart'; - +import 'package:orchid/api/preferences/user_preferences.dart'; import 'chat.dart'; -import 'settings.dart'; -import 'app_colors.dart'; - -void main() { -// ReceivePort _providerPort; // = ReceivePort(); -// IsolateChannel _providerChannel = new; -// IsolateChannel _providerChannel = IsolateChannel.connectReceive(); +void main() async { + await UserPreferences.init(); runApp(const MyApp()); } @@ -40,82 +23,3 @@ class MyApp extends StatelessWidget { } } -class MyHomePage extends StatefulWidget { - const MyHomePage({super.key, required this.title}); - final String title; - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - OrchidAssetImage _orchidAsset = OrchidAssetImage(); - - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - body: SafeArea( - child: Stack( - children: [ - Container( - padding: const EdgeInsets.all(8.0), - decoration: BoxDecoration( - gradient: OrchidGradients.blackGradientBackground, - ), - ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.max, - children: [Center(child: _orchidAsset.logo_outline)], - ), - Container( - child: Center( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - IconButton.filled( - icon: const Icon(Icons.settings), - onPressed: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => const SettingsView()), - ); - }, - ), - ], - ), - const SizedBox(height: 20), - OrchidActionButton( - text: 'Chat', - onPressed: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => const ChatView()), - ); - }, - ), - const SizedBox(height: 40), - OrchidActionButton( - text: 'Txt2Img', - onPressed: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => const ChatView()), - ); - }, - ), - ], - ), - ), - ), - ], - ), - ), - ), - ); - } -}