feat(editor): pen canvas + Material You UI
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:
2026-06-21 22:04:49 +08:00
parent 9db688d948
commit 3febbd1431
9 changed files with 993 additions and 37 deletions

View File

@@ -8,10 +8,13 @@
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'spike_editor_pane.dart';
import '../canvas/pen_editor_screen.dart';
/// Opens a file picker for a PDF, then pushes the spike pane on it.
/// Pass the user's own large PDF to get a realistic 60fps / pen test.
/// Opens a file picker for a PDF, then pushes the NEW pen-first canvas editor.
///
/// The 🧪 entry now opens the clean-room canvas (lib/editor/canvas/), which
/// OWNS the gesture pipeline (pressure, pinch-zoom, palm rejection). The old
/// spike_* files are left in place but no longer wired to this entry.
Future<void> openM1Spike(BuildContext context) async {
final result = await FilePicker.platform.pickFiles(
type: FileType.custom,
@@ -22,13 +25,7 @@ Future<void> openM1Spike(BuildContext context) async {
if (!context.mounted) return;
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => Scaffold(
appBar: AppBar(title: const Text('M1 Spike — pen / scroll / zoom')),
// denseStrokesAsset is null here: the bundled synthetic-stroke load is
// only for the perf bench. For manual on-device testing, draw real ink
// and scroll a real large PDF while watching the frame-time HUD.
body: SpikeEditorPane(pdfPath: path),
),
builder: (_) => PenEditorScreen(pdfPath: path),
),
);
}