Fladder/lib/screens/shared/nested_scaffold.dart
PartyDonut 82e09b3e0c Improvements to side navigation bar
Use custom tooltip instead of auto expanding sidebar
2025-07-30 21:18:07 +02:00

39 lines
1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
class NestedScaffold extends ConsumerWidget {
final Widget body;
final Widget? background;
const NestedScaffold({
required this.body,
this.background,
super.key,
});
@override
Widget build(BuildContext context, WidgetRef ref) {
return Stack(
alignment: Alignment.bottomCenter,
children: [
if (background != null) background!,
Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Theme.of(context).colorScheme.surface.withValues(alpha: 0.85),
Theme.of(context).colorScheme.surface.withValues(alpha: 0.7),
],
),
),
child: Scaffold(
backgroundColor: Colors.transparent,
body: body,
),
),
],
);
}
}