Flutter State Management: setState, BLoC, ValueNotifier, Provider

  Рет қаралды 24,449

Andrea Bizzotto

Andrea Bizzotto

Күн бұрын

Пікірлер: 21
@hectorprx
@hectorprx 4 жыл бұрын
Thanks Andrea for distilling 2 years of effort
@WhatIsThisAllAbout
@WhatIsThisAllAbout 4 жыл бұрын
Thanks Andrea for making such highly informative videos on flutter.
@progamer1196
@progamer1196 4 жыл бұрын
@Andrea whenever we call 'setState()' the complete widget and its children are built, is this the same case in BLoC and provider implementation?
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
You would not normally use StatefulWidget+setState with BLoC. Rather, you would take the output stream from a BLoC and feed it to a StreamBuilder, which rebuilds your UI.
@progamer1196
@progamer1196 4 жыл бұрын
@@CodeWithAndrea Ok thanks. Actually my real issue is that I am loading a lot of network images in a widget (around 100), so if I load them through stream builder (say by providing the image url), will it make the network call again when the widget is being rebuilt (like during push, pop navigation)?
@thewalkevent889
@thewalkevent889 4 жыл бұрын
This is a very good tutorial. I have a question. How can I use pageview or tabbarview in a stateless widget?
@snooringcode6594
@snooringcode6594 4 жыл бұрын
So which one is a good choice to go with?
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
Depends in your use case. I often use Provider+ChangeNotifier for local state that needs to be shared across widgets, and Provider+Bloc when working with streaming APIs (e.g. Firebase).
@snooringcode6594
@snooringcode6594 4 жыл бұрын
@@CodeWithAndrea Can we achieve the size of flutter apps just like native android or ios app sizes?
@Surimi888
@Surimi888 4 жыл бұрын
On the subject of ValueNotifier, in what scenario would you use ValueListenableBuilder over ChangeNotifierProvider?
@CuiqkOfficial
@CuiqkOfficial 4 жыл бұрын
When you don't want to use provider package.
@Surimi888
@Surimi888 4 жыл бұрын
@@CuiqkOfficial Could you give an example of when you wouldn't want to use provider?
@belqisshida5345
@belqisshida5345 5 жыл бұрын
how to avoid unnecessary rebuilds? example: Widget A. Widget B. Widget C. Here when I update a state in Widget A with provider, the Widgets B and C rebuilds too. So how to avoid unnecessary rebuilds in B and C ?
@CodeWithAndrea
@CodeWithAndrea 4 жыл бұрын
Keep an eye of my upcoming videos on Provider. I cover this issue there.
@martymcfly6164
@martymcfly6164 5 жыл бұрын
Hi Andrea, I have a problem with the Stream builder authentication with firebase. I followed your tutorial "Flutter & Firebase authentication with streams and StreamBuilder", everything works fine, except the HomeScreen is not returned visible when I log in on a different page than the SignInPage (I pushed a new route to a SignUpPage). The reason is (as far as I understand) that HomeScreen and SignInPage are only switched below, invisible, under the SignInPage. What is the best solution to fix this? Thanks in advance!
@CodeWithAndrea
@CodeWithAndrea 5 жыл бұрын
Hi Marty. You are correct, this is what happens when you push a new route. The best way to address this is to add a call to Navigator.pop() right after the sign in call succeeds. That way the page is dismissed and you are taken to the HomePage.
@emyboybeats4330
@emyboybeats4330 5 жыл бұрын
which is better for scaleable apps setState, BLoC, ValueNotifier, Provider?
@CodeWithAndrea
@CodeWithAndrea 5 жыл бұрын
Emyboy Beats It depends. For local application state, I recommend Value/ChangeNotifier + Provider. If you have a real-time backend, or stream-based APIs, then BLoCs work well. And StatefulWidgets + setState when working with text input & forms.
@emyboybeats4330
@emyboybeats4330 5 жыл бұрын
@@CodeWithAndrea Okay thank you.
@nicolaszein
@nicolaszein 4 жыл бұрын
Hello Andrea, do you do freelance work?
@uttamgondaliya2757
@uttamgondaliya2757 5 жыл бұрын
hi bro flutter full course?
Flutter State Management: setState, StreamBuilder, Scoped Model, Redux
28:38
Bend The Impossible Bar Win $1,000
00:57
Stokes Twins
Рет қаралды 43 МЛН
ПРИКОЛЫ НАД БРАТОМ #shorts
00:23
Паша Осадчий
Рет қаралды 3,6 МЛН
Фейковый воришка 😂
00:51
КАРЕНА МАКАРЕНА
Рет қаралды 6 МЛН
So Cute 🥰
00:17
dednahype
Рет қаралды 45 МЛН
Flutter Provider: The Essential Guide
17:12
Andrea Bizzotto
Рет қаралды 69 М.
Flutter: ValueNotifier Simplified, "Explain it to me like I'm 5"
28:28
Flutter Community
Рет қаралды 8 М.
Flutter Provider - State Management using PROVIDER ( A BLoC Alternative)
25:24
Flutter State Management - The Grand Tour
14:07
Fireship
Рет қаралды 241 М.
Set State Method in Flutter - State Management Basics
13:25
Flutter Explained
Рет қаралды 23 М.
Best State Management for Flutter | Flutter State Management
8:18
AI with Flutter
Рет қаралды 9 М.
Pragmatic State Management in Flutter (Google I/O'19)
33:25
Flutter
Рет қаралды 450 М.
Managing State in Flutter - Introducing Flutter
5:39
Flutter
Рет қаралды 96 М.
Bend The Impossible Bar Win $1,000
00:57
Stokes Twins
Рет қаралды 43 МЛН