Questions tagged [flutter-provider]

For questions relating to the "Provider" package for the Flutter framework. Use this tag in combination with the general [flutter] tag. If your question applies to Flutter more generally, use the [flutter] tag only.

This tag should be used for any questions regarding the provider package for the framework.

The provider is a wrapper around InheritedWidget to make them easier to use and more reusable.

Provider uses InheritedWidget's to provide dependency injection functionality for state management in Flutter applications.

To get started, one can read through the README on GitHub, i.e. on the official GitHub page for the provider package.

1487 questions
-1
votes
1 answer

How to rebuild the root widget of flutter?

I am using provider package to detect changes in 'todaysTasks' but as you can see 'todayTasks' depends on DaysRecords which stores a list of DayTasks, so what I want is to rebuild my root widget (which is MyApp) whenever i push a DayTask in…
-1
votes
2 answers

Flutter FutureBuilder() causing null exception for a second

class MyClass extends StatelessWidget { @override Widget build(BuildContext context) { var _userSnapshot; List myContactsList; return StreamProvider.value( value: DatabaseService("").myUser, …
-1
votes
1 answer

Flutter provider length was called on null

I have a list using flutter provider.But firestore data works.The problem is that provider. Error is the getter length was called on null. I searched this question in stackoverflow, i tried every answer but they did not solve my problem. Here is…
-1
votes
1 answer

Flutter Provider.of and search

I am a beginner in flutter and app development. I have a problem. I am using Provider.of in order to get my data. I am getting data and showing it in ListView.builder with no problem. But I want to make a search on my list. Please refer to code…
Emre
  • 312
  • 3
  • 9
-1
votes
1 answer

How to acces data from StreamProvider Flutter

I'm trying to show a list of reminder where user see all their reminders and able to edit it. I'm using StreamProvider so that I'm able to access in child widget. I map the DocumentSnapShot into MedReminder object. The StreamProvider should return…
-1
votes
1 answer

Too much refresh in sliverpersistentheader when ChangeNotifiers trigger

I have a flutter app in making with a SliverPersistentHeader (SPH, via delegate, acting as AppBar) which should display updated user-specific score/points/credits. This value get periodically recalculated in background and I get it refreshed via a…
-1
votes
2 answers

Prevent FormFieldText reset after calling camera activity in flutter

import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State { …
-1
votes
1 answer

context doesn't match when testing Provider

I have written a test to check that a provider works as expected, however i get the following exception when checking that the context matches the providers context: ══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK…
Hannes Hultergård
  • 1,157
  • 1
  • 11
  • 33
-2
votes
1 answer

Error: Could not find the correct Provider

Error: Could not find the correct Provider«FavoriteModel above this Consumer Widget This happens because you used a "BuildContext, that does not include the provider Eror: Could not find the correct Provider«FavoriteModels above this…
-2
votes
1 answer

How to add text watermark in camera and save with watermark text photo to gallery - Flutter

Is there anyone know how to add camera overlay text or watermark and after capture it save to gallery with that text/watermark. I have attached image given below. Desired demo image : - I haven't found any solution on flutter.
-2
votes
2 answers

How can I make 'this' equal to another instance of the same class in Dart?

I'm working on a Flutter project in which the architecture forces me to use an instance of a class, say UserModel, as a value attached to the BuildContext. In this way, I can access that class in every part of the app. Anyway, there are moments in…
-2
votes
1 answer

ListView Builder not building properly

I am trying to implement a infinite scroll pagnation in Flutter using provider for state management. I have two page, HomePage() and TestingPage().On start up, the code is able to successfully load data from the api endpoint but the retrieved data…
-2
votes
1 answer

Is possible to use GetX and Provider in one project?

I want create a project with two State Management Getx and Provider, my reason is, as a beginner I easy to use Provider to manage my fetch data and show it, while I use GetX to remove a lot of boiler-plate(ex. navigate, size of widget etc), so while…
-2
votes
2 answers

How to pass values between different flutter pages, and use it in everypart of the code?

/this is slider from settings value: sliderValue ??= 125, label: sliderValue.toString(), divisions: 23, onChanged: (newValue) { setState( () => sliderValue = newValue, ); }, //this is container in homepage Container( …
bird
  • 1
  • 2
-2
votes
1 answer

Flutter Viedeo Player like Youtube, Amazon Prime

How to download video from online(api response) and store it in local device and play that video using video player in flutter app. Eg : Amazon Prime, Youtube, Netflix...
1 2 3
99
100