spm 0.7.0 copy "spm: ^0.7.0" to clipboard
spm: ^0.7.0 copied to clipboard

PlatformAndroid

Unified static analysis and runtime profiling for Flutter rebuild scopes and their triggers.

example/spm_example.dart

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

/// Minimal example of a widget state after SPM instrumentation.
///
/// In normal use, the `spm inject` command adds the `SpmState` superclass and
/// `instanceId` getter for each target `State` class listed in the analysis
/// JSONL manifest.
class CounterExample extends StatefulWidget {
  const CounterExample({super.key});

  @override
  State<CounterExample> createState() => _CounterExampleState();
}

class _CounterExampleState extends SpmState<CounterExample> {
  int _count = 0;

  @override
  String get instanceId => 'example-counter';

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisSize: MainAxisSize.min,
      children: [
        Text('Count: $_count'),
        ElevatedButton(
          onPressed: () => setState(() => _count++),
          child: const Text('Increment'),
        ),
      ],
    );
  }
}
5
likes
160
points
842
downloads

Documentation

Documentation
API reference

Publisher

unverified uploader

Weekly Downloads

Unified static analysis and runtime profiling for Flutter rebuild scopes and their triggers.

Repository (GitHub)
View/report issues
Contributing

Topics

#flutter #cli #static-analysis #profiling

License

BSD-3-Clause (license)

Dependencies

analyzer, args, dartz, flutter, path, vm_service, web_socket_channel

More

Packages that depend on spm