✨ Attachments
This commit is contained in:
20
lib/providers/content/attachment_item.dart
Normal file
20
lib/providers/content/attachment_item.dart
Normal file
@ -0,0 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:solian/models/attachment.dart';
|
||||
import 'package:solian/services.dart';
|
||||
|
||||
class AttachmentItem extends StatelessWidget {
|
||||
final Attachment item;
|
||||
|
||||
const AttachmentItem({super.key, required this.item});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Hero(
|
||||
tag: Key('a${item.uuid}'),
|
||||
child: Image.network(
|
||||
'${ServiceFinder.services['paperclip']}/api/attachments/${item.uuid}',
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
11
lib/providers/content/attachment_list.dart
Normal file
11
lib/providers/content/attachment_list.dart
Normal file
@ -0,0 +1,11 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:solian/services.dart';
|
||||
|
||||
class AttachmentListProvider extends GetConnect {
|
||||
@override
|
||||
void onInit() {
|
||||
httpClient.baseUrl = ServiceFinder.services['paperclip'];
|
||||
}
|
||||
|
||||
Future<Response> getMetadata(String uuid) => get('/api/attachments/$uuid/meta');
|
||||
}
|
Reference in New Issue
Block a user