dartnative_assists 0.1.0
dartnative_assists: ^0.1.0 copied to clipboard
Analyzer plugin for DartNative apps: the wrap/remove/swap/convert widget assists the analysis server only offers to Flutter, plus warnings for DartNative behaviours that fail silently or crash at mount.
Using dartnative_assists #
Add the plugin to the analysis_options.yaml at the root of your DartNative
project. plugins is a top-level key, not nested under analyzer.
plugins:
dartnative_assists: ^0.1.0
Restart the Dart Analysis Server (Android Studio: Tools › Dart › Restart Dart Analysis Server; VS Code: "Dart: Restart Analysis Server"). Then, with the cursor on any widget:
Scaffold(
body: Center(
child: Text('hello'), // Option+Enter here: Wrap with Column, Remove this widget, …
),
)
And on a class line:
class Counter extends StatelessWidget { // Option+Enter: Convert to StatefulWidget
final int start;
const Counter({super.key, this.start = 0});
@override
Widget build(BuildContext context) => Text('$start');
}
The warning rules run in the IDE and in dn analyze. To enable the opt-in
lint as well:
plugins:
dartnative_assists:
version: ^0.1.0
diagnostics:
dartnative_offstage_loses_state: true