Skip to content

Commit c83a45c

Browse files
committed
Updated readme, license and changelog
1 parent bd3493b commit c83a45c

File tree

5 files changed

+77
-49
lines changed

5 files changed

+77
-49
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
## 0.0.1
22

3-
* TODO: Describe initial release.
3+
* Added MultiValueListenableBuilder widget.

LICENSE

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
1-
TODO: Add your license here.
1+
MIT License
2+
3+
Copyright (c) 2021 [DevKage]
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,53 @@
1-
# multi_value_listenable_builder
1+
# MultiValueListenableBuilder
22

3-
A new Flutter package project.
3+
A widget to listen to multiple [ValueListenable](https://api.flutter.dev/flutter/widgets/ValueListenableBuilder-class.html)s in Flutter.
4+
5+
## Usage
6+
7+
- Add the multi_value_listenable_builder as a dependency in your project.
8+
9+
- Import `package:multi_value_listenable_builder/multi_value_listenable_builder.dart` in required files.
10+
11+
- Use `MultiValueListenableBuilder` just like any other widget.
12+
13+
```dart
14+
import 'package:multi_value_listenable_builder/multi_value_listenable_builder.dart';
15+
16+
MultiValueListenableBuider(
17+
// Add all ValueListenables here.
18+
valueListenables: [
19+
listenable0,
20+
listenable1,
21+
listenable2,
22+
.
23+
.
24+
listenableN
25+
],
26+
builder: (context, values, child) {
27+
// Get the updated value of each listenable
28+
// in values list.
29+
return YourWidget(
30+
values.elementAt(0),
31+
values.elementAt(1),
32+
values.elementAt(2),
33+
.
34+
.
35+
values.elementAt(N),
36+
child: child // Optional child.
37+
);
38+
},
39+
child: YourOptionalChildWidget(),
40+
)
41+
```
42+
43+
A detailed and working example can be found [here](https://github.com/ufrshubham/multi-value-listenable-builder/example/).
444

545
## Getting Started
646

7-
This project is a starting point for a Dart
8-
[package](https://flutter.dev/developing-packages/),
9-
a library module containing code that can be shared easily across
10-
multiple Flutter or Dart projects.
47+
Learn more about Dart, Flutter and working with packages here.
48+
49+
- [Dart](https://dart.dev/)
50+
51+
- [Fluter](https://flutter.dev/)
1152

12-
For help getting started with Flutter, view our
13-
[online documentation](https://flutter.dev/docs), which offers tutorials,
14-
samples, guidance on mobile development, and a full API reference.
53+
- [Developing packages & plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages)

lib/src/multi_value_listenable_builder.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ import 'package:flutter/material.dart'
77
Container,
88
ValueListenableBuilder;
99

10-
/// This widget can listen to multiple [ValueListenable]s and
11-
/// call given builder if any one of them changes.
10+
/// This widget listens to multiple [ValueListenable]s and
11+
/// calls given builder function if any one of them changes.
1212
class MultiValueListenableBuider extends StatelessWidget {
13-
/// List of [ValueListenable]s.
13+
/// List of [ValueListenable]s to listen to.
1414
final List<ValueListenable> valueListenables;
1515

1616
/// The builder function to be called when value of any of the [ValueListenable] changes.
17-
/// The order of values in [values] list will be same as [valueListenables].
17+
/// The order of values list will be same as [valueListenables] list.
1818
final Widget Function(
1919
BuildContext context, List<dynamic> values, Widget? child) builder;
2020

2121
/// An optional child widget which will be avaliable as child parameter in [builder].
2222
final Widget? child;
2323

24+
// The const constructor.
2425
const MultiValueListenableBuider({
2526
Key? key,
2627
required this.valueListenables,

pubspec.yaml

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: multi_value_listenable_builder
2-
description: A Flutter package which allows to listening to multiple ValueListenables from a single widget.
2+
description: A Flutter package which allows to listening to multiple ValueListenables using a single widget.
33
version: 0.0.1
44
homepage: https://github.com/ufrshubham/multi-value-listenable-builder
55

@@ -15,37 +15,5 @@ dev_dependencies:
1515
flutter_test:
1616
sdk: flutter
1717

18-
# For information on the generic Dart part of this file, see the
19-
# following page: https://dart.dev/tools/pub/pubspec
20-
21-
# The following section is specific to Flutter.
2218
flutter:
23-
# To add assets to your package, add an assets section, like this:
24-
# assets:
25-
# - images/a_dot_burr.jpeg
26-
# - images/a_dot_ham.jpeg
27-
#
28-
# For details regarding assets in packages, see
29-
# https://flutter.dev/assets-and-images/#from-packages
30-
#
31-
# An image asset can refer to one or more resolution-specific "variants", see
32-
# https://flutter.dev/assets-and-images/#resolution-aware.
33-
# To add custom fonts to your package, add a fonts section here,
34-
# in this "flutter" section. Each entry in this list should have a
35-
# "family" key with the font family name, and a "fonts" key with a
36-
# list giving the asset and other descriptors for the font. For
37-
# example:
38-
# fonts:
39-
# - family: Schyler
40-
# fonts:
41-
# - asset: fonts/Schyler-Regular.ttf
42-
# - asset: fonts/Schyler-Italic.ttf
43-
# style: italic
44-
# - family: Trajan Pro
45-
# fonts:
46-
# - asset: fonts/TrajanPro.ttf
47-
# - asset: fonts/TrajanPro_Bold.ttf
48-
# weight: 700
49-
#
50-
# For details regarding fonts in packages, see
51-
# https://flutter.dev/custom-fonts/#from-packages
19+
uses-material-design: false

0 commit comments

Comments
 (0)