fix: some warnings remove + light / ugly theme added

This commit is contained in:
2026-07-29 21:25:47 +02:00
parent 031a618220
commit cd75d3a474
8 changed files with 107 additions and 52 deletions
+6
View File
@@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="256" height="256" viewBox="0 0 256 256" xml:space="preserve">
<g style="stroke: none; stroke-width: 0; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: none; fill-rule: nonzero; opacity: 1;" transform="translate(1.4065934065934016 1.4065934065934016) scale(2.81 2.81)">
<path d="M 62.407 19.525 c -3.066 0 -5.89 0.968 -8.229 2.622 l -12.627 9.198 c -1.089 -6.697 -6.898 -11.82 -13.918 -11.82 c -7.786 0 -14.119 6.333 -14.119 14.119 s 6.333 14.119 14.119 14.119 c 3.066 0 5.93 -1.009 8.27 -2.662 l 12.586 -9.157 c 1.089 6.697 6.898 11.82 13.918 11.82 c 7.786 0 14.119 -6.333 14.119 -14.119 S 70.233 19.525 62.407 19.525 z M 27.633 39.978 c -3.51 0 -6.333 -2.824 -6.333 -6.333 s 2.824 -6.333 6.333 -6.333 c 3.51 0 6.333 2.824 6.333 6.333 S 31.143 39.978 27.633 39.978 z M 62.407 39.978 c -3.51 0 -6.333 -2.824 -6.333 -6.333 s 2.824 -6.333 6.333 -6.333 c 3.51 0 6.333 2.824 6.333 6.333 S 65.917 39.978 62.407 39.978 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
<path d="M 73.864 56.356 h 3.268 v 11.457 h -3.268 V 56.356 z M 75.477 51.273 c -1.049 0 -1.896 0.847 -1.896 1.936 c 0 1.049 0.847 1.936 1.896 1.936 c 1.049 0 1.896 -0.847 1.896 -1.936 C 77.414 52.12 76.526 51.273 75.477 51.273 z M 90 56.356 v 14.079 h -3.268 v -3.147 c -0.766 0.363 -1.573 0.565 -2.461 0.565 c -3.147 0 -5.728 -2.582 -5.728 -5.769 c 0 -3.187 2.541 -5.769 5.728 -5.769 c 0.887 0 1.735 0.202 2.461 0.565 v -0.484 H 90 V 56.356 z M 86.732 62.084 c 0 -1.372 -1.089 -2.461 -2.42 -2.461 s -2.42 1.089 -2.42 2.461 c 0 1.372 1.089 2.461 2.42 2.461 C 85.643 64.545 86.732 63.416 86.732 62.084 z M 42.559 59.583 c 0.807 0 1.573 0.403 2.017 1.13 l 2.743 -1.815 c -1.049 -1.614 -2.824 -2.622 -4.76 -2.622 c -3.147 0 -5.728 2.582 -5.728 5.769 c 0 3.187 2.541 5.769 5.728 5.769 c 1.896 0 3.671 -0.968 4.76 -2.582 l -2.703 -1.775 c -0.444 0.686 -1.21 1.089 -2.017 1.089 c -1.331 0 -2.42 -1.089 -2.42 -2.461 C 40.139 60.713 41.228 59.583 42.559 59.583 z M 11.497 62.084 c 0 3.187 -2.541 5.769 -5.728 5.769 c -0.887 0 -1.735 -0.202 -2.501 -0.605 v 3.187 H 0 V 56.356 h 3.268 v 0.524 c 0.766 -0.363 1.614 -0.605 2.501 -0.605 C 8.956 56.275 11.497 58.897 11.497 62.084 z M 8.229 62.084 c 0 -1.372 -1.089 -2.461 -2.42 -2.461 c -1.331 0 -2.42 1.089 -2.42 2.461 c 0 1.372 1.089 2.461 2.42 2.461 C 7.14 64.545 8.229 63.416 8.229 62.084 z M 23.922 67.813 h -3.268 v -0.524 c -0.726 0.363 -1.573 0.565 -2.42 0.565 c -3.147 0 -5.728 -2.582 -5.728 -5.769 c 0 -3.187 2.541 -5.769 5.728 -5.769 c 0.847 0 1.694 0.202 2.42 0.565 v -0.484 h 3.268 V 67.813 z M 20.654 61.762 c -0.121 -1.21 -1.17 -2.178 -2.42 -2.178 c -1.331 0 -2.42 1.089 -2.42 2.461 c 0 1.372 1.089 2.461 2.42 2.461 c 1.251 0 2.259 -0.968 2.42 -2.178 V 61.762 z M 66.481 56.396 c -0.686 0 -1.412 0.161 -2.098 0.403 v -0.444 h -3.268 v 11.457 h 3.268 v -6.011 c 0 -2.017 1.856 -2.098 2.098 -2.098 c 0.565 0 1.049 0.161 1.412 0.524 c 0.403 0.363 0.605 0.928 0.605 1.654 v 5.849 h 3.268 v -5.89 C 71.766 58.252 69.104 56.396 66.481 56.396 z M 36.871 56.396 h -3.308 l -2.34 6.051 l -2.541 -6.051 h -3.55 l 4.518 10.085 l -1.573 3.994 h 3.308 L 36.871 56.396 z M 59.704 62.084 c 0 3.187 -2.541 5.769 -5.728 5.769 c -3.147 0 -5.728 -2.582 -5.728 -5.769 c 0 -3.187 2.541 -5.769 5.728 -5.769 C 57.122 56.275 59.704 58.897 59.704 62.084 z M 56.437 62.084 c 0 -1.372 -1.089 -2.461 -2.42 -2.461 c -1.331 0 -2.42 1.089 -2.42 2.461 c 0 1.372 1.089 2.461 2.42 2.461 C 55.347 64.545 56.437 63.416 56.437 62.084 z" style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-linejoin: miter; stroke-miterlimit: 10; fill: rgb(0,0,0); fill-rule: nonzero; opacity: 1;" transform=" matrix(1 0 0 1 0 0) " stroke-linecap="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

