Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ğecko
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Ğecko
Commits
15d5a29f
Commit
15d5a29f
authored
4 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Fix go to home tab if scan pubkey
parent
3dd58dbd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/ui/historyScreen.dart
+3
-8
3 additions, 8 deletions
lib/ui/historyScreen.dart
lib/ui/home.dart
+13
-7
13 additions, 7 deletions
lib/ui/home.dart
pubspec.yaml
+1
-1
1 addition, 1 deletion
pubspec.yaml
with
17 additions
and
16 deletions
lib/ui/historyScreen.dart
+
3
−
8
View file @
15d5a29f
...
@@ -20,15 +20,8 @@ class HistoryScreen extends StatefulWidget {
...
@@ -20,15 +20,8 @@ class HistoryScreen extends StatefulWidget {
}
}
class
HistoryScreenState
extends
State
<
HistoryScreen
>
{
class
HistoryScreenState
extends
State
<
HistoryScreen
>
{
int
currentIndex
=
0
;
Widget
currentScreen
;
Widget
currentScreen
;
void
onTabTapped
(
int
index
)
{
setState
(()
{
currentIndex
=
index
;
});
}
Uint8List
bytes
=
Uint8List
(
0
);
Uint8List
bytes
=
Uint8List
(
0
);
final
TextEditingController
_outputPubkey
=
new
TextEditingController
();
final
TextEditingController
_outputPubkey
=
new
TextEditingController
();
final
nRepositories
=
20
;
final
nRepositories
=
20
;
...
@@ -235,12 +228,14 @@ class HistoryScreenState extends State<HistoryScreen> {
...
@@ -235,12 +228,14 @@ class HistoryScreenState extends State<HistoryScreen> {
stackTrace:
stack
,
stackTrace:
stack
,
);
);
}
}
return
'false'
;
}
}
// this._outputPubkey.text = "";
// this._outputPubkey.text = "";
if
(
barcode
!=
null
)
{
if
(
barcode
!=
null
)
{
this
.
_outputPubkey
.
text
=
barcode
;
this
.
_outputPubkey
.
text
=
barcode
;
isPubkey
(
barcode
);
isPubkey
(
barcode
);
onTabTapped
(
0
);
}
else
{
return
'false'
;
}
}
return
barcode
;
return
barcode
;
}
}
...
...
This diff is collapsed.
Click to expand it.
lib/ui/home.dart
+
13
−
7
View file @
15d5a29f
...
@@ -12,18 +12,18 @@ class HomeScreen extends StatefulWidget {
...
@@ -12,18 +12,18 @@ class HomeScreen extends StatefulWidget {
final
List
<
Widget
>
screens
;
final
List
<
Widget
>
screens
;
@override
@override
_
HomeScreenState
createState
()
=
>
_
HomeScreenState
();
HomeScreenState
createState
()
=
>
HomeScreenState
();
}
}
class
_
HomeScreenState
extends
State
<
HomeScreen
>
{
class
HomeScreenState
extends
State
<
HomeScreen
>
{
GlobalKey
<
HistoryScreenState
>
_keyHistory
=
GlobalKey
();
GlobalKey
<
HistoryScreenState
>
_keyHistory
=
GlobalKey
();
int
_
currentIndex
=
0
;
int
currentIndex
=
0
;
Widget
currentScreen
;
Widget
currentScreen
;
void
onTabTapped
(
int
index
)
{
void
onTabTapped
(
int
index
)
{
setState
(()
{
setState
(()
{
_
currentIndex
=
index
;
currentIndex
=
index
;
});
});
}
}
...
@@ -36,7 +36,7 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -36,7 +36,7 @@ class _HomeScreenState extends State<HomeScreen> {
backgroundColor:
Colors
.
grey
[
300
],
backgroundColor:
Colors
.
grey
[
300
],
body:
SafeArea
(
body:
SafeArea
(
child:
IndexedStack
(
child:
IndexedStack
(
index:
_
currentIndex
,
index:
currentIndex
,
children:
<
Widget
>[
children:
<
Widget
>[
HistoryScreen
(
HistoryScreen
(
keyHistory:
_keyHistory
,
keyHistory:
_keyHistory
,
...
@@ -51,7 +51,13 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -51,7 +51,13 @@ class _HomeScreenState extends State<HomeScreen> {
width:
80.0
,
width:
80.0
,
child:
FittedBox
(
child:
FittedBox
(
child:
FloatingActionButton
(
child:
FloatingActionButton
(
onPressed:
()
=
>
_keyHistory
.
currentState
.
scan
(),
onPressed:
()
async
{
final
resultScan
=
await
_keyHistory
.
currentState
.
scan
();
print
(
resultScan
);
if
(
resultScan
!=
'false'
)
{
onTabTapped
(
0
);
}
},
child:
Container
(
child:
Container
(
height:
40.0
,
height:
40.0
,
width:
40.0
,
width:
40.0
,
...
@@ -64,7 +70,7 @@ class _HomeScreenState extends State<HomeScreen> {
...
@@ -64,7 +70,7 @@ class _HomeScreenState extends State<HomeScreen> {
fixedColor:
Colors
.
black
,
fixedColor:
Colors
.
black
,
type:
BottomNavigationBarType
.
fixed
,
type:
BottomNavigationBarType
.
fixed
,
onTap:
onTabTapped
,
onTap:
onTabTapped
,
currentIndex:
_
currentIndex
,
currentIndex:
currentIndex
,
items:
[
items:
[
BottomNavigationBarItem
(
BottomNavigationBarItem
(
icon:
new
Icon
(
Icons
.
format_list_bulleted
),
icon:
new
Icon
(
Icons
.
format_list_bulleted
),
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
1
View file @
15d5a29f
...
@@ -5,7 +5,7 @@ description: A new Flutter project.
...
@@ -5,7 +5,7 @@ description: A new Flutter project.
# pub.dev using `pub publish`. This is preferred for private packages.
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
publish_to
:
'
none'
# Remove this line if you wish to publish to pub.dev
version
:
0.0.0+
5
version
:
0.0.0+
7
environment
:
environment
:
sdk
:
"
>=2.7.0
<3.0.0"
sdk
:
"
>=2.7.0
<3.0.0"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment