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
aa4a52c9
Commit
aa4a52c9
authored
1 year ago
by
vjrj
Browse files
Options
Downloads
Patches
Plain Diff
Remove connectivity. Fix comment edition
parent
06fd5c38
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/ui/widgets/first_screen/pay_form.dart
+24
-30
24 additions, 30 deletions
lib/ui/widgets/first_screen/pay_form.dart
with
24 additions
and
30 deletions
lib/ui/widgets/first_screen/pay_form.dart
+
24
−
30
View file @
aa4a52c9
import
'package:connectivity_wrapper/connectivity_wrapper.dart'
;
import
'dart:async'
;
import
'package:easy_localization/easy_localization.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/material.dart'
;
...
...
@@ -93,31 +94,24 @@ class _PayFormState extends State<PayForm> {
autofillHints:
const
<
String
>[],
),
const
SizedBox
(
height:
10.0
),
ConnectivityWidgetWrapper
(
stacked:
false
,
offlineWidget:
ElevatedButton
(
onPressed:
null
,
style:
payBtnStyle
,
child:
_buildBtn
(
Text
(
tr
(
'offline'
))),
),
child:
ElevatedButton
(
key:
paySentKey
,
onPressed:
(
!
state
.
canBeSent
()
||
state
.
amount
==
null
||
!
_commentValidate
()
||
!
_weHaveBalance
(
context
,
state
.
amount
!
))
?
null
:
()
async
{
try
{
await
payWithRetry
(
context
,
state
,
false
);
}
on
RetryException
{
// Here the transactions can be lost, so we must implement some manual retry use
await
payWithRetry
(
context
,
state
,
true
);
}
},
style:
payBtnStyle
,
child:
_buildBtn
(
payBtnText
),
)),
ElevatedButton
(
key:
paySentKey
,
onPressed:
(
!
state
.
canBeSent
()
||
state
.
amount
==
null
||
!
_commentValidate
()
||
!
_weHaveBalance
(
context
,
state
.
amount
!
))
?
null
:
()
async
{
try
{
await
payWithRetry
(
context
,
state
,
false
);
}
on
RetryException
{
// Here the transactions can be lost, so we must implement some manual retry use
await
payWithRetry
(
context
,
state
,
true
);
}
},
style:
payBtnStyle
,
child:
_buildBtn
(
payBtnText
),
),
const
SizedBox
(
height:
8
),
ValueListenableBuilder
<
String
>(
valueListenable:
_feedbackNotifier
,
...
...
@@ -267,13 +261,13 @@ class NoNewLineTextInputFormatter extends TextInputFormatter {
@override
TextEditingValue
formatEditUpdate
(
TextEditingValue
oldValue
,
TextEditingValue
newValue
)
{
final
int
cursorPosition
=
newValue
.
selection
.
baseOffset
;
final
String
newText
=
newValue
.
text
.
replaceAll
(
'
\n
'
,
''
);
final
TextSelection
newSelection
=
TextSelection
.
collapsed
(
offset:
cursorPosition
);
return
TextEditingValue
(
text:
newText
,
selection:
newValue
.
selection
.
copyWith
(
baseOffset:
newText
.
length
,
extentOffset:
newText
.
length
,
),
selection:
newSelection
,
);
}
}
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