fix splash

This commit is contained in:
Dan Ballard 2024-03-31 13:01:59 -07:00
parent ff297ff9e9
commit 8f2b0b8563
3 changed files with 11 additions and 7 deletions

View File

@ -58,6 +58,11 @@ class CwtchNotifier {
// EnvironmentConfig.debugLog("NewEvent $type $data"); // EnvironmentConfig.debugLog("NewEvent $type $data");
switch (type) { switch (type) {
case "CwtchStarted": case "CwtchStarted":
flwtchState.cwtch.getCwtchDir().then((dir) {
globalSettings.themeloader.LoadThemes(dir);
});
if (data["Reload"] == "true" && profileCN.num > 0) { if (data["Reload"] == "true" && profileCN.num > 0) {
// don't reload... // don't reload...
// unless we have loaded no profiles...then there isnt a risk and this // unless we have loaded no profiles...then there isnt a risk and this

View File

@ -103,13 +103,10 @@ class FlwtchState extends State<Flwtch> with WindowListener {
new CwtchNotifier(profs, globalSettings, globalErrorHandler, globalTorStatus, newDesktopNotificationsManager(_notificationSelectConvo), globalAppState, globalServersList, this); new CwtchNotifier(profs, globalSettings, globalErrorHandler, globalTorStatus, newDesktopNotificationsManager(_notificationSelectConvo), globalAppState, globalServersList, this);
cwtch = CwtchFfi(cwtchNotifier); cwtch = CwtchFfi(cwtchNotifier);
} }
print("initState: invoking cwtch.Start()");
// Cwtch.start can take time, we don't want it blocking first splash screen draw, so postpone a smidge to let splash render // Cwtch.start can take time, we don't want it blocking first splash screen draw, so postpone a smidge to let splash render
Future.delayed(const Duration(milliseconds: 100), () {
cwtch.Start().then((vale) { print("initState delayed: invoking cwtch.Start()");
cwtch.getCwtchDir().then((dir) { cwtch.Start();
globalSettings.themeloader.LoadThemes(dir);
});
}); });
print("initState: starting connectivityListener"); print("initState: starting connectivityListener");
if (EnvironmentConfig.TEST_MODE == false) { if (EnvironmentConfig.TEST_MODE == false) {

View File

@ -7,6 +7,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import '../main.dart'; import '../main.dart';
import '../settings.dart'; import '../settings.dart';
import '../themes/cwtch.dart';
class SplashView extends StatefulWidget { class SplashView extends StatefulWidget {
@override @override
@ -26,6 +27,7 @@ class _SplashViewState extends State<SplashView> {
return Consumer<AppState>( return Consumer<AppState>(
builder: (context, appState, child) => Scaffold( builder: (context, appState, child) => Scaffold(
backgroundColor: darkGreyPurple, // Cwtch Dark Background
key: Key("SplashView"), key: Key("SplashView"),
body: Center( body: Center(
child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ child: Column(mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [
@ -55,7 +57,7 @@ class _SplashViewState extends State<SplashView> {
? AppLocalizations.of(context)!.storageMigrationModalMessage ? AppLocalizations.of(context)!.storageMigrationModalMessage
: AppLocalizations.of(context)!.shuttingDownApp, // Todo l10n AppLocalizations.of(context)!.storageMigrationModalMessage : AppLocalizations.of(context)!.shuttingDownApp, // Todo l10n AppLocalizations.of(context)!.storageMigrationModalMessage
style: defaultTextButtonStyle.copyWith( style: defaultTextButtonStyle.copyWith(
fontSize: 16.0, color: appState.appError == "" ? Provider.of<Settings>(context).theme.mainTextColor : Provider.of<Settings>(context).theme.textfieldErrorColor))), fontSize: 16.0, fontFamily: "Inter", color: appState.appError == "" ? whiteishPurple : hotPink))),
Visibility( Visibility(
visible: appState.modalState == ModalState.storageMigration || appState.modalState == ModalState.shutdown, visible: appState.modalState == ModalState.storageMigration || appState.modalState == ModalState.shutdown,
child: LinearProgressIndicator( child: LinearProgressIndicator(