Initial Flutter booru app

This commit is contained in:
2026-05-23 11:46:52 +03:00
commit 63da741295
187 changed files with 24113 additions and 0 deletions
@@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
import '../../../../backend/backend.dart';
class ProviderCard extends StatelessWidget {
const ProviderCard({
required this.config,
required this.onToggle,
required this.onEdit,
required this.onDelete,
super.key,
});
final ContentProviderConfig config;
final ValueChanged<bool> onToggle;
final VoidCallback onEdit;
final VoidCallback onDelete;
@override
Widget build(BuildContext context) {
return Card(
child: ListTile(
leading: Switch(value: config.enabled, onChanged: onToggle),
title: Text(config.name),
subtitle: Text(
'${config.apiType} · ${config.baseUrl}\nPriority ${config.priority}'),
isThreeLine: true,
trailing: Wrap(
spacing: 4,
children: [
IconButton(
tooltip: 'Edit',
onPressed: onEdit,
icon: const Icon(Icons.edit_rounded),
),
IconButton(
tooltip: 'Delete',
onPressed: onDelete,
icon: const Icon(Icons.delete_rounded),
),
],
),
),
);
}
}
@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import '../../../../backend/backend.dart';
import '../../../../shared/widgets/provider_status_badge.dart';
class ProviderHealthTile extends StatelessWidget {
const ProviderHealthTile({
required this.config,
required this.health,
required this.onCheck,
super.key,
});
final ContentProviderConfig config;
final ProviderHealth? health;
final VoidCallback onCheck;
@override
Widget build(BuildContext context) {
return Card(
child: ListTile(
title: Text(config.name),
subtitle: Text(
[
if (health != null) 'Ping ${health!.pingMs} ms',
if (health?.lastCheckedAt != null)
'Checked ${health!.lastCheckedAt}',
if (health?.errorMessage != null) health!.errorMessage!,
].join('\n'),
),
leading: ProviderStatusBadge(health: health),
trailing: IconButton(
tooltip: 'Check',
onPressed: onCheck,
icon: const Icon(Icons.network_check_rounded),
),
),
);
}
}