coffrify_flutter 0.9.0
coffrify_flutter: ^0.9.0 copied to clipboard
Flutter integration for the Coffrify SDK: secure API key storage, an InheritedWidget provider, and a ready-made transfer preview widget.
coffrify_flutter #
Flutter integration for the Coffrify Dart SDK, encrypted file transfer infrastructure.
Use the pure-Dart coffrify package directly
for non-Flutter code. This companion adds Flutter-only helpers:
CoffrifyFlutter: a lazily-initialized singleton with optional secure storage of the API key viaflutter_secure_storage.CoffrifyProvider: anInheritedWidgetthat exposes aCoffrifyinstance to descendants (CoffrifyProvider.of(context)).CoffrifyImage: a widget that resolves a transfer to its preview URL.
Install #
flutter pub add coffrify_flutter
Quickstart #
import 'package:coffrify_flutter/coffrify_flutter.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final coffrify = await CoffrifyFlutter.initialize(
apiKey: 'cof_live_…',
persistSecurely: true,
);
runApp(
CoffrifyProvider(
coffrify: coffrify.instance,
child: const MyApp(),
),
);
}
Then, anywhere in the tree:
final coffrify = CoffrifyProvider.of(context);
final transfers = await coffrify.transfers.list();
License #
MIT. See LICENSE.