Skip to content

Releases: pedromassango/build_context

3.0.0

10 Mar 15:13
Compare
Choose a tag to compare
  • Migrated to null safety
  • Migration to ScaffoldMessenger

Added support for:

*context.platform
*context.headline1
*context.headline2
*context.headline3
*context.headline4
*context.headline5
*context.headline6
*context.subtitle1
*context.bodyText1
*context.bodyText2
*context.caption
*context.button
*context.subtitle2
*context.overline

*context.modalRoute
*context.routeSettings

Latest stable version with +40 extensions

23 Apr 08:46
Compare
Choose a tag to compare

Available Extensions

From the MediaQuery. Access properties right in the context instance. Available extensions:

  • context.mediaQuerySize

  • context.orientation

  • context.mediaQueryPadding

  • context.alwaysUse24HourFormat

  • context.devicePixelRatio

  • context.platformBrightness

  • context.textScaleFactor

  • context.isLandscape

  • context.isPortrait

  • context.mediaQueryViewPadding

  • context.mediaQueryViewInsets

  • context.mediaQueryShortestSide

  • context.isPhone

  • context.isTablet

  • context.isSmallTablet

  • context.isLargeTablet

From the Navigator class. Navigate with ease. Available extensions:

  • context.push()
  • context.pop()
  • context.canPop()
  • context.pushNamed()
  • context.popUntil()

From the Theme class. Access your themes right in the context instance. Available extensions:

  • context.textTheme
  • context.primaryTextTheme
  • context.accentTextTheme
  • context.bottomAppBarTheme
  • context.bottomSheetTheme
  • context.appBarTheme
  • context.backgroundColor
  • context.primaryColor
  • context.buttonColor
  • context.scaffoldBackgroundColor

From Scaffold class. Handle your scaffold in their context.

Note: those must be called in the context of a Scaffold widget otherwise you might have errors.

  • context.openDrawer()
  • context.openEndDrawer()
  • context.showSnackBar()
  • context.hideCurrentSnackBar()
  • context.removeCurrentSnackBar()
  • context.showBottomSheet()

From Form.of(context) class.

Note: those must be called in the context of a Scaffold widget otherwise you might have errors.

  • context.form.validate()
  • context.form.reset()
  • context.form.save()

From FocusScope.of(context) class.

  • context.focusScope.hasFocus

  • context.focusScope.isFirstFocus

  • context.focusScope.canRequestFocus

  • context.focusScope.hasPrimaryFocus

  • context.focusScope.unfocus()

  • context.focusScope.nextFocus()

  • context.focusScope.requestFocus()

  • context.focusScope.previousFocus()

  • context.focusScope.setFirstFocus()

  • context.focusScope.consumeKeyboardToken()