Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
fluttertpc_get
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Jonatas
2020-09-02 15:54:15 -0300
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
29f349cedf4cae4c57b3aaa06775d30bf980af4c
29f349ce
2 parents
c1f56af7
6cb4bfe6
Merge branch 'master' of
https://github.com/jonataslaw/getx
into master
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletions
lib/src/utils/extensions/widget_extensions.dart
lib/src/utils/extensions/widget_extensions.dart
View file @
29f349c
import
'package:flutter/widgets.dart'
;
/// add Padding Property to widget
extension
WidgetPaddingX
on
Widget
{
Widget
paddingAll
(
double
padding
)
=>
Padding
(
padding:
EdgeInsets
.
all
(
padding
),
child:
this
);
...
...
@@ -24,6 +25,7 @@ extension WidgetPaddingX on Widget {
Widget
get
paddingZero
=>
Padding
(
padding:
EdgeInsets
.
zero
,
child:
this
);
}
/// Add margin property to widget
extension
WidgetMarginX
on
Widget
{
Widget
marginAll
(
double
margin
)
=>
Container
(
margin:
EdgeInsets
.
all
(
margin
),
child:
this
);
...
...
@@ -40,10 +42,15 @@ extension WidgetMarginX on Widget {
double
right
=
0.0
,
double
bottom
=
0.0
,
})
=>
Container
(
Padding
(
margin:
EdgeInsets
.
only
(
top:
top
,
left:
left
,
right:
right
,
bottom:
bottom
),
child:
this
);
Widget
get
marginZero
=>
Container
(
margin:
EdgeInsets
.
zero
,
child:
this
);
}
/// Allows you to insert widgets inside a CustomScrollView
extension
WidgetSliverBoxX
on
Widget
{
Widget
get
sliverBox
=>
SliverToBoxAdapter
(
child:
this
);
}
...
...
Please
register
or
login
to post a comment