feat(ui_layout): add new package for app compenant and start implementing layouts

This commit is contained in:
AN12345
2022-12-07 02:38:14 +00:00
committed by Gitea
parent 7fcb9e8ac3
commit 771f600eb7
93 changed files with 3055 additions and 0 deletions
@@ -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,
);
}