mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-02-09 04:59:36 -06:00
32 lines
946 B
Dart
32 lines
946 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:offtheline/offtheline.dart';
|
|
import 'package:phylum/libphylum/phylum_account.dart';
|
|
import 'package:phylum/ui/app/action_queue_status_notifier.dart';
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'action_view.dart';
|
|
|
|
class SliverErrors extends StatelessWidget {
|
|
const SliverErrors({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final actions = context.select<ActionQueueStatusNotifier, List<QueuedAction<PhylumAccount>>>((state) {
|
|
final failedActions = state.failedActions;
|
|
return failedActions;
|
|
});
|
|
|
|
return SliverList(
|
|
delegate: SliverChildBuilderDelegate(
|
|
(context, i) {
|
|
if (i == 0) {
|
|
return const ListTile(dense: true, title: Text('Errors'));
|
|
}
|
|
return ActionView(action: actions[i - 1]);
|
|
},
|
|
childCount: actions.isEmpty ? 0 : actions.length + 1,
|
|
),
|
|
);
|
|
}
|
|
}
|