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
Navaron Bracke
2023-11-09 10:38:10 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5d7d58558bd759179cb472627fbdc0b0a2d1baf8
5d7d5855
1 parent
b38d36a9
remove obsolete sample
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
86 deletions
example/lib/barcode_scanner_without_controller.dart
example/lib/main.dart
example/lib/barcode_scanner_without_controller.dart
deleted
100644 → 0
View file @
b38d36a
import
'package:flutter/material.dart'
;
import
'package:mobile_scanner/mobile_scanner.dart'
;
import
'package:mobile_scanner_example/scanner_error_widget.dart'
;
class
BarcodeScannerWithoutController
extends
StatefulWidget
{
const
BarcodeScannerWithoutController
({
super
.
key
});
@override
State
<
BarcodeScannerWithoutController
>
createState
()
=>
_BarcodeScannerWithoutControllerState
();
}
class
_BarcodeScannerWithoutControllerState
extends
State
<
BarcodeScannerWithoutController
>
with
SingleTickerProviderStateMixin
{
BarcodeCapture
?
capture
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Without controller'
)),
backgroundColor:
Colors
.
black
,
body:
Builder
(
builder:
(
context
)
{
return
Stack
(
children:
[
MobileScanner
(
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
),
),
),
),
),
],
),
),
),
],
);
},
),
);
}
}
example/lib/main.dart
View file @
5d7d585
...
...
@@ -4,7 +4,6 @@ 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'
;
import
'package:mobile_scanner_example/barcode_scanner_zoom.dart'
;
import
'package:mobile_scanner_example/mobile_scanner_overlay.dart'
;
...
...
@@ -76,17 +75,6 @@ class MyHome extends StatelessWidget {
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
const
BarcodeScannerWithoutController
(),
),
);
},
child:
const
Text
(
'MobileScanner without Controller'
),
),
ElevatedButton
(
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
=>
const
BarcodeScannerWithZoom
(),
),
);
...
...
Please
register
or
login
to post a comment