fix: resolve compilation errors

- Add flutter_riverpod dependency to pubspec.yaml
- Rename sealed class subtypes (Idle, Loading, Done) as public
- Update RecyclingGuideScreen to use type checks instead of pattern matching
- Fix CardThemeData type in app_theme.dart
- Keep withOpacity (warnings only, not errors)
This commit is contained in:
Alan Alonso
2026-05-22 19:30:41 -06:00
parent bda677df89
commit 057e063c0b
6 changed files with 58 additions and 23 deletions

View File

@@ -137,10 +137,13 @@ class _SearchResults extends ConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final estado = ref.watch(recyclingSearchProvider);
return switch (estado) {
_Idle() => const SizedBox.shrink(),
_Loading() => const Center(child: CircularProgressIndicator()),
_Done(results: final r) when r.isEmpty => Center(
if (estado is Idle) {
return const SizedBox.shrink();
} else if (estado is Loading) {
return const Center(child: CircularProgressIndicator());
} else if (estado is Done) {
if (estado.results.isEmpty) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -152,13 +155,14 @@ class _SearchResults extends ConsumerWidget {
),
],
),
),
_Done(results: final r) => ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: r.length,
itemBuilder: (_, i) => SearchResultTile(resultado: r[i]),
),
_ => const SizedBox.shrink(),
};
);
}
return ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: estado.results.length,
itemBuilder: (_, i) => SearchResultTile(resultado: estado.results[i]),
);
}
return const SizedBox.shrink();
}
}