0 purchases
context extensions
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;
copied to clipboard
Theme properties #
var textTheme = context.textTheme;
var colorPrimary = context.primaryColor;
var colorAccent = context.accentColor;
var colorCanvas = context.canvasColor;
var colorBackground = context.BackgroundColor;
copied to clipboard
Navigator helpers #
context.push((c) => NaxtPage());
context.pop();
copied to clipboard
MediaQuery properties #
var screenSize = context.screenSize;
var screenPadding = context.screenPadding;
copied to clipboard
Scaffold helpers #
context.showSnackBar(SnackBar(content: Tex('text')));
copied to clipboard
Overlay helpers #
var overlayEntry = context.addOverlay((context){
return Align(
alignment: AlignmentDirectional.bottomStart,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text('overlay'),
),
);
});
copied to clipboard
Action helper #
context.invokeAction(intent);
copied to clipboard
Form helper #
if(context.form.validate()){
/* ... */
} else {
/* ... */
}
copied to clipboard
Localization helper #
var locale = context.locale
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.