Skip to content

Commit

Permalink
Fix pr issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kawaijoe committed Jun 30, 2024
1 parent 782203c commit 7d6ba70
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
7 changes: 4 additions & 3 deletions forui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
## 0.2.0

* Add `NestedHeader` widget.
* Add `Header.nested` widget.

### Breaking changes

* `FHeaderActionStyle.action` parameter has been renamed to `FHeaderStyle.actionStyle`.
* `FHeaderActionStyle.padding` parameter has been moved to `FHeaderStyle.actionSpacing`.
* `FHeaderStyle` have been nested in `FHeaderStyles.rootStyle`.
* `FHeaderActionStyle.action` parameter has been renamed to `FRootHeaderStyle.actionStyle`.
* `FHeaderActionStyle.padding` parameter has been moved to `FRootHeaderStyle.actionSpacing`.

## 0.1.0

Expand Down
7 changes: 3 additions & 4 deletions forui/lib/src/theme/theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ final class FThemeData with Diagnosticable {
final FDialogStyle dialogStyle;

/// The header styles.
final FHeaderStyle headerStyle;
final FHeaderStyles headerStyle;

/// The tabs styles.
final FTabsStyle tabsStyle;
Expand Down Expand Up @@ -93,7 +93,7 @@ final class FThemeData with Diagnosticable {
buttonStyles: FButtonStyles.inherit(colorScheme: colorScheme, typography: typography, style: style),
cardStyle: FCardStyle.inherit(colorScheme: colorScheme, typography: typography, style: style),
dialogStyle: FDialogStyle.inherit(colorScheme: colorScheme, typography: typography, style: style),
headerStyle: FHeaderStyle.inherit(colorScheme: colorScheme, typography: typography, style: style),
headerStyle: FHeaderStyles.inherit(colorScheme: colorScheme, typography: typography, style: style),
tabsStyle: FTabsStyle.inherit(colorScheme: colorScheme, typography: typography, style: style),
textFieldStyle: FTextFieldStyle.inherit(colorScheme: colorScheme, typography: typography, style: style),
scaffoldStyle: FScaffoldStyle.inherit(colorScheme: colorScheme, style: style),
Expand Down Expand Up @@ -127,8 +127,7 @@ final class FThemeData with Diagnosticable {
FButtonStyles? buttonStyles,
FCardStyle? cardStyle,
FDialogStyle? dialogStyle,
FHeaderStyle? headerStyle,
FNestedHeaderStyle? nestedHeaderStyle,
FHeaderStyles? headerStyle,
FTabsStyle? tabsStyle,
FTextFieldStyle? textFieldStyle,
FScaffoldStyle? scaffoldStyle,
Expand Down
21 changes: 10 additions & 11 deletions forui/lib/src/widgets/header/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ part 'nested_header.dart';
/// A header.
///
/// A header contains the page's title and actions.
///
/// See:
/// * https://forui.dev/docs/header for working examples.
/// * [FHeaderStyle] for customizing a header's appearance.
/// * [FHeaderStyles] and [FNestedHeaderStyle] for customizing a header's appearance.
sealed class FHeader extends StatelessWidget {
const FHeader._({super.key});

Expand All @@ -46,28 +45,28 @@ sealed class FHeader extends StatelessWidget {
}

/// [FHeader]'s style.
final class FHeaderStyle with Diagnosticable {
final class FHeaderStyles with Diagnosticable {
/// The root header style.
final FRootHeaderStyle rootStyle;

/// The nested header style.
final FNestedHeaderStyle nestedStyle;

/// Creates a [FHeaderStyle].
const FHeaderStyle({
/// Creates a [FHeaderStyles].
const FHeaderStyles({
required this.rootStyle,
required this.nestedStyle,
});

/// Creates a [FRootHeaderStyle] that inherits its properties from the given [FColorScheme], [FTypography] and [FStyle].
FHeaderStyle.inherit({
/// Creates a [FHeaderStyles] that inherits its properties from the given [FColorScheme], [FTypography] and [FStyle].
FHeaderStyles.inherit({
required FColorScheme colorScheme,
required FTypography typography,
required FStyle style,
}) : rootStyle = FRootHeaderStyle.inherit(colorScheme: colorScheme, typography: typography, style: style),
nestedStyle = FNestedHeaderStyle.inherit(colorScheme: colorScheme, typography: typography, style: style);

/// Returns a copy of this [FHeaderStyle] with the given properties replaced.
/// Returns a copy of this [FHeaderStyles] with the given properties replaced.
///
/// ```dart
/// final style = FHeaderStyle(
Expand All @@ -82,11 +81,11 @@ final class FHeaderStyle with Diagnosticable {
/// print(style.rootStyle == copy.rootStyle); // true
/// print(style.nestedStyle == copy.nestedStyle); // false
/// ```
FHeaderStyle copyWith({
FHeaderStyles copyWith({
FRootHeaderStyle? rootStyle,
FNestedHeaderStyle? nestedStyle,
}) =>
FHeaderStyle(
FHeaderStyles(
rootStyle: rootStyle ?? this.rootStyle,
nestedStyle: nestedStyle ?? this.nestedStyle,
);
Expand All @@ -102,7 +101,7 @@ final class FHeaderStyle with Diagnosticable {
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is FHeaderStyle &&
other is FHeaderStyles &&
runtimeType == other.runtimeType &&
rootStyle == other.rootStyle &&
nestedStyle == other.nestedStyle;
Expand Down
2 changes: 1 addition & 1 deletion forui/lib/src/widgets/header/nested_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class _FNestedHeader extends FHeader {
}
}

/// [_FNestedHeader]'s style.
/// [FHeader.nested]'s style.
final class FNestedHeaderStyle with Diagnosticable {
/// The title's [TextStyle].
final TextStyle titleTextStyle;
Expand Down
4 changes: 2 additions & 2 deletions forui/lib/src/widgets/header/root_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ part of 'header.dart';
/// * https://forui.dev/docs/header for working examples.
/// * [FRootHeaderStyle] for customizing a header's appearance.
final class _FRootHeader extends FHeader {
/// The header's style. Defaults to [FThemeData.headerStyle].
/// The header's style. Defaults to [FThemeData.headerStyle.rootStyle].
final FRootHeaderStyle? style;

/// The title, aligned to the left.
Expand Down Expand Up @@ -66,7 +66,7 @@ final class _FRootHeader extends FHeader {
}
}

/// [_FRootHeader]'s style.
/// [FHeader.new]'s style.
final class FRootHeaderStyle with Diagnosticable {
/// The title's [TextStyle].
final TextStyle titleTextStyle;
Expand Down

0 comments on commit 7d6ba70

Please sign in to comment.