chore: bump dart sdk to 3.8 (#20355)

* chore: bump dart sdk to 3.8

* chore: make build

* make pigeon

* chore: format files

---------

Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
shenlong
2025-07-29 00:34:03 +05:30
committed by GitHub
parent 9b3718120b
commit e52b9d15b5
643 changed files with 32561 additions and 35292 deletions

View File

@@ -41,12 +41,7 @@ class SearchPage extends HookConsumerWidget {
location: prefilter?.location ?? SearchLocationFilter(),
camera: prefilter?.camera ?? SearchCameraFilter(),
date: prefilter?.date ?? SearchDateFilter(),
display: prefilter?.display ??
SearchDisplayFilters(
isNotInAlbum: false,
isArchive: false,
isFavorite: false,
),
display: prefilter?.display ?? SearchDisplayFilters(isNotInAlbum: false, isArchive: false, isFavorite: false),
mediaType: prefilter?.mediaType ?? AssetType.other,
language: "${context.locale.languageCode}-${context.locale.countryCode}",
),
@@ -65,10 +60,7 @@ class SearchPage extends HookConsumerWidget {
SnackBar searchInfoSnackBar(String message) {
return SnackBar(
content: Text(
message,
style: context.textTheme.labelLarge,
),
content: Text(message, style: context.textTheme.labelLarge),
showCloseIcon: true,
behavior: SnackBarBehavior.fixed,
closeIconColor: context.colorScheme.onSurface,
@@ -89,9 +81,7 @@ class SearchPage extends HookConsumerWidget {
final hasResult = await ref.watch(paginatedSearchProvider.notifier).search(filter.value);
if (!hasResult) {
context.showSnackBar(
searchInfoSnackBar('search_no_result'.tr()),
);
context.showSnackBar(searchInfoSnackBar('search_no_result'.tr()));
}
previousFilter.value = filter.value;
@@ -103,9 +93,7 @@ class SearchPage extends HookConsumerWidget {
final hasResult = await ref.watch(paginatedSearchProvider.notifier).search(filter.value);
if (!hasResult) {
context.showSnackBar(
searchInfoSnackBar('search_no_more_result'.tr()),
);
context.showSnackBar(searchInfoSnackBar('search_no_more_result'.tr()));
}
isSearching.value = false;
@@ -113,39 +101,26 @@ class SearchPage extends HookConsumerWidget {
searchPrefilter() {
if (prefilter != null) {
Future.delayed(
Duration.zero,
() {
search();
Future.delayed(Duration.zero, () {
search();
if (prefilter!.location.city != null) {
locationCurrentFilterWidget.value = Text(
prefilter!.location.city!,
style: context.textTheme.labelLarge,
);
}
},
);
if (prefilter!.location.city != null) {
locationCurrentFilterWidget.value = Text(prefilter!.location.city!, style: context.textTheme.labelLarge);
}
});
}
}
useEffect(
() {
Future.microtask(
() => ref.invalidate(paginatedSearchProvider),
);
searchPrefilter();
useEffect(() {
Future.microtask(() => ref.invalidate(paginatedSearchProvider));
searchPrefilter();
return null;
},
[],
);
return null;
}, []);
showPeoplePicker() {
handleOnSelect(Set<PersonDto> value) {
filter.value = filter.value.copyWith(
people: value,
);
filter.value = filter.value.copyWith(people: value);
peopleCurrentFilterWidget.value = Text(
value.map((e) => e.name != '' ? e.name : 'no_name'.tr()).join(', '),
@@ -154,9 +129,7 @@ class SearchPage extends HookConsumerWidget {
}
handleClear() {
filter.value = filter.value.copyWith(
people: {},
);
filter.value = filter.value.copyWith(people: {});
peopleCurrentFilterWidget.value = null;
search();
@@ -172,10 +145,7 @@ class SearchPage extends HookConsumerWidget {
expanded: true,
onSearch: search,
onClear: handleClear,
child: PeoplePicker(
onSelect: handleOnSelect,
filter: filter.value.people,
),
child: PeoplePicker(onSelect: handleOnSelect, filter: filter.value.people),
),
),
);
@@ -184,11 +154,7 @@ class SearchPage extends HookConsumerWidget {
showLocationPicker() {
handleOnSelect(Map<String, String?> value) {
filter.value = filter.value.copyWith(
location: SearchLocationFilter(
country: value['country'],
city: value['city'],
state: value['state'],
),
location: SearchLocationFilter(country: value['country'], city: value['city'], state: value['state']),
);
final locationText = <String>[];
@@ -204,16 +170,11 @@ class SearchPage extends HookConsumerWidget {
locationText.add(value['city']!);
}
locationCurrentFilterWidget.value = Text(
locationText.join(', '),
style: context.textTheme.labelLarge,
);
locationCurrentFilterWidget.value = Text(locationText.join(', '), style: context.textTheme.labelLarge);
}
handleClear() {
filter.value = filter.value.copyWith(
location: SearchLocationFilter(),
);
filter.value = filter.value.copyWith(location: SearchLocationFilter());
locationCurrentFilterWidget.value = null;
search();
@@ -230,15 +191,10 @@ class SearchPage extends HookConsumerWidget {
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: Container(
padding: EdgeInsets.only(
bottom: context.viewInsets.bottom,
),
padding: EdgeInsets.only(bottom: context.viewInsets.bottom),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: LocationPicker(
onSelected: handleOnSelect,
filter: filter.value.location,
),
child: LocationPicker(onSelected: handleOnSelect, filter: filter.value.location),
),
),
),
@@ -249,10 +205,7 @@ class SearchPage extends HookConsumerWidget {
showCameraPicker() {
handleOnSelect(Map<String, String?> value) {
filter.value = filter.value.copyWith(
camera: SearchCameraFilter(
make: value['make'],
model: value['model'],
),
camera: SearchCameraFilter(make: value['make'], model: value['model']),
);
cameraCurrentFilterWidget.value = Text(
@@ -262,9 +215,7 @@ class SearchPage extends HookConsumerWidget {
}
handleClear() {
filter.value = filter.value.copyWith(
camera: SearchCameraFilter(),
);
filter.value = filter.value.copyWith(camera: SearchCameraFilter());
cameraCurrentFilterWidget.value = null;
search();
@@ -280,10 +231,7 @@ class SearchPage extends HookConsumerWidget {
onClear: handleClear,
child: Padding(
padding: const EdgeInsets.all(16.0),
child: CameraPicker(
onSelect: handleOnSelect,
filter: filter.value.camera,
),
child: CameraPicker(onSelect: handleOnSelect, filter: filter.value.camera),
),
),
);
@@ -315,9 +263,7 @@ class SearchPage extends HookConsumerWidget {
);
if (date == null) {
filter.value = filter.value.copyWith(
date: SearchDateFilter(),
);
filter.value = filter.value.copyWith(date: SearchDateFilter());
dateRangeCurrentFilterWidget.value = null;
search();
@@ -327,13 +273,7 @@ class SearchPage extends HookConsumerWidget {
filter.value = filter.value.copyWith(
date: SearchDateFilter(
takenAfter: date.start,
takenBefore: date.end.add(
const Duration(
hours: 23,
minutes: 59,
seconds: 59,
),
),
takenBefore: date.end.add(const Duration(hours: 23, minutes: 59, seconds: 59)),
),
);
@@ -361,24 +301,20 @@ class SearchPage extends HookConsumerWidget {
// MEDIA PICKER
showMediaTypePicker() {
handleOnSelected(AssetType assetType) {
filter.value = filter.value.copyWith(
mediaType: assetType,
);
filter.value = filter.value.copyWith(mediaType: assetType);
mediaTypeCurrentFilterWidget.value = Text(
assetType == AssetType.image
? 'image'.tr()
: assetType == AssetType.video
? 'video'.tr()
: 'all'.tr(),
? 'video'.tr()
: 'all'.tr(),
style: context.textTheme.labelLarge,
);
}
handleClear() {
filter.value = filter.value.copyWith(
mediaType: AssetType.other,
);
filter.value = filter.value.copyWith(mediaType: AssetType.other);
mediaTypeCurrentFilterWidget.value = null;
search();
@@ -390,10 +326,7 @@ class SearchPage extends HookConsumerWidget {
title: 'search_filter_media_type_title'.tr(),
onSearch: search,
onClear: handleClear,
child: MediaTypePicker(
onSelect: handleOnSelected,
filter: filter.value.mediaType,
),
child: MediaTypePicker(onSelect: handleOnSelected, filter: filter.value.mediaType),
),
);
}
@@ -405,31 +338,19 @@ class SearchPage extends HookConsumerWidget {
value.forEach((key, value) {
switch (key) {
case DisplayOption.notInAlbum:
filter.value = filter.value.copyWith(
display: filter.value.display.copyWith(
isNotInAlbum: value,
),
);
filter.value = filter.value.copyWith(display: filter.value.display.copyWith(isNotInAlbum: value));
if (value) {
filterText.add('search_filter_display_option_not_in_album'.tr());
}
break;
case DisplayOption.archive:
filter.value = filter.value.copyWith(
display: filter.value.display.copyWith(
isArchive: value,
),
);
filter.value = filter.value.copyWith(display: filter.value.display.copyWith(isArchive: value));
if (value) {
filterText.add('archive'.tr());
}
break;
case DisplayOption.favorite:
filter.value = filter.value.copyWith(
display: filter.value.display.copyWith(
isFavorite: value,
),
);
filter.value = filter.value.copyWith(display: filter.value.display.copyWith(isFavorite: value));
if (value) {
filterText.add('favorite'.tr());
}
@@ -442,19 +363,12 @@ class SearchPage extends HookConsumerWidget {
return;
}
displayOptionCurrentFilterWidget.value = Text(
filterText.join(', '),
style: context.textTheme.labelLarge,
);
displayOptionCurrentFilterWidget.value = Text(filterText.join(', '), style: context.textTheme.labelLarge);
}
handleClear() {
filter.value = filter.value.copyWith(
display: SearchDisplayFilters(
isNotInAlbum: false,
isArchive: false,
isFavorite: false,
),
display: SearchDisplayFilters(isNotInAlbum: false, isArchive: false, isFavorite: false),
);
displayOptionCurrentFilterWidget.value = null;
@@ -467,10 +381,7 @@ class SearchPage extends HookConsumerWidget {
title: 'display_options'.tr(),
onSearch: search,
onClear: handleClear,
child: DisplayOptionPicker(
onSelect: handleOnSelect,
filter: filter.value.display,
),
child: DisplayOptionPicker(onSelect: handleOnSelect, filter: filter.value.display),
),
);
}
@@ -478,27 +389,15 @@ class SearchPage extends HookConsumerWidget {
handleTextSubmitted(String value) {
switch (textSearchType.value) {
case TextSearchType.context:
filter.value = filter.value.copyWith(
filename: '',
context: value,
description: '',
);
filter.value = filter.value.copyWith(filename: '', context: value, description: '');
break;
case TextSearchType.filename:
filter.value = filter.value.copyWith(
filename: value,
context: '',
description: '',
);
filter.value = filter.value.copyWith(filename: value, context: '', description: '');
break;
case TextSearchType.description:
filter.value = filter.value.copyWith(
filename: '',
context: '',
description: value,
);
filter.value = filter.value.copyWith(filename: '', context: '', description: value);
break;
}
@@ -506,10 +405,10 @@ class SearchPage extends HookConsumerWidget {
}
IconData getSearchPrefixIcon() => switch (textSearchType.value) {
TextSearchType.context => Icons.image_search_rounded,
TextSearchType.filename => Icons.abc_rounded,
TextSearchType.description => Icons.text_snippet_outlined,
};
TextSearchType.context => Icons.image_search_rounded,
TextSearchType.filename => Icons.abc_rounded,
TextSearchType.description => Icons.text_snippet_outlined,
};
return Scaffold(
resizeToAvoidBottomInset: false,
@@ -522,21 +421,11 @@ class SearchPage extends HookConsumerWidget {
style: MenuStyle(
elevation: const WidgetStatePropertyAll(1),
shape: WidgetStateProperty.all(
const RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(24),
),
),
),
padding: const WidgetStatePropertyAll(
EdgeInsets.all(4),
const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(24))),
),
padding: const WidgetStatePropertyAll(EdgeInsets.all(4)),
),
builder: (
BuildContext context,
MenuController controller,
Widget? child,
) {
builder: (BuildContext context, MenuController controller, Widget? child) {
return IconButton(
onPressed: () {
if (controller.isOpen) {
@@ -610,13 +499,8 @@ class SearchPage extends HookConsumerWidget {
],
title: Container(
decoration: BoxDecoration(
border: Border.all(
color: context.colorScheme.onSurface.withAlpha(0),
width: 0,
),
borderRadius: const BorderRadius.all(
Radius.circular(24),
),
border: Border.all(color: context.colorScheme.onSurface.withAlpha(0), width: 0),
borderRadius: const BorderRadius.all(Radius.circular(24)),
gradient: LinearGradient(
colors: [
context.colorScheme.primary.withValues(alpha: 0.075),
@@ -632,12 +516,7 @@ class SearchPage extends HookConsumerWidget {
key: const Key('search_text_field'),
controller: textSearchController,
contentPadding: prefilter != null ? const EdgeInsets.only(left: 24) : const EdgeInsets.all(8),
prefixIcon: prefilter != null
? null
: Icon(
getSearchPrefixIcon(),
color: context.colorScheme.primary,
),
prefixIcon: prefilter != null ? null : Icon(getSearchPrefixIcon(), color: context.colorScheme.primary),
onSubmitted: handleTextSubmitted,
focusNode: ref.watch(searchInputFocusProvider),
),
@@ -697,14 +576,9 @@ class SearchPage extends HookConsumerWidget {
),
),
if (isSearching.value)
const Expanded(
child: Center(child: CircularProgressIndicator()),
)
const Expanded(child: Center(child: CircularProgressIndicator()))
else
SearchResultGrid(
onScrollEnd: loadMoreSearchResult,
isSearching: isSearching.value,
),
SearchResultGrid(onScrollEnd: loadMoreSearchResult, isSearching: isSearching.value),
],
),
);
@@ -715,11 +589,7 @@ class SearchResultGrid extends StatelessWidget {
final VoidCallback onScrollEnd;
final bool isSearching;
const SearchResultGrid({
super.key,
required this.onScrollEnd,
this.isSearching = false,
});
const SearchResultGrid({super.key, required this.onScrollEnd, this.isSearching = false});
@override
Widget build(BuildContext context) {
@@ -777,12 +647,7 @@ class SearchEmptyContent extends StatelessWidget {
),
),
const SizedBox(height: 16),
Center(
child: Text(
'search_page_search_photos_videos'.tr(),
style: context.textTheme.labelLarge,
),
),
Center(child: Text('search_page_search_photos_videos'.tr(), style: context.textTheme.labelLarge)),
const SizedBox(height: 32),
const QuickLinkList(),
],
@@ -798,13 +663,8 @@ class QuickLinkList extends StatelessWidget {
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(
Radius.circular(20),
),
border: Border.all(
color: context.colorScheme.outline.withAlpha(10),
width: 1,
),
borderRadius: const BorderRadius.all(Radius.circular(20)),
border: Border.all(color: context.colorScheme.outline.withAlpha(10), width: 1),
gradient: LinearGradient(
colors: [
context.colorScheme.primary.withAlpha(10),
@@ -868,19 +728,9 @@ class QuickLink extends StatelessWidget {
);
return ListTile(
shape: RoundedRectangleBorder(
borderRadius: borderRadius,
),
leading: Icon(
icon,
size: 26,
),
title: Text(
title,
style: context.textTheme.titleSmall?.copyWith(
fontWeight: FontWeight.w500,
),
),
shape: RoundedRectangleBorder(borderRadius: borderRadius),
leading: Icon(icon, size: 26),
title: Text(title, style: context.textTheme.titleSmall?.copyWith(fontWeight: FontWeight.w500)),
onTap: onTap,
);
}