@@ -165,7 +165,7 @@ class ResponsiveWrapper extends StatefulWidget {
165165 }) : super (key: key);
166166
167167 @override
168- _ResponsiveWrapperState createState () => _ResponsiveWrapperState ();
168+ ResponsiveWrapperState createState () => ResponsiveWrapperState ();
169169
170170 static Widget builder (
171171 Widget ? child, {
@@ -190,7 +190,6 @@ class ResponsiveWrapper extends StatefulWidget {
190190 bool debugLog = false ,
191191 }) {
192192 return ResponsiveWrapper (
193- child: child,
194193 breakpoints: breakpoints,
195194 breakpointsLandscape: breakpointsLandscape,
196195 landscapePlatforms: landscapePlatforms,
@@ -211,6 +210,7 @@ class ResponsiveWrapper extends StatefulWidget {
211210 shrinkWrap: false ,
212211 alignment: alignment,
213212 debugLog: debugLog,
213+ child: child,
214214 );
215215 }
216216
@@ -232,7 +232,7 @@ class ResponsiveWrapper extends StatefulWidget {
232232 }
233233}
234234
235- class _ResponsiveWrapperState extends State <ResponsiveWrapper >
235+ class ResponsiveWrapperState extends State <ResponsiveWrapper >
236236 with WidgetsBindingObserver {
237237 double devicePixelRatio = 1 ;
238238 double getDevicePixelRatio () {
@@ -619,8 +619,8 @@ class _ResponsiveWrapperState extends State<ResponsiveWrapper>
619619 }
620620
621621 // Dimensions are only available after first frame paint.
622- WidgetsBinding .instance! .addObserver (this );
623- WidgetsBinding .instance! .addPostFrameCallback ((_) {
622+ WidgetsBinding .instance.addObserver (this );
623+ WidgetsBinding .instance.addPostFrameCallback ((_) {
624624 // Breakpoints must be initialized before the first frame is drawn.
625625 setBreakpoints ();
626626 // Directly updating dimensions is safe because frame callbacks
@@ -632,7 +632,7 @@ class _ResponsiveWrapperState extends State<ResponsiveWrapper>
632632
633633 @override
634634 void dispose () {
635- WidgetsBinding .instance! .removeObserver (this );
635+ WidgetsBinding .instance.removeObserver (this );
636636 super .dispose ();
637637 }
638638
@@ -642,7 +642,7 @@ class _ResponsiveWrapperState extends State<ResponsiveWrapper>
642642 // When physical dimensions change, update state.
643643 // The required MediaQueryData is only available
644644 // on the next frame for physical dimension changes.
645- WidgetsBinding .instance! .addPostFrameCallback ((_) {
645+ WidgetsBinding .instance.addPostFrameCallback ((_) {
646646 // Widget could be destroyed by resize. Verify widget
647647 // exists before updating dimensions.
648648 if (mounted) {
@@ -788,7 +788,7 @@ class ResponsiveWrapperData {
788788
789789 /// Creates data based on the [ResponsiveWrapper] state.
790790 static ResponsiveWrapperData fromResponsiveWrapper (
791- _ResponsiveWrapperState state) {
791+ ResponsiveWrapperState state) {
792792 return ResponsiveWrapperData (
793793 screenWidth: state.screenWidth,
794794 screenHeight: state.screenHeight,
@@ -810,29 +810,7 @@ class ResponsiveWrapperData {
810810
811811 @override
812812 String toString () =>
813- 'ResponsiveWrapperData(' 'screenWidth: ' +
814- screenWidth.toString () +
815- ', screenHeight: ' +
816- screenHeight.toString () +
817- ', scaledWidth: ' +
818- scaledWidth.toString () +
819- ', scaledHeight: ' +
820- scaledHeight.toString () +
821- ', breakpoints: ' +
822- breakpoints.asMap ().toString () +
823- ', breakpointSegments: ' +
824- breakpointSegments.toString () +
825- ', activeBreakpoint: ' +
826- activeBreakpoint.toString () +
827- ', isMobile: ' +
828- isMobile.toString () +
829- ', isPhone: ' +
830- isPhone.toString () +
831- ', isTablet: ' +
832- isTablet.toString () +
833- ', isDesktop: ' +
834- isDesktop.toString () +
835- ')' ;
813+ 'ResponsiveWrapperData(screenWidth: $screenWidth , screenHeight: $screenHeight , scaledWidth: $scaledWidth , scaledHeight: $scaledHeight , breakpoints: ${breakpoints .asMap ()}, breakpointSegments: $breakpointSegments , activeBreakpoint: $activeBreakpoint , isMobile: $isMobile , isPhone: $isPhone , isTablet: $isTablet , isDesktop: $isDesktop )' ;
836814
837815 bool equals (String ? name) => activeBreakpoint.name == name;
838816
@@ -1015,15 +993,7 @@ class ResponsiveBreakpoint {
1015993
1016994 @override
1017995 String toString () =>
1018- 'ResponsiveBreakpoint(' 'breakpoint: ' +
1019- breakpoint.toString () +
1020- ', name: ' +
1021- name.toString () +
1022- ', behavior: ' +
1023- behavior.toString () +
1024- ', scaleFactor: ' +
1025- scaleFactor.toString () +
1026- ')' ;
996+ 'ResponsiveBreakpoint(breakpoint: $breakpoint , name: $name , behavior: $behavior , scaleFactor: $scaleFactor )' ;
1027997
1028998 @override
1029999 bool operator == (Object other) =>
@@ -1107,13 +1077,7 @@ class ResponsiveBreakpointSegment {
11071077
11081078 @override
11091079 String toString () =>
1110- 'ResponsiveBreakpointSegment(' 'breakpoint: ' +
1111- breakpoint.toString () +
1112- ', segmentType: ' +
1113- segmentType.toString () +
1114- ', responsiveBreakpoint: ' +
1115- responsiveBreakpoint.toString () +
1116- ')' ;
1080+ 'ResponsiveBreakpointSegment(breakpoint: $breakpoint , segmentType: $segmentType , responsiveBreakpoint: $responsiveBreakpoint )' ;
11171081
11181082 @override
11191083 bool operator == (Object other) =>
0 commit comments