DrawerManager constructor

DrawerManager(
  1. BuildContext context, {
  2. Key? key,
  3. Color? backgroundColor,
  4. double? elevation,
  5. ShapeBorder? shape,
  6. Widget? child,
  7. String? semanticLabel,
  8. List<Widget>? drawerElements,
  9. required List<Widget> tileSelections,
})

Implementation

DrawerManager(
  BuildContext context, {
  Key? key,
  this.backgroundColor,
  this.elevation,
  this.shape,
  this.child,
  this.semanticLabel,
  this.drawerElements,
  required List<Widget> tileSelections,
}) : super(key: key) {
  dmProvider = Provider.of<DrawerManagerProvider>(context, listen: false);
  dmProvider.drawerSelections = tileSelections;

  var drawerSelectionCount = tileSelections.length;
  final drawerTileCount = dmProvider.onTapFunctions.length;

  final drawerTileCountErrorMessage = 'The DrawerTile count is more than the drawer selections. Check that your DrawerTiles ($drawerTileCount), and your selections ($drawerSelectionCount) match.';
  assert(drawerTileCount <= drawerSelectionCount, drawerTileCountErrorMessage);

}