35 lines
1.3 KiB
Dart
35 lines
1.3 KiB
Dart
|
|
// lib/editor/pdf/spike_launcher.dart
|
||
|
|
//
|
||
|
|
// THROWAWAY M1 entry: lets the user open the pdfrx pen/perf spike from the
|
||
|
|
// running app (so the CI-built Windows package can exercise MUST #3/#4/#5 on a
|
||
|
|
// real Surface Pen with the user's OWN large PDFs). Remove together with the
|
||
|
|
// rest of lib/editor/pdf/spike_* once M1 is signed off.
|
||
|
|
|
||
|
|
import 'package:file_picker/file_picker.dart';
|
||
|
|
import 'package:flutter/material.dart';
|
||
|
|
|
||
|
|
import 'spike_editor_pane.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.
|
||
|
|
Future<void> openM1Spike(BuildContext context) async {
|
||
|
|
final result = await FilePicker.platform.pickFiles(
|
||
|
|
type: FileType.custom,
|
||
|
|
allowedExtensions: ['pdf'],
|
||
|
|
);
|
||
|
|
final path = result?.files.single.path;
|
||
|
|
if (path == null) return;
|
||
|
|
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),
|
||
|
|
),
|
||
|
|
),
|
||
|
|
);
|
||
|
|
}
|