overpush 1.2.7
overpush: ^1.2.7 copied to clipboard
Flutter code push and OTA updates: ship Dart fixes to installed iOS and Android apps without an app-store review. Signed patches, staged rollout, crash-safe rollback.
example/lib/main.dart
// Exists to compile and smoke-test the plugin, not to demonstrate anything.
//
// `overpush release` normally generates the entrypoint that calls
// OverPush.init, so an app never writes this. Here it is explicit because there
// is no CLI involved.
import 'package:overpush/overpush.dart';
import 'package:flutter/material.dart';
import 'update_banner.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
await OverPush.init(const OverPushRuntimeConfig());
runApp(const _ExampleApp());
}
class _ExampleApp extends StatelessWidget {
const _ExampleApp();
@override
Widget build(BuildContext context) {
return MaterialApp(
// The app's own update UI, driven by OverPush.events.
builder: (context, child) => Stack(
children: [
if (child != null) child,
const UpdateBanner(),
],
),
home: Scaffold(
appBar: AppBar(title: const Text('OverPush')),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text('patched: ${OverPush.isPatched}'),
Text('enabled: ${OverPushRuntimeConfig.enabled}'),
// Says WHY when it is off, because "enabled: false" on its own
// sends people looking at the server.
Text(OverPushRuntimeConfig.disabledReason ?? 'configured'),
],
),
),
),
);
}
}