diff --git a/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart b/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart index 71b293e..3f33d03 100644 --- a/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart +++ b/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart @@ -1,9 +1,10 @@ import 'package:flutter/material.dart'; import 'package:lightmeter/data/models/exposure_pair.dart'; +import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; -import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/components/empty_exposure_pairs_list/widget_list_exposure_pairs_empty.dart'; import 'package:lightmeter/screens/metering/components/shared/exposure_pairs_list/components/exposure_pairs_list_item/widget_item_list_exposure_pairs.dart'; +import 'package:lightmeter/screens/shared/icon_placeholder/widget_icon_placeholder.dart'; class ExposurePairsList extends StatelessWidget { final List exposurePairs; @@ -15,7 +16,10 @@ class ExposurePairsList extends StatelessWidget { return AnimatedSwitcher( duration: Dimens.switchDuration, child: exposurePairs.isEmpty - ? const EmptyExposurePairsList() + ? IconPlaceholder( + icon: Icons.not_interested, + text: S.of(context).noExposurePairs, + ) : Stack( alignment: Alignment.center, children: [ diff --git a/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart b/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart index 6faf82d..0168608 100644 --- a/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart +++ b/lib/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/screen_equipment_profile.dart @@ -4,6 +4,7 @@ import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; import 'package:lightmeter/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_container/widget_container_equipment_profile.dart'; import 'package:lightmeter/screens/settings/components/metering/components/equipment_profiles/components/equipment_profile_screen/components/equipment_profile_name_dialog/widget_dialog_equipment_profile_name.dart'; +import 'package:lightmeter/screens/shared/icon_placeholder/widget_icon_placeholder.dart'; import 'package:lightmeter/screens/shared/sliver_screen/screen_sliver.dart'; import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart'; import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart'; @@ -116,30 +117,18 @@ class _EquipmentProfilesListPlaceholder extends StatelessWidget { @override Widget build(BuildContext context) { return Padding( - padding: const EdgeInsets.only( - bottom: Dimens.sliverAppBarExpandedHeight, - ), + padding: const EdgeInsets.only(bottom: Dimens.sliverAppBarExpandedHeight), child: FractionallySizedBox( widthFactor: 1 / 1.618, child: Center( child: GestureDetector( + behavior: HitTestBehavior.translucent, onTap: onTap, - child: Opacity( - opacity: Dimens.disabledOpacity, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Icon( - Icons.add, - size: MediaQuery.sizeOf(context).width / (1.618 * 1.618), - ), - const SizedBox(height: Dimens.grid4), - Text( - 'Tap to add', - style: Theme.of(context).textTheme.headlineSmall, - textAlign: TextAlign.center, - ) - ], + child: Padding( + padding: const EdgeInsets.all(Dimens.paddingL), + child: IconPlaceholder( + icon: Icons.add, + text: S.of(context).tapToAdd, ), ), ), diff --git a/lib/screens/metering/components/shared/exposure_pairs_list/components/empty_exposure_pairs_list/widget_list_exposure_pairs_empty.dart b/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart similarity index 68% rename from lib/screens/metering/components/shared/exposure_pairs_list/components/empty_exposure_pairs_list/widget_list_exposure_pairs_empty.dart rename to lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart index ea6728f..f11128a 100644 --- a/lib/screens/metering/components/shared/exposure_pairs_list/components/empty_exposure_pairs_list/widget_list_exposure_pairs_empty.dart +++ b/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart @@ -1,24 +1,30 @@ import 'package:flutter/material.dart'; -import 'package:lightmeter/generated/l10n.dart'; import 'package:lightmeter/res/dimens.dart'; -class EmptyExposurePairsList extends StatelessWidget { - const EmptyExposurePairsList({super.key}); +class IconPlaceholder extends StatelessWidget { + final IconData icon; + final String text; + + const IconPlaceholder({ + required this.icon, + required this.text, + super.key, + }); @override Widget build(BuildContext context) { return ConstrainedBox( - constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width / 2), + constraints: BoxConstraints(maxWidth: MediaQuery.sizeOf(context).width / 2), child: Column( mainAxisSize: MainAxisSize.min, children: [ Icon( - Icons.not_interested, + icon, color: Theme.of(context).colorScheme.onBackground, ), const SizedBox(height: Dimens.grid8), Text( - S.of(context).noExposurePairs, + text, style: Theme.of(context) .textTheme .bodyMedium