mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-12-10 14:06:38 -05:00
clean up build
This commit is contained in:
parent
b54868cc55
commit
5703da0802
30 changed files with 377 additions and 74 deletions
|
|
@ -1,54 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'themes/themes.dart';
|
||||
|
||||
class ThemeService {
|
||||
ThemeService._();
|
||||
static late SharedPreferences prefs;
|
||||
static ThemeService? _instance;
|
||||
|
||||
static Future<ThemeService> get instance async {
|
||||
if (_instance == null) {
|
||||
prefs = await SharedPreferences.getInstance();
|
||||
_instance = ThemeService._();
|
||||
}
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
final allThemes = <String, ThemeData>{
|
||||
'dark': darkTheme,
|
||||
'light': lightTheme,
|
||||
};
|
||||
|
||||
String get previousThemeName {
|
||||
String? themeName = prefs.getString('previousThemeName');
|
||||
if (themeName == null) {
|
||||
final isPlatformDark =
|
||||
WidgetsBinding.instance.window.platformBrightness == Brightness.dark;
|
||||
themeName = isPlatformDark ? 'light' : 'dark';
|
||||
}
|
||||
return themeName;
|
||||
}
|
||||
|
||||
get initial {
|
||||
String? themeName = prefs.getString('theme');
|
||||
if (themeName == null) {
|
||||
final isPlatformDark =
|
||||
WidgetsBinding.instance.window.platformBrightness == Brightness.dark;
|
||||
themeName = isPlatformDark ? 'dark' : 'light';
|
||||
}
|
||||
return allThemes[themeName];
|
||||
}
|
||||
|
||||
save(String newThemeName) {
|
||||
var currentThemeName = prefs.getString('theme');
|
||||
if (currentThemeName != null) {
|
||||
prefs.setString('previousThemeName', currentThemeName);
|
||||
}
|
||||
prefs.setString('theme', newThemeName);
|
||||
}
|
||||
|
||||
ThemeData getByName(String name) {
|
||||
return allThemes[name]!;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
ThemeData lightTheme = ThemeData.light();
|
||||
|
||||
ThemeData darkTheme = ThemeData.dark();
|
||||
|
||||
ThemeData pinkTheme = lightTheme.copyWith(
|
||||
primaryColor: const Color(0xFFF49FB6),
|
||||
scaffoldBackgroundColor: const Color(0xFFFAF8F0),
|
||||
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
||||
foregroundColor: Color(0xFF24737c),
|
||||
backgroundColor: Color(0xFFA6E0DE),
|
||||
),
|
||||
textTheme: const TextTheme(
|
||||
bodyText1: TextStyle(
|
||||
color: Colors.black87,
|
||||
),
|
||||
));
|
||||
|
||||
ThemeData halloweenTheme = lightTheme.copyWith(
|
||||
primaryColor: const Color(0xFF55705A),
|
||||
scaffoldBackgroundColor: const Color(0xFFE48873),
|
||||
floatingActionButtonTheme: const FloatingActionButtonThemeData(
|
||||
foregroundColor: Color(0xFFea8e71),
|
||||
backgroundColor: Color(0xFF2b2119),
|
||||
),
|
||||
);
|
||||
|
||||
ThemeData darkBlueTheme = ThemeData.dark().copyWith(
|
||||
primaryColor: const Color(0xFF1E1E2C),
|
||||
scaffoldBackgroundColor: const Color(0xFF2D2D44),
|
||||
textTheme: const TextTheme(
|
||||
bodyText1: TextStyle(
|
||||
color: Color(0xFF33E1Ed),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
ThemeData darkTheme = ThemeData.dark();
|
||||
|
||||
// late Color primaryColor = const Color(0xFF343455);
|
||||
// late Color secondaryColor = const Color(0xFF3D3E77);
|
||||
// late Color tertiaryColor = const Color(0xFFBB108E);
|
||||
// late Color alternate = const Color(0xFF5086DF);
|
||||
// late Color primaryBackground = const Color(0xFF252534);
|
||||
// late Color secondaryBackground = const Color(0xFF292D44);
|
||||
// late Color primaryText = const Color(0xFFD0D0E0);
|
||||
// late Color secondaryText = const Color(0xFFB0B0D0);
|
||||
|
||||
// late Color disabledText = Color(0x808F8F8F);
|
||||
// late Color primaryEdge = Color(0xFF555594);
|
||||
// late Color header = Color(0xFF8A8AD8);
|
||||
// late Color textBackground = Color(0xFF181820);
|
||||
// late Color active = Color(0xFF463BAD);
|
||||
// late Color inactive = Color(0xFF2E2E3C);
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
ThemeData lightTheme = ThemeData.light();
|
||||
|
||||
// late Color primaryColor = const Color(0xFF6667AB);
|
||||
// late Color secondaryColor = const Color(0xFF7C7ED0);
|
||||
// late Color tertiaryColor = const Color(0xFFF259C9);
|
||||
// late Color alternate = const Color(0xFF77ABFF);
|
||||
// late Color primaryBackground = const Color(0xFFA0A0D0);
|
||||
// late Color secondaryBackground = const Color(0xFFB0B0D0);
|
||||
// late Color primaryText = const Color(0xFF101010);
|
||||
// late Color secondaryText = const Color(0xFF282840);
|
||||
|
||||
// late Color disabledText = Color(0x8047464F);
|
||||
// late Color primaryEdge = Color(0xFF44447F);
|
||||
// late Color header = Color(0xFFE0E0F0);
|
||||
// late Color textBackground = Color(0xFFE0E0F0);
|
||||
// late Color active = Color(0xFF5B4FFA);
|
||||
// late Color inactive = Color(0xFF3E3E72);
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export 'light.dart';
|
||||
export 'dark.dart';
|
||||
Loading…
Add table
Add a link
Reference in a new issue