collection_notifiers 2.4.0
collection_notifiers: ^2.4.0 copied to clipboard
Reactive List, Set, Map and Queue for Flutter — mutate in place, notify only on real change. A flutter_hooks hook per type (useListNotifier) plus a ValueListenable fallback.
import 'package:flutter/material.dart';
import 'src/list_tab.dart';
import 'src/map_tab.dart';
import 'src/queue_tab.dart';
import 'src/set_tab.dart';
void main() {
runApp(const CollectionNotifiersExample());
}
class const CollectionNotifiersExample({super.key}) extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Collection Notifiers Example',
theme: ThemeData(
colorScheme: .fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const _HomePage(),
);
}
}
class _HomePage extends StatelessWidget {
const _HomePage();
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
title: const Text('Collection Notifiers'),
bottom: const TabBar(
tabs: [
Tab(text: 'List'),
Tab(text: 'Set'),
Tab(text: 'Map'),
Tab(text: 'Queue'),
],
),
),
body: const TabBarView(
children: [ListTab(), SetTab(), MapTab(), QueueTab()],
),
),
);
}
}