flutter_stack_trace 1.0.1 flutter_stack_trace: ^1.0.1 copied to clipboard
A package for manipulating flutter stack traces and printing them readably,base on stack_trace
import 'package:flutter/material.dart';
import 'package:flutter_stack_trace/flutter_stack_trace.dart';
void main() => FlutterChain.capture(
() {
runApp(MyApp());
},
// simple: false,
);
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
debugLog("On technical forums, I think it's rarely appropriate to constantly ping people for greeting. There are exceptions. But I don't want to be spending this time explaining. The explicit request should have been clear, in my opinion.");
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'You have pushed the button this many times:',
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _click,
child: Icon(Icons.add),
),
);
}
_click() {
debugLog("test", isShowTime: false);
_scheduleAsync();
}
void _scheduleAsync() {
new Future.delayed(new Duration(seconds: 1)).then((_) => _runAsync());
}
void _runAsync() {
throw 'oh no!';
}
}