Compare commits

...

3 Commits

Author SHA1 Message Date
AN12345
45c7bd6fca refactor(ui_layout): update example with components updates (close #90)
Some checks failed
continuous-integration/drone/push Build is failing
2022-12-12 12:42:11 -05:00
AN12345
cd2806b07b refactor(bloc_layout): update example with new app bar entity (#90) 2022-12-12 12:36:40 -05:00
AN12345
dd275460f6 feat(ui_components): make app bar leading & actions customizable 2022-12-12 12:34:02 -05:00
5 changed files with 41 additions and 5 deletions

View File

@ -18,7 +18,9 @@ class CustomAppBar extends AppBarComponent {
);
@override
AppBarComponent configure({String? title}) => CustomAppBar(
AppBarComponent configure(
{String? title, Widget? leading, List<Widget>? actions}) =>
CustomAppBar(
title: title ?? this.title,
);
}

View File

@ -10,7 +10,9 @@ class CustomAppBar extends AppBarComponent {
);
@override
AppBarComponent configure({String? title}) => CustomAppBar(
AppBarComponent configure(
{String? title, Widget? leading, List<Widget>? actions}) =>
CustomAppBar(
title: title ?? this.title,
);
}

View File

@ -1,3 +1,19 @@
// Copyright (C) 2022 WYATT GROUP
// Please see the AUTHORS file for details.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
import 'package:flutter/material.dart';
abstract class Component extends StatelessWidget {

View File

@ -19,10 +19,21 @@ import 'package:wyatt_ui_components/src/domain/entities/component.dart';
abstract class AppBarComponent extends Component {
final String? title;
const AppBarComponent({this.title, super.key});
final Widget? leading;
final List<Widget>? actions;
const AppBarComponent({
this.title,
this.leading,
this.actions,
super.key,
});
@override
AppBarComponent configure({String? title});
AppBarComponent configure({
String? title,
Widget? leading,
List<Widget>? actions,
});
}
abstract class BottomNavigationBarComponent extends Component {

View File

@ -13,7 +13,12 @@ class CustomAppBar extends AppBarComponent {
);
@override
AppBarComponent configure({String? title}) => CustomAppBar(
AppBarComponent configure({
String? title,
Widget? leading,
List<Widget>? actions,
}) =>
CustomAppBar(
title: title ?? this.title,
);
}