Bottom Nav Bar in Flutter using Stacked

  Рет қаралды 20,720

FilledStacks

FilledStacks

Күн бұрын

Пікірлер: 187
@javeedishaq7643
@javeedishaq7643 3 жыл бұрын
comprehensive and very well delivered tutorial as always, I got a Flutter project from South Africa and told them about you and Filled Stack that I follow the project structure and guideline given by Dane Mackier, they expressed proud feeling about you :)
@FilledStacks
@FilledStacks 3 жыл бұрын
Thank you! That's so awesome to hear man. It's great to hear that some companies here at home know about me, I fly very far under the radar on most matters. Thanks for speaking good things about me to my fellow South Africans :)
@themindstorm9947
@themindstorm9947 4 жыл бұрын
Thank you so much for the tutorials! I started using stacked to rebuild an app, and I am definitely more productive, and my code is more readable. It think it's great that rather than just showing how to do the state management, you should how to integrate other important things like services, routing, and testing too. I feel that your version of MVVM is a little like a "framework" Flutter deserves (sort of like Nuxt for Vue) Keep it up, and looking forward to seeing more 😁
@FilledStacks
@FilledStacks 4 жыл бұрын
That is some amazing feedback to receive. Thank you for taking the time to type it out. I appreciate really appreciate it. Not only because it's positive but also because comments help me look for better approaches or improving on the patterns devs already find valuable. Thanks again, I appreciate it.
@rubinbajracharya9319
@rubinbajracharya9319 4 жыл бұрын
Awesome 👍. Can you also include deep nested navigation with Android back button handling as well inside the bottom bar.
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you. That would be nested navigators like the ones in the Flutter Web series. When I cover the navigation service I'll show you how to use nested navigators. Android back button calls the same function as the ios back swipe so there's no special requirements to handle it. it's all the same thing.
@bigaloz80
@bigaloz80 4 жыл бұрын
+1 that would be great
@zameermasjedee8530
@zameermasjedee8530 4 жыл бұрын
+1 to a nested navigator deep dive 🙏🏽
@berosolo866
@berosolo866 4 жыл бұрын
kzbin.info/www/bejne/pKiVlGmPfpaGmJo this one?
@tylerthornton9611
@tylerthornton9611 4 жыл бұрын
Thank you, Dane! More Stacked sugar to make our lives easier. :)
@FilledStacks
@FilledStacks 4 жыл бұрын
hehe, happy to help!
@nicholasrj8447
@nicholasrj8447 4 жыл бұрын
Awesome stuff you guys are doing with stacked! It is making life so much easier (and more organised) developing in Flutter 🙌
@FilledStacks
@FilledStacks 4 жыл бұрын
Woooohoooo!!!! That's great to hear! Thanks for watching the videos and using the architecture / package. it's been fun working with it in production as well.
@ericjubber7868
@ericjubber7868 4 жыл бұрын
Another great video. I'm making a ton of progress on my application using Stacked. Keep up the great work, Dane - this package has helped immensely with development.
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you! That's very great to hear. I appreciate you leaving the comment :)
@ericjubber7868
@ericjubber7868 4 жыл бұрын
@@FilledStacks I have a question about calling initialization logic once. I have a Singleton FeedViewModel (like the PostsViewModel here). However, when a user signs out of the app and signs into another account, he/she is presented with the posts from the signed out user at first, and only gets his/her own posts when reloading the page. I assume this is is because the ViewModel is a singleton, and isn't "reset" for the next user when he/she signs out. Could you suggest a workaround for this?
@ericjubber7868
@ericjubber7868 4 жыл бұрын
I figured it out: when signing out, I just call locator.resetLazySingleton(instance: locator()); and it does the trick.
@dariadobszai9452
@dariadobszai9452 3 жыл бұрын
Thank you so much for this tutorial! It covered everything I needed for the Bottom Nav
@FilledStacks
@FilledStacks 3 жыл бұрын
Awesome! Thanks for letting me know, I appreciate it.
@beyondbuks4828
@beyondbuks4828 4 жыл бұрын
Does KZbin think i am a bot if i like every tutorial of yours? Thank you for making these amazing tutorials. Please make a tutorial on using "SEMBAST" for local storage.
@FilledStacks
@FilledStacks 4 жыл бұрын
haha, I don't think they will. But it will definitely help the community by putting my videos in their feeds. I am planning on a sqlite video first because I've succesfully implemented in a maintainable way for 2 client projects so I have the most experience in that at the moment. I might do some of the others after that as well.
@MOhan-ur4ei
@MOhan-ur4ei 4 жыл бұрын
We can also create an array of views you want to display as a class variable and use indexedstack to display the view. It works fine for me 😊. By the ways many thanks to the stacked. Keep up the good work man 💪
@FilledStacks
@FilledStacks 4 жыл бұрын
Yes, that works perfectly fine as well. I use a map sometimes and i do that as well when i want to cache the view.
@derodian
@derodian 4 жыл бұрын
Awesome Tutorial. Got what I was trying to do.
@FilledStacks
@FilledStacks 4 жыл бұрын
Great!!! That's good to hear, thanks for letting me know.
@lcsvcn
@lcsvcn 3 жыл бұрын
What extension do you use in your VS Code? I like this one that connect child widgets to its parents, but don't know the name :(
@FilledStacks
@FilledStacks 3 жыл бұрын
It's called dart code I think. you have to enable the option for it. search for flutter ui in your preferences and enable both options that come up.
@cernunnos123
@cernunnos123 4 жыл бұрын
What shortcut did you use to duplicate the NavBarItem at around 2:40? Cheers!
@FilledStacks
@FilledStacks 4 жыл бұрын
alt+shift+down arrow on Windows and option+shift+down arrow on Mac :) Cheers!
@sadhlife
@sadhlife 4 жыл бұрын
Ctrl+K Ctrl+R for (i like to think K R stands for Keyboard Reference) to get a list of all the shortcuts
@adityajoshi1315
@adityajoshi1315 4 жыл бұрын
I was looking for this. Thankyou so much
@FilledStacks
@FilledStacks 4 жыл бұрын
You're very welcome :) I hope it helps
@bigaloz80
@bigaloz80 4 жыл бұрын
Fantastic. Thank you. Is state maintained if you navigate to a child page within a tab, eg you have a list of items, tap on one to go to a detail page, change to a different bottom nav tab and change back - would the detail page still be open?
@FilledStacks
@FilledStacks 4 жыл бұрын
My pleasure :) That would depend on the how you're navigating within that view. I If you're using a nested navigator then it should keep it's navigation state given the navigator is not reset completely.
@YTarikKalyoncu
@YTarikKalyoncu 4 жыл бұрын
So helpful. Thanks man I asked you this on Instagram and you made video for it
@FilledStacks
@FilledStacks 4 жыл бұрын
Yes you did :) it takes time but I'll always get to the most asked questions.
@junkf.1971
@junkf.1971 4 жыл бұрын
Thank you for this! Will you be doing a vid for persistent bottom navigation bar? My project requires one with the option to hide the bottom nav bar in some views. Can you give some recommendations on how to achieve this with stacked?
@FilledStacks
@FilledStacks 4 жыл бұрын
You're welcome :) I will not be doing a video on persistent bottom nav bar that I can think of. If you want it over your entire app then you can simply wrap your views in your Builder function with a scaffold that contains a bottom nav bar in it. That will put it over every view shown in the app. then you can hide it as you please.
@codebeastcodes
@codebeastcodes 3 жыл бұрын
@@FilledStacks Can you help me with a sample code, please? I'm stuck with this same problem.
@FilledStacks
@FilledStacks 3 жыл бұрын
@@codebeastcodes Hey I can not. I don't have any on hand. Check out my Flutter web template layout video. In there I explain builder functionality and you should be able to see how you can add a widget over all other widgets in the app using the builder.
@Kvsanal78
@Kvsanal78 3 жыл бұрын
Hi Dane, does the pageTransitionSwitcher save state of each child or does it load the child every time when it's on the view ?
@FilledStacks
@FilledStacks 3 жыл бұрын
It's dependent on how you implement it. You can construct new everytime or use a cached one in memory.
@Kvsanal78
@Kvsanal78 3 жыл бұрын
@@FilledStacks I will look into that 👍🏻
@lukitaz
@lukitaz 4 жыл бұрын
Using IndexedStack solves the issue of the tab views being rebuilt pretty easily. Anyways, I can't thank you enough for your content. Where is the donate button? You don't even have ads on your videos!
@FilledStacks
@FilledStacks 4 жыл бұрын
IndexedStack doesn't solve it when you want it to be rebuilt or choose which one you want. To use indexed stack you also have to construct all the views before handing it over. That means if you , like me have a view in your tabs that does real time tracking and has a gmaps instance in it, that will be created and in memory and listening to the streams / fetching data even though it's not on the screen. The way I'm doing it the view is only constructed when it's needed, and removed / disposed when it's not in view. IndexedStack doesn't do that.
@lukitaz
@lukitaz 4 жыл бұрын
@@FilledStacks Thank you for the thorough explanation!
@touchtrain5488
@touchtrain5488 4 жыл бұрын
I've been following your videos, and I like your structure 🙂🙂 Do you handle theming (light/dark) in a specific way? Or do you just use the material provided theme and brightness values? Also what if there are multiple themes apart from light and dark? Sort of like light, dark, black, and colorful theme. Interested in your take on this 👍
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you :) I'm glad you like it. When it comes to themes i don't like to use the Theme object. I have a file with constants in it for my colors, padding, text styles etc. When it comes to a theme manager. This post of mine is the closes that i've come too. www.filledstacks.com/snippet/build-a-theme-manager-in-flutter/
@routadu
@routadu 4 жыл бұрын
6:42 I've followed everything But on changing tab it is calling the build method again How could I avoid that ? I'm using Google Maps in one of the views and don't want that to rebuild everytime It doesn't look good
@FilledStacks
@FilledStacks 4 жыл бұрын
Flutter is built so you have multiple build calls all the time. Build has to be called because it has to know what to render when you get there. Use a stateless widget, keep a local google map use that cached map instead of constructing it again in the build function. You should write your build function knowing it'll be called multiple times per view, when the keyboard shows, when a dialog shows, when you navigate to it, away from it, when you show an overlay entry, when you get a call, etc.
@kevinmathew1309
@kevinmathew1309 4 жыл бұрын
Thank you Filled Stacks. Can you share any of your smaller projects in GitHub, I am curious of how you implement your styles in a real tims project. Also beginners like myself can use that as a great reference.
@FilledStacks
@FilledStacks 4 жыл бұрын
I don't have any code that I can share on github, I also don't have small projects at the moment. The code in my videos is exactly how we do real world / production projects for clients. The videos are made from the code that I had already written in production that has passed our QA and the clients QA requirements. I don't know what else would show real world things because I only share code that should be used in real world projects.
@kevinmathew1309
@kevinmathew1309 4 жыл бұрын
@@FilledStacks yes all your tutorials are really helpful. And am using those to design my projects. Is there a tutorial on how to architect a common api call service(like how to throw a network time out dialog, how to handle different errors, retry a network call etc)
@FilledStacks
@FilledStacks 4 жыл бұрын
@@kevinmathew1309 I show how I setup my api in quite a lot of my videos. State and APi video for flutter web, my provider architecture video (the first 1). Timeouts depend on the library you're using. requests has it built in, Dio too I think. i don't have much in the way of network retry's clients so far has wanted 1 try timeouts to avoid long waiting times on slow connections. When we do something special with the api I'll definitely share a video about that too. So far it's been call a url, serialise response, show data.
@adnanefouham6275
@adnanefouham6275 4 жыл бұрын
Thanks for this amazing tutorial ! I 've made a bottomNavBar using page view is this will impact the performance of my app ?
@FilledStacks
@FilledStacks 4 жыл бұрын
You're welcome :) I don't know. You'll have to test and determine yourself.
@Shumi_Desu
@Shumi_Desu 4 жыл бұрын
Is there a way to rebuild specific child widget on pull to refresh when initialiseSpecialViewModelsOnce = true and disposeViewModel=false? Can you show me how its done? Thanks
@FilledStacks
@FilledStacks 4 жыл бұрын
I don't think there's anything special you need to do. Add the pull to refresh on the child you want it to work on and refresh it on the refresh call. The ViewModelBuilder has nothing to do with that functionality.
@diegozablah6697
@diegozablah6697 3 жыл бұрын
Hey! Great video! I have a question regarding the swapping between the views. I have already set disposeViewModel to false, initialiseSpecialViewModelsOnlyOnce to True and have also added the Storage key. However, when I switch between the views, the previous view is loaded as if it were the first time. Any ideas as to why this might be?
@tewodrosadane
@tewodrosadane 3 жыл бұрын
I have been running into the same issue. I have done everything as in the instruction but the view resets when navigating back to a previous page.
@FilledStacks
@FilledStacks 3 жыл бұрын
Mmmmmmmm, interesting. this is still working for us in our code base. Maybe there's something that we're missing. Could you please create an issue with an example git repo attached to help us reproduce. That might help find the problem.
@simontai3900
@simontai3900 4 жыл бұрын
Thank you for the tutorials and your hard work, It is quite straight forward to me, and save my days. I have one question, in my app, I need to make a Instagram like navigation (means the bottom nav bar persist across screen), do you hv any recommendations?
@FilledStacks
@FilledStacks 4 жыл бұрын
You're very welcome. The easiest way is to add your bottom navigation bar to the entire app through the builder property of the material / cupertino app. But then you should remove everything in this video as it'll just be normal navigation that you can do using the navigation service instead of swapping the views.
@ketanchoyal7024
@ketanchoyal7024 4 жыл бұрын
What are your views on state management using Riverpod ? Have you tried it?
@FilledStacks
@FilledStacks 4 жыл бұрын
I think it has massive potential. I have not tried it yet, but it's high up on my list when I do a technology review for new projects / packages to use in stacked.
@DávidLakatos-w3y
@DávidLakatos-w3y Жыл бұрын
hi thanks for this video! can you provide som information how to nested navigate like from todo item to a 'detail page' but the bottomNavBar stays at place?
@FilledStacks
@FilledStacks Жыл бұрын
Yeah, create a Navigator as the main container then navigate in there. Keep the navigation bar on the main view that houses the second navigator.
@DávidLakatos-w3y
@DávidLakatos-w3y Жыл бұрын
@@FilledStacks can u show some code? thx
@FilledStacks
@FilledStacks Жыл бұрын
@@DávidLakatos-w3y Hey I can't, I don't have any on hand. Watch my nested layout video then you should get an idea of how it works and apply that to bottom navigation.
@pincharuzihaan4031
@pincharuzihaan4031 4 жыл бұрын
Thanks for the tutorial have been following the whole stacked series. I just have a simple question. How do I change the starting value. For example i want the model.currentIndex to start at 2.
@FilledStacks
@FilledStacks 4 жыл бұрын
You're welcome! And thanks for following. You can set that in the onModelReady function.
@hurbes101
@hurbes101 4 жыл бұрын
before this I was using IndexedStacked but it was hard to do animations with it....this made it alot easier ....is that transition animation works with navigation too ? if not can you please tell me a easier way to use transition animations with your navigation service
@FilledStacks
@FilledStacks 4 жыл бұрын
There's a navigate with transition function on the navigation service :D You can supply the transition style and it'll apply it for you :)
@ObiWanKenobi_IceNation
@ObiWanKenobi_IceNation 4 жыл бұрын
Sorry, me again.. Unfortunately the page swtcher doesn't seem to work well with sub-navigation. If a tab has its own navigator, it will show the starting page when navigating away and then back.. regardless of what was displayed before. Scroll position is also lost, even with a pagestorage key.
@FilledStacks
@FilledStacks 4 жыл бұрын
mmmmmm, i didn't look at sub navigation. i've never had to do it in a tabbed form so I don't have much input here. if you figure it out you please leave a comment so i can know how to do it as well.
@ObiWanKenobi_IceNation
@ObiWanKenobi_IceNation 4 жыл бұрын
@@FilledStacks Sure! I'm pretty sure we'd face the same issue even with the root navigator, though.. Will check!
@FilledStacks
@FilledStacks 4 жыл бұрын
@@ObiWanKenobi_IceNation Thank you. I've only had to use it 1 level deep so I never had to solve the problem.
@bigaloz80
@bigaloz80 4 жыл бұрын
@@ObiWanKenobi_IceNation Hi, did you manage to solve nested nav using stacked? I'm struggling with it!
@ObiWanKenobi_IceNation
@ObiWanKenobi_IceNation 4 жыл бұрын
@@bigaloz80 unfortunately no, I resorted to this gist.github.com/diegoveloper/1cd23e79a31d0c18a67424f0cbdfd7ad. It uses IndexedStack under the hood and maintains state ;)
@stankokostic725
@stankokostic725 3 жыл бұрын
Hey Dane, as always, enjoying these practical tutorials, you make it look really easy! As I asked in another video, the only thing that I didn't understand so far is how to pass a parameter in overriden futureToRun() functions if needed, since here you are using a hardcoded "3" for getPostsForUser()?
@alvin3171997
@alvin3171997 3 жыл бұрын
In your app, you would pass the argument from the UI into the viewmodel. For example in your UI code: viewmodelBuilder: () => yourViewModel(postId: 3) Then in the viewModel: FutureToRun() => getPost(id: postId) Hope that helps =)
@FilledStacks
@FilledStacks 3 жыл бұрын
@Stanko Kostic the reply above is correct. That's how I've been doing it :)
@stankokostic725
@stankokostic725 3 жыл бұрын
@@alvin3171997 Thanks, that's a great and clean way to handle it :)
@ravilakhtariya6322
@ravilakhtariya6322 3 жыл бұрын
can you tell me how to pass data when navigate to other screen with stacked ....not with changenotifier...
@FilledStacks
@FilledStacks 3 жыл бұрын
You pass it to the arguments parameter in the navigation service, the same you would do with a normal navigate call. If you're using auto_route then use the ViewNameArguments class that gets generated for you .
@omidpakdel
@omidpakdel 4 жыл бұрын
Thanks for your amazing tutorial, Stacked is soooooo greaaaaaaaaaaaatttt. btw, i have a question i'm trying to implement keeping bottom navbar on all pages (persist nav bar), any recommendations with stacked ?
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you :) I appreciate the kind words. if you want it over your entire app you can use the builder property in the material app. That will put it over your login screen and every other screen shown in the app.
@omidpakdel
@omidpakdel 4 жыл бұрын
@@FilledStacks appreciate your help
@FilledStacks
@FilledStacks 4 жыл бұрын
@@omidpakdel You're welcome :)
@JayPerf
@JayPerf 4 жыл бұрын
Is there any way to do the PageStorageKey technique but with TabBarViews / Default Tab Controller on one of the bottom nav item pages? How would you preserve the tab-index when switching between bottom nav bar items?
@FilledStacks
@FilledStacks 4 жыл бұрын
You'd have to track that yourself like we track the index for the bottom tab bar view.
@JayPerf
@JayPerf 4 жыл бұрын
@@FilledStacks killer, no problem - I have a nav page that is a full screen Google map, and this video solved every issue I was having with it, and the performance / state preservation of my Map page and my nav events is off the charts now, thank you as always @FilledStacks
@FilledStacks
@FilledStacks 4 жыл бұрын
@@JayPerf That's great news! I was making it for that purpose as we also have a view in the tab that always updates / refreshes when we get there and subscribed to events etc. Using this method lowers that by so much. It's working great now!
@EricPLMobileDeveloper
@EricPLMobileDeveloper 3 жыл бұрын
May I know whether can put multiple viewModels in one ViewModelBuilder ? if can, how ?
@FilledStacks
@FilledStacks 3 жыл бұрын
No you can not. You would never need to. You can share functionality using a service if you need to
@wheatonrecurrence9525
@wheatonrecurrence9525 3 жыл бұрын
How do I create a button e.g. in posts page, that emulates clicking the todo on the botton navigation?
@FilledStacks
@FilledStacks 3 жыл бұрын
If you want to swap the navigation page when you click a button somewhere else I would use a stream in a service that sends an index. I'd listen to that in the viewmodel where the bottom nav is then swap it to the index transmitted.
@wheatonrecurrence9525
@wheatonrecurrence9525 3 жыл бұрын
@@FilledStacks Gotcha, gonna try that now, thanks!
@sadhlife
@sadhlife 4 жыл бұрын
I'm planning on watching your stacked series pretty soon, but the "singleton decorator" thing, after which you ran a command in the terminal to generate some code, that looked a bit weird. can't all that be done in code itself, instead of needing a code generator script?
@FilledStacks
@FilledStacks 4 жыл бұрын
Awesome! Yes, that can all be done in code. It's basically 1 line of code to add. I have 20-30 services, some other utility classes added so instead of maintaining those when I change something I just run the generate script and continue coding. You can definitely do it without it, it's not a requirement.
@sadhlife
@sadhlife 4 жыл бұрын
@@FilledStacks I see thanks
@ketanchoyal7024
@ketanchoyal7024 4 жыл бұрын
Yes it can be done manually too by initializing them in locator file as shown in some of his previous videos
@Nhatnguyen-lu1bm
@Nhatnguyen-lu1bm 4 жыл бұрын
Thanks for the great tutorial. May I know how to make it works with google_maps_flutter? The map rebuilt every time I switch the bottom tab
@FilledStacks
@FilledStacks 4 жыл бұрын
Yes, you can cache the maps instance and show that everytime instead of constructing a new one. store it locally in a Stateful widget then use that if it's not null.
@rotries
@rotries 4 жыл бұрын
Hi, Dane! Thank you so much for this tutorial. I have a question, how would you reset the state of the view for example, if the user logs out?
@FilledStacks
@FilledStacks 4 жыл бұрын
Hey there, You're very welcome :) What I do is have a logout stream on the user service. It can be of any type. When the user logs out I broadcast something over that stream and then in the HomeViewModel I reset everything to it's starting state. The way when we login again it starts from the beginning.
@rotries
@rotries 4 жыл бұрын
@@FilledStacks Thank you for your input! ☺️
@FilledStacks
@FilledStacks 4 жыл бұрын
@@rotries You're welcome
@SandaruwanFdo
@SandaruwanFdo 2 жыл бұрын
Thanks for the Tutorial. can you provide persistent bottom navigation bar tutorial with stacked
@FilledStacks
@FilledStacks 2 жыл бұрын
You're very welcome. That's not a stacked feature, that's just a general Flutter thing. You can add your bottom nav bar in the builder function of the Material or Cupertino app and it'll show up on all screens.
@SandaruwanFdo
@SandaruwanFdo 2 жыл бұрын
@@FilledStacks Yes, but how to fixed bottom nav bar with routes?
@FilledStacks
@FilledStacks 2 жыл бұрын
@@SandaruwanFdo Fix what? Does the solution I provided produce an error?
@ApichartNakarungutti
@ApichartNakarungutti 3 жыл бұрын
I have additional pages like this - Home - Card List - Card (Sub page of Card List to view Card detail) - Settings I don't know how to navigate to Card and keep bottom navigation bar visible on Card page.
@FilledStacks
@FilledStacks 3 жыл бұрын
You can add it to your scaffold or add the view as one of the bottom nav pages. Or wrap it around all the views in your MaterialApp builder and turn it off/on in the views you need to.
@BrianHeunis
@BrianHeunis 3 жыл бұрын
@@FilledStacks hi dane, bit confused wrt your reply. Can you be a bit more specific to what you are referring to in your answer?
@FilledStacks
@FilledStacks 3 жыл бұрын
Use the builder property on the material app and add you child at the bottom of a stack and the bottom nav bar on top of it. Or you can use a nested navigator which I would say is first choice. Wtr to my answer answer above the other two ways I mention is better if you always want the bottom nav bar to show.
@dayya4004
@dayya4004 4 жыл бұрын
Hi. I have been searching and comparing thing i am lost. I would like you to help me with some knowledge. I am intrested in making Ios and android apps. I just discovered flutter now 🙈. So iwant to learn where should i start. Especially the language (java or phython). . Will be looking forward for your response. Thank you
@FilledStacks
@FilledStacks 4 жыл бұрын
Hi, flutter is written in dart, so there's no point in learning Java or Python. If you're a beginner in programming then i'd say don't worry about Flutter and learn how to program first. Otherwise everything in flutter will feel difficult. Do a basic OO programming course and then come back to Flutter after.
@frederickmfinanga2037
@frederickmfinanga2037 4 жыл бұрын
Hey could you please do a tutorial for adding social sign in authentication with firebase and also how handle scenarios when a user tries to login or sign up with an account that already exist using different signing methods. How to link everything, so that the user can always log in with whichever platform they choose and aren't forced to pick the same one all the time. I hope i made sense. thanks
@FilledStacks
@FilledStacks 4 жыл бұрын
Hey there, I don't think i'll do that as it'll repeat a lot of what i did in my firebase authentication video. The only difference would be a single function call to sign in with the social provider instead of with email. I currently enable multiple account sign up and link the users data to their email so if it's the same email used on all accounts they'll get the same data, if not they'll get different data. As i show in the firebase series. Instead of using the uid use the email.
@blackant12
@blackant12 4 жыл бұрын
Hi. I have an small issue. The apps that I have developed with stacked become unresponsive after coming from the background. This only happens on release mode as they work fine on emulator. I'm not sure though if it's related with the package but it's unique to all the apps I have built with it. I'm not getting any error.UI just doesn't respond.
@FilledStacks
@FilledStacks 4 жыл бұрын
Hey, I don't think that's unique to stacked. Maybe it's something you're doing? We're developing 6 apps with it, 1 which is already in use. I haven't seen this problem. I see something similar in debug mode but that's only in the latest flutter releases. It happens without stacked as well.
@blackant12
@blackant12 4 жыл бұрын
@@FilledStacks I rolled back to version 1.17 and it works fine.
@wheatonrecurrence9525
@wheatonrecurrence9525 3 жыл бұрын
Is there a way to keep to bottom bar when navigate to a new page?
@FilledStacks
@FilledStacks 3 жыл бұрын
Yes, a few ways. nested navigation or wrapping your builder in material app with a child that has a bottom bar at the bottom. Anything you draw in the builder method will draw over everything in your app besides dialogs.
@wheatonrecurrence9525
@wheatonrecurrence9525 3 жыл бұрын
@@FilledStacks Got it, thank you!
@danielashraf6201
@danielashraf6201 3 жыл бұрын
what if I wanna keep BottomNavigationBar when push new screen ??
@FilledStacks
@FilledStacks 3 жыл бұрын
I would make a widget that takes in a child and places it at the bottom of a stack and then wrap the child in the builder property of the material app. The child there is your view you're navigating too. So you can just wrap it with a stack and put the bar at the bottom of that stack over the child that's below it.
@danielashraf6201
@danielashraf6201 3 жыл бұрын
@@FilledStacks could u give an example ?
@FilledStacks
@FilledStacks 3 жыл бұрын
@@danielashraf6201 I can not but there's 1 here stackoverflow.com/questions/49748759/example-for-builder-property-in-materialapp-class-in-flutter and the docs are here api.flutter.dev/flutter/material/MaterialApp/builder.html
@joeder3867
@joeder3867 4 жыл бұрын
Great tutorial as always! How would I implement an alert indicator in the bottom navigation. For example if one tab is a chat and I want to display the number of unread messages as an indicator?
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you :) I would use a stack and give the bottom icons it's own viewmodel that returns a bool to indicate if the alert is on or not. When it's on i'll render the alert icon when it's not I wont. The viewmodel can get it's boolean from the service that contains that information.
@joeder3867
@joeder3867 4 жыл бұрын
Thanks that sounds great! One more question: When I listen to a broadcast stream in a service and I attach 2 listeners to that stream. Will it be twice the amount of reads (eg in firebase)?
@attafriski5181
@attafriski5181 4 жыл бұрын
I am sorry, but i can't find the PageTransitionSwitcher, can anyone help me?
@FilledStacks
@FilledStacks 4 жыл бұрын
it's in the animations package
@attafriski5181
@attafriski5181 4 жыл бұрын
@@FilledStacks Thank you Mr.Dane
@mianarslan1239
@mianarslan1239 3 жыл бұрын
I followed the same but it rebuilds every time on changing index
@FilledStacks
@FilledStacks 3 жыл бұрын
Make sure you're setting the correct values in the named constructor. It works for us.
@deepak5283
@deepak5283 4 жыл бұрын
sir when i have run flutter app in emulator,it runs correctly .when i see a emulator the app size is 97 mb,the app size is large .i have doubt if i use flutter for my project app size it would bigger , how to use flutter to develop big project
@FilledStacks
@FilledStacks 4 жыл бұрын
My apps are aroun 9-15 MB in release mode. Run it in release, or make a full release build and see what the sizing is. When you upload bundles to the playstore it'll be smaller as well because they'll optimise the builds the users are downloading.
@deepak5283
@deepak5283 4 жыл бұрын
@@FilledStacks so i can build big apps in flutter without fear about app size ?
@FilledStacks
@FilledStacks 4 жыл бұрын
@@deepak5283 yep, that's what I do. I build very large apps, even the desktop apps are only 16Mb at the moment.
@Torr-zh7ik
@Torr-zh7ik 4 жыл бұрын
Nice video as usual! Are you planning on making a tutorial for Freezed package with Stacked architecture?
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you. I use freezed for my models but I haven't had a reason to share a video on it because I don't do anything special with it. I use use the basic functionality just generating the code. But I do want to make a video of it. What specifically do you want to see that @resocoder didn't cover in his video on freezed?
@Torr-zh7ik
@Torr-zh7ik 4 жыл бұрын
@@FilledStacks As much as I liked resocoder's tutorial, it was a little bit detached from real life implementation of a flutter app and by this time already outdated. There might not be a need for a stand alone Freezed tutorial, but rather "this is how I use it" kind of video whenever you decide to create another "let's build another app together" mini-series (which I thoroughly enjoy watching btw). Personally, I would like to see how you use MAP/WHEN/JSON, UNION classes and what functionality you leave inside a datamodel class and what would you extract into corresponding service class. Thank you!
@FilledStacks
@FilledStacks 4 жыл бұрын
@@Torr-zh7ik I see. We don't use union or map, or when, just the json functions. Or let me rather say we haven't used it, I haven't found a reason to. I kind of understand what you're asking but I also don't because I use it purely as a code generator for my models. i don't use any of the other functionality besides fromJson and toJson. Sometimes I use copywith to create new models with different values. If there's anything i think worth sharing there I'll share it, i don't do much besides update the model and run the command. But I'll keep it in mind.
@frederickmfinanga2037
@frederickmfinanga2037 4 жыл бұрын
Hey, could you please make a tutorial on how to build different flavors for dev and prod with firebase? on iOS and Andorid
@FilledStacks
@FilledStacks 4 жыл бұрын
Hey, I've seen quite a few of those, I don't know have anything special to add to those so I don't want to go read someone else's tutorial and make a video version of it. There's a lot of resources on that.
@emmanueljimawo5595
@emmanueljimawo5595 4 жыл бұрын
Thankyou so much.
@FilledStacks
@FilledStacks 4 жыл бұрын
You're very welcome! :D
@ibrabi7072
@ibrabi7072 4 жыл бұрын
nested navigation tutorial maybe?
@FilledStacks
@FilledStacks 4 жыл бұрын
Definitely. Thanks for the recommendation I'll add it to the list.
@hendrickmanenga9213
@hendrickmanenga9213 4 жыл бұрын
Once again you make my life easier.However "initialiseSpecialViewModelsOnce: true " gets ignored and ViewModels gets refetched everytime i swap tabs
@FilledStacks
@FilledStacks 4 жыл бұрын
Awesome! That's weird because as you can see in the video it works :) And it's working for me in the apps that's using it. Make sure you set disposeViewModel to false as well.
@ObiWanKenobi_IceNation
@ObiWanKenobi_IceNation 4 жыл бұрын
Fantastic content! I'm gonna be that guy, forgive me: "build" is pronounced "bìld", not "bòld" ❤😊
@FilledStacks
@FilledStacks 4 жыл бұрын
Thank you. Hahaha, I do say build! it just comes out wrong out of my mouth :) so funny. My girlfriend just said I say bold lol. Accents are weird.
@ObiWanKenobi_IceNation
@ObiWanKenobi_IceNation 4 жыл бұрын
@@FilledStacks ahahah ikr! Didn't want to sound rude, thanks for the understanding mate!
@tammaibigin
@tammaibigin 3 жыл бұрын
Hey Dane, IndexedStack solves the same issue. I think so :)
@FilledStacks
@FilledStacks 3 жыл бұрын
Hey, it doesn't :) All those widget are built at the same time and the logic can't be controlled for if it's built all together or when required.
@tammaibigin
@tammaibigin 3 жыл бұрын
@@FilledStacks ah ha, all of IndexedStack's children was built at first time. Thank you for pointing that out :D
@FilledStacks
@FilledStacks 3 жыл бұрын
@@tammaibigin 😉
@Fawad06
@Fawad06 3 жыл бұрын
10:44 true words!
@FilledStacks
@FilledStacks 3 жыл бұрын
don't even know what you're regerring to haha
@Fawad06
@Fawad06 3 жыл бұрын
@@FilledStacks you read every comment and answer them
@FilledStacks
@FilledStacks 3 жыл бұрын
@@Fawad06 haha, thanks! I was wondering what you're pointing to. And yes, I do :) I'm here to help. Can't help if you don't answer questions xD
@Fawad06
@Fawad06 3 жыл бұрын
@@FilledStacks your welcome man..hey dane can you help me? Im learning your stacked architecture and I can't get the arguments passed in route, can you refer me to any code or video which could help... thanks in advance
@walidbagh
@walidbagh 4 жыл бұрын
YAAAAY Thanks.
@FilledStacks
@FilledStacks 4 жыл бұрын
Wooooohooooo! :D Good to see you're excited.
@mohsenalbo5533
@mohsenalbo5533 4 жыл бұрын
Wow nice
@FilledStacks
@FilledStacks 4 жыл бұрын
I was hoping that would be the case :) it's a pretty simple setup that does quite a log of work with a small amount of code.
@thepotatokitty
@thepotatokitty 4 жыл бұрын
Why not go with IndexedStack? Much easier and achieves the same
@FilledStacks
@FilledStacks 4 жыл бұрын
IndexedStack constructs all the widgets at the and supplies it to the stack. This means, in my case, when i have 5 views it will construct it, start the real time listeneing stream and request the data required for those views. When you get back to those views it's not constructed again so the onModelReady isn't fired again, and the other way around. with this way i can control when it fires, if it fires everytime i get there AND it's lazy loaded. This means the widget is only built when you navigate to it. Indexed stack requires all of it to be built, and if you, like me have a map on one of the views and a real time status tracker, etc then you don't want that be constructed if it's not being used.
@thepotatokitty
@thepotatokitty 4 жыл бұрын
@@FilledStacks Ah gotcha, thanks
@ianmcelvain9627
@ianmcelvain9627 4 жыл бұрын
@@FilledStacks I have had both of these views, where IndexedStack is easier but not optimal. Could you post a snippet on your site or some kind of tutorial for caching GoogleMaps and have it persist through switches in the BottomNavigationBar? That is the only reason I am still using IndexedStack so it doesn't rebuild and I've tried caching GoogleMaps but still rebuilding due to my lack of experience with Dart.
@FilledStacks
@FilledStacks 4 жыл бұрын
@@ianmcelvain9627 Hey, If you use the approach I show above you can simply store your google map widget as a private field in your state class , construct it in the build method if it's not null and then use that in the widget tree where you need it. I don't have any snippets for that.
@ianmcelvain9627
@ianmcelvain9627 4 жыл бұрын
@@FilledStacks I appreciate the help! I created the google maps variable in HomeView to then check if null in the build method of the HomeView and if it is I assign it to a new GoogleMap(). I then pass the private google maps variable to my MapView() as a parameter which is in the switch statement of getViewForIndex function. I use that passed parameter as the maps widget in the build function for the MapView() and it still rebuilds.
Dialog Service in Flutter | Show Dialog Without Context
21:56
FilledStacks
Рет қаралды 16 М.
10x Your Speed With Flutter
8:04
Flutter Mapp
Рет қаралды 59 М.
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 80 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 1,8 МЛН
Сюрприз для Златы на день рождения
00:10
Victoria Portfolio
Рет қаралды 2,4 МЛН
State Management with Stacked in Flutter
33:24
FilledStacks
Рет қаралды 33 М.
Flutter Theme Manager for Multiple Themes
8:55
FilledStacks
Рет қаралды 21 М.
30 Programming Truths I know at 30 that I Wish I Knew at 20
17:41
Complete Flutter Architecture using Provider and Stacked
22:59
FilledStacks
Рет қаралды 91 М.
React Native vs Flutter - Which should you use?
22:31
Simon Grimm
Рет қаралды 39 М.
NSURLProtocol: How I Stole an App For My Wedding
56:25
Bryce Bostwick
Рет қаралды 50 М.
Vim Tips I Wish I Knew Earlier
23:00
Sebastian Daschner
Рет қаралды 72 М.
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 80 МЛН