build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Build correct body based on constraints

Implementation

@override
Widget build(BuildContext context) {
  return OrientationBuilder(
    builder: (context, orientation) {
      return LayoutBuilder(
        builder: ((context, constraints) {
          // Fixed with based on orientation
          double originalWidth = constraints.maxWidth;

          if (orientation == Orientation.landscape) {
            originalWidth = constraints.maxHeight;
          }

          return _buildBody(originalWidth);
        }),
      );
    },
  );
}