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.

Dart Plugin unable to highlight the parameters which are used

See original GitHub issue

I have just started to code my first sample app in Flutter, while coding I am unable to undestand what are the parameters which are being used in classes.

Eg: Start with MaterialApp, it has number of parameters

MaterialApp({ // can't be const because the asserts use methods on Map :-(
  Key key,
  this.navigatorKey,
  this.home,
  this.routes: const <String, WidgetBuilder>{},
  this.initialRoute,
  this.onGenerateRoute,
  this.onUnknownRoute,
  this.navigatorObservers: const <NavigatorObserver>[],
  this.builder,
  this.title: '',
  this.onGenerateTitle,
  this.color,
  this.theme,
  this.locale,
  this.localizationsDelegates,
  this.localeResolutionCallback,
  this.supportedLocales: const <Locale>[const Locale('en', 'US')],
  this.debugShowMaterialGrid: false,
  this.showPerformanceOverlay: false,
  this.checkerboardRasterCacheImages: false,
  this.checkerboardOffscreenLayers: false,
  this.showSemanticsDebugger: false,
  this.debugShowCheckedModeBanner: true,
})

If we add a following sample code

    return new MaterialApp(
        title: "My App",
        home: new Scaffold(
            appBar: new AppBar(title: new Text("Welcome to Flutter")),
            body: new Center(child: new Text("Hello World")),
            floatingActionButton: new FloatingActionButton(
                onPressed: null, backgroundColor: Colors.teal)));
  }

If we press CMD+P to preview the syntax parameters which we have used, the plugin does not highlight it well in Android Studio, as compare to what it does excellent if we code in Java and Kotlin.

Is there any other way to interpret the parameter which we have passed to a construct

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
InMatrixcommented, Mar 5, 2018

Perhaps formatting the parameters as a list will make it easier to read? I’d also suggest making required parameters bold.

0reactions
alexander-doroshkocommented, Mar 6, 2018

Parameter info tooltip definitely needs improvements. Especially in case of optional parameters. Currently, the implementation is on the IntelliJ Platform / Dart plugin end, Analysis Server is not involved. Unfortunately, I’m not sure when I have time for the task so pull requests are welcome.

Read more comments on GitHub >

github_iconTop Results From Across the Web

flutter : FAILURE: Build failed with an exception - Stack Overflow
C:\src\flutter\.pub-cache\hosted\pub.dartlang.org\file_picker-2.1.0\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.
Read more >
Linter rules - Dart
Use the Dart linter to identify possible problems in your Dart code. You can use the linter through your IDE or with the...
Read more >
Flutter for React Native developers
Introduction to Dart for JavaScript Developers ... These parameters can be used in a child component using this.props . content_copy.
Read more >
test | Dart Package - Pub.dev
Any matchers from the matcher package can be used with expect() to do ... You can select specific tests cases to run by...
Read more >
How to write a Flutter plugin - Google Codelabs
In this codelab, you'll learn how to author a plugin for iOS and ... makes it easy for users to interact with cross-platform...
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