add edgeInsets gen

null_safety
小赖 4 years ago
parent 4cc429d0f8
commit 576d826792

@ -82,6 +82,19 @@ class _ExampleNumExtState extends State<ExampleNumExt> {
), ),
), ),
), ),
ListTile(title: Text('EdgeInsets')),
ListTile(
leading: Chip(label: Text('.edge')),
title: Text('EdgeInsets Gen'),
subtitle: Text('10.edge'),
trailing: Container(
height: 30.w,
width: 30.w,
color: Colors.red,
padding: 10.edge,
child: Container(color: Colors.green),
),
),
], ],
), ),
); );

@ -9,6 +9,9 @@ extension NumExt on num {
/// SizedBox /// SizedBox
Widget get hb => SizedBox(height: this.w); Widget get hb => SizedBox(height: this.w);
/// EdgeInsets.all
EdgeInsets get edge => EdgeInsets.all(this.w);
/// ///
BorderRadius get radius => BorderRadius.circular(this.w); BorderRadius get radius => BorderRadius.circular(this.w);

Loading…
Cancel
Save