flutter / flutter/flutter

Make `ErrorWidget`'s text selectable

Open
#158,193 2 comments 0 reactions 0 assignees View on GitHub
c: new feature c: proposal framework P3 team-framework triaged-framework
Dominant language
Dart
Stars
179k
Forks
31.1k
PR merge metrics
PR metrics pending

Description

# Problem

When an assertion is triggered, it is displayed using the `ErrorWidget`.

Unfortunately, its text is unselectable - I cannot copy it to search the internet for help.

# Solution

Ideas:

1. Make the `ErrorWidget`'s text selectable
2. Add a link to Google that searches for the error

# Example scenario

This app has a bad container that provides both a `color` and a `decoration` in a `Container`:

```dart
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
color: Colors.blue,
decoration: BoxDecoration(
color: Colors.blue,
),
);
}
}
```

Result:

![image](https://github.com/user-attachments/assets/4f9fe6a3-df38-4d3c-a0e7-b667b556a17a)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.