Open Lumen on a responsive bookshelf and land pending story work
- Start the app on a shelf of every installed book instead of the last book's home. Cards show the cover, translated metadata, available languages, restored patterns and either "Continue reading" or a way in. - Keep each book's saved route: the shelf is never written to flutter_screen, so choosing a book resumes its own leaf. - Lay the shelf out responsively: dense single-column cards on phones, a two-column grid from 720 logical pixels, a centred 860 px column on tablets and a chevron that exists in the bundled handwriting font. - Keep Settings reachable from the shelf and let the home page's story library button open the shelf instead of a dialog. - Add tool/shelf_screenshots_test.dart, which renders the shelf at phone and tablet metrics, checks that every card and Settings stay reachable without overflow, and writes artifacts/library/shelf-*.png. - Commit the pending Midnight Invitation package (campaign, notebook, narration and artwork), cast drama and ambience tooling, region selection, phone/tablet integration coverage and related docs. flutter analyze is clean and all 74 widget/domain tests pass.
This commit is contained in:
+29
-9
@@ -66,12 +66,26 @@ class Paper extends StatefulWidget {
|
||||
State<Paper> createState() => _PaperState();
|
||||
}
|
||||
|
||||
/// Artwork follows the selected story on reading, contents and puzzle pages.
|
||||
class PaperSkin extends InheritedWidget {
|
||||
const PaperSkin({super.key, required this.asset, required super.child});
|
||||
final String? asset;
|
||||
|
||||
static String? assetOf(BuildContext context) =>
|
||||
context.dependOnInheritedWidgetOfExactType<PaperSkin>()?.asset;
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(PaperSkin oldWidget) => asset != oldWidget.asset;
|
||||
}
|
||||
|
||||
class _PaperState extends State<Paper> {
|
||||
Offset _drag = Offset.zero;
|
||||
Offset _origin = Offset.zero;
|
||||
@override
|
||||
Widget build(BuildContext context) => ColoredBox(
|
||||
color: const Color(0xff314345),
|
||||
color: PaperSkin.assetOf(context) == null
|
||||
? const Color(0xff314345)
|
||||
: const Color(0xff241e27),
|
||||
child: SafeArea(
|
||||
child: LayoutBuilder(
|
||||
builder: (context, c) {
|
||||
@@ -139,7 +153,8 @@ class _PaperState extends State<Paper> {
|
||||
width: w,
|
||||
height: h,
|
||||
child: Image.asset(
|
||||
'assets/artwork/mara-single-page-v2.png',
|
||||
PaperSkin.assetOf(context) ??
|
||||
'assets/artwork/mara-single-page-v2.png',
|
||||
fit: BoxFit.fill,
|
||||
excludeFromSemantics: true,
|
||||
),
|
||||
@@ -175,11 +190,15 @@ class Leaf extends StatelessWidget {
|
||||
super.key,
|
||||
required this.body,
|
||||
this.wideBody,
|
||||
this.fittedBody,
|
||||
this.footer,
|
||||
this.onTurn,
|
||||
});
|
||||
final Widget body;
|
||||
|
||||
/// A bounded portrait layout, used to keep the complete puzzle in view.
|
||||
final Widget? fittedBody;
|
||||
|
||||
/// Replaces [body] on a landscape page. The shorter page suits side-by-side
|
||||
/// columns better than one long scroll, so it should arrange its own panes.
|
||||
final Widget? wideBody;
|
||||
@@ -197,13 +216,14 @@ class Leaf extends StatelessWidget {
|
||||
Expanded(
|
||||
child: wide
|
||||
? wideBody!
|
||||
: SingleChildScrollView(
|
||||
// Each newly opened leaf starts at the top, including
|
||||
// leaves revisited with Previous or a bookmark.
|
||||
key: const ValueKey('leaf-scroll'),
|
||||
padding: const EdgeInsets.fromLTRB(4, 8, 4, 8),
|
||||
child: body,
|
||||
),
|
||||
: fittedBody ??
|
||||
SingleChildScrollView(
|
||||
// Each newly opened leaf starts at the top, including
|
||||
// leaves revisited with Previous or a bookmark.
|
||||
key: const ValueKey('leaf-scroll'),
|
||||
padding: const EdgeInsets.fromLTRB(4, 8, 4, 8),
|
||||
child: body,
|
||||
),
|
||||
),
|
||||
?footer,
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user