Solian/lib/widgets/wrapper.dart

34 lines
895 B
Dart
Raw Normal View History

2024-04-12 16:38:20 +00:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:solian/providers/layout_provider.dart';
import 'package:solian/widgets/navigation_drawer.dart';
class LayoutWrapper extends StatelessWidget {
final Widget? child;
const LayoutWrapper({super.key, this.child});
@override
Widget build(BuildContext context) {
var cfg = context.watch<LayoutConfig>();
return Scaffold(
drawer: const SolianNavigationDrawer(),
body: NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
return <Widget>[
SliverAppBar(
title: Text(cfg.title),
elevation: 10.0,
expandedHeight: 50,
floating: true,
snap: true,
),
];
},
body: child ?? Container(),
),
);
}
}