master #81
@ -20,18 +20,26 @@ import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
||||
|
||||
class AppBarLayout extends Layout {
|
||||
const AppBarLayout({
|
||||
required this.title,
|
||||
required this.body,
|
||||
this.title,
|
||||
this.leading,
|
||||
this.actions,
|
||||
super.key,
|
||||
});
|
||||
final String title;
|
||||
final String? title;
|
||||
final Widget? leading;
|
||||
final List<Widget>? actions;
|
||||
final Widget body;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(60),
|
||||
child: context.components.appBar?.configure(title: title) ??
|
||||
child: context.components.appBar?.configure(
|
||||
title: title,
|
||||
leading: leading,
|
||||
actions: actions,
|
||||
) ??
|
||||
const SizedBox.shrink(),
|
||||
),
|
||||
body: body,
|
||||
|
@ -3,19 +3,18 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
||||
|
||||
class BottomNavigationBarLayout extends Layout {
|
||||
|
||||
const BottomNavigationBarLayout({
|
||||
required this.currentIndex,
|
||||
required this.body,
|
||||
this.currentIndex,
|
||||
this.body,
|
||||
super.key,
|
||||
});
|
||||
final Widget body;
|
||||
final int currentIndex;
|
||||
final Widget? body;
|
||||
final int? currentIndex;
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
body: body,
|
||||
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
|
||||
currentIndex: currentIndex,
|
||||
currentIndex: currentIndex ?? 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
@ -19,27 +19,34 @@ import 'package:wyatt_ui_components/wyatt_wyatt_ui_components.dart';
|
||||
import 'package:wyatt_ui_layout/src/presentation/layouts/layout.dart';
|
||||
|
||||
class FrameLayout extends Layout {
|
||||
|
||||
const FrameLayout({
|
||||
required this.title,
|
||||
required this.body,
|
||||
required this.currentIndex,
|
||||
this.title,
|
||||
this.leading,
|
||||
this.actions,
|
||||
this.currentIndex,
|
||||
super.key,
|
||||
});
|
||||
final String title;
|
||||
final String? title;
|
||||
final Widget? leading;
|
||||
final List<Widget>? actions;
|
||||
final Widget body;
|
||||
final int currentIndex;
|
||||
final int? currentIndex;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: PreferredSize(
|
||||
preferredSize: const Size.fromHeight(60),
|
||||
child: context.components.appBar?.configure(title: title) ??
|
||||
child: context.components.appBar?.configure(
|
||||
title: title,
|
||||
leading: leading,
|
||||
actions: actions,
|
||||
) ??
|
||||
const SizedBox.shrink(),
|
||||
),
|
||||
body: body,
|
||||
bottomNavigationBar: context.components.bottomNavigationBar?.configure(
|
||||
currentIndex: currentIndex,
|
||||
currentIndex: currentIndex ?? 0,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user