local_cache_sync 3.1.1 copy "local_cache_sync: ^3.1.1" to clipboard
local_cache_sync: ^3.1.1 copied to clipboard

Cache json map to local file with Dart:io. Read cache with sync api.

example/lib/main.dart

import 'package:example/pages/homePage.dart';
import 'package:flutter/material.dart';
import 'package:local_cache_sync/local_cache_sync.dart';
import 'package:path_provider/path_provider.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  LocalCacheSync.instance.setCachePath(
    await getTemporaryDirectory(),
    'example_app/',
  );
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  // This widget is the root of your application.
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.green,
      ),
      home: HomePage(),
    );
  }
}
7
likes
120
pub points
76%
popularity

Publisher

unverified uploader

Cache json map to local file with Dart:io. Read cache with sync api.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on local_cache_sync