+31 -4
View File
@@ -1,7 +1,10 @@
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:kooltab2/theme.dart';
import 'package:kooltab2/utils/app_update_util.dart';
import 'package:provider/provider.dart';
import '../models/settings.dart';
import '../viewmodels/settings_view_model.dart';
import '../theme.dart';
class KoolTabApp extends StatefulWidget {
const KoolTabApp({super.key, required this.router});
@@ -13,13 +16,37 @@ class KoolTabApp extends StatefulWidget {
}
class _KoolTabAppState extends State<KoolTabApp> {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
context.read<SettingsViewModel>().ensureLoaded();
});
}
@override
Widget build(BuildContext context) {
final settings = context.watch<SettingsViewModel>().settings;
return MaterialApp.router(
title: 'KoolTab',
debugShowCheckedModeBanner: false,
routerConfig: widget.router,
theme: darkTheme,
theme: lightTheme,
darkTheme: darkTheme,
themeMode: _mapThemeMode(settings.themeMode, context),
);
}
}
ThemeMode _mapThemeMode(AppThemeMode mode, BuildContext context) {
final hasLoaded = context.read<SettingsViewModel>().hasLoaded;
return switch (mode) {
AppThemeMode.dark => ThemeMode.dark,
AppThemeMode.light => ThemeMode.light,
AppThemeMode.system =>
hasLoaded ? ThemeMode.system : ThemeMode.dark,
};
}
}
+63 -37
View File
@@ -462,11 +462,10 @@ final ThemeData neoBrutalDarkTheme = ThemeData(
);
const _violetL = Color(0xFF7C3AED);
const _violetSoftL = Color(0xFF6D28D9);
const _bgL = Color(0xFFFAFAFC);
const _bgL = Color(0xFFF6F5F3);
const _surfaceL = Color(0xFFFFFFFF);
const _surfaceRaisedL = Color(0xFFF3F1F8);
const _outlineL = Color(0x14000000); // ~8% black
const _surfaceRaisedL = Color(0xFFF0EDE7);
const _outlineL = Color(0x1A000000); // ~10% black
final ThemeData lightTheme = ThemeData(
useMaterial3: true,
@@ -477,7 +476,7 @@ final ThemeData lightTheme = ThemeData(
seedColor: _violetL,
brightness: Brightness.light,
surface: _surfaceL,
error: const Color(0xFFE5484D),
error: const Color(0xFFDC2626),
),
scaffoldBackgroundColor: _bgL,
@@ -487,22 +486,28 @@ final ThemeData lightTheme = ThemeData(
elevation: 0,
centerTitle: false,
backgroundColor: _bgL,
foregroundColor: Colors.black87,
foregroundColor: const Color(0xFF1A1A1A),
surfaceTintColor: Colors.transparent,
titleTextStyle: const TextStyle(
fontSize: 22,
fontWeight: FontWeight.w800,
letterSpacing: -0.3,
color: Colors.black87,
color: Color(0xFF1A1A1A),
),
iconTheme: const IconThemeData(
color: Color(0xFF5C5C5C),
size: 22,
),
actionsIconTheme: const IconThemeData(
color: Color(0xFF5C5C5C),
size: 22,
),
iconTheme: const IconThemeData(color: Colors.black54, size: 22),
actionsIconTheme: const IconThemeData(color: Colors.black54, size: 22),
),
iconButtonTheme: IconButtonThemeData(
style: IconButton.styleFrom(
backgroundColor: Colors.black.withValues(alpha: 0.04),
foregroundColor: Colors.black54,
backgroundColor: const Color(0x08000000),
foregroundColor: const Color(0xFF5C5C5C),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.md),
),
@@ -512,7 +517,8 @@ final ThemeData lightTheme = ThemeData(
cardTheme: CardThemeData(
color: _surfaceL,
elevation: 0,
elevation: 1,
shadowColor: const Color(0x0C000000),
margin: const EdgeInsets.symmetric(
horizontal: AppSpacing.md,
vertical: AppSpacing.sm,
@@ -528,8 +534,8 @@ final ThemeData lightTheme = ThemeData(
elevation: 0,
backgroundColor: _violetL,
foregroundColor: Colors.white,
disabledBackgroundColor: Colors.black.withValues(alpha: 0.06),
disabledForegroundColor: Colors.black26,
disabledBackgroundColor: const Color(0x0F000000),
disabledForegroundColor: const Color(0x42000000),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xl,
vertical: AppSpacing.lg,
@@ -563,7 +569,7 @@ final ThemeData lightTheme = ThemeData(
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
foregroundColor: Colors.black87,
foregroundColor: const Color(0xFF1A1A1A),
side: const BorderSide(color: _outlineL, width: 1.4),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.xl,
@@ -577,7 +583,7 @@ final ThemeData lightTheme = ThemeData(
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
foregroundColor: Colors.black54,
foregroundColor: const Color(0xFF5C5C5C),
padding: const EdgeInsets.symmetric(
horizontal: AppSpacing.lg,
vertical: AppSpacing.md,
@@ -590,8 +596,8 @@ final ThemeData lightTheme = ThemeData(
inputDecorationTheme: InputDecorationTheme(
filled: true,
fillColor: _surfaceRaisedL,
hintStyle: const TextStyle(color: Colors.black38),
fillColor: _surfaceL,
hintStyle: const TextStyle(color: Color(0xFF9E9E9E)),
contentPadding: const EdgeInsets.symmetric(
horizontal: AppSpacing.lg,
vertical: AppSpacing.lg,
@@ -613,27 +619,31 @@ final ThemeData lightTheme = ThemeData(
dialogTheme: DialogThemeData(
backgroundColor: _surfaceL,
surfaceTintColor: Colors.transparent,
elevation: 8,
elevation: 12,
shadowColor: const Color(0x18000000),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.lg),
),
titleTextStyle: const TextStyle(
color: Colors.black87,
color: Color(0xFF1A1A1A),
fontSize: 19,
fontWeight: FontWeight.w800,
),
contentTextStyle: const TextStyle(color: Colors.black54, height: 1.4),
contentTextStyle: const TextStyle(
color: Color(0xFF5C5C5C),
height: 1.4,
),
),
floatingActionButtonTheme: const FloatingActionButtonThemeData(
backgroundColor: _violetL,
foregroundColor: Colors.white,
elevation: 2,
elevation: 3,
),
navigationBarTheme: NavigationBarThemeData(
backgroundColor: _surfaceL,
indicatorColor: _violetL.withValues(alpha: 0.15),
indicatorColor: _violetL.withValues(alpha: 0.12),
labelTextStyle: const WidgetStatePropertyAll(
TextStyle(fontWeight: FontWeight.w600),
),
@@ -644,8 +654,8 @@ final ThemeData lightTheme = ThemeData(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.md),
),
iconColor: _violetSoftL,
textColor: Colors.black87,
iconColor: _violetL,
textColor: const Color(0xFF1A1A1A),
contentPadding: const EdgeInsets.symmetric(
horizontal: AppSpacing.md,
vertical: AppSpacing.xs,
@@ -653,9 +663,9 @@ final ThemeData lightTheme = ThemeData(
),
snackBarTheme: SnackBarThemeData(
backgroundColor: Colors.black87,
backgroundColor: const Color(0xFF1E1E24),
behavior: SnackBarBehavior.floating,
elevation: 4,
elevation: 6,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.md),
),
@@ -671,11 +681,11 @@ final ThemeData lightTheme = ThemeData(
chipTheme: ChipThemeData(
backgroundColor: _surfaceRaisedL,
labelStyle: const TextStyle(
color: Colors.black87,
color: Color(0xFF1A1A1A),
fontWeight: FontWeight.w600,
fontSize: 12,
),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppRadii.sm),
side: const BorderSide(color: _outlineL),
@@ -683,21 +693,37 @@ final ThemeData lightTheme = ThemeData(
),
textTheme: const TextTheme(
displayLarge: TextStyle(color: Colors.black87, fontWeight: FontWeight.w800),
displayLarge: TextStyle(
color: Color(0xFF1A1A1A),
fontWeight: FontWeight.w800,
),
headlineMedium: TextStyle(
color: Colors.black87,
color: Color(0xFF1A1A1A),
fontWeight: FontWeight.w800,
letterSpacing: -0.3,
),
titleLarge: TextStyle(
color: Colors.black87,
color: Color(0xFF1A1A1A),
fontWeight: FontWeight.w800,
letterSpacing: -0.2,
),
titleMedium: TextStyle(color: Colors.black87, fontWeight: FontWeight.w700),
bodyLarge: TextStyle(color: Colors.black54, fontSize: 16, height: 1.5),
bodyMedium: TextStyle(color: Colors.black45, height: 1.4),
bodySmall: TextStyle(color: Colors.black38, height: 1.3),
labelLarge: TextStyle(color: Colors.black87, fontWeight: FontWeight.w700),
titleMedium: TextStyle(
color: Color(0xFF1A1A1A),
fontWeight: FontWeight.w700,
),
bodyLarge: TextStyle(
color: Color(0xFF5C5C5C),
fontSize: 16,
height: 1.5,
),
bodyMedium: TextStyle(color: Color(0xFF757575), height: 1.4),
bodySmall: TextStyle(
color: Color(0xFF9E9E9E),
height: 1.3,
),
labelLarge: TextStyle(
color: Color(0xFF1A1A1A),
fontWeight: FontWeight.w700,
),
),
);
-4
View File
@@ -1,13 +1,9 @@
import 'dart:convert';
import 'dart:io';
import 'package:crypto/crypto.dart';
import 'package:flutter/cupertino.dart';
import 'package:http/http.dart' as http;
import 'package:open_filex/open_filex.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:path_provider/path_provider.dart';
class UpdateInfo {
final bool update;
+1 -1
View File
@@ -75,7 +75,7 @@ class SettingsViewModel extends ChangeNotifier {
? update.download
: "$kUpdateServerUrl${update.download}";
debugPrint("Download Url: ${url}");
debugPrint("Download Url: $url");
final stream = OtaUpdate().execute(
url,
+1 -1
View File
@@ -6,7 +6,7 @@ import 'package:kooltab2/models/closed_tab_item.dart';
class ClosedTabCard extends StatefulWidget {
final ClosedTab closedTab;
const ClosedTabCard({required this.closedTab});
const ClosedTabCard({super.key, required this.closedTab});
@override
State<ClosedTabCard> createState() => _ClosedTabCardState();
+4 -4
View File
@@ -10,6 +10,7 @@ class ProductTile extends StatelessWidget {
static const _tileImageSize = 280.0;
const ProductTile({
super.key,
required this.product,
required this.enabled,
required this.onTap,
@@ -25,8 +26,7 @@ class ProductTile extends StatelessWidget {
product.stockQuantity > 0 &&
product.stockQuantity <= product.lowStockThreshold;
final hasImage = product.imagePath != null &&
product.imagePath!.isNotEmpty;
final hasImage = product.imagePath != null && product.imagePath!.isNotEmpty;
final borderColor = outOfStock
? scheme.error.withValues(alpha: 0.7)
@@ -58,8 +58,8 @@ class ProductTile extends StatelessWidget {
File(product.imagePath!),
fit: BoxFit.scaleDown,
cacheWidth: _tileImageSize.toInt(),
errorBuilder:
(context, error, stackTrace) => _noImage(scheme),
errorBuilder: (context, error, stackTrace) =>
_noImage(scheme),
)
: _noImage(scheme),
),
+1 -1
View File
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class SlideConfirm extends StatefulWidget {
final VoidCallback onConfirmed;
const SlideConfirm({required this.onConfirmed});
const SlideConfirm({super.key, required this.onConfirmed});
@override
State<SlideConfirm> createState() => _SlideConfirmState();