select_when 1.0.1+1 copy "select_when: ^1.0.1+1" to clipboard
select_when: ^1.0.1+1 copied to clipboard

A Flutter Provider extension: `selectWhen` to control when a selector should be invoked

example/select_when_example.dart

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

class SelectWhenExample extends StatelessWidget {
  const SelectWhenExample({super.key});

  @override
  Widget build(BuildContext context) {
    final name = context.selectWhen(
      (Person person) => person.name,
      when: (Person person) => !person.isLoading,
    );

    return Text(name);
  }
}

class Person with ChangeNotifier {
  String name = 'Skull Kid';

  bool isLoading = false;
}
1
likes
160
points
13
downloads

Publisher

verified publishermrgnhnt.com

Weekly Downloads

A Flutter Provider extension: `selectWhen` to control when a selector should be invoked

Repository (GitHub)
View/report issues

Topics

#provider #inherited-widget #extensions

Documentation

API reference

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

flutter, provider

More

Packages that depend on select_when