tp_upgrade_lib 3.8.9 copy "tp_upgrade_lib: ^3.8.9" to clipboard
tp_upgrade_lib: ^3.8.9 copied to clipboard

A new Flutter plugin.

example/lib/main.dart

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:tp_upgrade_lib/tp_update_widget.dart';
import 'package:tp_upgrade_lib/tp_upgrade_lib.dart';

import 'tp_update_util.dart';

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

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.blue,
        title: const Text('Plugin example app'),
      ),
      body: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          MaterialButton(onPressed: ()=>onDownTap(context),child: Text('点击更新'),color: Colors.blue,)
          // SizedBox(
          //   height: 30,
          //   width: 30,
          //   child: CircularProgressIndicator(
          //     // value: null,
          //     // backgroundColor: backgroundColor,
          //     valueColor: AlwaysStoppedAnimation<Color>(Colors.red),
          //   ),
          // )
        ],
      ),
    );
  }

  onDownTap(BuildContext context) {
    TpUpdateUtil.checkVs(context);
  }

}
0
likes
105
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter plugin.

Homepage

Documentation

API reference

License

unknown (license)

Dependencies

dio, flutter, install_plugin, path_provider, url_launcher

More

Packages that depend on tp_upgrade_lib