forked from lxm_flutter/FlutterUnit
✨ 添加应用版本检查页
This commit is contained in:
@@ -112,21 +112,6 @@ class AboutAppPage extends StatelessWidget {
|
||||
child: Wrap(
|
||||
spacing: 20,
|
||||
children: <Widget>[
|
||||
// FeedbackWidget(
|
||||
// onPressed: () => _launchURL(
|
||||
// "https://juejin.im/user/5b42c0656fb9a04fe727eb37"),
|
||||
// child: Wrap(
|
||||
// direction: Axis.vertical,
|
||||
// crossAxisAlignment: WrapCrossAlignment.center,
|
||||
// children: <Widget>[
|
||||
// Icon(
|
||||
// TolyIcon.icon_juejin,
|
||||
// size: 35,
|
||||
// color: Colors.blue,
|
||||
// ),
|
||||
// Text('掘金')
|
||||
// ],
|
||||
// )),
|
||||
FeedbackWidget(
|
||||
onPressed: () =>
|
||||
_launchURL("https://github.com/toly1994328/FlutterUnit"),
|
||||
|
||||
128
lib/views/pages/about/version_info.dart
Normal file
128
lib/views/pages/about/version_info.dart
Normal file
@@ -0,0 +1,128 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_unit/app/res/cons.dart';
|
||||
import 'package:flutter_unit/app/router.dart';
|
||||
import 'package:flutter_unit/app/style/NoScrollBehavior.dart';
|
||||
import 'package:flutter_unit/components/permanent/circle_image.dart';
|
||||
import 'package:flutter_unit/components/permanent/feedback_widget.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
/// create by 张风捷特烈 on 2020/6/16
|
||||
/// contact me by email 1981462002@qq.com
|
||||
/// 说明:
|
||||
|
||||
class VersionInfo extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.white,
|
||||
elevation: 0,
|
||||
iconTheme: IconThemeData(
|
||||
color: Colors.grey
|
||||
),
|
||||
),
|
||||
body:ConstrainedBox(
|
||||
constraints: BoxConstraints.expand(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top:28.0),
|
||||
child: _buildTop(),
|
||||
),
|
||||
|
||||
_buildCenter(context),
|
||||
Spacer(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom:8.0),
|
||||
child: buildBottom(),
|
||||
)
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTop() {
|
||||
return Wrap(
|
||||
direction: Axis.vertical,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 10,
|
||||
children: <Widget>[
|
||||
CircleImage(image: AssetImage("assets/images/icon_head.png"),size: 80,),
|
||||
Text('Flutter Unit',style: TextStyle(fontSize: 20,fontWeight: FontWeight.bold),),
|
||||
Text('Version ${Cons.version}'),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _buildCenter(BuildContext context) {
|
||||
final labelStyle= TextStyle(fontSize: 13);
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left:20.0,right: 20,top: 20),
|
||||
child: ScrollConfiguration(
|
||||
behavior: NoScrollBehavior(),
|
||||
child: ListView(
|
||||
shrinkWrap: true,
|
||||
children: <Widget>[
|
||||
Divider(height: 1,),
|
||||
ListTile(
|
||||
title: Text('应用详情',style: labelStyle,),
|
||||
trailing: _nextIcon(context),
|
||||
onTap: () => Navigator.of(context).pushNamed(Router.about_app),
|
||||
),
|
||||
Divider(height: 1,indent: 10),
|
||||
ListTile(
|
||||
title: Text('检查新版本',style: labelStyle),
|
||||
trailing: _nextIcon(context),
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
),
|
||||
Divider(height: 1,indent: 10),
|
||||
ListTile(
|
||||
title: Text('检查数据库新版本',style: labelStyle),
|
||||
trailing: _nextIcon(context),
|
||||
onTap: () {
|
||||
|
||||
},
|
||||
),
|
||||
Divider(height: 1,),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _nextIcon(BuildContext context) =>
|
||||
Icon(Icons.chevron_right, color: Colors.grey);
|
||||
|
||||
Widget buildBottom() {
|
||||
return Wrap(
|
||||
direction: Axis.vertical,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
spacing: 4,
|
||||
children: <Widget>[
|
||||
FeedbackWidget(
|
||||
onPressed: (){
|
||||
_launchURL("https://github.com/toly1994328/FlutterUnit");
|
||||
},
|
||||
child: Text('《查看本项目Github仓库》',style: TextStyle(fontSize: 12,color: Color(0xff616C84),),)),
|
||||
Text('Power By 张风捷特烈',style: TextStyle(fontSize: 12,color: Colors.grey),),
|
||||
Text('Copyright © 2008-2020 Toly1994',style: TextStyle(fontSize: 12,color: Colors.grey),),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
_launchURL(String url) async {
|
||||
if (await canLaunch(url)) {
|
||||
await launch(url);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class HomeDrawer extends StatelessWidget {
|
||||
padding: EdgeInsets.zero,
|
||||
children: <Widget>[
|
||||
UnitDrawerHeader(color: color),
|
||||
_buildItem(context, TolyIcon.icon_them, '我的主题', Router.setting),
|
||||
_buildItem(context, TolyIcon.icon_them, '应用设置', Router.setting),
|
||||
_buildItem(context, TolyIcon.icon_layout, '数据统计', null),
|
||||
Divider(height: 1),
|
||||
_buildFlutterUnit(context),
|
||||
|
||||
@@ -18,7 +18,7 @@ class HomePage extends StatefulWidget {
|
||||
_HomePageState createState() => _HomePageState();
|
||||
}
|
||||
|
||||
class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin{
|
||||
class _HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin{
|
||||
ScrollController _ctrl;
|
||||
double _limitY = 35;
|
||||
double _height = kToolbarHeight * 2 - 20;
|
||||
|
||||
@@ -14,7 +14,7 @@ class SettingPage extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text('主题设置'),
|
||||
title: Text('应用设置'),
|
||||
),
|
||||
body: ListView(
|
||||
children: <Widget>[
|
||||
@@ -59,6 +59,15 @@ class SettingPage extends StatelessWidget {
|
||||
),
|
||||
Divider(),
|
||||
_buildShowBg(context),
|
||||
ListTile(
|
||||
leading: Icon(
|
||||
Icons.info,
|
||||
color: Theme.of(context).primaryColor,
|
||||
),
|
||||
title: Text('版本信息'),
|
||||
trailing: _nextIcon(context),
|
||||
onTap: () => Navigator.of(context).pushNamed(Router.version_info),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user