Skip to content

Commit

Permalink
messing around with the web inde.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Garrett Bischof committed Jul 18, 2024
1 parent d611e68 commit 275d57f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
22 changes: 17 additions & 5 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

// Package imports
import 'package:flutter_bloc/flutter_bloc.dart';
import "package:flutter_displaymode/flutter_displaymode.dart";
import 'package:dart_ping_ios/dart_ping_ios.dart';
import 'package:dynamic_color/dynamic_color.dart';
Expand Down Expand Up @@ -194,8 +195,12 @@ class _ThunderAppState extends State<ThunderApp> {

return DynamicColorBuilder(
builder: (lightColorScheme, darkColorScheme) {
ThemeData theme = FlexThemeData.light(useMaterial3: true, scheme: FlexScheme.values.byName(state.selectedTheme.name));
ThemeData darkTheme = FlexThemeData.dark(useMaterial3: true, scheme: FlexScheme.values.byName(state.selectedTheme.name), darkIsTrueBlack: state.themeType == ThemeType.pureBlack);
ThemeData theme = FlexThemeData.light(
useMaterial3: true, scheme: FlexScheme.values.byName(state.selectedTheme.name));
ThemeData darkTheme = FlexThemeData.dark(
useMaterial3: true,
scheme: FlexScheme.values.byName(state.selectedTheme.name),
darkIsTrueBlack: state.themeType == ThemeType.pureBlack);

// Enable Material You theme
if (state.useMaterialYouTheme == true) {
Expand Down Expand Up @@ -231,7 +236,10 @@ class _ThunderAppState extends State<ThunderApp> {
),
);

Locale? locale = AppLocalizations.supportedLocales.where((Locale locale) => locale.languageCode == thunderBloc.state.appLanguageCode).firstOrNull;
Locale? locale = AppLocalizations.supportedLocales
.where(
(Locale locale) => locale.languageCode == thunderBloc.state.appLanguageCode)
.firstOrNull;

return OverlaySupport.global(
child: MaterialApp.router(
Expand All @@ -247,12 +255,16 @@ class _ThunderAppState extends State<ThunderApp> {
Locale('eo'), // Additional locale which is not officially supported: Esperanto
],
routerConfig: router,
themeMode: state.themeType == ThemeType.system ? ThemeMode.system : (state.themeType == ThemeType.light ? ThemeMode.light : ThemeMode.dark),
themeMode: state.themeType == ThemeType.system
? ThemeMode.system
: (state.themeType == ThemeType.light ? ThemeMode.light : ThemeMode.dark),
theme: theme,
darkTheme: darkTheme,
debugShowCheckedModeBanner: false,
scaffoldMessengerKey: GlobalContext.scaffoldMessengerKey,
scrollBehavior: (state.reduceAnimations && Platform.isAndroid) ? const ScrollBehavior().copyWith(overscroll: false) : null,
scrollBehavior: (state.reduceAnimations && Platform.isAndroid)
? const ScrollBehavior().copyWith(overscroll: false)
: null,
),
);
},
Expand Down
2 changes: 1 addition & 1 deletion lib/splash/pages/splash_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'package:lottie/lottie.dart';
import 'package:thunder/thunder/thunder.dart';

PageController thunderPageController = PageController(initialPage: 1);
PageController thunderPageController = PageController(initialPage: 0);

class SplashScreen extends StatelessWidget {
const SplashScreen({Key? key}) : super(key: key);
Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,6 @@ flutter:
fonts:
- asset: fonts/Thunder.ttf

flutter_native_splash:
image: assets/logo.png
color: 212123
#flutter_native_splash:
# image: assets/logo.png
# color: 212123
4 changes: 3 additions & 1 deletion web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@
right: 0;
}
</style>

<script id="splash-screen-script">
function removeSplashFromWeb() {
document.getElementById("splash")?.remove();
document.getElementById("splash-branding")?.remove();
document.body.style.background = "transparent";
}

</script>
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport">
</head>
<body>
<picture id="splash">
Expand Down

0 comments on commit 275d57f

Please sign in to comment.