mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-08-05 04:36:41 +00:00
moved date to title
This commit is contained in:
parent
137d13cfbe
commit
3cd4d32a2b
6 changed files with 44 additions and 60 deletions
|
@ -170,7 +170,6 @@
|
|||
"addEquipmentProfileTitle": "Ausrüstung hinzufügen",
|
||||
"editEquipmentProfileTitle": "Ausrüstung bearbeiten",
|
||||
"editPhotoTitle": "Foto bearbeiten",
|
||||
"date": "Datum",
|
||||
"ndFilter": "ND Filter",
|
||||
"note": "Notiz",
|
||||
"notSet": "Nicht gesetzt",
|
||||
|
|
|
@ -170,7 +170,6 @@
|
|||
"addEquipmentProfileTitle": "Add equipment",
|
||||
"editEquipmentProfileTitle": "Edit equipment",
|
||||
"editPhotoTitle": "Edit Photo",
|
||||
"date": "Date",
|
||||
"ndFilter": "ND Filter",
|
||||
"note": "Note",
|
||||
"notSet": "Not set",
|
||||
|
|
|
@ -161,7 +161,6 @@
|
|||
"addEquipmentProfileTitle": "Ajouter un profil",
|
||||
"editEquipmentProfileTitle": "Editer le profil",
|
||||
"editPhotoTitle": "Modifier la photo",
|
||||
"date": "Date",
|
||||
"ndFilter": "Filtre ND",
|
||||
"note": "Note",
|
||||
"notSet": "Non défini",
|
||||
|
|
|
@ -160,7 +160,6 @@
|
|||
"addEquipmentProfileTitle": "Добавить профиль",
|
||||
"editEquipmentProfileTitle": "Редактировать профиль",
|
||||
"editPhotoTitle": "Редактировать фото",
|
||||
"date": "Дата",
|
||||
"ndFilter": "ND фильтр",
|
||||
"note": "Заметка",
|
||||
"notSet": "Не задано",
|
||||
|
|
|
@ -158,7 +158,6 @@
|
|||
"addEquipmentProfileTitle": "添加设备",
|
||||
"editEquipmentProfileTitle": "编辑设备",
|
||||
"editPhotoTitle": "编辑照片",
|
||||
"date": "日期",
|
||||
"ndFilter": "ND 滤镜",
|
||||
"note": "备注",
|
||||
"notSet": "未设置",
|
||||
|
|
|
@ -37,6 +37,7 @@ class _LogbookPhotoEditScreenState extends State<LogbookPhotoEditScreen> {
|
|||
builder: (context, state) => IgnorePointer(
|
||||
ignoring: state.isLoading,
|
||||
child: SliverScreen(
|
||||
title: Text(_formatDate(state.timestamp)),
|
||||
appBarActions: [
|
||||
BlocBuilder<LogbookPhotoEditBloc, LogbookPhotoEditState>(
|
||||
buildWhen: (previous, current) => previous.canSave != current.canSave,
|
||||
|
@ -60,29 +61,30 @@ class _LogbookPhotoEditScreenState extends State<LogbookPhotoEditScreen> {
|
|||
SliverToBoxAdapter(
|
||||
child: Opacity(
|
||||
opacity: state.isLoading ? Dimens.disabledOpacity : Dimens.enabledOpacity,
|
||||
child: const Column(
|
||||
children: [
|
||||
_PhotoPreviewBuilder(),
|
||||
Card(
|
||||
margin: EdgeInsets.all(Dimens.paddingM),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: Dimens.paddingM),
|
||||
child: Column(
|
||||
children: [
|
||||
_DateListTile(),
|
||||
//TODO: maybe make it edge to edge and add InterActiveViewer
|
||||
LogbookPhotoCoordinatesListTile(),
|
||||
_NoteListTile(),
|
||||
_EvListTile(),
|
||||
_IsoListTile(),
|
||||
_NdFilterListTile(),
|
||||
_AperturePickerListTile(),
|
||||
_ShutterSpeedPickerListTile(),
|
||||
],
|
||||
child: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: Dimens.paddingM),
|
||||
child: Column(
|
||||
children: [
|
||||
_PhotoPreviewBuilder(),
|
||||
SizedBox(height: Dimens.grid16),
|
||||
Card(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: Dimens.paddingM),
|
||||
child: Column(
|
||||
children: [
|
||||
LogbookPhotoCoordinatesListTile(),
|
||||
_NoteListTile(),
|
||||
_EvListTile(),
|
||||
_IsoListTile(),
|
||||
_NdFilterListTile(),
|
||||
_AperturePickerListTile(),
|
||||
_ShutterSpeedPickerListTile(),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -92,6 +94,15 @@ class _LogbookPhotoEditScreenState extends State<LogbookPhotoEditScreen> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
String _formatDate(DateTime dateTime) {
|
||||
final day = dateTime.day.toString().padLeft(2, '0');
|
||||
final month = dateTime.month.toString().padLeft(2, '0');
|
||||
final year = dateTime.year.toString();
|
||||
final hour = dateTime.hour.toString().padLeft(2, '0');
|
||||
final minute = dateTime.minute.toString().padLeft(2, '0');
|
||||
return '$day.$month.$year $hour:$minute';
|
||||
}
|
||||
}
|
||||
|
||||
class _PhotoPreviewBuilder extends StatelessWidget {
|
||||
|
@ -105,46 +116,24 @@ class _PhotoPreviewBuilder extends StatelessWidget {
|
|||
aspectRatio: PlatformConfig.cameraPreviewAspectRatio,
|
||||
child: Hero(
|
||||
tag: state.id,
|
||||
child: PlatformConfig.cameraStubImage.isNotEmpty
|
||||
? Image.asset(
|
||||
PlatformConfig.cameraStubImage,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
File(state.name),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(Dimens.borderRadiusM),
|
||||
child: PlatformConfig.cameraStubImage.isNotEmpty
|
||||
? Image.asset(
|
||||
PlatformConfig.cameraStubImage,
|
||||
fit: BoxFit.cover,
|
||||
)
|
||||
: Image.file(
|
||||
File(state.name),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DateListTile extends StatelessWidget {
|
||||
const _DateListTile();
|
||||
|
||||
String _formatDate(DateTime dateTime) {
|
||||
final day = dateTime.day.toString().padLeft(2, '0');
|
||||
final month = dateTime.month.toString().padLeft(2, '0');
|
||||
final year = dateTime.year.toString();
|
||||
final hour = dateTime.hour.toString().padLeft(2, '0');
|
||||
final minute = dateTime.minute.toString().padLeft(2, '0');
|
||||
return '$day.$month.$year $hour:$minute';
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BlocBuilder<LogbookPhotoEditBloc, LogbookPhotoEditState>(
|
||||
buildWhen: (_, __) => false,
|
||||
builder: (context, state) => ListTile(
|
||||
leading: const Icon(Icons.access_time),
|
||||
title: Text(S.of(context).date),
|
||||
trailing: Text(_formatDate(state.timestamp)),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _NoteListTile extends StatelessWidget {
|
||||
const _NoteListTile();
|
||||
|
||||
|
|
Loading…
Reference in a new issue