Skip to content

Commit

Permalink
62: Add placeholder icon and fix icon size
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenkleinle committed Feb 6, 2025
1 parent 9e104ab commit de5a22a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
3 changes: 3 additions & 0 deletions assets/icons/sunflower.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions lib/features/settings/widgets/settings_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,13 @@ class SettingsCard extends StatelessWidget {
style: theme.textTheme.titleSmall?.apply(color: isEnabled ? ThemeColors.text : ThemeColors.textDisabled),
),
subtitle: Text(subtitle, style: TextStyle(color: isEnabled ? ThemeColors.text : ThemeColors.textDisabled)),
leading: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: icon,
leading: SizedBox(
height: 48,
width: 48,
child: ClipRRect(
borderRadius: BorderRadius.circular(8.0),
child: icon,
),
),
trailing: onPress != null
? Padding(
Expand Down
6 changes: 5 additions & 1 deletion lib/features/tools/widgets/tools_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gruene_app/app/constants/config.dart';
import 'package:gruene_app/app/utils/open_url.dart';
import 'package:gruene_app/app/widgets/icon.dart';
import 'package:gruene_app/features/settings/widgets/settings_card.dart';
import 'package:gruene_app/swagger_generated_code/gruene_api.swagger.dart';

Expand All @@ -12,6 +13,7 @@ class ToolsList extends StatelessWidget {

@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
return ListView(
padding: const EdgeInsets.all(16),
children: tools.map(
Expand All @@ -23,7 +25,9 @@ class ToolsList extends StatelessWidget {
subtitle: tool.shortDescription[Config.defaultLocale] as String? ?? '',
onPress: url != null ? () => openUrl(url, context) : null,
isExternal: true,
icon: icon != null ? SvgPicture.string(icon, width: 48, height: 48) : SizedBox(width: 48, height: 48),
icon: icon == null
? CustomIcon(path: 'assets/icons/sunflower.svg', color: theme.colorScheme.primary)
: SvgPicture.string(icon, colorFilter: ColorFilter.mode(theme.colorScheme.primary, BlendMode.srcIn)),
);
},
).toList(),
Expand Down

0 comments on commit de5a22a

Please sign in to comment.