tanutapi / dart_meteor

A Meteor DDP library for Dart/Flutter developers.
Other
37 stars 15 forks source link

using with provider package #23

Closed YouSour closed 3 years ago

YouSour commented 3 years ago

hi , bro @tanutapi , i try to use provider with this package i got some error like this :

class 'BehaviorSubject<Map<String, dynamic>>' has no instance getter 'values'. Receiver: Instance of 'BehaviorSubject<Map<String, dynamic>>' Tried calling: values

here , what i did

provider

class LoanRequestProvider with ChangeNotifier {
 Stream<Stream<Map<String, dynamic>>> get streamLoanRequest async* {
    yield meteor.collections['microfis_loanRequest'];
  }
}

stream on client

 Expanded(
                        child: Consumer<LoanRequestProvider>(
                          builder: (ctx, loanRequest, child) => StreamBuilder(
                            stream: loanRequest.streamLoanRequest,
                            builder: (context, AsyncSnapshot snapshot) {
                              switch (snapshot.connectionState) {
                                case ConnectionState.waiting:
                                  return WaitingData(
                                    textColor: CommonColors.blackLight,
                                    loadingColor: CommonColors.primary,
                                  );
                                case ConnectionState.none:

how can i fix this error ?
thank in advance

YouSour commented 3 years ago

found it

tanutapi commented 3 years ago

Hi Sour, cloud you share what happened with your code?

On Sun, 21 Feb 2021 at 09:46 Sour notifications@github.com wrote:

Closed #23 https://github.com/tanutapi/dart_meteor/issues/23.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tanutapi/dart_meteor/issues/23#event-4355913480, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADGTDW67ST76A25KPXGMVN3TABXYPANCNFSM4WYGWG5A .

-- Tanut Apiwong.