feat: add a book by scanning
This commit is contained in:
parent
72fd0b66a9
commit
981dce5bfe
14 changed files with 264 additions and 59 deletions
27
lib/utils/overlay_boundary.dart
Normal file
27
lib/utils/overlay_boundary.dart
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class OverlayBoundary extends StatefulWidget {
|
||||
const OverlayBoundary({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
State<OverlayBoundary> createState() => _OverlayBoundaryState();
|
||||
}
|
||||
|
||||
class _OverlayBoundaryState extends State<OverlayBoundary> {
|
||||
late final OverlayEntry _overlayEntry = OverlayEntry(
|
||||
builder: (context) => widget.child,
|
||||
);
|
||||
|
||||
@override
|
||||
void didUpdateWidget(covariant OverlayBoundary oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
_overlayEntry.markNeedsBuild();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Overlay(initialEntries: [_overlayEntry]);
|
||||
}
|
||||
}
|
||||
Reference in a new issue