Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
mobile_scanner
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Julian Steenbakker
2023-02-03 10:45:45 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4572d185db2441703fda220dfb52176b62efa547
4572d185
1 parent
0e268fdc
imp: update example with pageview
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
100 additions
and
7 deletions
example/ios/Runner.xcodeproj/project.pbxproj
example/ios/Runner/Info.plist
example/lib/barcode_scanner_controller.dart
example/lib/barcode_scanner_pageview.dart
example/lib/main.dart
example/ios/Runner.xcodeproj/project.pbxproj
View file @
4572d18
...
...
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 5
1
;
objectVersion = 5
4
;
objects = {
/* Begin PBXBuildFile section */
...
...
@@ -199,6 +199,7 @@
/* Begin PBXShellScriptBuildPhase section */
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
...
...
@@ -213,6 +214,7 @@
};
9740EEB61CF901F6004384FC /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
...
...
example/ios/Runner/Info.plist
View file @
4572d18
...
...
@@ -49,5 +49,7 @@
</array>
<key>
UIViewControllerBasedStatusBarAppearance
</key>
<false/>
<key>
UIApplicationSupportsIndirectInputEvents
</key>
<true/>
</dict>
</plist>
...
...
example/lib/barcode_scanner_controller.dart
View file @
4572d18
...
...
@@ -197,10 +197,4 @@ class _BarcodeScannerWithControllerState
),
);
}
@override
void
dispose
()
{
controller
.
dispose
();
super
.
dispose
();
}
}
...
...
example/lib/barcode_scanner_pageview.dart
0 → 100644
View file @
4572d18
import
'package:flutter/material.dart'
;
import
'package:mobile_scanner/mobile_scanner.dart'
;
import
'package:mobile_scanner_example/scanner_error_widget.dart'
;
class
BarcodeScannerPageView
extends
StatefulWidget
{
const
BarcodeScannerPageView
({
Key
?
key
})
:
super
(
key:
key
);
@override
_BarcodeScannerPageViewState
createState
()
=>
_BarcodeScannerPageViewState
();
}
class
_BarcodeScannerPageViewState
extends
State
<
BarcodeScannerPageView
>
with
SingleTickerProviderStateMixin
{
BarcodeCapture
?
capture
;
Widget
cameraView
()
{
return
Builder
(
builder:
(
context
)
{
return
Stack
(
children:
[
MobileScanner
(
startDelay:
true
,
controller:
MobileScannerController
(
torchEnabled:
true
),
fit:
BoxFit
.
contain
,
errorBuilder:
(
context
,
error
,
child
)
{
return
ScannerErrorWidget
(
error:
error
);
},
onDetect:
(
capture
)
{
setState
(()
{
this
.
capture
=
capture
;
});
},
),
Align
(
alignment:
Alignment
.
bottomCenter
,
child:
Container
(
alignment:
Alignment
.
bottomCenter
,
height:
100
,
color:
Colors
.
black
.
withOpacity
(
0.4
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceEvenly
,
children:
[
Center
(
child:
SizedBox
(
width:
MediaQuery
.
of
(
context
).
size
.
width
-
120
,
height:
50
,
child:
FittedBox
(
child:
Text
(
capture
?.
barcodes
.
first
.
rawValue
??
'Scan something!'
,
overflow:
TextOverflow
.
fade
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headlineMedium
!
.
copyWith
(
color:
Colors
.
white
),
),
),
),
),
],
),
),
),
],
);
},
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
Colors
.
black
,
body:
PageView
(
children:
[
cameraView
(),
Container
(),
cameraView
(),
cameraView
(),
],
),
);
}
}
...
...
example/lib/main.dart
View file @
4572d18
import
'package:flutter/material.dart'
;
import
'package:mobile_scanner_example/barcode_list_scanner_controller.dart'
;
import
'package:mobile_scanner_example/barcode_scanner_controller.dart'
;
import
'package:mobile_scanner_example/barcode_scanner_pageview.dart'
;
import
'package:mobile_scanner_example/barcode_scanner_returning_image.dart'
;
import
'package:mobile_scanner_example/barcode_scanner_window.dart'
;
import
'package:mobile_scanner_example/barcode_scanner_without_controller.dart'
;
...
...
@@ -84,6 +85,16 @@ class MyHome extends StatelessWidget {
},
child:
const
Text
(
'MobileScanner with zoom slider'
),
),
ElevatedButton
(
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
const
BarcodeScannerPageView
(),
),
);
},
child:
const
Text
(
'MobileScanner pageView'
),
),
],
),
),
...
...
Please
register
or
login
to post a comment