cache_data 1.0.1 copy "cache_data: ^1.0.1" to clipboard
cache_data: ^1.0.1 copied to clipboard

A Flutter library to fetch data then save the cache using hive; return dart objects.

example/lib/main.dart

import 'package:cache_data/cache_data.dart';

import 'homeview.dart';
import 'package:flutter/material.dart';

import 'main.mapper.g.dart' show initializeJsonMapper;

import 'package:dart_json_mapper_flutter/dart_json_mapper_flutter.dart'
    show flutterAdapter;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await CacheData.init();
  initializeJsonMapper(adapters: [flutterAdapter]);
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(title: 'Material App', home: HomeView());
  }
}
2
likes
120
pub points
0%
popularity

Publisher

unverified uploader

A Flutter library to fetch data then save the cache using hive; return dart objects.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dart_json_mapper, flutter, hive, hive_flutter, http

More

Packages that depend on cache_data