cached_map 2.0.5
cached_map: ^2.0.5 copied to clipboard

A Flutter plugin for Caching Json/Map<String,dynamic> to your App's temporary directory.

cached_map #

A Flutter plugin for Caching Json/Map<String,dynamic> to your App's temporary directory.

Getting Started #

///code example of how to use

import the package
import 'package:cached_map/cached_map.dart';




//you can either use it with static methods 

await Mapped.saveFileDirectly(file:
{
  "user name":"user",
  "email":"user@gmail.com"
},
    cachedFileName: "user");

Map<String, dynamic>? user = await Mapped.loadFileDirectly(cachedFileName: "user");
print(user);
Mapped.deleteFileDirectly(cachedFileName: "user");


///------------------------OR--------------------------






//you can use it by creating object of Mapped class


 ///instantiate it in initState
  getMapInstance();
 
 
 getMapInstance()async{
    Mapped mapped = await Mapped.getInstance();
    }
    ///save a file
       mapped.saveFile(file:
        {
          "name":"test",
          "email":"email"
        },
            cachedFileName: "user");
    ///load file
    Map<String,dynamic>? user = mapped.loadFile(cachedFileName:"user");
    ///delete file
    mapped.deleteFile(cachedFileName: "user");
    
    




5
likes
90
pub points
35%
popularity

A Flutter plugin for Caching Json/Map<String,dynamic> to your App's temporary directory.

Documentation

API reference

License

LICENSE

Dependencies

flutter, path_provider

More

Packages that depend on cached_map