Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flutter-toolbox
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
android
flutter-toolbox
Commits
bc37a59b
Commit
bc37a59b
authored
4 months ago
by
Benoît Harrault
Browse files
Options
Downloads
Patches
Plain Diff
Scroll too long parameters page, improve layout
parent
63d38ebc
No related branches found
No related tags found
1 merge request
!15
Resolve "Scroll too long parameters page"
Pipeline
#7406
passed
4 months ago
Stage: build-debug
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+4
-0
4 additions, 0 deletions
CHANGELOG.md
lib/parameters/pages/parameters.dart
+40
-31
40 additions, 31 deletions
lib/parameters/pages/parameters.dart
pubspec.yaml
+1
-1
1 addition, 1 deletion
pubspec.yaml
with
45 additions
and
32 deletions
CHANGELOG.md
+
4
−
0
View file @
bc37a59b
## 0.8.4
-
Allow scroll too long parameters page, improve layout
## 0.8.3
-
Improve topbar buttons
...
...
This diff is collapsed.
Click to expand it.
lib/parameters/pages/parameters.dart
+
40
−
31
View file @
bc37a59b
...
...
@@ -12,36 +12,49 @@ class PageParameters extends StatelessWidget {
final
ApplicationConfigDefinition
appConfig
;
final
bool
canBeResumed
;
final
double
separatorHeight
=
8
.0
;
final
double
separatorHeight
=
4
.0
;
@override
Widget
build
(
BuildContext
context
)
{
final
List
<
Widget
>
lines
=
[];
// Activity settings (top)
final
List
<
Widget
>
blockTop
=
[];
for
(
ApplicationSettingsParameter
parameter
in
appConfig
.
activitySettings
)
{
if
(
parameter
.
displayedOnTop
)
{
for
(
var
itemsLine
in
buildParametersLines
(
for
(
List
<
Widget
>
itemsLine
in
buildParametersLines
(
parameter:
parameter
,
isEnabled:
!
canBeResumed
,
))
{
lines
.
add
(
Row
(
blockTop
.
add
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
itemsLine
,
));
}
lines
.
add
(
SizedBox
(
height:
separatorHeight
));
blockTop
.
add
(
SizedBox
(
height:
separatorHeight
));
}
}
lines
.
add
(
Expanded
(
child:
SizedBox
(
height:
separatorHeight
),
));
// Activity settings (bottom)
final
List
<
Widget
>
blockBottom
=
[];
for
(
ApplicationSettingsParameter
parameter
in
appConfig
.
activitySettings
)
{
if
(
!
parameter
.
displayedOnTop
)
{
for
(
List
<
Widget
>
itemsLine
in
buildParametersLines
(
parameter:
parameter
,
isEnabled:
!
canBeResumed
,
))
{
blockBottom
.
add
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
itemsLine
,
));
}
blockBottom
.
add
(
SizedBox
(
height:
separatorHeight
));
}
}
// Actions buttons (middle block)
final
List
<
Widget
>
blockActions
=
[];
if
(
canBeResumed
)
{
// Resume activity
line
s
.
add
(
AspectRatio
(
blockAction
s
.
add
(
AspectRatio
(
aspectRatio:
3
,
child:
ActivityButtonResumeSaved
(
onPressed:
()
{
...
...
@@ -50,7 +63,7 @@ class PageParameters extends StatelessWidget {
),
));
// Delete saved activity
line
s
.
add
(
SizedBox
.
square
(
blockAction
s
.
add
(
SizedBox
.
square
(
dimension:
MediaQuery
.
of
(
context
)
.
size
.
width
/
5
,
child:
ActivityButtonDeleteSaved
(
onPressed:
()
{
...
...
@@ -60,7 +73,7 @@ class PageParameters extends StatelessWidget {
));
}
else
{
// Start new activity
line
s
.
add
(
blockAction
s
.
add
(
AspectRatio
(
aspectRatio:
3
,
child:
ActivityButtonStartNew
(
...
...
@@ -71,29 +84,25 @@ class PageParameters extends StatelessWidget {
),
);
}
blockActions
.
add
(
SizedBox
(
height:
separatorHeight
));
lines
.
add
(
SizedBox
(
height:
separatorHeight
));
// Global blocks list
final
List
<
Widget
>
blocks
=
[
Expanded
(
child:
ListView
(
children:
blockTop
,
),
),
SizedBox
(
height:
separatorHeight
),
];
// Activity settings (bottom)
for
(
ApplicationSettingsParameter
parameter
in
appConfig
.
activitySettings
)
{
if
(
!
parameter
.
displayedOnTop
)
{
for
(
var
itemsLine
in
buildParametersLines
(
parameter:
parameter
,
isEnabled:
!
canBeResumed
,
))
{
lines
.
add
(
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
itemsLine
,
));
}
blocks
.
addAll
(
blockActions
);
lines
.
add
(
SizedBox
(
height:
separatorHeight
));
}
if
(
blockBottom
.
isNotEmpty
)
{
blocks
.
addAll
(
blockBottom
);
}
return
Column
(
children:
lines
,
);
return
Column
(
children:
blocks
);
}
List
<
List
<
Widget
>>
buildParametersLines
({
...
...
This diff is collapsed.
Click to expand it.
pubspec.yaml
+
1
−
1
View file @
bc37a59b
...
...
@@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects."
publish_to
:
"
none"
version
:
0.8.
3
version
:
0.8.
4
homepage
:
https://git.harrault.fr/android/flutter-toolbox
...
...
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