Skip to content

Commit 6ca265b

Browse files
committed
String Overrides
*Output ResponsiveWrapperData and ResponsiveBreakpoints to strings.
1 parent 984a34b commit 6ca265b

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

lib/responsive_framework.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,31 @@ class ResponsiveWrapperData {
442442
);
443443
}
444444

445+
@override
446+
String toString() =>
447+
"ResponsiveWrapperData(" +
448+
"Screen Width: " +
449+
screenWidth?.toString() +
450+
", Screen Height: " +
451+
screenHeight?.toString() +
452+
", Scaled Width: " +
453+
scaledWidth?.toString() +
454+
", Scaled Height: " +
455+
scaledHeight?.toString() +
456+
", Breakpoints: " +
457+
breakpoints?.asMap().toString() +
458+
", Active Breakpoint: " +
459+
activeBreakpoint.toString() +
460+
", Is Mobile: " +
461+
isMobile?.toString() +
462+
", Is Phone: " +
463+
isPhone?.toString() +
464+
", Is Tablet: " +
465+
isTablet?.toString() +
466+
", Is Desktop: " +
467+
isDesktop?.toString() +
468+
")";
469+
445470
/// Is the [scaledWidth] larger than or equal to [breakpointName]?
446471
/// Defaults to false if the [breakpointName] cannot be found.
447472
bool isLargerThan(String breakpointName) =>
@@ -509,4 +534,17 @@ class ResponsiveBreakpoint {
509534
this.scaleFactor = 1,
510535
this.name})
511536
: assert(breakpoint != null);
537+
538+
@override
539+
String toString() =>
540+
"ResponsiveBreakpoint(" +
541+
"Breakpoint: " +
542+
breakpoint.toString() +
543+
", Scale: " +
544+
scale.toString() +
545+
", Scale Factor: " +
546+
scaleFactor.toString() +
547+
", Name: " +
548+
name?.toString() +
549+
")";
512550
}

0 commit comments

Comments
 (0)