Skip to content

Commit

Permalink
* improve something
Browse files Browse the repository at this point in the history
  • Loading branch information
pdliuw committed Mar 12, 2021
1 parent 45b892c commit ed6176d
Show file tree
Hide file tree
Showing 31 changed files with 11,304 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .packages
Expand Up @@ -3,9 +3,9 @@
#
# For more info see: https://dart.dev/go/dot-packages-deprecation
#
# Generated by pub on 2021-03-12 16:54:46.545979.
ai_barcode_platform_interface:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/ai_barcode_platform_interface-2.0.0/lib/
ai_barcode_web:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/ai_barcode_web-1.0.0/lib/
# Generated by pub on 2021-03-12 22:44:27.166114.
ai_barcode_platform_interface:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/ai_barcode_platform_interface-2.1.0/lib/
ai_barcode_web:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/ai_barcode_web-2.0.0/lib/
async:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/async-2.5.0/lib/
boolean_selector:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/boolean_selector-2.1.0/lib/
characters:file:///Users/air/develop_tool/flutter_macos_2.0.0-stable/.pub-cache/hosted/pub.flutter-io.cn/characters-1.1.0/lib/
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,8 @@
## [2.0.0]

* fix something
* improve something

## [1.6.0]

* improve: improve design
Expand Down
16 changes: 12 additions & 4 deletions example/lib/app_barcode_scanner_widget.dart
Expand Up @@ -46,11 +46,9 @@ class _BarcodePermissionWidgetState extends State<_BarcodePermissionWidget> {
@override
void initState() {
super.initState();

_requestPermission();
}

void _requestPermission() async {
void _requestMobilePermission() async {
if (await Permission.camera.request().isGranted) {
setState(() {
_isGranted = true;
Expand All @@ -60,6 +58,16 @@ class _BarcodePermissionWidgetState extends State<_BarcodePermissionWidget> {

@override
Widget build(BuildContext context) {
TargetPlatform platform = Theme.of(context).platform;

if (platform == TargetPlatform.android || platform == TargetPlatform.iOS) {
_requestMobilePermission();
} else {
setState(() {
_isGranted = true;
});
}

return Column(
children: <Widget>[
Expanded(
Expand All @@ -74,7 +82,7 @@ class _BarcodePermissionWidgetState extends State<_BarcodePermissionWidget> {
: Center(
child: OutlineButton(
onPressed: () {
_requestPermission();
_requestMobilePermission();
},
child: Text("请求权限"),
),
Expand Down
2 changes: 1 addition & 1 deletion example/lib/full_screen_scanner_page.dart
Expand Up @@ -19,7 +19,7 @@ class _FullScreenScannerPageState extends State<FullScreenScannerPage> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(_code),
Text("「$_code」"),
],
),
Expanded(
Expand Down
6 changes: 3 additions & 3 deletions example/pubspec.lock
Expand Up @@ -14,21 +14,21 @@ packages:
path: ".."
relative: true
source: path
version: "1.6.0"
version: "2.0.0"
ai_barcode_platform_interface:
dependency: transitive
description:
name: ai_barcode_platform_interface
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.0"
version: "2.1.0"
ai_barcode_web:
dependency: transitive
description:
name: ai_barcode_web
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.0"
version: "2.0.0"
airoute:
dependency: "direct main"
description:
Expand Down
38 changes: 37 additions & 1 deletion example/web/index.html
@@ -1,10 +1,46 @@
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
Fore more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
-->
<base href="/">

<meta charset="UTF-8">
<title>ai_barcode_example</title>
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">

<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">

<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>

<title>example</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('flutter-first-frame', function () {
navigator.serviceWorker.register('flutter_service_worker.js');
});
}
</script>
<script src="jsQR.js" type="application/javascript"></script>
<script src="main.dart.js" type="application/javascript"></script>
</body>
</html>

0 comments on commit ed6176d

Please sign in to comment.