From 7cd85810321e9f6adb6f4fbed4ed98339a9b346f Mon Sep 17 00:00:00 2001 From: laiiihz Date: Thu, 26 Nov 2020 13:25:05 +0800 Subject: [PATCH] add sizedBox extension --- lib/ansu_ui.dart | 2 ++ lib/extension/sizedbox_extension.dart | 9 +++++++++ 2 files changed, 11 insertions(+) create mode 100644 lib/extension/sizedbox_extension.dart diff --git a/lib/ansu_ui.dart b/lib/ansu_ui.dart index fdd1d69..0d1b72d 100644 --- a/lib/ansu_ui.dart +++ b/lib/ansu_ui.dart @@ -21,5 +21,7 @@ export 'text_field/as_search_text_field.dart'; export 'utils/screen_adapter.dart'; +export 'extension/sizedbox_extension.dart'; + //`BOTTOM` is external lib export 'package:flutter_screenutil/flutter_screenutil.dart'; diff --git a/lib/extension/sizedbox_extension.dart b/lib/extension/sizedbox_extension.dart new file mode 100644 index 0000000..9f2bff3 --- /dev/null +++ b/lib/extension/sizedbox_extension.dart @@ -0,0 +1,9 @@ +import 'package:ansu_ui/ansu_ui.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +extension SizedBoxExt on num { + Widget get wb => SizedBox(width: ScreenUtil().setWidth(this)); + + Widget get hb => SizedBox(height: ScreenUtil().setWidth(this)); +}