feat(ui_layout): add new package for app compenant and start implementing layouts
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
|
||||
|
||||
class CustomAppBar extends AppBarComponent {
|
||||
const CustomAppBar({
|
||||
super.title,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => AppBar(
|
||||
title: Text(title ?? ''),
|
||||
);
|
||||
|
||||
@override
|
||||
AppBarComponent configure({String? title}) => CustomAppBar(
|
||||
title: title ?? this.title,
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:wyatt_wyatt_ui_layout/wyatt_wyatt_ui_layout.dart';
|
||||
|
||||
class CustomBottomNavigationBar extends BottomNavigationBarComponent {
|
||||
const CustomBottomNavigationBar({
|
||||
super.currentIndex,
|
||||
super.onTap,
|
||||
super.key,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => BottomNavigationBar(
|
||||
currentIndex: currentIndex,
|
||||
onTap: (index) => super.onTap?.call(context, index),
|
||||
items: const [
|
||||
BottomNavigationBarItem(
|
||||
label: 'Icon 1',
|
||||
icon: Icon(
|
||||
Icons.nearby_off,
|
||||
),
|
||||
),
|
||||
BottomNavigationBarItem(
|
||||
label: 'Icon 2',
|
||||
icon: Icon(
|
||||
Icons.dangerous,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
@override
|
||||
CustomBottomNavigationBar configure({
|
||||
void Function(BuildContext, int)? onTap,
|
||||
int currentIndex = 0,
|
||||
}) =>
|
||||
CustomBottomNavigationBar(
|
||||
onTap: onTap ?? this.onTap,
|
||||
currentIndex: currentIndex,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user