codepush 0.2.8 copy "codepush: ^0.2.8" to clipboard
codepush: ^0.2.8 copied to clipboard

PlatformAndroid

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'),
            ],
          ),
        ),
      ),
    );
  }
}
0
likes
140
points
--
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Ship Dart fixes to installed Flutter apps without an app-store review. Signed patches, staged rollout, crash-safe rollback. Android needs no forked engine.

Topics

#code-push #hot-update #ota #deployment

License

MIT (license)

Dependencies

codepush_protocol, crypto, dio, flutter, path_provider, shared_preferences

More

Packages that depend on codepush

Packages that implement codepush