mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-07-04 05:00:39 +00:00
Compare commits
3 commits
88a726b1e2
...
31a429b423
Author | SHA1 | Date | |
---|---|---|---|
![]() |
31a429b423 | ||
![]() |
1804e37033 | ||
![]() |
d0674063d2 |
10 changed files with 91 additions and 38 deletions
|
@ -54,6 +54,7 @@
|
||||||
"isoValuesFilterDescription": "Select the ISO values to display. These may be your most commonly used values or those supported by your camera.",
|
"isoValuesFilterDescription": "Select the ISO values to display. These may be your most commonly used values or those supported by your camera.",
|
||||||
"equipmentProfile": "Equipment profile",
|
"equipmentProfile": "Equipment profile",
|
||||||
"equipmentProfiles": "Equipment profiles",
|
"equipmentProfiles": "Equipment profiles",
|
||||||
|
"tapToAdd": "Tap to add",
|
||||||
"general": "General",
|
"general": "General",
|
||||||
"keepScreenOn": "Keep screen on",
|
"keepScreenOn": "Keep screen on",
|
||||||
"haptics": "Haptics",
|
"haptics": "Haptics",
|
||||||
|
@ -86,4 +87,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
"film": "Pellicule",
|
"film": "Pellicule",
|
||||||
"equipment": "Équipement",
|
"equipment": "Équipement",
|
||||||
"equipmentProfileName": "Nom du profil de l'équipement",
|
"equipmentProfileName": "Nom du profil de l'équipement",
|
||||||
|
"tapToAdd": "Appuie pour ajouter",
|
||||||
"equipmentProfileNameHint": "Praktica MTL5B",
|
"equipmentProfileNameHint": "Praktica MTL5B",
|
||||||
"equipmentProfileAllValues": "Tout",
|
"equipmentProfileAllValues": "Tout",
|
||||||
"apertureValues": "Valeurs Aperture",
|
"apertureValues": "Valeurs Aperture",
|
||||||
|
@ -86,4 +87,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
"isoValuesFilterDescription": "Выберите значения ISO для отображения. Это может быть наиболее часто используемые значения или значения, поддерживаемые вашей камерой.",
|
"isoValuesFilterDescription": "Выберите значения ISO для отображения. Это может быть наиболее часто используемые значения или значения, поддерживаемые вашей камерой.",
|
||||||
"equipmentProfile": "Оборудование",
|
"equipmentProfile": "Оборудование",
|
||||||
"equipmentProfiles": "Профили оборудования",
|
"equipmentProfiles": "Профили оборудования",
|
||||||
|
"tapToAdd": "Нажмите, чтобы добавить",
|
||||||
"general": "Общие",
|
"general": "Общие",
|
||||||
"keepScreenOn": "Запрет блокировки",
|
"keepScreenOn": "Запрет блокировки",
|
||||||
"haptics": "Вибрация",
|
"haptics": "Вибрация",
|
||||||
|
@ -86,4 +87,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
"isoValuesFilterDescription": "选择要显示的 ISO。这些值可能是您最常用的值,也可能是相机支持的值。",
|
"isoValuesFilterDescription": "选择要显示的 ISO。这些值可能是您最常用的值,也可能是相机支持的值。",
|
||||||
"equipmentProfile": "设备配置",
|
"equipmentProfile": "设备配置",
|
||||||
"equipmentProfiles": "设备配置",
|
"equipmentProfiles": "设备配置",
|
||||||
|
"tapToAdd": "點擊添加",
|
||||||
"general": "通用",
|
"general": "通用",
|
||||||
"keepScreenOn": "保持屏幕常亮",
|
"keepScreenOn": "保持屏幕常亮",
|
||||||
"haptics": "震动",
|
"haptics": "震动",
|
||||||
|
|
|
@ -14,7 +14,6 @@ class Dimens {
|
||||||
static const double grid48 = 48;
|
static const double grid48 = 48;
|
||||||
static const double grid56 = 56;
|
static const double grid56 = 56;
|
||||||
static const double grid72 = 72;
|
static const double grid72 = 72;
|
||||||
static const double grid168 = 168;
|
|
||||||
|
|
||||||
static const double paddingS = 8;
|
static const double paddingS = 8;
|
||||||
static const double paddingM = 16;
|
static const double paddingM = 16;
|
||||||
|
@ -30,6 +29,8 @@ class Dimens {
|
||||||
static const double enabledOpacity = 1.0;
|
static const double enabledOpacity = 1.0;
|
||||||
static const double disabledOpacity = 0.38;
|
static const double disabledOpacity = 0.38;
|
||||||
|
|
||||||
|
static const double sliverAppBarExpandedHeight = 168;
|
||||||
|
|
||||||
// TopBar
|
// TopBar
|
||||||
static const double readingContainerDoubleValueHeight = 128;
|
static const double readingContainerDoubleValueHeight = 128;
|
||||||
static const double readingContainerSingleValueHeight = 76;
|
static const double readingContainerSingleValueHeight = 76;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/data/models/exposure_pair.dart';
|
import 'package:lightmeter/data/models/exposure_pair.dart';
|
||||||
|
import 'package:lightmeter/generated/l10n.dart';
|
||||||
import 'package:lightmeter/res/dimens.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/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 {
|
class ExposurePairsList extends StatelessWidget {
|
||||||
final List<ExposurePair> exposurePairs;
|
final List<ExposurePair> exposurePairs;
|
||||||
|
@ -15,7 +16,10 @@ class ExposurePairsList extends StatelessWidget {
|
||||||
return AnimatedSwitcher(
|
return AnimatedSwitcher(
|
||||||
duration: Dimens.switchDuration,
|
duration: Dimens.switchDuration,
|
||||||
child: exposurePairs.isEmpty
|
child: exposurePairs.isEmpty
|
||||||
? const EmptyExposurePairsList()
|
? IconPlaceholder(
|
||||||
|
icon: Icons.not_interested,
|
||||||
|
text: S.of(context).noExposurePairs,
|
||||||
|
)
|
||||||
: Stack(
|
: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -4,6 +4,7 @@ import 'package:lightmeter/generated/l10n.dart';
|
||||||
import 'package:lightmeter/res/dimens.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_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/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:lightmeter/screens/shared/sliver_screen/screen_sliver.dart';
|
||||||
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
|
@ -44,30 +45,38 @@ class _EquipmentProfilesScreenState extends State<EquipmentProfilesScreen> {
|
||||||
icon: const Icon(Icons.close),
|
icon: const Icon(Icons.close),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
slivers: [
|
slivers: profilesCount == 1
|
||||||
SliverList(
|
? [
|
||||||
delegate: SliverChildBuilderDelegate(
|
SliverFillRemaining(
|
||||||
(context, index) => index > 0
|
hasScrollBody: false,
|
||||||
? Padding(
|
child: _EquipmentProfilesListPlaceholder(onTap: _addProfile),
|
||||||
padding: EdgeInsets.fromLTRB(
|
)
|
||||||
Dimens.paddingM,
|
]
|
||||||
index == 0 ? Dimens.paddingM : 0,
|
: [
|
||||||
Dimens.paddingM,
|
SliverList(
|
||||||
Dimens.paddingM,
|
delegate: SliverChildBuilderDelegate(
|
||||||
),
|
(context, index) => index > 0 // skip default
|
||||||
child: EquipmentProfileContainer(
|
? Padding(
|
||||||
key: profileContainersKeys[index],
|
padding: EdgeInsets.fromLTRB(
|
||||||
data: EquipmentProfiles.of(context)[index],
|
Dimens.paddingM,
|
||||||
onExpand: () => _keepExpandedAt(index),
|
index == 0 ? Dimens.paddingM : 0,
|
||||||
onUpdate: (profileData) => _updateProfileAt(profileData, index),
|
Dimens.paddingM,
|
||||||
onDelete: () => _removeProfileAt(index),
|
Dimens.paddingM,
|
||||||
),
|
),
|
||||||
)
|
child: EquipmentProfileContainer(
|
||||||
: const SizedBox.shrink(),
|
key: profileContainersKeys[index],
|
||||||
childCount: profilesCount,
|
data: EquipmentProfiles.of(context)[index],
|
||||||
),
|
onExpand: () => _keepExpandedAt(index),
|
||||||
),
|
onUpdate: (profileData) => _updateProfileAt(profileData, index),
|
||||||
],
|
onDelete: () => _removeProfileAt(index),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
childCount: profilesCount,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SliverToBoxAdapter(child: SizedBox(height: MediaQuery.paddingOf(context).bottom)),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,3 +108,32 @@ class _EquipmentProfilesScreenState extends State<EquipmentProfilesScreen> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class _EquipmentProfilesListPlaceholder extends StatelessWidget {
|
||||||
|
final VoidCallback onTap;
|
||||||
|
|
||||||
|
const _EquipmentProfilesListPlaceholder({required this.onTap});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(bottom: Dimens.sliverAppBarExpandedHeight),
|
||||||
|
child: FractionallySizedBox(
|
||||||
|
widthFactor: 1 / 1.618,
|
||||||
|
child: Center(
|
||||||
|
child: GestureDetector(
|
||||||
|
behavior: HitTestBehavior.translucent,
|
||||||
|
onTap: onTap,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(Dimens.paddingL),
|
||||||
|
child: IconPlaceholder(
|
||||||
|
icon: Icons.add,
|
||||||
|
text: S.of(context).tapToAdd,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SliverToBoxAdapter(child: SizedBox(height: MediaQuery.paddingOf(context).bottom)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,24 +1,30 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:lightmeter/generated/l10n.dart';
|
|
||||||
import 'package:lightmeter/res/dimens.dart';
|
import 'package:lightmeter/res/dimens.dart';
|
||||||
|
|
||||||
class EmptyExposurePairsList extends StatelessWidget {
|
class IconPlaceholder extends StatelessWidget {
|
||||||
const EmptyExposurePairsList({super.key});
|
final IconData icon;
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
const IconPlaceholder({
|
||||||
|
required this.icon,
|
||||||
|
required this.text,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return ConstrainedBox(
|
return ConstrainedBox(
|
||||||
constraints: BoxConstraints(maxWidth: MediaQuery.of(context).size.width / 2),
|
constraints: BoxConstraints(maxWidth: MediaQuery.sizeOf(context).width / 2),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
Icons.not_interested,
|
icon,
|
||||||
color: Theme.of(context).colorScheme.onBackground,
|
color: Theme.of(context).colorScheme.onBackground,
|
||||||
),
|
),
|
||||||
const SizedBox(height: Dimens.grid8),
|
const SizedBox(height: Dimens.grid8),
|
||||||
Text(
|
Text(
|
||||||
S.of(context).noExposurePairs,
|
text,
|
||||||
style: Theme.of(context)
|
style: Theme.of(context)
|
||||||
.textTheme
|
.textTheme
|
||||||
.bodyMedium
|
.bodyMedium
|
|
@ -24,7 +24,7 @@ class SliverScreen extends StatelessWidget {
|
||||||
SliverAppBar(
|
SliverAppBar(
|
||||||
pinned: true,
|
pinned: true,
|
||||||
automaticallyImplyLeading: false,
|
automaticallyImplyLeading: false,
|
||||||
expandedHeight: Dimens.grid168,
|
expandedHeight: Dimens.sliverAppBarExpandedHeight,
|
||||||
flexibleSpace: FlexibleSpaceBar(
|
flexibleSpace: FlexibleSpaceBar(
|
||||||
centerTitle: false,
|
centerTitle: false,
|
||||||
titlePadding: const EdgeInsets.all(Dimens.paddingM),
|
titlePadding: const EdgeInsets.all(Dimens.paddingM),
|
||||||
|
@ -39,7 +39,6 @@ class SliverScreen extends StatelessWidget {
|
||||||
actions: appBarActions,
|
actions: appBarActions,
|
||||||
),
|
),
|
||||||
...slivers,
|
...slivers,
|
||||||
SliverToBoxAdapter(child: SizedBox(height: MediaQuery.of(context).padding.bottom)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in a new issue