flutter_siren 0.0.2 copy "flutter_siren: ^0.0.2" to clipboard
flutter_siren: ^0.0.2 copied to clipboard

outdated

One way to notify users when a new version of your app is available and prompt them to upgrade.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  Future<void> _showPromptUpdate(BuildContext context) async {
    final siren = Siren();
    siren.promptUpdate(context);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Siren Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Siren Demo'),
        ),
        body: Builder(builder: (context) => Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'Press the following button to show the update dialog:',
              ),
              FlatButton(
                child: Text('Check Update'),
                color: Colors.blue,
                textColor: Colors.white,
                padding: EdgeInsets.all(8.0),
                splashColor: Colors.blueAccent,
                onPressed: () => _showPromptUpdate(context),
              )
            ],
          ),
        ),
        )
      ),
    );
  }
}
17
likes
0
pub points
16%
popularity

Publisher

verified publisherdiegocosta.me

One way to notify users when a new version of your app is available and prompt them to upgrade.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, package_info, url_launcher

More

Packages that depend on flutter_siren