Skip to content

Commit

Permalink
Merge branch 'main' into feature/ui-breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
Daviiddoo committed Dec 17, 2024
2 parents 41850db + 815c785 commit c02daad
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 98 deletions.
8 changes: 5 additions & 3 deletions forui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bump minimum Flutter version to 3.27.0.

* Add `showFSheet(...)`.

* Add `showFModalSheet(...)`.
* Add `showFPersistentSheet(...)`.

* Add `FModalSheetRoute`.

Expand All @@ -30,7 +30,9 @@ Bump minimum Flutter version to 3.27.0.

* Add `FSelectMenuTile.builder`.

* Add `resizeToAvoidBottomInset` to `FScaffold(...)`.
* Add `FScaffold.resizeToAvoidBottomInset`.

* Add `FThemeData.debugLabel`.

### Changes

Expand Down Expand Up @@ -497,4 +499,4 @@ The minimum Flutter version has been increased from `3.19.0` to `3.24.0`.

## 0.1.0

* Initial release! 🚀
* Initial release! 🚀
4 changes: 4 additions & 0 deletions forui/example/macos/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}

override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}
10 changes: 5 additions & 5 deletions forui/lib/src/theme/breakpoints.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ final class FBreakpoints with Diagnosticable {
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DoubleProperty('sm', sm))
..add(DoubleProperty('md', md))
..add(DoubleProperty('lg', lg))
..add(DoubleProperty('xl', xl))
..add(DoubleProperty('xl2', xl2));
..add(DoubleProperty('sm', sm, defaultValue: 640))
..add(DoubleProperty('md', md, defaultValue: 768))
..add(DoubleProperty('lg', lg, defaultValue: 1024))
..add(DoubleProperty('xl', xl, defaultValue: 1280))
..add(DoubleProperty('xl2', xl2, defaultValue: 1536));
}
}
4 changes: 2 additions & 2 deletions forui/lib/src/theme/color_scheme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ final class FColorScheme with Diagnosticable {
..add(ColorProperty('error', error))
..add(ColorProperty('errorForeground', errorForeground))
..add(ColorProperty('border', border))
..add(DoubleProperty('enabledHoveredOpacity', enabledHoveredOpacity))
..add(DoubleProperty('disabledOpacity', disabledOpacity));
..add(PercentProperty('enabledHoveredOpacity', enabledHoveredOpacity))
..add(PercentProperty('disabledOpacity', disabledOpacity));
}

@override
Expand Down
15 changes: 11 additions & 4 deletions forui/lib/src/theme/theme_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import 'package:meta/meta.dart';
/// [FThemeData] and widget styles provide an `inherit(...)` constructor. The constructor configures the theme data/
/// widget style using the defaults provided by the [colorScheme], [typography], and [style].
final class FThemeData with Diagnosticable {
/// A label that is used in the [toString] output. Intended to aid with identifying themes in debug output.
final String? debugLabel;

/// The responsive breakpoints.
final FBreakpoints breakpoints;

Expand Down Expand Up @@ -156,19 +159,22 @@ final class FThemeData with Diagnosticable {
required this.textFieldStyle,
required this.tooltipStyle,
required this.tileGroupStyle,
this.debugLabel,
this.breakpoints = const FBreakpoints(),
this.typography = const FTypography(),
});

