ota_update 1.0.0 copy "ota_update: ^1.0.0" to clipboard
ota_update: ^1.0.0 copied to clipboard

outdated

A Flutter plugin providing ota updates for Android and iOS, with download progress (Android only)

example/lib/main.dart

import 'dart:async';

import 'package:flutter/material.dart';
import 'package:ota_update/ota_update.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  OtaEvent currentEvent;

  @override
  void initState() {
    super.initState();
    tryOtaUpdate();
  }

  Future<void> tryOtaUpdate() async {
    try {
      //LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
      OtaUpdate().execute('https://test1.4q.sk/flutter_hello_world.apk').listen(
        (OtaEvent event) {
          setState(() => currentEvent = event);
        },
      );
    } catch (e) {
      print('Failed to make OTA update. Details: $e');
    }
  }

  @override
  Widget build(BuildContext context) {
    if (currentEvent == null) {
      return Container();
    }
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('OTA status: ${currentEvent.status} : ${currentEvent.value} \n'),
        ),
      ),
    );
  }
}
283
likes
0
pub points
96%
popularity

Publisher

verified publisher4q.eu

A Flutter plugin providing ota updates for Android and iOS, with download progress (Android only)

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on ota_update