w method
Log a message at level Level.warning
.
Implementation
@override
void w(message, [error, StackTrace? stackTrace]) {
//if (level.index >= leisim.Level.warning.index && kDebugMode) {
List<String> stackTraceLine = '${StackTrace.current}'
.split('\n')
.where((line) => line.length > 2)
.map((line) => line.substring(1).replaceAll(RegExp(r'^([0-9])+'), '').trim())
.takeWhile((line) => !line.contains('package:flutter'))
.skip(1)
.toList();
String stackTrace = stackTraceLine.isNotEmpty ? stackTraceLine[1] : '';
print(yellow('\n'
'=== WARNING ============================'
'\n'
'[w] $message'
'\n'
' $stackTrace'
'\n'));
//}
}