mirror of
https://github.com/immich-app/immich.git
synced 2024-11-17 19:08:49 -07:00
2b5cef156c
* Add i18n framework to mobile app and write simple translation generator * Replace all texts in login_form with i18n keys * Localization of sharing section * Localization of asset viewer section * Use JSON as base translation format * Add check for missing/unused translation keys * Add localizely * Remove i18n directory in favour of localizely * Backup Translation * More translations * Translate home page * Translation of search page * Translate new server version announcement * Reformat code * Fix typo in german translation * Update englisch translations * Change translation keys to match dart filenames * Add /api to translated endpoint_urls * Update localizely.yml * Add languages to ios plist * Remove unused keys * Added script to check outdated key in other translations * Add download key to localizely.yml Co-authored-by: Alex <alex.tran1502@gmail.com>
74 lines
2.1 KiB
Dart
74 lines
2.1 KiB
Dart
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:hive_flutter/hive_flutter.dart';
|
|
import 'package:immich_mobile/constants/hive_box.dart';
|
|
import 'package:immich_mobile/utils/capitalize_first_letter.dart';
|
|
|
|
class ThumbnailWithInfo extends StatelessWidget {
|
|
const ThumbnailWithInfo(
|
|
{Key? key,
|
|
required this.textInfo,
|
|
required this.imageUrl,
|
|
required this.onTap})
|
|
: super(key: key);
|
|
|
|
final String textInfo;
|
|
final String imageUrl;
|
|
final Function onTap;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
var box = Hive.box(userInfoBox);
|
|
|
|
return GestureDetector(
|
|
onTap: () {
|
|
onTap();
|
|
},
|
|
child: Padding(
|
|
padding: const EdgeInsets.only(right: 8.0),
|
|
child: SizedBox(
|
|
width: MediaQuery.of(context).size.width / 2,
|
|
child: Stack(
|
|
alignment: Alignment.bottomCenter,
|
|
children: [
|
|
Container(
|
|
foregroundDecoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(10),
|
|
color: Colors.black26,
|
|
),
|
|
child: ClipRRect(
|
|
borderRadius: BorderRadius.circular(10),
|
|
child: CachedNetworkImage(
|
|
width: 250,
|
|
height: 250,
|
|
fit: BoxFit.cover,
|
|
imageUrl: imageUrl,
|
|
httpHeaders: {
|
|
"Authorization": "Bearer ${box.get(accessTokenKey)}"
|
|
},
|
|
),
|
|
),
|
|
),
|
|
Positioned(
|
|
bottom: 8,
|
|
left: 10,
|
|
child: SizedBox(
|
|
width: MediaQuery.of(context).size.width / 3,
|
|
child: Text(
|
|
textInfo,
|
|
style: const TextStyle(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 16,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|