|
|
@ -1,5 +1,6 @@
|
|
|
|
import 'dart:io';
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:auto_size_text/auto_size_text.dart';
|
|
|
|
import 'package:device_info/device_info.dart';
|
|
|
|
import 'package:device_info/device_info.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
@ -30,57 +31,39 @@ class _InfoViewState extends State<InfoView>
|
|
|
|
packageInfo != null && (androidInfo != null || iosInfo != null);
|
|
|
|
packageInfo != null && (androidInfo != null || iosInfo != null);
|
|
|
|
|
|
|
|
|
|
|
|
_buildGridItem(String title, String subTitle) {
|
|
|
|
_buildGridItem(String title, String subTitle) {
|
|
|
|
return CupertinoContextMenu(
|
|
|
|
return MaterialButton(
|
|
|
|
actions: [
|
|
|
|
elevation: 2,
|
|
|
|
CupertinoContextMenuAction(
|
|
|
|
onPressed: () {},
|
|
|
|
child: Text('复制'),
|
|
|
|
onLongPress: () {
|
|
|
|
onPressed: () {
|
|
|
|
Scaffold.of(context).hideCurrentSnackBar();
|
|
|
|
Clipboard.setData(ClipboardData(text: subTitle));
|
|
|
|
Clipboard.setData(ClipboardData(text: subTitle));
|
|
|
|
Navigator.pop(context);
|
|
|
|
Scaffold.of(context).showSnackBar(SnackBar(
|
|
|
|
},
|
|
|
|
content: Text('已复制'),
|
|
|
|
),
|
|
|
|
action: SnackBarAction(
|
|
|
|
],
|
|
|
|
label: '确定',
|
|
|
|
previewBuilder: (context, animation, child) {
|
|
|
|
onPressed: () {
|
|
|
|
return Material(
|
|
|
|
Scaffold.of(context).hideCurrentSnackBar();
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
|
|
|
|
width: MediaQuery.of(context).size.width - 100,
|
|
|
|
|
|
|
|
constraints: BoxConstraints(minHeight: 300),
|
|
|
|
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(title),
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
subTitle,
|
|
|
|
|
|
|
|
style: TextStyle(fontSize: 22),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
child: Material(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
|
borderRadius: BorderRadius.circular(5),
|
|
|
|
elevation: 3,
|
|
|
|
),
|
|
|
|
child: Padding(
|
|
|
|
color: Theme.of(context).scaffoldBackgroundColor,
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
child: Padding(
|
|
|
|
child: Column(
|
|
|
|
padding: const EdgeInsets.all(8.0),
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
Text(title),
|
|
|
|
children: [
|
|
|
|
Text(
|
|
|
|
Text(title),
|
|
|
|
subTitle ?? '',
|
|
|
|
AutoSizeText(
|
|
|
|
style: TextStyle(fontSize: 22),
|
|
|
|
subTitle ?? '',
|
|
|
|
maxLines: 2,
|
|
|
|
style: TextStyle(fontSize: 26),
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
maxLines: 2,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -93,8 +76,17 @@ class _InfoViewState extends State<InfoView>
|
|
|
|
title: Text(title),
|
|
|
|
title: Text(title),
|
|
|
|
subtitle: Text(subTitle ?? ''),
|
|
|
|
subtitle: Text(subTitle ?? ''),
|
|
|
|
onLongPress: () {
|
|
|
|
onLongPress: () {
|
|
|
|
|
|
|
|
Scaffold.of(context).hideCurrentSnackBar();
|
|
|
|
Clipboard.setData(ClipboardData(text: subTitle));
|
|
|
|
Clipboard.setData(ClipboardData(text: subTitle));
|
|
|
|
Scaffold.of(context).showSnackBar(SnackBar(content: Text('已复制')));
|
|
|
|
Scaffold.of(context).showSnackBar(SnackBar(
|
|
|
|
|
|
|
|
content: Text('已复制'),
|
|
|
|
|
|
|
|
action: SnackBarAction(
|
|
|
|
|
|
|
|
label: '确定',
|
|
|
|
|
|
|
|
onPressed: () {
|
|
|
|
|
|
|
|
Scaffold.of(context).hideCurrentSnackBar();
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|