Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ginkgo
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
vjrj
ginkgo
Commits
abb69645
Commit
abb69645
authored
1 year ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
More work with the cards drawer
parent
74147712
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/ui/widgets/card_drawer.dart
+5
-10
5 additions, 10 deletions
lib/ui/widgets/card_drawer.dart
lib/ui/widgets/first_screen/credit_card_mini.dart
+80
-79
80 additions, 79 deletions
lib/ui/widgets/first_screen/credit_card_mini.dart
with
85 additions
and
89 deletions
lib/ui/widgets/card_drawer.dart
+
5
−
10
View file @
abb69645
...
...
@@ -10,6 +10,7 @@ import '../../data/models/cesium_card.dart';
import
'../../shared_prefs.dart'
;
import
'../screens/sandbox.dart'
;
import
'../ui_helpers.dart'
;
import
'first_screen/card_stack.dart'
;
class
CardDrawer
extends
StatelessWidget
{
const
CardDrawer
({
super
.
key
});
...
...
@@ -52,17 +53,11 @@ class CardDrawer extends StatelessWidget {
const
SizedBox
(
height:
200
,
child:
Center
(
child:
Text
(
'Cards'
,
style:
TextStyle
(
fontSize:
24
,
fontWeight:
FontWeight
.
bold
,
),
),
child:
CardStack
(),
),
),
if
(
kReleaseMode
)
Expanded
(
child:
Container
()),
if
(
!
kReleaseMode
)
Expanded
(
child:
Container
()),
/*
if (!kReleaseMode)
Expanded(
child: Container(
decoration: const BoxDecoration(
...
...
@@ -86,7 +81,7 @@ class CardDrawer extends StatelessWidget {
},
),
),
),
),
*/
if
(
inDevelopment
)
ListTile
(
leading:
const
Icon
(
Icons
.
build
),
...
...
This diff is collapsed.
Click to expand it.
lib/ui/widgets/first_screen/credit_card_mini.dart
+
80
−
79
View file @
abb69645
import
'package:durt/durt.dart'
;
import
'package:easy_localization/easy_localization.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_dotenv/flutter_dotenv.dart'
;
import
'../../../shared_prefs.dart'
;
import
'../../ui_helpers.dart'
;
import
'card_name_editable.dart'
;
import
'card_text_style.dart'
;
class
CreditCardMini
extends
StatelessWidget
{
const
CreditCardMini
({
super
.
key
,
required
this
.
wallet
});
const
CreditCardMini
({
super
.
key
,
required
this
.
pubKey
});
final
CesiumWallet
wallet
;
final
String
pubKey
;
@override
Widget
build
(
BuildContext
context
)
{
final
String
pubKey
=
wallet
.
pubkey
;
const
double
cardRadius
=
10.0
;
final
bool
bigDevice
=
bigScreen
(
context
);
final
double
cardPadding
=
bigDevice
?
26.0
:
16.0
;
return
Card
(
elevation:
8.0
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
cardRadius
),
),
child:
AspectRatio
(
aspectRatio:
1.58
,
// Credit cart aspect ratio
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
cardRadius
),
boxShadow:
<
BoxShadow
>[
BoxShadow
(
color:
Colors
.
grey
[
400
]
!
,
blurRadius:
10.0
,
spreadRadius:
1.0
,
)
],
gradient:
LinearGradient
(
begin:
Alignment
.
bottomLeft
,
end:
Alignment
.
topRight
,
colors:
<
Color
>[
Color
(
int
.
parse
(
"
${dotenv.env['CARD_COLOR_LEFT']}
"
)),
Color
(
int
.
parse
(
"
${dotenv.env['CARD_COLOR_RIGHT']}
"
)),
],
),
),
child:
Stack
(
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
160
,
10
,
0
,
0
),
child:
Opacity
(
opacity:
0.1
,
child:
Image
.
asset
(
'assets/img/gbrevedot_alt.png'
))),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
<
Widget
>[
Padding
(
padding:
EdgeInsets
.
all
(
cardPadding
),
child:
FittedBox
(
fit:
BoxFit
.
scaleDown
,
child:
Text
(
dotenv
.
env
[
'CARD_TEXT'
]
??
tr
(
'g1_wallet'
),
style:
TextStyle
(
color:
Colors
.
white
,
fontSize:
MediaQuery
.
of
(
context
)
.
size
.
width
*
0.07
,
fontWeight:
FontWeight
.
bold
,
),
)),
final
double
cardInternalElPadding
=
bigDevice
?
5
:
6.0
;
return
Padding
(
padding:
const
EdgeInsets
.
all
(
10
),
child:
Card
(
elevation:
8.0
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
cardRadius
),
),
child:
AspectRatio
(
aspectRatio:
1.58
,
// Credit cart aspect ratio
child:
Container
(
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
cardRadius
),
boxShadow:
<
BoxShadow
>[
BoxShadow
(
color:
Colors
.
grey
[
400
]
!
,
blurRadius:
3.0
,
spreadRadius:
1.0
,
)
],
gradient:
LinearGradient
(
begin:
Alignment
.
bottomLeft
,
end:
Alignment
.
topRight
,
colors:
<
Color
>[
Color
(
int
.
parse
(
"
${dotenv.env['CARD_COLOR_LEFT']}
"
)),
Color
(
int
.
parse
(
"
${dotenv.env['CARD_COLOR_RIGHT']}
"
)),
],
),
const
SizedBox
(
height:
6.0
),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
cardPadding
),
child:
Row
(
children:
<
Widget
>[
GestureDetector
(
onTap:
()
=
>
showTooltip
(
context
,
''
,
tr
(
'keys_tooltip'
)),
child:
FittedBox
(
fit:
BoxFit
.
scaleDown
,
child:
Text
(
'**** **** '
,
style:
cardTextStyle
(
context
)))),
FittedBox
(
fit:
BoxFit
.
scaleDown
,
child:
Text
(
'
${pubKey.substring(0, 4)}
${pubKey.substring(4, 8)}
'
,
style:
cardTextStyle
(
context
),
))
])),
if
(
bigDevice
)
const
SizedBox
(
height:
6.0
),
const
SizedBox
(
height:
18.0
),
]),
]),
)));
),
child:
Padding
(
padding:
const
EdgeInsets
.
all
(
10
),
child:
Stack
(
children:
<
Widget
>[
Padding
(
padding:
const
EdgeInsets
.
fromLTRB
(
120
,
10
,
0
,
0
),
child:
Opacity
(
opacity:
0.1
,
child:
Image
.
asset
(
'assets/img/gbrevedot_alt.png'
,
width:
100
,
height:
100
),
)),
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
// mainAxisAlignment: MainAxisAlignment.start,
children:
<
Widget
>[
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
cardInternalElPadding
,
vertical:
cardInternalElPadding
),
child:
Row
(
children:
<
Widget
>[
Expanded
(
child:
CardNameText
(
currentText:
SharedPreferencesHelper
()
.
getName
(),
onTap:
()
{},
)),
])),
Padding
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
cardInternalElPadding
,
vertical:
cardInternalElPadding
),
child:
Row
(
children:
<
Widget
>[
GestureDetector
(
onTap:
()
=
>
showQrDialog
(
context:
context
,
publicKey:
pubKey
),
child:
FittedBox
(
fit:
BoxFit
.
scaleDown
,
child:
Text
(
'
${pubKey.substring(0, 4)}
${pubKey.substring(4, 8)}
'
,
style:
cardTextStyle
(
context
,
fontSize:
16
),
))),
])),
if
(
bigDevice
)
const
SizedBox
(
height:
6.0
),
const
SizedBox
(
height:
8.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