volt 0.0.0
volt: ^0.0.0 copied to clipboard
Simple, fast, effortless data fetching and real-time updates
volt ⚡️ #
Effortlessly manage asynchronous data fetching, caching, and real-time data delivery with minimal code.
Install #
flutter pub add volt
copied to clipboard
Usage #
final usersQuery = VoltQuery(
box: "users",
source: () => fetch("https://jsonplaceholder.typicode.com/users"),
fromJson: Users.fromJson,
);
Widget build(BuildContext context) {
final users = useQuery(usersQuery);
return users == null
? CircularProgressIndicator()
: ListView.builder(
itemCount: users.length,
itemBuilder: (_, index) => ListTile(title: Text(users[index].name)),
);
}
copied to clipboard