chore: bump line length to 120 (#20191)
This commit is contained in:
@@ -24,10 +24,7 @@ class CameraInfo extends StatelessWidget {
|
||||
"${exifInfo.make} ${exifInfo.model}",
|
||||
style: context.textTheme.labelLarge,
|
||||
),
|
||||
subtitle: exifInfo.f != null ||
|
||||
exifInfo.exposureSeconds != null ||
|
||||
exifInfo.mm != null ||
|
||||
exifInfo.iso != null
|
||||
subtitle: exifInfo.f != null || exifInfo.exposureSeconds != null || exifInfo.mm != null || exifInfo.iso != null
|
||||
? Text(
|
||||
"ƒ/${exifInfo.fNumber} ${exifInfo.exposureTime} ${exifInfo.focalLength} mm ISO ${exifInfo.iso ?? ''} ",
|
||||
style: context.textTheme.bodySmall,
|
||||
|
||||
@@ -24,9 +24,7 @@ class DetailPanel extends HookConsumerWidget {
|
||||
child: Column(
|
||||
children: [
|
||||
AssetDateTime(asset: asset),
|
||||
asset.isRemote
|
||||
? DescriptionInput(asset: asset)
|
||||
: const SizedBox.shrink(),
|
||||
asset.isRemote ? DescriptionInput(asset: asset) : const SizedBox.shrink(),
|
||||
PeopleInfo(asset: asset),
|
||||
AssetLocation(asset: asset),
|
||||
AssetDetails(asset: asset),
|
||||
|
||||
@@ -17,11 +17,8 @@ class FileInfo extends StatelessWidget {
|
||||
|
||||
final height = asset.orientatedHeight ?? asset.height;
|
||||
final width = asset.orientatedWidth ?? asset.width;
|
||||
String resolution =
|
||||
height != null && width != null ? "$width x $height " : "";
|
||||
String fileSize = asset.exifInfo?.fileSize != null
|
||||
? formatBytes(asset.exifInfo!.fileSize!)
|
||||
: "";
|
||||
String resolution = height != null && width != null ? "$width x $height " : "";
|
||||
String fileSize = asset.exifInfo?.fileSize != null ? formatBytes(asset.exifInfo!.fileSize!) : "";
|
||||
String text = resolution + fileSize;
|
||||
final imgSizeString = text.isNotEmpty ? text : null;
|
||||
|
||||
|
||||
@@ -18,12 +18,8 @@ class PeopleInfo extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final peopleProvider =
|
||||
ref.watch(assetPeopleNotifierProvider(asset).notifier);
|
||||
final people = ref
|
||||
.watch(assetPeopleNotifierProvider(asset))
|
||||
.value
|
||||
?.where((p) => !p.isHidden);
|
||||
final peopleProvider = ref.watch(assetPeopleNotifierProvider(asset).notifier);
|
||||
final people = ref.watch(assetPeopleNotifierProvider(asset)).value?.where((p) => !p.isHidden);
|
||||
|
||||
showPersonNameEditModel(
|
||||
String personId,
|
||||
@@ -46,8 +42,7 @@ class PeopleInfo extends ConsumerWidget {
|
||||
(p) => SearchCuratedContent(
|
||||
id: p.id,
|
||||
label: p.name,
|
||||
subtitle: p.birthDate != null &&
|
||||
p.birthDate!.isBefore(asset.fileCreatedAt)
|
||||
subtitle: p.birthDate != null && p.birthDate!.isBefore(asset.fileCreatedAt)
|
||||
? _formatAge(p.birthDate!, asset.fileCreatedAt)
|
||||
: null,
|
||||
),
|
||||
@@ -56,9 +51,7 @@ class PeopleInfo extends ConsumerWidget {
|
||||
[];
|
||||
|
||||
return AnimatedCrossFade(
|
||||
crossFadeState: (people?.isEmpty ?? true)
|
||||
? CrossFadeState.showFirst
|
||||
: CrossFadeState.showSecond,
|
||||
crossFadeState: (people?.isEmpty ?? true) ? CrossFadeState.showFirst : CrossFadeState.showSecond,
|
||||
duration: const Duration(milliseconds: 200),
|
||||
firstChild: Container(),
|
||||
secondChild: Padding(
|
||||
@@ -109,22 +102,18 @@ class PeopleInfo extends ConsumerWidget {
|
||||
int ageInMonths = _calculateAgeInMonths(birthDate, referenceDate);
|
||||
|
||||
if (ageInMonths <= 11) {
|
||||
return "exif_bottom_sheet_person_age_months"
|
||||
.tr(namedArgs: {'months': ageInMonths.toString()});
|
||||
return "exif_bottom_sheet_person_age_months".tr(namedArgs: {'months': ageInMonths.toString()});
|
||||
} else if (ageInMonths > 12 && ageInMonths <= 23) {
|
||||
return "exif_bottom_sheet_person_age_year_months"
|
||||
.tr(namedArgs: {'months': (ageInMonths - 12).toString()});
|
||||
return "exif_bottom_sheet_person_age_year_months".tr(namedArgs: {'months': (ageInMonths - 12).toString()});
|
||||
} else {
|
||||
return "exif_bottom_sheet_person_age_years"
|
||||
.tr(namedArgs: {'years': ageInYears.toString()});
|
||||
return "exif_bottom_sheet_person_age_years".tr(namedArgs: {'years': ageInYears.toString()});
|
||||
}
|
||||
}
|
||||
|
||||
int _calculateAge(DateTime birthDate, DateTime referenceDate) {
|
||||
int age = referenceDate.year - birthDate.year;
|
||||
if (referenceDate.month < birthDate.month ||
|
||||
(referenceDate.month == birthDate.month &&
|
||||
referenceDate.day < birthDate.day)) {
|
||||
(referenceDate.month == birthDate.month && referenceDate.day < birthDate.day)) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
|
||||
Reference in New Issue
Block a user