Skip to main content

appsonair_flutter_appsync 1.2.1 copy "appsonair_flutter_appsync: ^1.2.1" to clipboard
appsonair_flutter_appsync: ^1.2.1 copied to clipboard

The AppsOnAir AppSync Flutter SDK lets you manage forced and regular app updates, as well as enable maintenance mode, directly via AppsOnAir.

example/lib/main.dart

import 'package:appsonair_flutter_appsync/app_sync_service.dart';
import 'package:flutter/material.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'AppSync Example',
      theme: ThemeData(
        colorSchemeSeed: const Color(0xFF6200EE),
        useMaterial3: true,
      ),
      home: const DemoApp(),
    );
  }
}

class DemoApp extends StatefulWidget {
  const DemoApp({super.key});

  @override
  State<DemoApp> createState() => _DemoAppState();
}

class _DemoAppState extends State<DemoApp> {
  @override
  void initState() {
    super.initState();
    // Default — shows the native AppsOnAir update / maintenance UI
    AppSyncService.sync(context);

    // ── Custom UI (optional) ─────────────────────────────────────────────
    // Set showNativeUI: false to disable the default AppsOnAir alert.
    // Provide customWidget to render your own update/maintenance UI.
    // The `response` map contains app info returned by the SDK:
    //   response["appName"]                    → app display name
    //   response["updateData"]["buildNumber"]  → latest available build
    // ─────────────────────────────────────────────────────────────────────
    // AppSyncService.sync(
    //   context,
    //   options: {'showNativeUI': false}, // required when using customWidget
    //   customWidget: (response) {
    //     return Column(
    //       mainAxisSize: MainAxisSize.min,
    //       children: [
    //         Text('App: ${response["appName"]}'),
    //         Text('Version: ${response["updateData"]["buildNumber"]}'),
    //         const SizedBox(height: 20),
    //         ElevatedButton(
    //           onPressed: () {}, // handle update action here
    //           child: const Text('Update'),
    //         ),
    //       ],
    //     );
    //   },
    // );
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('AppSync Example')),
      body: const Center(
        child: Text('AppSync is active.\nShake or force update to test.'),
      ),
    );
  }
}
1
likes
150
points
321
downloads

Documentation

API reference

Publisher

verified publisherappsonair.com

Weekly Downloads

The AppsOnAir AppSync Flutter SDK lets you manage forced and regular app updates, as well as enable maintenance mode, directly via AppsOnAir.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on appsonair_flutter_appsync

Packages that implement appsonair_flutter_appsync