Skip to content

Commit

Permalink
Merge pull request #4 from musiolmarco/Release/3.1.0
Browse files Browse the repository at this point in the history
Release/3.1.0
  • Loading branch information
musiolmarco authored Feb 13, 2024
2 parents fa83631 + f8461a9 commit 85e0e65
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/error_text_widget_example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ packages:
path: "../.."
relative: true
source: path
version: "3.0.0"
version: "3.0.2"
fake_async:
dependency: transitive
description:
Expand Down
20 changes: 18 additions & 2 deletions lib/error_text_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ class ErrorTextWidget extends StatelessWidget {
/// [TextOverflow] for the title text widget
final TextOverflow? titleTextOverflow;

/// [Color] that will overwrite the title [TextStyle] color
final Color? titleColor;

/// [Color] that will overwrite the description [TextStyle] color
final Color? descriptionColor;

const ErrorTextWidget({
super.key,
this.titleText,
Expand All @@ -70,6 +76,8 @@ class ErrorTextWidget extends StatelessWidget {
this.onRefreshIcon,
this.titleTextOverflow,
this.descriptionTextOverflow,
this.descriptionColor,
this.titleColor,
});

/// This method can be used to setup default values for the widget
Expand Down Expand Up @@ -115,7 +123,12 @@ class ErrorTextWidget extends StatelessWidget {
Flexible(
child: Text(
titleText ?? _defaultTitleText,
style: titleTextStyle ?? _defaultTitleTextStyle,
style: titleTextStyle?.copyWith(
color: titleColor,
) ??
_defaultTitleTextStyle.copyWith(
color: titleColor,
),
textAlign: TextAlign.center,
overflow: _defaultTitleTextOverflow ?? titleTextOverflow,
),
Expand All @@ -127,7 +140,10 @@ class ErrorTextWidget extends StatelessWidget {
child: Text(
descriptionText ?? _defaultDescriptionText,
textAlign: TextAlign.center,
style: descriptionTextStyle ?? _defaultDescriptionTextStyle,
style: descriptionTextStyle?.copyWith(color: descriptionColor) ??
_defaultDescriptionTextStyle?.copyWith(
color: descriptionColor,
),
overflow:
_defaultDescriptionTextOverflow ?? descriptionTextOverflow,
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: error_text_widget
description: Displaying errors easy in Flutter
version: 3.0.1
version: 3.0.2
homepage: https://github.com/musiolmarco/error_text_widget

environment:
Expand Down

0 comments on commit 85e0e65

Please sign in to comment.