value<T> static method

T value<T>({
  1. required BuildContext context,
  2. required T mobile,
  3. T? tablet,
  4. T? desktop,
  5. T? large,
})

Adatively provides the assign type with the correct element based on the current breakpoint {@tool snippet}

Here are some examples of how to create Bamboo.value instances:

Mostly, you may need to pass only mobile and large:

BamboomResponsive.value(
   context: context,
   mobile: Colors.amberAccent,
   desktop: Colors.pink,
   tablet: Colors.black,
 )

{@end-tool} {@tool snippet} If any of the value non-required value is set to null it will take the mobile breakpoint as default See also:

  • number, a method which allow set adative num values.

Implementation

static T value<T>({
  required BuildContext context,
  required T mobile,
  T? tablet,
  T? desktop,
  T? large,
}) {
  return Bamboo<T>(
    mobile: mobile,
    tablet: tablet,
    desktop: desktop,
    context: context,
    large: large,
    unit: Unit.px,
  ).adaptive;
}