/// Creates a [FThemeData] that configures the widget styles using the given properties.
factory FThemeData.inherit({
required FColorScheme colorScheme,
String? debugLabel,
FStyle? style,
FTypography? typography,
}) {
typography ??= FTypography.inherit(colorScheme: colorScheme);
style ??= FStyle.inherit(colorScheme: colorScheme, typography: typography);
return FThemeData(
debugLabel: debugLabel,
colorScheme: colorScheme,
typography: typography,
style: style,
Expand Down Expand Up @@ -327,10 +333,11 @@ final class FThemeData with Diagnosticable {
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('breakpoints', breakpoints, level: DiagnosticLevel.debug))
..add(DiagnosticsProperty('colorScheme', colorScheme, level: DiagnosticLevel.debug))
..add(DiagnosticsProperty('typography', typography, level: DiagnosticLevel.debug))
..add(DiagnosticsProperty('style', style, level: DiagnosticLevel.debug))
..add(StringProperty('debugLabel', debugLabel, showName: false))
..add(DiagnosticsProperty('breakpoints', breakpoints))
..add(DiagnosticsProperty('colorScheme', colorScheme))
..add(DiagnosticsProperty('typography', typography))
..add(DiagnosticsProperty('style', style))
..add(DiagnosticsProperty('accordionStyle', accordionStyle))
..add(DiagnosticsProperty('alertStyles', alertStyles, level: DiagnosticLevel.debug))
..add(DiagnosticsProperty('avatarStyle', avatarStyle, level: DiagnosticLevel.debug))
Expand Down
18 changes: 18 additions & 0 deletions forui/lib/src/theme/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Zinc](https://ui.shadcn.com/themes) theme.
static final zinc = (
light: FThemeData.inherit(
debugLabel: 'Zinc Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -27,6 +28,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Zinc Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -50,6 +52,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Slate](https://ui.shadcn.com/themes) theme.
static final slate = (
light: FThemeData.inherit(
debugLabel: 'Slate Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -69,6 +72,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Slate Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -92,6 +96,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Red](https://ui.shadcn.com/themes) theme.
static final red = (
light: FThemeData.inherit(
debugLabel: 'Red Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -111,6 +116,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Red Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -134,6 +140,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Rose](https://ui.shadcn.com/themes) theme.
static final rose = (
light: FThemeData.inherit(
debugLabel: 'Rose Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -153,6 +160,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Rose Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -176,6 +184,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Orange](https://ui.shadcn.com/themes) theme.
static final orange = (
light: FThemeData.inherit(
debugLabel: 'Orange Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -195,6 +204,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Orange Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -218,6 +228,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Green](https://ui.shadcn.com/themes) theme.
static final green = (
light: FThemeData.inherit(
debugLabel: 'Green Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -237,6 +248,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Green Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -260,6 +272,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Blue](https://ui.shadcn.com/themes) theme.
static final blue = (
light: FThemeData.inherit(
debugLabel: 'Blue Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -279,6 +292,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Blue Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -302,6 +316,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Yellow](https://ui.shadcn.com/themes) theme.
static final yellow = (
light: FThemeData.inherit(
debugLabel: 'Yellow Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -321,6 +336,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Yellow Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand All @@ -344,6 +360,7 @@ extension FThemes on Never {
/// The light and dark variants of the [Violet](https://ui.shadcn.com/themes) theme.
static final violet = (
light: FThemeData.inherit(
debugLabel: 'Violet Light ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.light,
barrier: Color(0x33000000),
Expand All @@ -363,6 +380,7 @@ extension FThemes on Never {
),
),
dark: FThemeData.inherit(
debugLabel: 'Violet Dark ThemeData',
colorScheme: const FColorScheme(
brightness: Brightness.dark,
barrier: Color(0x7A000000),
Expand Down
26 changes: 13 additions & 13 deletions forui/lib/src/theme/typography.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,19 @@ final class FTypography with Diagnosticable {
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties
..add(StringProperty('family', defaultFontFamily, defaultValue: 'packages/forui/Inter'))
..add(DiagnosticsProperty('xs', xs, defaultValue: 12))
..add(DiagnosticsProperty('sm', sm, defaultValue: 14))
..add(DiagnosticsProperty('base', base, defaultValue: 16))
..add(DiagnosticsProperty('lg', lg, defaultValue: 18))
..add(DiagnosticsProperty('xl', xl, defaultValue: 20))
..add(DiagnosticsProperty('xl2', xl2, defaultValue: 22))
..add(DiagnosticsProperty('xl3', xl3, defaultValue: 30))
..add(DiagnosticsProperty('xl4', xl4, defaultValue: 36))
..add(DiagnosticsProperty('xl5', xl5, defaultValue: 48))
..add(DiagnosticsProperty('xl6', xl6, defaultValue: 60))
..add(DiagnosticsProperty('xl7', xl7, defaultValue: 72))
..add(DiagnosticsProperty('xl8', xl8, defaultValue: 96));
..add(StringProperty('defaultFontFamily', defaultFontFamily, defaultValue: 'packages/forui/Inter'))
..add(DiagnosticsProperty('xs', xs))
..add(DiagnosticsProperty('sm', sm))
..add(DiagnosticsProperty('base', base))
..add(DiagnosticsProperty('lg', lg))
..add(DiagnosticsProperty('xl', xl))
..add(DiagnosticsProperty('xl2', xl2))
..add(DiagnosticsProperty('xl3', xl3))
..add(DiagnosticsProperty('xl4', xl4))
..add(DiagnosticsProperty('xl5', xl5))
..add(DiagnosticsProperty('xl6', xl6))
..add(DiagnosticsProperty('xl7', xl7))
..add(DiagnosticsProperty('xl8', xl8));
}

@override
Expand Down
4 changes: 2 additions & 2 deletions forui/lib/src/widgets/accordion/accordion_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class _Expandable extends SingleChildRenderObjectWidget {
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DoubleProperty('value', value));
properties.add(PercentProperty('value', value));
}
}

Expand Down Expand Up @@ -243,7 +243,7 @@ class _RenderExpandable extends RenderBox with RenderObjectWithChildMixin<Render
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
super.debugFillProperties(properties);
properties.add(DoubleProperty('value', value));
properties.add(PercentProperty('value', value));
}
}

Expand Down
Loading

0 comments on commit c02daad

Please sign in to comment.