Overview Version History Q & A Rating & Review
Ease State Helper
VS Code extension for Ease State Helper Flutter state management.
Features
Commands
Ease: New ViewModel - Creates a new ViewModel with its .ease.dart file
Ease: Regenerate .ease.dart - Regenerates the .ease.dart file when state type changes
Right-click on any folder in the Explorer to access these commands.
Snippets
Prefix
Description
easevm
Create an Ease ViewModel class
easewatch
Watch a ViewModel (subscribes to changes)
easeread
Read a ViewModel without subscribing
easeselect
Select a specific value from ViewModel state
easeprovider
Add a provider to providers list
Usage
Creating a New ViewModel
Right-click on a folder in the Explorer
Select Ease: New ViewModel
Enter the ViewModel name (e.g., "Counter")
Enter the state type (e.g., "int" or "CounterState")
This creates two files:
counter_view_model.dart - The ViewModel class
counter_view_model.ease.dart - Provider, InheritedModel, and context extensions
Registering the Provider
Add your provider to the EaseScope widget in main.dart:
import 'package:ease_state_helper/ease_state_helper.dart';
import 'counter_view_model.dart';
void main() {
runApp(
EaseScope(
providers: [
(child) => CounterViewModelProvider(child: child),
// ... other providers
],
child: const MyApp(),
),
);
}
Using the ViewModel
// Watch (rebuilds on state change)
final counter = context.counterViewModel;
// Read (no subscription, for callbacks)
context.readCounterViewModel().increment();
// Select (partial subscription)
final count = context.selectCounterViewModel((s) => s);
Requirements
VS Code 1.85.0 or higher
Flutter/Dart project using ease_state_helper package