volt 0.0.2 copy "volt: ^0.0.2" to clipboard
volt: ^0.0.2 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.

Features #

  • ⚡️ Blazing-fast development with minimal boilerplate code
  • 🚀 Fast in-memory caching for instant data access
  • 💾 Robust disk caching for seamless offline support
  • 🔄 Smart query deduplication to optimize network requests
  • 🔮 Configurable auto-refetching to keep data fresh
  • 📡 Real-time reactive updates across all listeners
  • 🧩 Easy integration with existing Flutter projects
  • 🧠 Compute isolate support for heavy deserialization tasks
  • 📦 Simple and compact package for efficient state management
  • 🔒 Built-in error handling, auto recovery and retry mechanisms

Install #

flutter pub add volt
copied to clipboard

Usage #

VoltQuery<Post> postQuery(String id) => VoltQuery(
      queryKey: ["post", id],
      queryFn: () => fetch("https://jsonplaceholder.typicode.com/posts/$id"),
      select: Post.fromJson,
    );

Widget build(BuildContext context) {
  final post = useQuery(postQuery("1"));

  return post == null ? CircularProgressIndicator() : Text("Post: ${post.title}");
}
copied to clipboard

Configuration #

Widget build(BuildContext context) {
  final queryClient = useMemoized(() => VoltQueryClient(
    // configuration options
  ));
  
  return VoltQueryClientProvider(
    client: queryClient,
    child: MyApp(),
  );
}
copied to clipboard
1
likes
0
points
441
downloads

Publisher

unverified uploader

Weekly Downloads

2024.09.19 - 2025.04.03

Simple, fast, effortless data fetching and real-time updates

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, crypto, flutter, flutter_hooks, path_provider, rxdart, synchronized

More

Packages that depend on volt