Search packages, repositories and app categories

GitHub repositoryufrshubham/multi-value-listenable-builder

multi-value-listenable-builder

A Flutter package to listen to multiple value listenables in a single widget.

multi-value-listenable-builder project cover
Stars
12
Forks
4
Last push (UTC)
Oct 1, 2022
Project status
Active

Original README

English project snapshot. Visit GitHub for the latest content.

MultiValueListenableBuilder

A widget to listen to multiple ValueListenables in Flutter.

pub

Usage

  • Add the multi_value_listenable_builder as a dependency in your project.

  • Import package:multi_value_listenable_builder/multi_value_listenable_builder.dart in required files.

  • Use MultiValueListenableBuilder just like any other widget.

import 'package:multi_value_listenable_builder/multi_value_listenable_builder.dart';

MultiValueListenableBuilder(
    // Add all ValueListenables here.
    valueListenables: [
        listenable0,
        listenable1,
        listenable2,
        .
        .
        listenableN
    ],
    builder: (context, values, child) {
        // Get the updated value of each listenable
        // in values list.
        return YourWidget(
            values.elementAt(0),
            values.elementAt(1),
            values.elementAt(2),
            .
            .
            values.elementAt(N),
            child: child // Optional child.
        );
    },
    child: YourOptionalChildWidget(),
)

A detailed and working example can be found here.

DevKage GitHub avatar
GitHub author

DevKage ↗

Expert at starting new game projects but not finishing them. I guess I am a game developer 😅

@BentleySystems @bluefireteam
LanguagesDartHTML

Categories

Packages published by this repository

Dependencies used

Dependency list 2 items

  • flutter{"sdk":"flutter"}
  • flutter_testDevelopment{"sdk":"flutter"}

How do I choose a repository?

Start with your use case, compare repository activity, and check the original project before adopting it.

  1. Search by repository name, owner or description, then narrow the results by topic.
  2. Compare stars, forks and recent pushes. Stars show community interest, not a guarantee of quality.
  3. Read the README, license and issues on GitHub before using a project.

Sources and maintenance

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