cached_network 0.0.1 copy "cached_network: ^0.0.1" to clipboard
cached_network: ^0.0.1 copied to clipboard

A package use to fetch data from web and write as string into cache directory and provide a widget use to view caches.

Cached Netword #

This is a package use to fetch data from web and write as string into cache directory. If the cache file exists, then will read data from cache file instead of web. Besides, it provides a widget use to view caches.

Install #

flutter pub add cached_network

Getting started #

CachedNetwork

import 'package:cached_network/cached_network.dart';

void main() async {
  var network = CachedNetwork();
  final response = await network.fetch('https://google.com');
}

CacheView

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

void main() {
  runApp(const MaterialApp(
    home: CacheViewDemo(),
  ));
}

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

  @override
  Widget build(BuildContext context) {
    return const CacheView();
  }
}

Important #

If you use CachedNetwork not in flutter or in isolate, you should specify the cacheDirectory when you construct the instance.

0
likes
0
pub points
79%
popularity

Publisher

verified publishercals.xyz

A package use to fetch data from web and write as string into cache directory and provide a widget use to view caches.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

crypto, dio, flutter, path, path_provider

More

Packages that depend on cached_network