context_extensions 1.0.0 icon indicating copy to clipboard operation
context_extensions: ^1.0.0 copied to clipboard

Various extensions on BuildContext to access inherited widget's state

context_extentions #

Getting inherited widget's state #

 var themeData = context.theme;

 var scaffold = context.scaffold;
 
 var navigator = context.navigator;
 
 var overlay = context.overlay;
 
 var mediaQuery = context.mediaQuery;

Theme properties #

var textTheme = context.textTheme;

var colorPrimary = context.primaryColor;

var colorAccent = context.accentColor;

var colorCanvas = context.canvasColor;

var colorBackground = context.BackgroundColor;

context.push((c) => NaxtPage());

context.pop();

MediaQuery properties #


var screenSize = context.screenSize;

var screenPadding = context.screenPadding;

Scaffold helpers #


context.showSnackBar(SnackBar(content: Tex('text')));

Overlay helpers #


var overlayEntry = context.addOverlay((context){
  return Align(
    alignment: AlignmentDirectional.bottomStart,
    child: Padding(
      padding: const EdgeInsets.all(8.0),
      child: Text('overlay'),
    ),
  );
});

Action helper #

context.invokeAction(intent);

Form helper #

if(context.form.validate()){
  /* ... */
} else {
  /* ... */
}

Localization helper #

var locale = context.locale
4
likes
110
pub points
22%
popularity

Publisher

verified publisher iconaligator.ir

Various extensions on BuildContext to access inherited widget's state

Homepage

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on context_extensions