feat: no titlebar on macOS

Fixes #136
This commit is contained in:
lollipopkit
2023-08-18 20:01:18 +08:00
parent fe51669369
commit b5c705a1fe
28 changed files with 290 additions and 204 deletions

View File

@@ -28,8 +28,7 @@ class MyApp extends StatelessWidget {
// Issue #57
// if not [ok] -> [AMOLED] mode, use [ThemeMode.dark]
final themeMode = isAMOLED ? ThemeMode.values[tMode] : ThemeMode.dark;
final localeStr = _setting.locale.fetch();
final locale = localeStr?.toLocale;
final locale = _setting.locale.fetch()?.toLocale;
final darkTheme = ThemeData(
useMaterial3: true,
brightness: Brightness.dark,
@@ -47,39 +46,25 @@ class MyApp extends StatelessWidget {
useMaterial3: true,
colorSchemeSeed: primaryColor,
),
darkTheme: isAMOLED
? darkTheme
: darkTheme.copyWith(
scaffoldBackgroundColor: Colors.black,
dialogBackgroundColor: Colors.black,
drawerTheme: const DrawerThemeData(
backgroundColor: Colors.black,
),
appBarTheme: const AppBarTheme(
backgroundColor: Colors.black,
),
dialogTheme: const DialogTheme(
backgroundColor: Colors.black,
),
bottomSheetTheme: const BottomSheetThemeData(
backgroundColor: Colors.black,
),
listTileTheme: const ListTileThemeData(
tileColor: Colors.black12,
),
cardTheme: const CardTheme(
color: Colors.black12,
),
navigationBarTheme: const NavigationBarThemeData(
backgroundColor: Colors.black,
),
popupMenuTheme: const PopupMenuThemeData(
color: Colors.black,
),
),
darkTheme: isAMOLED ? darkTheme : _getAmoledTheme(darkTheme),
home: fullScreen ? const FullScreenPage() : const HomePage(),
);
},
);
}
}
ThemeData _getAmoledTheme(ThemeData darkTheme) => darkTheme.copyWith(
scaffoldBackgroundColor: Colors.black,
dialogBackgroundColor: Colors.black,
drawerTheme: const DrawerThemeData(backgroundColor: Colors.black),
appBarTheme: const AppBarTheme(backgroundColor: Colors.black),
dialogTheme: const DialogTheme(backgroundColor: Colors.black),
bottomSheetTheme:
const BottomSheetThemeData(backgroundColor: Colors.black),
listTileTheme: const ListTileThemeData(tileColor: Colors.black12),
cardTheme: const CardTheme(color: Colors.black12),
navigationBarTheme:
const NavigationBarThemeData(backgroundColor: Colors.black),
popupMenuTheme: const PopupMenuThemeData(color: Colors.black),
);