feat(editor): pen canvas + Material You UI
All checks were successful
CI / Windows build (push) Successful in 8m22s
All checks were successful
CI / Windows build (push) Successful in 8m22s
Clean-room reimplementation of Saber's input model: we own the gesture pipeline so pen draws with real pressure (perfect_freehand), two-finger pinch zooms/pans, and palm is rejected (stylus-priority, 2nd-pointer cancels stroke). pdfrx renders one page at a time (PdfPageView, no gestures) under a shared transform; page-based nav. Material You theme via dynamic_color (system accent + seed fallback) and a floating tonal tool palette + page pill. Old pdfrx-overlay spike no longer wired.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:dynamic_color/dynamic_color.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
@@ -34,30 +35,36 @@ class BadNoteApp extends ConsumerWidget {
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final settings = ref.watch(settingsProvider);
|
||||
|
||||
return MaterialApp(
|
||||
title: 'BadNote',
|
||||
themeMode: settings.themeMode,
|
||||
theme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: settings.colorSchemeSeed,
|
||||
brightness: Brightness.light,
|
||||
),
|
||||
textTheme: GoogleFonts.interTextTheme(
|
||||
ThemeData(brightness: Brightness.light).textTheme,
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
colorScheme: ColorScheme.fromSeed(
|
||||
seedColor: settings.colorSchemeSeed,
|
||||
brightness: Brightness.dark,
|
||||
),
|
||||
textTheme: GoogleFonts.interTextTheme(
|
||||
ThemeData(brightness: Brightness.dark).textTheme,
|
||||
),
|
||||
useMaterial3: true,
|
||||
),
|
||||
home: const HomeScreen(),
|
||||
// Material You: prefer the OS dynamic color (Windows/Android system accent);
|
||||
// fall back to the user's seed color when the platform provides none.
|
||||
return DynamicColorBuilder(
|
||||
builder: (lightDynamic, darkDynamic) {
|
||||
final lightScheme = lightDynamic?.harmonized() ??
|
||||
ColorScheme.fromSeed(
|
||||
seedColor: settings.colorSchemeSeed,
|
||||
brightness: Brightness.light,
|
||||
);
|
||||
final darkScheme = darkDynamic?.harmonized() ??
|
||||
ColorScheme.fromSeed(
|
||||
seedColor: settings.colorSchemeSeed,
|
||||
brightness: Brightness.dark,
|
||||
);
|
||||
return MaterialApp(
|
||||
title: 'BadNote',
|
||||
themeMode: settings.themeMode,
|
||||
theme: _theme(lightScheme),
|
||||
darkTheme: _theme(darkScheme),
|
||||
home: const HomeScreen(),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
ThemeData _theme(ColorScheme scheme) => ThemeData(
|
||||
colorScheme: scheme,
|
||||
useMaterial3: true,
|
||||
textTheme: GoogleFonts.interTextTheme(
|
||||
ThemeData(brightness: scheme.brightness).textTheme,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user