implemented the Ticker module with a native ProseMirror document renderer and integrated API support for structured content, navigation trees, and proxied files
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
/// Carries render-time collaborators (the link-tap hook) down the node tree so
|
||||
/// individual node widgets stay pure `(node) => Widget` builders.
|
||||
class PmRenderScope extends InheritedWidget {
|
||||
/// Invoked when a link mark or an image `href` is tapped. The navigation /
|
||||
/// URL policy is injected from outside — the renderer only exposes the hook.
|
||||
final void Function(String href)? onLinkTap;
|
||||
|
||||
const PmRenderScope({
|
||||
required this.onLinkTap,
|
||||
required super.child,
|
||||
super.key,
|
||||
});
|
||||
|
||||
static PmRenderScope? maybeOf(BuildContext context) =>
|
||||
context.dependOnInheritedWidgetOfExactType<PmRenderScope>();
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(PmRenderScope oldWidget) =>
|
||||
oldWidget.onLinkTap != onLinkTap;
|
||||
}
|
||||
Reference in New Issue
Block a user