codepush 0.2.8
codepush: ^0.2.8 copied to clipboard
Ship Dart fixes to installed Flutter apps without an app-store review. Signed patches, staged rollout, crash-safe rollback. Android needs no forked engine.
example/lib/main.dart
// Exists to compile and smoke-test the plugin, not to demonstrate anything.
//
// `codepush release` normally generates the entrypoint that calls
// CodePush.init, so an app never writes this. Here it is explicit because there
// is no CLI involved.
import 'package:codepush/codepush.dart';
import 'package:flutter/material.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await CodePush.init(const CodePushRuntimeConfig());
runApp(const _ExampleApp());
}
class _ExampleApp extends StatelessWidget {
const _ExampleApp();
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('CodePush')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('patched: ${CodePush.isPatched}'),
Text('enabled: ${CodePushRuntimeConfig.enabled}'),
// Says WHY when it is off, because "enabled: false" on its own
// sends people looking at the server.
Text(CodePushRuntimeConfig.disabledReason ?? 'configured'),
],
),
),
),
);
}
}