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
Jonny Borges
2020-09-02 14:45:38 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2020-09-02 14:45:38 -0300
Commit
15ee89eded787f31103ae9f2c827542f84a124a0
15ee89ed
1 parent
b71145ea
Update widget_extensions.dart
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
lib/src/utils/extensions/widget_extensions.dart
lib/src/utils/extensions/widget_extensions.dart
View file @
15ee89e
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
);
...
...
@@ -33,14 +35,14 @@ extension WidgetMarginX on Widget {
margin:
EdgeInsets
.
symmetric
(
horizontal:
horizontal
,
vertical:
vertical
),
child:
this
);
Widget
marginOnly
({
double
left
=
0.0
,
double
top
=
0.0
,
double
right
=
0.0
,
double
bottom
=
0.0
,
})
=>
Container
(
Padding
(
margin:
EdgeInsets
.
only
(
top:
top
,
left:
left
,
right:
right
,
bottom:
bottom
),
child:
this
);
...
...
@@ -48,6 +50,7 @@ extension WidgetMarginX on Widget {
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