adaptic 0.0.1 copy "adaptic: ^0.0.1" to clipboard
adaptic: ^0.0.1 copied to clipboard

A new Flutter package project.

Adaptive #

This package provides set of widgets and functions which makes it easy and fast to write platform and screen adaptive code. By using this package you can avoid using if statements and MediaQuery for different platform and screen sizes.

Features #

  • Developer can define thier own breakpoints in AdaptiveData widget.
  • Generic functions to return values based on breakpoints or platform.

Getting started #

  • Simply install and import the package and start using.
  • All functions require AdaptiveData widget above the tree.

Usage #

Add AdaptiveData anywhere above the tree.


Widget build(BuildContext context){
	return AdaptiveData(
		smallScreenBreakpoint: 480,
      		mediumScreenBreakpoint: 768,
      		largeScreenBreakpoint: 1024,
      		child: Scaffold( 
			body: Container()
			),
	);
}

Use functions anywhere below the AdaptiveData.


AdaptiveIfScreen<Widget>(
              context: context,
              ifNotSpecified: listView(), // if screen size is less than medium or small breakpoint then use this as 
              ifLarge: Row(
                children: [
                  Expanded(flex: 50, child: listView()),
                  Expanded(flex: 50, child: SampleItemDetailsView())
                ],
              ))),
    );


Center(
        child: Padding(
          padding: AdaptiveIfScreen(
              context: context,
              ifNotSpecified: EdgeInsets.all(10),
              ifLarge: EdgeInsets.all(20),
              ifMedium: EdgeInsets.all(15),
              ifSmall: EdgeInsets.all(10)),
          child: Text('More Information Here'),
        ),
      ),

Functions #

  • AdaptiveIfScreen<T> : To return screen size specific values.
  • AdaptiveIfPlatform<T> : To return platform specifice values.
  • AdaptiveIf<T> : Combination of AdaptiveIfScreen and AdaptiveIfPlatform.
  • AdaptivePlatformVoidCallback : Returns platform specific voidCallback ( for example to provide deifferent onTap callback).
  • AdaptiveScreenVoidCallback : Returnns screen size specifc voidCallback.

Additional information #

To raise issues , suggestions and ideas: https://github.com/suryaa62/adaptive

1
likes
90
pub points
0%
popularity

Publisher

unverified uploader

A new Flutter package project.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on adaptic