I used to see full stack trace when Flutter framework throw error. However since recent release, no stack track are shown other then the following message.
Full code
import 'package:flutter/material.dart';
class BtnApp extends StatelessWidget {
final String title;
BtnApp([this.title]);
@override
Widget build(BuildContext context) {
if (title.substring(0, 1) == '/') {
print('start with /');
} else {
print('other');
}
return new Container();
}
}
main() {
runApp(new BtnApp());
}
Output
Launching lib/tinker/btnapp.dart on iPhone 7 in debug mode...
Running pod install...
Running Xcode build...
Syncing files to device iPhone 7...
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞════════
The method 'substring' was called on null.
Receiver: null
When the exception was thrown, this was the stack:
════════════════════════════════════════════════════════
no stack trace here

There might've been changes on the version that you've updated to which have caused the issue. I've tried the minimal repro you've provided on Flutter version 2.5.1 stable channel and stacktraces for the error were displayed for both Android and iOS.
As a side note, Flutter has since release null safety support and it should prevent "method was called on null" issues - which are usually caused by forgetting to initialize the object that you're trying to access.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With