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
3b915be9
Commit
3b915be9
authored
4 years ago
by
poka
Browse files
Options
Downloads
Patches
Plain Diff
Fix Snack display
parent
b3cd0074
No related branches found
No related tags found
1 merge request
!2
Make home great again
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/screens/history.dart
+130
-119
130 additions, 119 deletions
lib/screens/history.dart
lib/screens/home.dart
+213
-186
213 additions, 186 deletions
lib/screens/home.dart
with
343 additions
and
305 deletions
lib/screens/history.dart
+
130
−
119
View file @
3b915be9
...
...
@@ -162,128 +162,139 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
// Build history list
return
NotificationListener
(
child:
Expanded
(
child:
ListView
(
controller:
scrollController
,
children:
<
Widget
>[
SizedBox
(
height:
20
),
if
(
_historyProvider
.
pubkey
!=
''
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
child:
Builder
(
builder:
(
context
)
=
>
Expanded
(
child:
ListView
(
controller:
scrollController
,
children:
<
Widget
>[
SizedBox
(
height:
20
),
if
(
_historyProvider
.
pubkey
!=
''
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
mainAxisSize:
MainAxisSize
.
min
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
if
(
_isFirstExec
)
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
12
,
0
,
5
,
0
),
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getAvatar
(
_historyProvider
.
pubkey
),
initialData:
[
File
(
appPath
.
path
+
'/default_avatar.png'
)
],
builder:
(
BuildContext
context
,
AsyncSnapshot
<
List
>
_avatar
)
{
cesiumData
=
_avatar
.
data
;
// _cesiumPlusProvider.isComplete = true;
if
(
_avatar
.
connectionState
!=
ConnectionState
.
done
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
avatarsSize
);
}
if
(
_avatar
.
hasError
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
avatarsSize
);
}
if
(
_avatar
.
hasData
)
{
return
SingleChildScrollView
(
padding:
EdgeInsets
.
all
(
0.0
),
child:
Image
.
file
(
_avatar
.
data
[
0
],
height:
avatarsSize
));
}
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
avatarsSize
);
})),
GestureDetector
(
onTap:
()
{
Clipboard
.
setData
(
ClipboardData
(
text:
_historyProvider
.
pubkey
));
_historyProvider
.
snackCopyKey
(
context
);
},
child:
Text
(
_historyProvider
.
getShortPubkey
(
_historyProvider
.
pubkey
),
style:
TextStyle
(
fontSize:
22
,
fontWeight:
FontWeight
.
w800
,
fontFamily:
'Monospace'
)),
),
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
0
,
5
,
0
),
// .only(right: 15),
child:
Text
(
'TODO'
)),
SizedBox
(
width:
0
)
]),
if
(
_isFirstExec
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
// padding: const EdgeInsets.,
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getName
(
_historyProvider
.
pubkey
),
initialData:
'...'
,
builder:
(
context
,
snapshot
)
{
return
Text
(
snapshot
.
data
!=
''
?
snapshot
.
data
:
'-'
,
style:
TextStyle
(
fontSize:
20
));
}))
]),
SizedBox
(
height:
18
),
if
(
_isFirstExec
)
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
12
,
0
,
5
,
0
),
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getAvatar
(
_historyProvider
.
pubkey
),
initialData:
[
File
(
appPath
.
path
+
'/default_avatar.png'
)
],
builder:
(
BuildContext
context
,
AsyncSnapshot
<
List
>
_avatar
)
{
cesiumData
=
_avatar
.
data
;
// _cesiumPlusProvider.isComplete = true;
if
(
_avatar
.
connectionState
!=
ConnectionState
.
done
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
avatarsSize
);
}
if
(
_avatar
.
hasError
)
{
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
avatarsSize
);
}
if
(
_avatar
.
hasData
)
{
return
SingleChildScrollView
(
padding:
EdgeInsets
.
all
(
0.0
),
child:
Image
.
file
(
_avatar
.
data
[
0
],
height:
avatarsSize
));
}
return
Image
.
file
(
File
(
appPath
.
path
+
'/default_avatar.png'
),
height:
avatarsSize
);
})),
GestureDetector
(
onTap:
()
{
Clipboard
.
setData
(
ClipboardData
(
text:
_historyProvider
.
pubkey
));
_historyProvider
.
snackCopyKey
(
context
);
},
child:
Text
(
_historyProvider
.
getShortPubkey
(
_historyProvider
.
pubkey
),
style:
TextStyle
(
fontSize:
22
,
fontWeight:
FontWeight
.
w800
,
fontFamily:
'Monospace'
)),
),
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
30
,
0
,
5
,
0
),
// .only(right: 15),
child:
Text
(
'TODO'
)),
SizedBox
(
width:
0
)
]),
if
(
_isFirstExec
)
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
// padding: const EdgeInsets.,
child:
FutureBuilder
(
future:
_cesiumPlusProvider
.
getName
(
_historyProvider
.
pubkey
),
initialData:
'...'
,
builder:
(
context
,
snapshot
)
{
return
Text
(
snapshot
.
data
!=
''
?
snapshot
.
data
:
'-'
,
style:
TextStyle
(
fontSize:
20
));
}))
]),
SizedBox
(
height:
18
),
if
(
_isFirstExec
)
Container
(
padding:
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
child:
Text
(
balance
.
toString
()
+
' Ğ1'
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18.0
))),
SizedBox
(
height:
20
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
elevation:
1
,
primary:
Colors
.
grey
[
50
],
// background
onPrimary:
Colors
.
black
,
// foreground
),
onPressed:
()
{
_historyProvider
.
switchProfileView
();
},
child:
Text
(
_historyProvider
.
historySwitchButtun
,
style:
TextStyle
(
fontSize:
15
,
color:
Color
(
0xffD28928
)))),
// const Divider(
// color: Colors.grey,
// height: 5,
// thickness: 0.5,
// indent: 0,
// endIndent: 0,
// ),
_historyProvider
.
isHistoryScreen
?
historyView
(
context
,
result
)
:
payView
(
context
),
],
)),
const
EdgeInsets
.
fromLTRB
(
0
,
0
,
0
,
0
),
child:
Text
(
balance
.
toString
()
+
' Ğ1'
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
fontSize:
18.0
))),
SizedBox
(
height:
20
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
elevation:
1
,
primary:
Colors
.
grey
[
50
],
// background
onPrimary:
Colors
.
black
,
// foreground
),
onPressed:
()
{
_historyProvider
.
switchProfileView
();
},
child:
Text
(
_historyProvider
.
historySwitchButtun
,
style:
TextStyle
(
fontSize:
15
,
color:
Color
(
0xffD28928
)))),
// const Divider(
// color: Colors.grey,
// height: 5,
// thickness: 0.5,
// indent: 0,
// endIndent: 0,
// ),
_historyProvider
.
isHistoryScreen
?
historyView
(
context
,
result
)
:
payView
(
context
),
],
))),
onNotification:
(
t
)
{
if
(
t
is
ScrollEndNotification
&&
scrollController
.
position
.
pixels
>
=
...
...
This diff is collapsed.
Click to expand it.
lib/screens/home.dart
+
213
−
186
View file @
3b915be9
...
...
@@ -12,8 +12,7 @@ class HomeScreen extends StatelessWidget {
Widget
build
(
BuildContext
context
)
{
HomeProvider
_homeProvider
=
Provider
.
of
<
HomeProvider
>(
context
);
HistoryProvider
_historyProvider
=
Provider
.
of
<
HistoryProvider
>(
context
);
// _historyProvider.snackNode(context);
HistoryProvider
_historyStatic
=
HistoryProvider
(
''
);
return
Scaffold
(
resizeToAvoidBottomInset:
false
,
drawer:
Drawer
(
...
...
@@ -74,13 +73,6 @@ class HomeScreen extends StatelessWidget {
icon:
_homeProvider
.
searchIcon
,
color:
Colors
.
grey
[
850
],
onPressed:
()
{
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) {
// return SearchList();
// }),
// );
if
(
_homeProvider
.
searchIcon
.
icon
==
Icons
.
search
)
{
_homeProvider
.
searchIcon
=
Icon
(
Icons
.
close
,
...
...
@@ -115,183 +107,218 @@ class HomeScreen extends StatelessWidget {
backgroundColor:
Color
(
0xffFFD58D
),
),
backgroundColor:
Color
(
0xffF9F9F1
),
body:
// _homeProvider.currentTab[_homeProvider.currentIndex],
Builder
(
builder:
(
context
)
=
>
Column
(
children:
<
Widget
>[
// _historyProvider.snackNode(context),
// SnackBar(content: Text('tataaa')),
Padding
(
padding:
EdgeInsets
.
only
(
top:
22
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
SizedBox
(
width:
7
),
Image
(
image:
AssetImage
(
'assets/icon/gecko_final.png'
),
height:
180
),
])),
Padding
(
padding:
EdgeInsets
.
only
(
top:
15
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
"L’application de paiement Ğ1
\n
plus mobile qu’un lésard du Vietnam"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
15
),
)
])),
Padding
(
padding:
EdgeInsets
.
only
(
top:
60
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Column
(
children:
<
Widget
>[
Container
(
child:
ClipOval
(
child:
Material
(
color:
Color
(
0xffFFD58D
),
// button color
child:
InkWell
(
splashColor:
Color
(
0xffD28928
),
// inkwell color
child:
Padding
(
padding:
EdgeInsets
.
all
(
17
),
child:
Image
(
image:
AssetImage
(
'assets/qrcode-scan.png'
),
height:
58
)),
onTap:
()
async
{
await
_historyProvider
.
scan
(
context
);
}),
),
),
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
,
blurRadius:
4.0
,
offset:
Offset
(
2.0
,
2.5
),
spreadRadius:
0.5
)
],
),
),
SizedBox
(
height:
10
),
Text
(
"Payer par QR-Code"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
13
),
)
])
])),
Padding
(
padding:
EdgeInsets
.
only
(
top:
60
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Column
(
children:
<
Widget
>[
Container
(
child:
ClipOval
(
child:
Material
(
color:
Color
(
0xffFFD58D
),
// button color
child:
InkWell
(
splashColor:
Color
(
0xffD28928
),
// inkwell color
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
18
,
vertical:
14
),
child:
Image
(
image:
AssetImage
(
'assets/blockchain.png'
),
height:
65
)),
onTap:
()
{}),
),
),
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
,
blurRadius:
4.0
,
offset:
Offset
(
2.0
,
2.5
),
spreadRadius:
0.5
)
],
),
),
SizedBox
(
height:
10
),
Text
(
"Explorer
\n
"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
13
),
)
body:
Builder
(
builder:
(
ctx
)
=
>
StatefulWrapper
(
onInit:
()
{
WidgetsBinding
.
instance
.
addPostFrameCallback
((
_
)
{
_historyStatic
.
snackNode
(
ctx
);
});
},
child:
Column
(
children:
<
Widget
>[
Padding
(
padding:
EdgeInsets
.
only
(
top:
22
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
SizedBox
(
width:
7
),
Image
(
image:
AssetImage
(
'assets/icon/gecko_final.png'
),
height:
180
),
])),
Padding
(
padding:
EdgeInsets
.
only
(
top:
15
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Text
(
"L’application de paiement Ğ1
\n
plus mobile qu’un lésard du Vietnam"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
15
),
)
])),
Padding
(
padding:
EdgeInsets
.
only
(
top:
60
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Column
(
children:
<
Widget
>[
Container
(
child:
ClipOval
(
child:
Material
(
color:
Color
(
0xffFFD58D
),
// button color
child:
InkWell
(
splashColor:
Color
(
0xffD28928
),
// inkwell color
child:
Padding
(
padding:
EdgeInsets
.
all
(
17
),
child:
Image
(
image:
AssetImage
(
'assets/qrcode-scan.png'
),
height:
58
)),
onTap:
()
async
{
await
_historyProvider
.
scan
(
context
);
}),
),
),
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
,
blurRadius:
4.0
,
offset:
Offset
(
2.0
,
2.5
),
spreadRadius:
0.5
)
],
),
),
SizedBox
(
height:
10
),
Text
(
"Payer par QR-Code"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
13
),
)
])
])),
Padding
(
padding:
EdgeInsets
.
only
(
top:
60
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
<
Widget
>[
Column
(
children:
<
Widget
>[
Container
(
child:
ClipOval
(
child:
Material
(
color:
Color
(
0xffFFD58D
),
// button color
child:
InkWell
(
splashColor:
Color
(
0xffD28928
),
// inkwell color
child:
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
18
,
vertical:
14
),
child:
Image
(
image:
AssetImage
(
'assets/blockchain.png'
),
height:
65
)),
onTap:
()
{}),
),
),
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
,
blurRadius:
4.0
,
offset:
Offset
(
2.0
,
2.5
),
spreadRadius:
0.5
)
],
),
),
SizedBox
(
height:
10
),
Text
(
"Explorer
\n
"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
13
),
)
]),
SizedBox
(
width:
140
),
Column
(
children:
<
Widget
>[
Container
(
child:
ClipOval
(
child:
Material
(
color:
Color
(
0xffFFD58D
),
// button color
child:
InkWell
(
splashColor:
Color
(
0xffD28928
),
// inkwell color
child:
Padding
(
padding:
EdgeInsets
.
all
(
20
),
child:
Image
(
image:
AssetImage
(
'assets/lock.png'
),
height:
50
)),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
WalletsHome
();
}),
);
}),
),
),
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
,
blurRadius:
4.0
,
offset:
Offset
(
2.0
,
2.5
),
spreadRadius:
0.5
)
],
),
),
SizedBox
(
height:
10
),
Text
(
"Gérer mes
\n
portefeuilles"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
13
),
)
])
]))
]),
SizedBox
(
width:
140
),
Column
(
children:
<
Widget
>[
Container
(
child:
ClipOval
(
child:
Material
(
color:
Color
(
0xffFFD58D
),
// button color
child:
InkWell
(
splashColor:
Color
(
0xffD28928
),
// inkwell color
child:
Padding
(
padding:
EdgeInsets
.
all
(
20
),
child:
Image
(
image:
AssetImage
(
'assets/lock.png'
),
height:
50
)),
onTap:
()
{
Navigator
.
push
(
context
,
MaterialPageRoute
(
builder:
(
context
)
{
return
WalletsHome
();
}),
);
}),
),
),
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
color:
Colors
.
white
,
boxShadow:
[
BoxShadow
(
color:
Colors
.
grey
,
blurRadius:
4.0
,
offset:
Offset
(
2.0
,
2.5
),
spreadRadius:
0.5
)
],
),
),
SizedBox
(
height:
10
),
Text
(
"Gérer mes
\n
portefeuilles"
,
textAlign:
TextAlign
.
center
,
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
13
),
)
])
]))
]),
// bottomNavigationBar: BottomNavigationBar(
// backgroundColor: Color(0xffFFD58D),
// fixedColor: Colors.grey[850],
// unselectedItemColor: Color(0xffBD935C),
// type: BottomNavigationBarType.fixed,
// onTap: (index) {
// _homeProvider.currentIndex = index;
// },
// currentIndex: _homeProvider.currentIndex,
// items: [
// BottomNavigationBarItem(
// icon: Image.asset('assets/block-space-disabled.png', height: 26),
// activeIcon: Image.asset('assets/blockchain.png', height: 26),
// label: 'Explorateur',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.lock),
// label: 'Mes portefeuilles',
// ),
// ],
// ),
));
// bottomNavigationBar: BottomNavigationBar(
// backgroundColor: Color(0xffFFD58D),
// fixedColor: Colors.grey[850],
// unselectedItemColor: Color(0xffBD935C),
// type: BottomNavigationBarType.fixed,
// onTap: (index) {
// _homeProvider.currentIndex = index;
// },
// currentIndex: _homeProvider.currentIndex,
// items: [
// BottomNavigationBarItem(
// icon: Image.asset('assets/block-space-disabled.png', height: 26),
// activeIcon: Image.asset('assets/blockchain.png', height: 26),
// label: 'Explorateur',
// ),
// BottomNavigationBarItem(
// icon: Icon(Icons.lock),
// label: 'Mes portefeuilles',
// ),
// ],
// ),
)));
}
}
class
StatefulWrapper
extends
StatefulWidget
{
final
Function
onInit
;
final
Widget
child
;
const
StatefulWrapper
({
@required
this
.
onInit
,
@required
this
.
child
});
@override
_StatefulWrapperState
createState
()
=
>
_StatefulWrapperState
();
}
class
_StatefulWrapperState
extends
State
<
StatefulWrapper
>
{
@override
void
initState
()
{
if
(
widget
.
onInit
!=
null
)
{
widget
.
onInit
();
}
super
.
initState
();
}
@override
Widget
build
(
BuildContext
context
)
{
return
widget
.
child
;
}
}
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