v1.4.6+67
All checks were successful
Flutter Schmutter / build (push) Successful in 3m46s

This commit is contained in:
2025-06-23 02:51:49 +02:00
parent e30635304b
commit 405d388db0
4 changed files with 104 additions and 58 deletions

View File

@ -7,6 +7,9 @@ class MediaItem {
final int mode;
final List<Tag>? tags;
final List<Favorite>? favorites;
final String? username;
final String? userchannel;
final String? usernetwork;
MediaItem({
required this.id,
@ -17,6 +20,9 @@ class MediaItem {
required this.mode,
this.tags = const [],
this.favorites = const [],
this.username,
this.userchannel,
this.usernetwork,
});
String get thumbnailUrl => 'https://f0ck.me/t/$id.webp';
@ -33,6 +39,9 @@ class MediaItem {
int? mode,
List<Tag>? tags,
List<Favorite>? favorites,
String? username,
String? userchannel,
String? usernetwork,
}) {
return MediaItem(
id: id ?? this.id,
@ -43,6 +52,9 @@ class MediaItem {
mode: mode ?? this.mode,
tags: tags ?? this.tags,
favorites: favorites ?? this.favorites,
username: username ?? this.username,
userchannel: userchannel ?? this.userchannel,
usernetwork: usernetwork ?? this.usernetwork,
);
}
@ -64,6 +76,9 @@ class MediaItem {
?.map((e) => Favorite.fromJson(e))
.toList() ??
[],
username: json['username'],
userchannel: json['userchannel'],
usernetwork: json['usernetwork'],
);
}
}
@ -97,8 +112,8 @@ class Favorite {
factory Favorite.fromJson(Map<String, dynamic> json) {
return Favorite(
userId: json['user_id'],
username: json['user'],
userId: json['userId'],
username: json['username'],
avatar: json['avatar'],
);
}

View File

@ -305,7 +305,9 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> {
() => PullexRefreshController(),
);
return PullexRefresh(
return Stack(
children: [
PullexRefresh(
onRefresh: () => _onRefresh(item.id, refreshController),
header: const WaterDropHeader(),
controller: refreshController,
@ -324,7 +326,8 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> {
);
},
child: Obx(
() => _buildMedia(item, index == _currentIndex.value),
() =>
_buildMedia(item, index == _currentIndex.value),
),
),
),
@ -339,21 +342,7 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> {
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
TagSection(tags: item.tags ?? []),
Obx(
() => Visibility(
visible: authController.isLoggedIn,
child: Padding(
padding: const EdgeInsets.only(top: 20.0),
child: FavoriteSection(
item: item,
index: index,
),
),
),
),
],
children: [TagSection(tags: item.tags ?? [])],
),
),
),
@ -363,6 +352,48 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> {
),
],
),
),
Obx(() {
if (!authController.isLoggedIn) {
return const SizedBox.shrink();
}
final MediaItem currentItem =
mediaController.items[_currentIndex.value];
return DraggableScrollableSheet(
initialChildSize: 0.11,
minChildSize: 0.11,
maxChildSize: 0.245,
snap: true,
builder: (context, scrollController) => ListView(
controller: scrollController,
padding: const EdgeInsets.only(left: 16, right: 16),
children: [
FavoriteSection(
item: currentItem,
index: _currentIndex.value,
),
const SizedBox(height: 16),
Text(
"Dateigröße: ${(currentItem.size / 1024).toStringAsFixed(1)} KB",
style: Theme.of(context).textTheme.bodySmall,
),
Text(
"Typ: ${currentItem.mime}",
style: Theme.of(context).textTheme.bodySmall,
),
Text(
"ID: ${currentItem.id}",
style: Theme.of(context).textTheme.bodySmall,
),
Text(
"Hochgeladen am: ${DateTime.fromMillisecondsSinceEpoch(currentItem.stamp * 1000)}",
style: Theme.of(context).textTheme.bodySmall,
),
],
),
);
}),
],
);
},
),

View File

@ -31,7 +31,7 @@ class ApiService extends GetConnect {
}
final Response<dynamic> response = await get(
'https://api.f0ck.me/items_new/get',
'https://api.f0ck.me/items/get',
query: params,
headers: headers,
);

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.4.5+66
version: 1.4.6+67
environment:
sdk: ^3.9.0-100.2.beta