getOffsetX method Null safety

  1. @override
double getOffsetX(
  1. ScaffoldPrelayoutGeometry scaffoldGeometry,
  2. double adjustment
)
override

Calculates x-offset for start-aligned FloatingActionButtonLocations.

Implementation

@override
double getOffsetX(ScaffoldPrelayoutGeometry scaffoldGeometry, double adjustment) {
  assert(scaffoldGeometry.textDirection != null);
  switch (scaffoldGeometry.textDirection) {
    case TextDirection.rtl:
      return StandardFabLocation._rightOffsetX(scaffoldGeometry, adjustment);
    case TextDirection.ltr:
      return StandardFabLocation._leftOffsetX(scaffoldGeometry, adjustment);
  }
}