Remove HTML tags from errors in dialog
This commit is contained in:
parent
fdf3c983a2
commit
0e6a39cdbf
|
|
@ -5,6 +5,7 @@ import 'package:flutter/services.dart';
|
||||||
// Package imports:
|
// Package imports:
|
||||||
import 'package:flutter_redux/flutter_redux.dart';
|
import 'package:flutter_redux/flutter_redux.dart';
|
||||||
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
import 'package:pointer_interceptor/pointer_interceptor.dart';
|
||||||
|
import 'package:html2md/html2md.dart' as html2md;
|
||||||
|
|
||||||
// Project imports:
|
// Project imports:
|
||||||
import 'package:invoiceninja_flutter/.env.dart';
|
import 'package:invoiceninja_flutter/.env.dart';
|
||||||
|
|
@ -24,7 +25,11 @@ class ErrorDialog extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final localization = AppLocalization.of(context);
|
final localization = AppLocalization.of(context);
|
||||||
final store = StoreProvider.of<AppState>(context);
|
final store = StoreProvider.of<AppState>(context);
|
||||||
var errorStr = '$error';
|
String errorStr = '$error'.trim();
|
||||||
|
|
||||||
|
if (errorStr.startsWith('<')) {
|
||||||
|
errorStr = html2md.convert(errorStr);
|
||||||
|
}
|
||||||
|
|
||||||
if (error is Error) {
|
if (error is Error) {
|
||||||
errorStr += '\n\n' + (error as Error).stackTrace.toString();
|
errorStr += '\n\n' + (error as Error).stackTrace.toString();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue