Skip to content

Commit

Permalink
toast
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Nov 15, 2024
1 parent 3faac27 commit 9ac5e5a
Show file tree
Hide file tree
Showing 22 changed files with 293 additions and 275 deletions.
7 changes: 3 additions & 4 deletions packages/remix/demo/lib/components/badge_use_case.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'package:demo/helpers/knob_builder.dart';
import 'package:flutter/widgets.dart';
import 'package:remix/remix.dart';
import 'package:widgetbook/widgetbook.dart';
Expand All @@ -12,13 +11,13 @@ Widget buildAvatarUseCase(BuildContext context) {
return Scaffold(
body: Center(
child: Badge(
variants: [
context.knobs.variant(FortalezaBadgeStyle.variants),
],
label: context.knobs.string(
label: 'Label',
initialValue: 'New',
),
variants: const [
// context.knobs.variant(FortalezaBadgeStyle.variants),
],
),
),
);
Expand Down
17 changes: 3 additions & 14 deletions packages/remix/lib/src/components/button/button_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,10 @@ class Button extends StatelessWidget {
/// The text content displayed in the center of the button.
final String label;

/// {@template remix.component.disabled}
/// When disabled, the component will not respond to user interaction and will
/// appear visually distinct to indicate its disabled state.
/// {@endtemplate}
/// {@macro remix.component.disabled}
final bool disabled;

/// {@template remix.component.loading}
/// When loading, the component will display a spinner and disable user
/// interaction. The component's content will be hidden but maintain its
/// space to prevent layout shifts.
/// {@endtemplate}
/// {@macro remix.component.loading}
final bool loading;

/// The icon displayed in the left side of the button.
Expand All @@ -36,11 +29,7 @@ class Button extends StatelessWidget {
/// The icon displayed in the right side of the button.
final IconData? iconRight;

/// {@template remix.component.onPressed}
/// Called when the component is tapped.
/// If null or if [disabled] is true, the component will be disabled and won't
/// respond to touch.
/// {@endtemplate}
/// {@macro remix.component.onPressed}
final VoidCallback? onPressed;

/// A builder that returns a [Widget] for the button's spinner.
Expand Down
6 changes: 1 addition & 5 deletions packages/remix/lib/src/components/chip/chip_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ class Chip extends StatefulWidget {
/// The icon displayed in the right side of the component.
final IconData? iconRight;

/// {@template remix.component.onChanged}
/// Called when the component is tapped.
/// If null or if [disabled] is true, the component will be disabled and won't
/// respond to touch.
/// {@endtemplate}
/// {@macro remix.component.onChanged}
final void Function(bool)? onChanged;

/// {@macro remix.component.disabled}
Expand Down
6 changes: 3 additions & 3 deletions packages/remix/lib/src/components/menu_item/menu_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ part 'menu_item_widget.dart';
class MenuItemSpec extends Spec<MenuItemSpec>
with _$MenuItemSpec, Diagnosticable {
final FlexBoxSpec container;
final FlexSpec titleSubtitleContainer;
final FlexBoxSpec titleSubtitleContainer;
final IconSpec icon;
final TextSpec title;
final TextSpec subtitle;
Expand All @@ -28,14 +28,14 @@ class MenuItemSpec extends Spec<MenuItemSpec>

const MenuItemSpec({
FlexBoxSpec? container,
FlexSpec? titleSubtitleContainer,
FlexBoxSpec? titleSubtitleContainer,
IconSpec? icon,
TextSpec? title,
TextSpec? subtitle,
super.modifiers,
super.animated,
}) : container = container ?? const FlexBoxSpec(),
titleSubtitleContainer = titleSubtitleContainer ?? const FlexSpec(),
titleSubtitleContainer = titleSubtitleContainer ?? const FlexBoxSpec(),
icon = icon ?? const IconSpec(),
title = title ?? const TextSpec(),
subtitle = subtitle ?? const TextSpec();
Expand Down
11 changes: 5 additions & 6 deletions packages/remix/lib/src/components/menu_item/menu_item.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ class MenuItemStyle extends SpecStyle<MenuItemSpecUtility> {
final $ = spec.utilities;

final titleSubtitleContainer = $.titleSubtitleContainer.chain
..mainAxisAlignment.start()
..crossAxisAlignment.start()
..mainAxisSize.min()
..flex.mainAxisAlignment.start()
..flex.crossAxisAlignment.start()
..flex.mainAxisSize.min()
..wrap.expanded()
..gap(4.0);
..flex.gap(4.0);

final title = $.title.style.fontSize(14.0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class FortalezaMenuItemStyle extends MenuItemStyle {
final $ = spec.utilities;

final baseStyle = super.makeStyle(spec);
final titleSubtitleLayout = $.titleSubtitleContainer.chain..gap.$space(1);
final titleSubtitleLayout = $.titleSubtitleContainer.flex.gap.$space(1);

final title = $.title.chain
..style.$text(2)
Expand Down
12 changes: 6 additions & 6 deletions packages/remix/lib/src/components/textfield/textfield.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class TextFieldSpec extends Spec<TextFieldSpec>
final Brightness keyboardAppearance;
final Color? autocorrectionTextRectColor;

final FlexBoxSpec flexContainer;
final FlexSpec mainFlex;
final FlexBoxSpec textFieldContainer;
final FlexBoxSpec container;
final TextStyle? hintTextStyle;
final TextSpec helperText;
final IconSpec icon;
Expand Down Expand Up @@ -89,8 +89,8 @@ class TextFieldSpec extends Spec<TextFieldSpec>
Brightness? keyboardAppearance,
this.autocorrectionTextRectColor,
bool? cursorOpacityAnimates,
FlexBoxSpec? flexContainer,
FlexSpec? mainFlex,
FlexBoxSpec? textFieldContainer,
FlexBoxSpec? container,
this.hintTextStyle,
TextSpec? helperText,
IconSpec? icon,
Expand All @@ -114,9 +114,9 @@ class TextFieldSpec extends Spec<TextFieldSpec>
scrollPadding = scrollPadding ?? const EdgeInsets.all(20.0),
clipBehavior = clipBehavior ?? Clip.hardEdge,
keyboardAppearance = keyboardAppearance ?? Brightness.light,
flexContainer = flexContainer ?? const FlexBoxSpec(),
textFieldContainer = textFieldContainer ?? const FlexBoxSpec(),
helperText = helperText ?? const TextSpec(),
mainFlex = mainFlex ?? const FlexSpec(),
container = container ?? const FlexBoxSpec(),
icon = icon ?? const IconSpec(),
floatingLabel = floatingLabel ?? false,
floatingLabelHeight = floatingLabelHeight ?? 14;
Expand Down
68 changes: 35 additions & 33 deletions packages/remix/lib/src/components/textfield/textfield.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9ac5e5a

Please sign in to comment.