Size/dynamic_size library
A library for dynamic sizing and navigation in Flutter.
The dynamicutils
library provides utilities for dynamically sizing widgets based on the device's screen dimensions.
It also includes navigation functions for managing screen transitions.
Usage:
- Import the
dynamicutils
library. - Create an instance of the
DynamicSize
class by providing the initial height and width values. - Use the
height
andwidth
methods to dynamically calculate the desired height and width based on the provided values. - Use the
HeightSpace
andWidthSpace
methods to createSizedBox
widgets with dynamic heights and widths. - Use the
dContainer
method to create aContainer
widget with dynamic dimensions and other customizable properties. - Use the
Pop
,NewScreen
, andReplaceScreen
functions for navigation purposes.
Note: This library requires the flutter
and material
packages.
Classes
- DynamicSize
- A class for dynamically sizing widgets based on screen dimensions.
Functions
-
newScreen(
BuildContext context, dynamic screen()) → void - Navigates to a new screen.
-
pop(
BuildContext context) → void - Navigates back to the previous screen.
-
replaceScreen(
BuildContext context, dynamic screen()) → void - Replaces the current screen with a new screen.