question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a command to write recommended settings to the users User Settings for Dart

See original GitHub issue

Start with the following code:

class CircularButton extends StatelessWidget {
  final Widget text;
  final VoidCallback onPressed;

  const CircularButton({this.text, this.onPressed});

  @override
  Widget build(BuildContext context) {
    return Center(
      child: RaisedButton(
        shape: CircleBorder(side: BorderSide(color: Colors.blue, width: 2)),
        child: text,
        onPressed: onPressed,
      ),
    );
  }
}

Next, place the cursor on RaisedButton Invoke refactoring (option-enter).
Select ‘Wrap with new widget’

=>

The code is oddly formatted; I would expect child: RaisedButton( to be indented two positions in from child: widget(, but it’s 8 positions in.

Second, when I attempt to type a widget name, say SizedBox, in the widget placeholder text I get no code completion.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mit-mitcommented, Nov 14, 2018

Yeah, that works a lot better!

Is it not possible to set settings like this programmatically for .dart files?

0reactions
DanTupcommented, Aug 26, 2019

Hmmm, apparently the issue I opened is now a 404 🤷‍♂️ I’ve re-opened it and it got the same issue number 🤔

#1946

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to apply recommended Dart and Flutter settings in VS ...
Open VS Code · Open command palette via Ctrl + Shift + P · Type Dart: Use Recommended Settings and hit Enter.
Read more >
Recommended Settings - Dart Code - Dart & Flutter support ...
You can set copy these from the JSON to your VS Code User Settings or by run the Dart: Use Recommended Settings command...
Read more >
Reading configuration files and settings in Flutter and Dart
Create a folder named assets in the root of your Flutter project and add my_config.json to it (still with the same JSON content...
Read more >
Effective Dart: Documentation
DO use prose to explain parameters, return values, and exceptions. DO put doc comments before metadata annotations. ... AVOID using markdown excessively. AVOID ......
Read more >
Configuration | Flutter Version Management
You can configure the fvm cache directory by setting FVM_HOME environment variable. If nothing is set the default fvm path will be used....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found