Skip to content

A Dart package providing list implementations that notify when they're modified.

License

Notifications You must be signed in to change notification settings

hacker1024/notifying_list.dart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notifying_list

A Dart package providing list implementations that notify when they're modified.

Features

  • A callback-based notifying list (CallbackNotifyingList)
  • A stream-based notifying list (StreamNotifyingList)

Getting started

Import the library:

import 'package:notifying_list/notifying_list.dart';

Usage

final callbackList = CallbackNotifyingList<num>(() => print('Modified!'));
callbackList.add(0); // 'Modified!'

final streamList = StreamNotifyingList()
  ..stream.forEach(
    (currentList) => print('Modified! Current list: $currentList'),
  );
streamList.add(0); // 'Modified! Current list: [0]'

Releases

No releases published

Languages