mirror of
https://github.com/lucavenir/go_router_riverpod.git
synced 2025-08-06 14:59:53 +08:00
25 lines
886 B
Dart
25 lines
886 B
Dart
import 'package:example/utils/cache_for.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_animate/flutter_animate.dart';
|
|
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
|
|
part 'cute_rabbits.g.dart';
|
|
|
|
@riverpod
|
|
FutureOr<List<(IconData, String)>> cuteRabbits(CuteRabbitsRef ref) async {
|
|
// A proper mock of a simple request. I guess adopting a rabbit is simple.
|
|
await Future<void>.delayed(800.milliseconds);
|
|
|
|
final result = [
|
|
(Icons.cruelty_free, 'A fluffy, cute, rabbit.'),
|
|
(Icons.cruelty_free_outlined, 'Wow, this looks even fluffier!'),
|
|
(Icons.cruelty_free_sharp, "Why must I choose, I want 'em all!"),
|
|
(Icons.cruelty_free_rounded, 'This is all puffy 😍'),
|
|
(Icons.pets, 'Uhm... we also could see more pets...'),
|
|
(Icons.flutter_dash, 'Oh. My. God.\nI. Want. This.'),
|
|
];
|
|
|
|
ref.cacheFor(2.minutes);
|
|
return result;
|
|
}
|