Skip to content

Commit

Permalink
YaruBanner: remove effectively unused copyIconAsWatermark (#428)
Browse files Browse the repository at this point in the history
I found occurrences of two `copyIconAsWatermark`. One in the example
and one in the software app. Both of them pass `watermarkIcon` so just
check if `watermarkIcon != null`. One can pass the same widget to both
proaperties should they want to "copy" it.
  • Loading branch information
jpnurmi committed Nov 29, 2022
1 parent 8088294 commit 28e5826
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion example/lib/pages/banner_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class BannerPage extends StatelessWidget {
size: 80,
color: Theme.of(context).primaryColor,
),
copyIconAsWatermark: true,
onTap: () => showAboutDialog(context: context),
surfaceTintColor: i.isEven ? Colors.pink : null,
watermarkIcon: const Icon(
Expand Down
8 changes: 2 additions & 6 deletions lib/src/utilities/yaru_banner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ class YaruBanner extends StatelessWidget {
super.key,
this.onTap,
this.surfaceTintColor,
this.copyIconAsWatermark = false,
required this.title,
required this.icon,
this.subtitle,
Expand All @@ -28,9 +27,6 @@ class YaruBanner extends StatelessWidget {
/// If null [Theme]'s background color is used.
final Color? surfaceTintColor;

/// If true the [icon] will be displayed a second time, with small opacity.
final bool copyIconAsWatermark;

/// The [Widget] used as the leading icon.
final Widget icon;

Expand Down Expand Up @@ -67,14 +63,14 @@ class YaruBanner extends StatelessWidget {
elevation: light ? 4 : 6,
mouseCursor: onTap != null ? SystemMouseCursors.click : null,
),
if (copyIconAsWatermark == true)
if (watermarkIcon != null)
Padding(
padding: const EdgeInsets.only(right: 20),
child: Align(
alignment: Alignment.centerRight,
child: Opacity(
opacity: 0.1,
child: watermarkIcon != null ? watermarkIcon! : icon,
child: watermarkIcon,
),
),
),
Expand Down

0 comments on commit 28e5826

Please sign in to comment.