@@ -622,8 +622,9 @@ class FlutterErrorDetails with Diagnosticable {
622622 longMessage = ' $exception ' ;
623623 }
624624 longMessage = longMessage.trimRight ();
625- if (longMessage.isEmpty)
625+ if (longMessage.isEmpty) {
626626 longMessage = ' <no message available>' ;
627+ }
627628 return longMessage;
628629 }
629630
@@ -690,8 +691,9 @@ class FlutterErrorDetails with Diagnosticable {
690691 // strip out that header when we see it.
691692 final String prefix = '${exception .runtimeType }: ' ;
692693 String message = exceptionAsString ();
693- if (message.startsWith (prefix))
694+ if (message.startsWith (prefix)) {
694695 message = message.substring (prefix.length);
696+ }
695697 properties.add (ErrorSummary (message));
696698 }
697699 }
@@ -1002,8 +1004,9 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
10021004 return true ;
10031005 }());
10041006 final bool reportError = isInDebugMode || details.silent != true ; // could be null
1005- if (! reportError && ! forceReport)
1007+ if (! reportError && ! forceReport) {
10061008 return ;
1009+ }
10071010 if (_errorCount == 0 || forceReport) {
10081011 // Diagnostics is only available in debug mode. In profile and release modes fallback to plain print.
10091012 if (isInDebugMode) {
@@ -1115,8 +1118,9 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
11151118 if (skipped == 1 ) {
11161119 result.add ('(elided one frame from ${where .single })' );
11171120 } else if (skipped > 1 ) {
1118- if (where.length > 1 )
1121+ if (where.length > 1 ) {
11191122 where[where.length - 1 ] = 'and ${where .last }' ;
1123+ }
11201124 if (where.length > 2 ) {
11211125 result.add ('(elided $skipped frames from ${where .join (", " )})' );
11221126 } else {
@@ -1190,8 +1194,9 @@ class FlutterError extends Error with DiagnosticableTreeMixin implements Asserti
11901194///
11911195/// The `label` argument, if present, will be printed before the stack.
11921196void debugPrintStack ({StackTrace ? stackTrace, String ? label, int ? maxFrames}) {
1193- if (label != null )
1197+ if (label != null ) {
11941198 debugPrint (label);
1199+ }
11951200 if (stackTrace == null ) {
11961201 stackTrace = StackTrace .current;
11971202 } else {
@@ -1208,8 +1213,9 @@ void debugPrintStack({StackTrace? stackTrace, String? label, int? maxFrames}) {
12081213 line.contains ('dart:sdk_internal' );
12091214 });
12101215 }
1211- if (maxFrames != null )
1216+ if (maxFrames != null ) {
12121217 lines = lines.take (maxFrames);
1218+ }
12131219 debugPrint (FlutterError .defaultStackFilter (lines).join ('\n ' ));
12141220}
12151221
@@ -1252,8 +1258,9 @@ class DiagnosticsStackTrace extends DiagnosticsBlock {
12521258 StackTrace ? stack,
12531259 IterableFilter <String >? stackFilter,
12541260 ) {
1255- if (stack == null )
1261+ if (stack == null ) {
12561262 return < DiagnosticsNode > [];
1263+ }
12571264 final IterableFilter <String > filter = stackFilter ?? FlutterError .defaultStackFilter;
12581265 final Iterable <String > frames = filter ('${FlutterError .demangleStackTrace (stack )}' .trimRight ().split ('\n ' ));
12591266 return frames.map <DiagnosticsNode >(_createStackFrame).toList ();
0 commit comments