f_cache 1.1.2 copy "f_cache: ^1.1.2" to clipboard
f_cache: ^1.1.2 copied to clipboard

Generic cache manager for flutter. Saves files and infos on the tmp storages of the device.

example/lib/main.dart

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;
  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Image(image: CachedNetworkImage('https://lmg.jj20.com/up/allimg/4k/s/02/210924233115O14-0-lp.jpg')),
          ],
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
2
likes
160
points
96
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Generic cache manager for flutter. Saves files and infos on the tmp storages of the device.

Repository

License

MIT (license)

Dependencies

crypto, flutter, http, path, path_provider

More

Packages that depend on f_cache