Merge branch 'dev' of github.com:refilc/naplo into dev

This commit is contained in:
Pearoo 2024-03-20 21:33:19 +01:00
commit 76083b679f
4 changed files with 24 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:background_fetch/background_fetch.dart'; import 'package:background_fetch/background_fetch.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:refilc/api/providers/user_provider.dart'; import 'package:refilc/api/providers/user_provider.dart';
import 'package:refilc/api/providers/database_provider.dart'; import 'package:refilc/api/providers/database_provider.dart';
import 'package:refilc/database/init.dart'; import 'package:refilc/database/init.dart';
@ -18,6 +19,8 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
// import 'firebase_options.dart'; // import 'firebase_options.dart';
// days without touching grass: 5,843 (16 yrs)
void main() async { void main() async {
// Initalize // Initalize
WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized(); WidgetsBinding binding = WidgetsFlutterBinding.ensureInitialized();
@ -40,6 +43,22 @@ void main() async {
BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask); BackgroundFetch.registerHeadlessTask(backgroundHeadlessTask);
// pre-cache required icons
const todaySvg = SvgAssetLoader('assets/svg/menu_icons/today_selected.svg');
const gradesSvg = SvgAssetLoader('assets/svg/menu_icons/grades_selected.svg');
const timetableSvg =
SvgAssetLoader('assets/svg/menu_icons/timetable_selected.svg');
const notesSvg = SvgAssetLoader('assets/svg/menu_icons/notes_selected.svg');
svg.cache
.putIfAbsent(todaySvg.cacheKey(null), () => todaySvg.loadBytes(null));
svg.cache
.putIfAbsent(gradesSvg.cacheKey(null), () => gradesSvg.loadBytes(null));
svg.cache.putIfAbsent(
timetableSvg.cacheKey(null), () => timetableSvg.loadBytes(null));
svg.cache
.putIfAbsent(notesSvg.cacheKey(null), () => notesSvg.loadBytes(null));
// Run App // Run App
runApp(App( runApp(App(
database: startup.database, database: startup.database,

View File

@ -716,7 +716,7 @@ class TimetablePageState extends State<TimetablePage>
indicatorPadding: indicatorPadding:
const EdgeInsets.symmetric(horizontal: 10.0), const EdgeInsets.symmetric(horizontal: 10.0),
indicator: BoxDecoration( indicator: BoxDecoration(
color: AppColors.of(context).highlight, color: Theme.of(context).colorScheme.background,
// color: Colors.transparent, // color: Colors.transparent,
// border: Border.all( // border: Border.all(
// color: AppColors.of(context) // color: AppColors.of(context)

View File

@ -93,7 +93,7 @@ class StatusBarState extends State<StatusBar> {
decoration: BoxDecoration( decoration: BoxDecoration(
// borderRadius: BorderRadius.circular(1.0), // borderRadius: BorderRadius.circular(1.0),
borderRadius: BorderRadius.zero, borderRadius: BorderRadius.zero,
color: AppColors.of(context).background, color: Theme.of(context).scaffoldBackgroundColor,
), ),
padding: const EdgeInsets.only(left: 10.0, right: 10.0), padding: const EdgeInsets.only(left: 10.0, right: 10.0),
child: Text( child: Text(

View File

@ -570,6 +570,9 @@ class PaintListScreenState extends State<PaintListScreen>
// changing font family // changing font family
settingsProvider.update(fontFamily: newThemeByID!.fontFamily, store: true); settingsProvider.update(fontFamily: newThemeByID!.fontFamily, store: true);
// set "paint mode" to custom accent
settingsProvider.update(accentColor: AccentColor.custom, store: true);
// seems weird but it works, trust me (idk why) // seems weird but it works, trust me (idk why)
// await settingsProvider.update(theme: settingsProvider.theme, store: true); // await settingsProvider.update(theme: settingsProvider.theme, store: true);
Provider.of<ThemeModeObserver>(context, listen: false) Provider.of<ThemeModeObserver>(context, listen: false)