fl_update_apk_pl 0.0.1 fl_update_apk_pl: ^0.0.1 copied to clipboard
Android 更新快捷插件.
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:flutter/services.dart';
import 'package:fl_update_apk_pl/fl_update_apk_pl.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Column(
children: <Widget>[
InkWell(
child: Container(
height: 50,
width: double.infinity,
),
onTap: () {
//先检测是否需要更新
//假如需要更新请求参数放入
FlUpdateApkPl.sendDownloadData(
"http://test-1251233192.coscd.myqcloud.com/1_1.apk", "标题", "内容", "1 表示是否强制更新");
},
)
],
),
),
),
);
}
}