diff --git a/CHANGELOG.md b/CHANGELOG.md index ce2a256..62c65b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.2 + +- Add `EmptyWidget`, `Full`, `FullWidth`, `FullHeight` + ## 1.0.1 - Add topics diff --git a/README.md b/README.md index 237319b..08561d7 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,18 @@ Internally, These widgets use `SafeArea` widget and remove specified padding wit - `SafeAreaRight` - `SafeAreaBottom` +## Size Widgets + +- `Full` +- `FullWidth` +- `FullHeight` + +## Empty Widget + +- `Empty` + +## Code + ```dart PaddingAll( 24, diff --git a/example/pubspec.lock b/example/pubspec.lock index e6b7bbf..2880505 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -113,7 +113,7 @@ packages: path: ".." relative: true source: path - version: "1.0.1" + version: "1.0.2" path: dependency: transitive description: diff --git a/lib/padding_extra.dart b/lib/padding_extra.dart index fc4a37e..caae316 100644 --- a/lib/padding_extra.dart +++ b/lib/padding_extra.dart @@ -1,2 +1,4 @@ +export 'src/empty_widget.dart'; export 'src/padding_widgets.dart'; export 'src/safe_area_widgets.dart'; +export 'src/size_widgets.dart'; diff --git a/lib/src/empty_widget.dart b/lib/src/empty_widget.dart new file mode 100644 index 0000000..9c4d1e8 --- /dev/null +++ b/lib/src/empty_widget.dart @@ -0,0 +1,10 @@ +import 'package:flutter/cupertino.dart'; + +class Empty extends StatelessWidget { + const Empty({super.key}); + + @override + Widget build(BuildContext context) { + return const ExcludeSemantics(child: SizedBox.shrink()); + } +} diff --git a/lib/src/size_widgets.dart b/lib/src/size_widgets.dart new file mode 100644 index 0000000..b2d8098 --- /dev/null +++ b/lib/src/size_widgets.dart @@ -0,0 +1,43 @@ +import 'package:flutter/widgets.dart'; + +class Full extends StatelessWidget { + const Full({ + super.key, + required this.child, + }); + + final Widget child; + + @override + Widget build(BuildContext context) { + return SizedBox.expand(child: child); + } +} + +class FullHeight extends StatelessWidget { + const FullHeight({ + super.key, + required this.child, + }); + + final Widget child; + + @override + Widget build(BuildContext context) { + return SizedBox(height: double.infinity, child: child); + } +} + +class FullWidth extends StatelessWidget { + const FullWidth({ + super.key, + required this.child, + }); + + final Widget child; + + @override + Widget build(BuildContext context) { + return SizedBox(width: double.infinity, child: child); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index 1025e12..7df35d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: padding_extra description: This package provides extra padding widgets -version: 1.0.1 +version: 1.0.2 #homepage: https://mj-studio-library.github.io/flutter-local-file-preferences/ repository: https://github.com/mj-studio-library/padding_extra