Skip to content

Commit

Permalink
Refactor variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
kawaijoe committed May 7, 2024
1 parent ae2cffc commit dc51b3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion forui/lib/src/box/box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FBox extends StatelessWidget {

@override
Widget build(BuildContext context) {
final style = this.style ?? FTheme.of(context).widgetData.fBoxStyle;
final style = this.style ?? FTheme.of(context).widgetData.boxStyle;

return ColoredBox(
color: style.color,
Expand Down
9 changes: 5 additions & 4 deletions forui/lib/src/theme/widget_data.dart
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import 'package:forui/src/box/box_style.dart';

/// A class that holds the widget data.
class FWidgetData {
/// The box style.
final FBoxStyle fBoxStyle;
final FBoxStyle boxStyle;

/// Creates a [WidgetData].
FWidgetData({required this.fBoxStyle});
FWidgetData({required this.boxStyle});

/// Creates a copy of this [FWidgetData] with the given properties replaced.
FWidgetData copyWith({
FBoxStyle? fBoxStyle,
FBoxStyle? boxStyle,
}) => FWidgetData(
fBoxStyle: fBoxStyle ?? this.fBoxStyle,
boxStyle: boxStyle ?? this.boxStyle,
);
}

0 comments on commit dc51b3c

Please sign in to comment.