mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 01:12:58 -04:00
fix(mobile): Remove unsplash placeholder image and style empty places, objects (#1742)
This commit is contained in:
parent
11b2e2a6e2
commit
37cfac27b8
@ -145,8 +145,6 @@
|
|||||||
"profile_drawer_settings": "Settings",
|
"profile_drawer_settings": "Settings",
|
||||||
"profile_drawer_sign_out": "Sign Out",
|
"profile_drawer_sign_out": "Sign Out",
|
||||||
"search_bar_hint": "Search your photos",
|
"search_bar_hint": "Search your photos",
|
||||||
"search_page_no_objects": "No Objects Info Available",
|
|
||||||
"search_page_no_places": "No Places Info Available",
|
|
||||||
"search_page_places": "Places",
|
"search_page_places": "Places",
|
||||||
"search_page_things": "Things",
|
"search_page_things": "Things",
|
||||||
"search_result_page_new_search_hint": "New Search",
|
"search_result_page_new_search_hint": "New Search",
|
||||||
|
@ -7,18 +7,21 @@ class ThumbnailWithInfo extends StatelessWidget {
|
|||||||
const ThumbnailWithInfo({
|
const ThumbnailWithInfo({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.textInfo,
|
required this.textInfo,
|
||||||
required this.imageUrl,
|
this.imageUrl,
|
||||||
|
this.noImageIcon,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
final String textInfo;
|
final String textInfo;
|
||||||
final String imageUrl;
|
final String? imageUrl;
|
||||||
final Function onTap;
|
final Function onTap;
|
||||||
|
final IconData? noImageIcon;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var box = Hive.box(userInfoBox);
|
var box = Hive.box(userInfoBox);
|
||||||
|
var isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||||
|
var textAndIconColor = isDarkMode ? Colors.grey[100] : Colors.grey[700];
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
onTap();
|
onTap();
|
||||||
@ -31,26 +34,37 @@ class ThumbnailWithInfo extends StatelessWidget {
|
|||||||
alignment: Alignment.bottomCenter,
|
alignment: Alignment.bottomCenter,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
foregroundDecoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(25),
|
||||||
color: Colors.black26,
|
color: isDarkMode ? Colors.grey[900] : Colors.grey[100],
|
||||||
),
|
border: Border.all(
|
||||||
child: ClipRRect(
|
color: isDarkMode ? Colors.grey[800]! : Colors.grey[400]!,
|
||||||
borderRadius: BorderRadius.circular(10),
|
width: 1,
|
||||||
child: CachedNetworkImage(
|
|
||||||
width: 250,
|
|
||||||
height: 250,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
imageUrl: imageUrl,
|
|
||||||
httpHeaders: {
|
|
||||||
"Authorization": "Bearer ${box.get(accessTokenKey)}"
|
|
||||||
},
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
child: imageUrl != null
|
||||||
|
? ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
child: CachedNetworkImage(
|
||||||
|
width: 250,
|
||||||
|
height: 250,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
imageUrl: imageUrl!,
|
||||||
|
httpHeaders: {
|
||||||
|
"Authorization": "Bearer ${box.get(accessTokenKey)}"
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Center(
|
||||||
|
child: Icon(
|
||||||
|
noImageIcon ?? Icons.not_listed_location,
|
||||||
|
color: textAndIconColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
bottom: 8,
|
bottom: 12,
|
||||||
left: 10,
|
left: 14,
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: MediaQuery.of(context).size.width / 3,
|
width: MediaQuery.of(context).size.width / 3,
|
||||||
child: Text(
|
child: Text(
|
||||||
@ -58,7 +72,7 @@ class ThumbnailWithInfo extends StatelessWidget {
|
|||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
fontSize: 14,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
@ -85,9 +85,7 @@ class SearchPage extends HookConsumerWidget {
|
|||||||
itemCount: 1,
|
itemCount: 1,
|
||||||
itemBuilder: ((context, index) {
|
itemBuilder: ((context, index) {
|
||||||
return ThumbnailWithInfo(
|
return ThumbnailWithInfo(
|
||||||
imageUrl:
|
textInfo: '',
|
||||||
'https://images.unsplash.com/photo-1612178537253-bccd437b730e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymxhbmt8ZW58MHx8MHx8&auto=format&fit=crop&w=700&q=60',
|
|
||||||
textInfo: 'search_page_no_places'.tr(),
|
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@ -140,9 +138,8 @@ class SearchPage extends HookConsumerWidget {
|
|||||||
itemCount: 1,
|
itemCount: 1,
|
||||||
itemBuilder: ((context, index) {
|
itemBuilder: ((context, index) {
|
||||||
return ThumbnailWithInfo(
|
return ThumbnailWithInfo(
|
||||||
imageUrl:
|
textInfo: '',
|
||||||
'https://images.unsplash.com/photo-1612178537253-bccd437b730e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymxhbmt8ZW58MHx8MHx8&auto=format&fit=crop&w=700&q=60',
|
noImageIcon: Icons.signal_cellular_no_sim_sharp,
|
||||||
textInfo: 'search_page_no_objects'.tr(),
|
|
||||||
onTap: () {},
|
onTap: () {},
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user