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

View File

@ -305,7 +305,9 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> {
() => PullexRefreshController(), () => PullexRefreshController(),
); );
return PullexRefresh( return Stack(
children: [
PullexRefresh(
onRefresh: () => _onRefresh(item.id, refreshController), onRefresh: () => _onRefresh(item.id, refreshController),
header: const WaterDropHeader(), header: const WaterDropHeader(),
controller: refreshController, controller: refreshController,
@ -324,7 +326,8 @@ class _MediaDetailScreenState extends State<MediaDetailScreen> {
); );
}, },
child: Obx( 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), padding: const EdgeInsets.all(16.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [TagSection(tags: item.tags ?? [])],
TagSection(tags: item.tags ?? []),
Obx(
() => Visibility(
visible: authController.isLoggedIn,
child: Padding(
padding: const EdgeInsets.only(top: 20.0),
child: FavoriteSection(
item: item,
index: index,
),
),
),
),
],
), ),
), ),
), ),
@ -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( final Response<dynamic> response = await get(
'https://api.f0ck.me/items_new/get', 'https://api.f0ck.me/items/get',
query: params, query: params,
headers: headers, 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 # 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 # 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. # 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: environment:
sdk: ^3.9.0-100.2.beta sdk: ^3.9.0-100.2.beta