Skip to content

Commit

Permalink
lints: ^3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gmpassos committed Dec 15, 2023
1 parent 362ddcd commit 8c7b1a6
Show file tree
Hide file tree
Showing 23 changed files with 142 additions and 221 deletions.
6 changes: 2 additions & 4 deletions bin/bones_ui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ mixin DefaultTemplate {
}

class MyCommandInfo extends CommandInfo with DefaultTemplate {
MyCommandInfo(String cliTitle, ConsolePrinter consolePrinter)
: super(cliTitle, consolePrinter);
MyCommandInfo(super.cliTitle, super.consolePrinter);

@override
String get usage => usageWithDefaultTemplate(super.usage);
Expand All @@ -101,8 +100,7 @@ class MyCommandInfo extends CommandInfo with DefaultTemplate {
}

class MyCommandCreate extends CommandCreate with DefaultTemplate {
MyCommandCreate(String cliTitle, ConsolePrinter consolePrinter)
: super(cliTitle, consolePrinter);
MyCommandCreate(super.cliTitle, super.consolePrinter);

@override
String get usage => usageWithDefaultTemplate(super.usage);
Expand Down
12 changes: 6 additions & 6 deletions example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void main() async {

// `Bones_UI` root.
class MyRoot extends UIRoot {
MyRoot(Element? rootContainer) : super(rootContainer);
MyRoot(super.rootContainer);

MyMenu? _menu;
MyFooter? _footer;
Expand Down Expand Up @@ -38,7 +38,7 @@ class MyRoot extends UIRoot {

// Top menu.
class MyMenu extends UIComponent {
MyMenu(Element? parent) : super(parent);
MyMenu(super.parent);

// Renders a fixed top menu with sections 'home' and 'help'.
@override
Expand All @@ -61,7 +61,7 @@ class MyMenu extends UIComponent {

// Footer
class MyFooter extends UIComponent {
MyFooter(Element? parent) : super(parent);
MyFooter(super.parent);

// Renders a fixed top menu with sections 'home' and 'help'.
@override
Expand Down Expand Up @@ -99,7 +99,7 @@ class MyNavigable extends UINavigableComponent {

// The `home` route.
class MyHome extends UIComponent {
MyHome(Element? parent) : super(parent);
MyHome(super.parent);

@override
dynamic render() {
Expand All @@ -120,7 +120,7 @@ class MyHome extends UIComponent {

// The `help` route.
class MyHelp extends UIComponent {
MyHelp(Element? parent) : super(parent);
MyHelp(super.parent);

@override
dynamic render() {
Expand Down Expand Up @@ -151,7 +151,7 @@ class MyHelp extends UIComponent {

// The `components` route.
class MyComponents extends UIComponent {
MyComponents(Element? parent) : super(parent);
MyComponents(super.parent);

@override
dynamic render() {
Expand Down
15 changes: 5 additions & 10 deletions lib/src/bones_ui_content.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ abstract class UIContent extends UIComponent {
/// Optional top margin (in px) for the content.
int topMargin;

UIContent(Element? parent,
UIContent(super.parent,
{this.topMargin = 0,
dynamic classes,
dynamic classes2,
bool inline = true,
bool renderOnConstruction = false})
: super(parent,
classes: classes,
classes2: classes2,
inline: inline,
renderOnConstruction: renderOnConstruction);
super.classes,
super.classes2,
super.inline,
super.renderOnConstruction});

@override
List render() {
Expand Down
7 changes: 3 additions & 4 deletions lib/src/bones_ui_explorer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,13 @@ class _UIExplorerCatalog extends UIComponent {
final MapProperties _documentListing;

_UIExplorerCatalog(
Element? parent,
super.parent,
this.documentInputConfig,
this._documentViewer,
this._documentPreview,
this._documentStorage,
this._documentListing,
{dynamic classes})
: super(parent, classes: classes, renderOnConstruction: false);
this._documentListing)
: super(renderOnConstruction: false);

@override
dynamic render() {
Expand Down
51 changes: 18 additions & 33 deletions lib/src/bones_ui_navigator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -700,29 +700,21 @@ abstract class UINavigableComponent extends UIComponent {

Map<String, String>? _currentRouteParameters;

UINavigableComponent(Element? parent, Iterable<String> routes,
UINavigableComponent(super.parent, Iterable<String> routes,
{dynamic componentClass,
dynamic componentStyle,
dynamic classes,
dynamic classes2,
dynamic style,
dynamic style2,
dynamic id,
bool inline = true,
super.classes,
super.classes2,
super.style,
super.style2,
super.id,
super.inline,
bool renderOnConstruction = false})
: _routes = routes.toList(),
super(parent,
componentClass: [
UINavigableComponent.componentClass,
componentClass
],
classes: classes,
classes2: classes2,
style: style,
style2: style2,
id: id,
inline: inline,
renderOnConstruction: renderOnConstruction) {
super(componentClass: [
UINavigableComponent.componentClass,
componentClass
], renderOnConstruction: renderOnConstruction) {
_normalizeRoutes();

if (findRoutes!) updateRoutes();
Expand Down Expand Up @@ -938,21 +930,14 @@ abstract class UINavigableContent extends UINavigableComponent {
/// Optional top margin (in px) for the content.
int topMargin;

UINavigableContent(Element? parent, List<String> routes,
UINavigableContent(super.parent, List<String> super.routes,
{this.topMargin = 0,
dynamic classes,
dynamic classes2,
dynamic style,
dynamic style2,
bool inline = true,
bool renderOnConstruction = false})
: super(parent, routes,
classes: classes,
classes2: classes2,
style: style,
style2: style2,
inline: inline,
renderOnConstruction: renderOnConstruction);
super.classes,
super.classes2,
super.style,
super.style2,
super.inline,
super.renderOnConstruction});

@override
dynamic render() {
Expand Down
9 changes: 4 additions & 5 deletions lib/src/bones_ui_root.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,18 @@ abstract class UIRoot extends UIComponent {

final String? name;

UIRoot(Element? rootContainer,
UIRoot(super.rootContainer,
{this.name,
dynamic style,
dynamic classes,
UIComponentClearParent clearParent =
UIComponentClearParent super.clearParent =
UIComponentClearParent.onInitialRender,
this.readyTimeout = const Duration(seconds: 15)})
: super(rootContainer,
: super(
style: style,
classes: classes,
componentClass: 'ui-root',
construct: false,
clearParent: clearParent) {
construct: false) {
_initializeAll();

final componentInternals = this.componentInternals;
Expand Down
7 changes: 3 additions & 4 deletions lib/src/component/bui.dart
Original file line number Diff line number Diff line change
Expand Up @@ -630,13 +630,12 @@ class BUIViewProvider extends BUIViewProviderBase {
final Map<String, BUIView> footers = {};
final Map<String?, BUIView> views = {};

BUIViewProvider(String? name,
{DataAssets? dataAssets,
BUIViewProvider(super.name,
{super.dataAssets,
this.navbar,
Iterable<BUIView>? headers,
Iterable<BUIView>? footers,
Iterable<BUIView>? views})
: super(name, dataAssets: dataAssets) {
Iterable<BUIView>? views}) {
this.headers.addAll(BUIView.toViewsMap(headers));
this.footers.addAll(BUIView.toViewsMap(footers));
this.views.addAll(BUIView.toViewsMap(views));
Expand Down
81 changes: 29 additions & 52 deletions lib/src/component/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,18 @@ import 'loading.dart';
abstract class UIButtonBase extends UIComponent {
static final eventClick = 'CLICK';

UIButtonBase(Element? parent,
UIButtonBase(super.parent,
{String? navigate,
Map<String, String>? navigateParameters,
ParametersProvider? navigateParametersProvider,
dynamic classes,
dynamic classes2,
super.classes,
super.classes2,
dynamic componentClass,
dynamic style,
dynamic style2,
dynamic componentStyle,
UIComponentGenerator? generator})
: super(parent,
classes: classes,
classes2: classes2,
componentClass: ['ui-button', componentClass],
style: style,
style2: style2,
componentStyle: componentStyle,
generator: generator) {
super.style,
super.style2,
super.componentStyle,
super.generator})
: super(componentClass: ['ui-button', componentClass]) {
registerClickListener(onClickEvent);

if (navigate != null) {
Expand Down Expand Up @@ -195,32 +188,23 @@ class UIButton extends UIButtonBase {
/// Font size of the button.
String? _fontSize;

UIButton(Element? parent, Object? buttonContent,
{String? navigate,
Map<String, String>? navigateParameters,
ParametersProvider? navigateParametersProvider,
dynamic classes,
dynamic classes2,
UIButton(super.parent, Object? buttonContent,
{super.navigate,
super.navigateParameters,
super.navigateParametersProvider,
super.classes,
super.classes2,
dynamic componentClass,
dynamic style,
dynamic style2,
super.style,
super.style2,
bool small = false,
String? fontSize})
: _buttonContent = buttonContent,
_fontSize = fontSize,
super(parent,
navigate: navigate,
navigateParameters: navigateParameters,
navigateParametersProvider: navigateParametersProvider,
classes: classes,
classes2: classes2,
componentClass: [
small ? 'ui-button-small' : 'ui-button',
componentClass
],
style: style,
style2: style2,
generator: generator);
super(componentClass: [
small ? 'ui-button-small' : 'ui-button',
componentClass
], generator: generator);

/// The [buttonContent] as text.
String? get text => resolveToText(_buttonContent);
Expand Down Expand Up @@ -381,7 +365,7 @@ class UIButtonLoader extends UIButtonBase {
final bool withProgress;

UIButtonLoader(
Element? parent,
super.parent,
Object? buttonContent, {
this.loadingConfig,
dynamic loadedTextOK,
Expand All @@ -390,15 +374,15 @@ class UIButtonLoader extends UIButtonBase {
dynamic loadedTextClass,
dynamic loadedTextErrorStyle,
dynamic loadedTextErrorClass,
String? navigate,
Map<String, String>? navigateParameters,
ParametersProvider? navigateParametersProvider,
dynamic classes,
dynamic classes2,
super.navigate,
super.navigateParameters,
super.navigateParametersProvider,
super.classes,
super.classes2,
dynamic componentClass,
dynamic buttonClasses,
dynamic style,
dynamic style2,
super.style,
super.style2,
dynamic buttonStyle,
bool? withProgress,
}) : _loadedTextOK = TextProvider.from(loadedTextOK),
Expand All @@ -411,15 +395,8 @@ class UIButtonLoader extends UIButtonBase {
_buttonStyle = TextProvider.from(buttonStyle),
withProgress = withProgress ?? false,
_buttonContent = buttonContent,
super(parent,
navigate: navigate,
navigateParameters: navigateParameters,
navigateParametersProvider: navigateParametersProvider,
classes: classes,
classes2: classes2,
super(
componentClass: ['ui-button-loader', componentClass],
style: style,
style2: style2,
generator: generator);

/// The [buttonContent] as text.
Expand Down
10 changes: 4 additions & 6 deletions lib/src/component/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class UICalendarPopup extends UIComponent
late final UICalendar _calendar;
late final UIButton _button;

UICalendarPopup(Element? parent,
UICalendarPopup(super.parent,
{String? buttonText,
String? fieldName,
DateTime? currentDate,
Expand All @@ -73,8 +73,7 @@ class UICalendarPopup extends UIComponent
double backgroundAlpha = 0.80,
int? backgroundBlur})
: fieldName = fieldName ?? 'calendar',
_buttonText = buttonText,
super(parent) {
_buttonText = buttonText {
_calendar = UICalendar(
null,
fieldName: fieldName,
Expand Down Expand Up @@ -178,7 +177,7 @@ class UICalendar extends UIComponent implements UIField<List<CalendarEvent>> {

Set<CalendarMode> _allowedModes;

UICalendar(Element? parent,
UICalendar(super.parent,
{String? fieldName,
List<CalendarEvent>? events,
CalendarMode mode = CalendarMode.week,
Expand All @@ -192,8 +191,7 @@ class UICalendar extends UIComponent implements UIField<List<CalendarEvent>> {
timeInterval = timeInterval ?? 60,
_currentDate = currentDate ?? today(),
firstDayOfWeek = firstDayOfWeek ?? _getFirstDayOfWeek(),
_allowedModes = (allowedModes ?? CalendarMode.values).toSet(),
super(parent);
_allowedModes = (allowedModes ?? CalendarMode.values).toSet();

Set<CalendarMode> get allowedModes =>
UnmodifiableSetView<CalendarMode>(_allowedModes);
Expand Down
Loading

0 comments on commit 8c7b1a6

Please sign in to comment.