misty 0.1.0 copy "misty: ^0.1.0" to clipboard
misty: ^0.1.0 copied to clipboard

PlatformAndroidiOS
outdated

Misty - 一个Flutter web项目的本地缓存解决方案.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:misty/misty.dart';
import 'package:misty_example/index_page.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  MistyStartModel mistyStartOption = MistyStartModel(
    baseHost: 'https://mistyapp.oss-cn-hangzhou.aliyuncs.com',
    options: [
      Option(
        key: 'misty-app-one',
        open: 1,
        priority: 0,
        version: '202208161155',
      ),
      Option(
        key: 'misty-app-two',
        open: 1,
        priority: 0,
        version: '202208241529',
      ),
    ],
    basics: Basics(
      common: Common(
        compress: '/common.zip',
        version: '202208151527',
      ),
    ),
    assets: [
      {
        'misty-app-one': '/misty-app-one/misty-app.zip',
      },
      {
        'misty-app-two': '/misty-app-two/dist.zip',
      },
    ],
  );

  @override
  void initState() {
    Misty.start(mistyStartOption);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Builder(builder: (context) {
        return const IndexPage();
      }),
    );
  }
}
2
likes
125
points
59
downloads

Publisher

verified publisherimfunc.com

Weekly Downloads

Misty - 一个Flutter web项目的本地缓存解决方案.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

archive, dio, flutter, http, mime, path, path_provider, plugin_platform_interface, shared_preferences, uuid, webview_flutter

More

Packages that depend on misty