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
40d35b4e
Commit
40d35b4e
authored
1 year ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Added missing widget
parent
77d5b792
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/screens/sandbox.dart
+61
-5
61 additions, 5 deletions
lib/ui/screens/sandbox.dart
lib/ui/widgets/fifth_screen/import_clipboard_dialog.dart
+58
-0
58 additions, 0 deletions
lib/ui/widgets/fifth_screen/import_clipboard_dialog.dart
with
119 additions
and
5 deletions
lib/ui/screens/sandbox.dart
+
61
−
5
View file @
40d35b4e
import
'package:flutter_neumorphic/flutter_neumorphic.dart'
;
import
'../widgets/first_screen/c
ard_name_editable
.dart'
;
import
'../widgets/first_screen/c
redit_card
.dart'
;
class
Sandbox
extends
StatefulWidget
{
const
Sandbox
({
super
.
key
});
...
...
@@ -10,12 +10,68 @@ class Sandbox extends StatefulWidget {
}
class
_SandboxState
extends
State
<
Sandbox
>
{
final
double
expandedHeight
=
500
;
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
appBar:
AppBar
(
title:
const
Text
(
'Sandbox'
),
),
body:
const
CardNameEditable
());
body:
CustomScrollView
(
slivers:
<
Widget
>[
SliverAppBar
(
expandedHeight:
expandedHeight
,
pinned:
true
,
flexibleSpace:
LayoutBuilder
(
builder:
(
BuildContext
context
,
BoxConstraints
constraints
)
{
// Calcula la proporción de la altura actual respecto a la altura expandida
final
double
percent
=
(
expandedHeight
-
constraints
.
maxHeight
)
/
expandedHeight
;
return
Stack
(
fit:
StackFit
.
expand
,
children:
<
Widget
>[
// CreditCard(),
Positioned
(
top:
0
,
left:
0
,
child:
ClipRect
(
child:
AnimatedOpacity
(
opacity:
1
-
percent
,
duration:
const
Duration
(
milliseconds:
200
),
child:
CreditCard
(),
),
),
),
Positioned
(
bottom:
16
,
left:
36
,
child:
ClipRect
(
child:
AnimatedOpacity
(
opacity:
percent
,
duration:
const
Duration
(
milliseconds:
200
),
child:
Text
(
'Mi AppBar'
,
style:
Theme
.
of
(
context
)
.
textTheme
.
headlineSmall
?.
copyWith
(
color:
Colors
.
white
),
),
),
),
),
],
);
}),
),
SliverList
(
delegate:
SliverChildBuilderDelegate
(
(
BuildContext
context
,
int
index
)
=
>
ListTile
(
title:
Text
(
'Item
$index
'
),
),
childCount:
50
,
),
),
],
),
);
}
}
This diff is collapsed.
Click to expand it.
lib/ui/widgets/fifth_screen/import_clipboard_dialog.dart
0 → 100644
+
58
−
0
View file @
40d35b4e
import
'package:clipboard/clipboard.dart'
;
import
'package:easy_localization/easy_localization.dart'
;
import
'package:flutter/material.dart'
;
class
ImportClipboardDialog
extends
StatefulWidget
{
const
ImportClipboardDialog
({
super
.
key
,
required
this
.
onImport
});
final
Function
(
String
)
onImport
;
@override
State
<
ImportClipboardDialog
>
createState
()
=
>
_ImportClipboardDialogState
();
}
class
_ImportClipboardDialogState
extends
State
<
ImportClipboardDialog
>
{
final
TextEditingController
_textController
=
TextEditingController
();
Future
<
void
>
_pasteFromClipboard
()
async
{
FlutterClipboard
.
paste
()
.
then
((
String
?
value
)
{
setState
(()
{
if
(
value
!=
null
)
{
_textController
.
text
=
value
;
}
});
});
}
@override
Widget
build
(
BuildContext
context
)
{
return
AlertDialog
(
title:
Text
(
tr
(
'import_wallet_from_clipboard'
)),
content:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
Text
(
tr
(
'import_wallet_from_clipboard_desc'
)),
TextField
(
controller:
_textController
,
maxLines:
5
,
decoration:
InputDecoration
(
hintText:
tr
(
'paste_here'
)),
),
const
SizedBox
(
height:
10
),
TextButton
(
onPressed:
_pasteFromClipboard
,
child:
Text
(
tr
(
'paste'
)),
),
],
),
actions:
<
Widget
>[
TextButton
(
child:
Text
(
tr
(
'import'
)),
onPressed:
()
{
Navigator
.
of
(
context
)
.
pop
(
_textController
.
text
);
widget
.
onImport
(
_textController
.
text
);
},
),
],
);
}
}
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