dfa 0.0.1 dfa: ^0.0.1 copied to clipboard
Dynamic Flutter for Android.
dfa_flutter_plugin #
A Flutter plugin for updating your android applications dynamically, it supports both dart code and assets.
Getting Started #
Add dependency to your pubspec.yaml
file:
dependencies:
dfa: x.y.z
Usage #
import 'package:dfa/dfa.dart';
// ------ Core API ------
// Install patch from the given archive file.
DfaManager.installPatch(file);
// Get loaded patch(may be null).
DfaManager.getLoadedPatch();
// Get installed patch(may be null).
DfaManager.getInstalledPatch();
// Retrive archive info from the given archive file.
DfaManager.getArchiveInfo(file);
// Delete a patch.
DfaManager.deletePatch(patch);
// Clean all patch data.
DfaManager.cleanAll();
// ------ Dev API ------
// Open dev page, this page shows current patch info.
DfaManager.openDevPage();
// Choose a file from the system File Chooser.
DfaManager.choosePatchFile();
About assets #
Override the default asset bundle in suitable position:
DefaultAssetBundle(
bundle: DfaManager.getAssetBundle(),
child: MaterialApp(
...
),
);
If you are using rootBundle
explicitly in dart code, you should replace it with DfaManager.getAssetBundle()
for the asset patch to take ettect.