Тёмный
No video :(

Flutter Folder Structure and Packages 

Robert Brunhage
Подписаться 47 тыс.
Просмотров 40 тыс.
50% 1

Understanding the basics of folder structure and packages is an important topic that not many covers. Here we will learn different types of folder structure as well as how we can use dart packages to our own advantage. Course to build a production-ready app 👉 robertbrunhage.com/course
00:00 Overview
00:32 Folder by Type
01:34 Folder by Layer
02:15 Folder by Feature
03:14 Dart Packages
07:02 Announcement
····················································································
♥ Become a Patreon supporter: / robertbrunhage
♥ Subscribe: bit.ly/2SUyRhx
····················································································
● Website: robertbrunhage.com
● Twitter: / robertbrunhage
● Discord: / discord
● Instagram: / robertbrunhagedev
● Facebook: bit.ly/RobertDev

Опубликовано:

 

13 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 88   
@Lensbreak
@Lensbreak 3 года назад
Please make tutorial: folder by feature architect + riverpod hooks + flutter hooks + firebase
@longtimedeveloper6498
@longtimedeveloper6498 3 года назад
Very nice work Robert, I've started using folder by feature. This really makes it easy to migrate to a package when needed. Best, Karl
@RobertBrunhage
@RobertBrunhage 3 года назад
Glad it was helpful and I agree!
@davidowens9597
@davidowens9597 3 года назад
Folders under lib: models, views, controllers, and services. MVC+S design pattern. The views folder has a folder for each page/screen with the page widget and all widgets on the page in the same sub-folder. Widgets used by multiple pages are in the root of the views folder.
@math045b3
@math045b3 3 года назад
I'm using by layer for my biggest project (also my first) and it's quite annoying, but changing it is also frustrating. For all other projects I use by features even for the small ones it makes so much more sense to me
@SarveshBhatnagar1214
@SarveshBhatnagar1214 3 года назад
This was informative. Thank you for the video, not many people have talked about this stuff before.
@PadamShrestha
@PadamShrestha 3 года назад
Waiting for a full project tutorial based on folder by feature architect + riverpod + flutter hooks 🤪
@techzone2009
@techzone2009 3 года назад
I have built a project using riverpod and folder by feature ..chaiyo vaney dimla
@PadamShrestha
@PadamShrestha 3 года назад
@@techzone2009 sure.
@juniordev4190
@juniordev4190 2 года назад
@@techzone2009 If you could write. Project nai chaiyena baru euta blog with examples vae ni hunxa.
@miroliebschner426
@miroliebschner426 3 года назад
Your videos are really the best out there. I haven't yet but I really consider donating via your Patreon which would be the first time I use Patreon ever.
@RobertBrunhage
@RobertBrunhage 3 года назад
Thank you so much it really means a lot! I am just super happy the videos are helpful, that was the goal all along 😊
@nikhilkukreja8498
@nikhilkukreja8498 3 года назад
Thank you so much Robert. I generally used to make screens,models kind of structure. But folder by feature is really great approach i liked it. And i have already subscribed to your emails on your website. God bless you always :)
@RobertBrunhage
@RobertBrunhage 3 года назад
Glad I could be of help Nikhil! I appreciate all the support you give 🙏
@gyakhoe
@gyakhoe 3 года назад
Mine is folder by feature but I make additional folder(as per folder by layer) inside each feature lib --feature1 ----ui ----bloc ----data --feature2 ---ui ---bloc ---data
@moazelsawaf2000
@moazelsawaf2000 3 года назад
Very very very great video ❤ I was looking for a way to make my code reusable to use it in multiple projects and I've found it! ❤ Thanks a lot, sir ❤
@user-gp1tr4kr4d
@user-gp1tr4kr4d 3 года назад
data -> models , services -> local , http ui -> screens -> screen1, screen2 widgets blocs -> bloc1, bloc2
@MdSiam-kw5ox
@MdSiam-kw5ox 9 месяцев назад
Thanks for this video man. 👍
@MrVipulLal
@MrVipulLal Год назад
Good one, sir! Thanks
@arsarsars1able
@arsarsars1able 3 года назад
Good information, helpful for big projects.
@RobertBrunhage
@RobertBrunhage 3 года назад
Thanks! The more we know the more educated decisions we can make 😊
@arsarsars1able
@arsarsars1able 3 года назад
@@RobertBrunhage yeah ✌
@YazeedAlKhalaf
@YazeedAlKhalaf 3 года назад
I made a vs code extension for making my folder structure, tell me what you think? GitHub: github.com/YazeedAlKhalaf/Stacked VS Code extension link: marketplace.visualstudio.com/items?itemName=YazeedAlKhalaf.stacked
@d34dsouI
@d34dsouI 3 года назад
Thank you Robert. Could you please make a video for explaining repository-services-stores-ui layered architecture especially suggested by mobx? Especially, I don't get what is repository and services layers and how to create and use them.
@RobertBrunhage
@RobertBrunhage 3 года назад
Will write it up, I want to cover more architecture approaches as well!
@geraldcampana9296
@geraldcampana9296 3 года назад
cant wait hehehe!
@user-nu2nj7mf2z
@user-nu2nj7mf2z Год назад
Hi RU-vidr! Thank you! I liked this video. I was struggling with adding dependency in Flutter project which dependencies were ignoring each other. The Package Structure Folder approach gives me an idea how to handle that issue. Nice job!
@rsajdok
@rsajdok 3 года назад
I have had a problem if should I use struct by layer or feature and how to separate a part of application for another one. Now, it seems clearly for me, thanks
@RobertBrunhage
@RobertBrunhage 3 года назад
Awesome, glad it helped!
@AkashdeepSingh-my9rr
@AkashdeepSingh-my9rr 3 года назад
This is really awesome. I'll follow up this structure . Thanks 😊
@RobertBrunhage
@RobertBrunhage 3 года назад
Glad you found it helpful!
@hawkybae
@hawkybae 3 года назад
Folder by feature works for me. Definitely going to look into creating packages for reusable functionality! Thanks. Also any hints on what the upcoming course maybe about? 😉
@RobertBrunhage
@RobertBrunhage 3 года назад
Super happy you liked it! Want to have project based courses so we will see 😊
@ianmcelvain9627
@ianmcelvain9627 3 года назад
The Stacked pattern from FilledStacks makes the most sense to me for production. This brings a lot of folders and .dart files into your structure but in my experience, most of the time it’s better to work in laid out, readable projects/code than it is to work with condensed code or folders in the effort to look clean and efficient.
@RobertBrunhage
@RobertBrunhage 3 года назад
Hmm I am not quite sure I follow, you can still follow @FilledStacks pattern but create everything in the same file if you want to (not recommended). The folder structure is not a rule and should (most of the time) change depending on how projects grow (in my experience). I have background in Angular and they have great documentation on how they do folder structure (LIFT) which I like a lot. In the end, this is to provide knowledge and not decide how you SHOULD do something 😊
@ianmcelvain9627
@ianmcelvain9627 3 года назад
@@RobertBrunhage I completely agree with this and I wasn’t trying to come off as one rule for all, that goes against programming and general engineering. This is just my preference, as you said in the video to drop them in the comments. I come from (day to day) C, C++ mainly for game engine programming so things like grabbing resources outside the folder dir of the script, I’m used to. General app development and web have always looked very messy to me, almost unstable in both conventions and methodology of making systems. The pro of that is that there is a lot to learn from the methods on the internet. One of the biggest practices is separating business logic from UI and that’s why when I refer to Stacked I also mean the minor folder structure convention that is with it because the interpretation of that methodology of separation makes sense to me. But preferences aside, your videos are extremely helpful and shine a light on production practices that are shadowed when first learning Flutter. E.g., creating an actual AppName.dart/class to be called into void main() instead of having main + MyApp class in one file lol so minor but helps start clean code.
@RobertBrunhage
@RobertBrunhage 3 года назад
@@ianmcelvain9627 Oh hope I didn't come off as rude, it was not my intention! Sorry if that was the case. Thanks for sharing your experience and I think many will benefit from it! Thanks for the support and super happy you liked the video :)
@patricklearn6536
@patricklearn6536 3 года назад
Amazing video thank you!
@albanr8028
@albanr8028 3 года назад
Exactement le tutoriel que je recherchais ! Merci !
@i.k.shaikh3772
@i.k.shaikh3772 3 года назад
Very well done ✅
@RobertBrunhage
@RobertBrunhage 3 года назад
Many thanks!
@fabsync
@fabsync 3 года назад
Robert.. thanks a lot for this video.. I think I would love to see the structure of a one of your big projects in a video.. There are many challenges also (I think) in terms of organizing big projects by features...specially when in a big project you may have 50-120 pages and each page may have 10 to 50 features..
@RobertBrunhage
@RobertBrunhage 3 года назад
It depends on how small you think of features. I work at a very big company where folder by feature is implemented (or in android by module) which works great and that project is huge. I suggest giving it a try :)
@fabsync
@fabsync 3 года назад
Thanks Robert! Modules grasp better the concept for me than features :)
@RobertBrunhage
@RobertBrunhage 3 года назад
@@fabsync You can do pretty much the exact same thing with dart packages if you prefer that more! There are no hard rules here, just do what makes most sense!
@adambartosik357
@adambartosik357 2 года назад
thanks for this video! ;-) Good explanation of Packages / Modules
@letsclode
@letsclode 3 года назад
Been waiting for this.
@danielm3977
@danielm3977 3 года назад
Thank you Robert. Very informative video. Just a newbie question: In the Controller folder, What types of structure we put in. Tbh I googled it but not sure if I know exactly what "Controller " is. Best wishes.
@RobertBrunhage
@RobertBrunhage 3 года назад
These folders were just examples, if you are not using those in your projects you won't be using that folder! It was just for illustrational purposes
@workflop4117
@workflop4117 3 года назад
Thank you so much amazing video 😍
@alihesari2703
@alihesari2703 3 года назад
great great great
@priyanshparmar819
@priyanshparmar819 3 года назад
I wanted to integrate notification in my project. I am using folder by feature approach. Where should i add notification functionality, should i create new feature for managing notifications?
@replicasensei1204
@replicasensei1204 3 года назад
Intuitive....tnks
@mruduladdipalli5417
@mruduladdipalli5417 3 года назад
Awesome
@m.sulthanalihsan464
@m.sulthanalihsan464 3 года назад
thanks man, i like your video..
@OtarBediashvili
@OtarBediashvili 3 года назад
Great video and great explanation, thanks. pub get button seems useful. How can we get it?
@RobertBrunhage
@RobertBrunhage 3 года назад
Hmm I just always had it so thought everyone did haha
@mortenfriis
@mortenfriis 3 года назад
It should be available to you when you're in the pubspec.yaml file.
@OtarBediashvili
@OtarBediashvili 3 года назад
Yeah, that's correct
@madhusudhanr3527
@madhusudhanr3527 3 года назад
Thank you very much. I always have problem with the folder structure. BTW How do we create package like @personal/auth, @personal/database etc?
@RobertBrunhage
@RobertBrunhage 3 года назад
What do you mean with @personal/? You can define it however you want aslong as you reference the correct path and that it is a package :)
@madhusudhanr3527
@madhusudhanr3527 3 года назад
@@RobertBrunhage I meant like naming packages like npm private packages.
@RobertBrunhage
@RobertBrunhage 3 года назад
@@madhusudhanr3527 Have not tried that so if you do, let me know of the results!
@madhusudhanr3527
@madhusudhanr3527 3 года назад
@@RobertBrunhage Thanks for the reply and will surely let you know if it works. A suggestion for future video. "SSL pinning in flutter apps"
@tasehagi
@tasehagi 3 года назад
Hi. Thanks for the video. I have one question: how does modifying a local dart package work? Do I see the changes immediately? Do I need to run 'pub get' again? Also I see your website is a ReactJS app 😂
@RobertBrunhage
@RobertBrunhage 3 года назад
You will see the changes immediately! Yes, sadly Flutter Web doesn't have the things I want right now (especially as I am moving to Next.js soon) :(
@dhanniekristanto
@dhanniekristanto 3 года назад
@@RobertBrunhage actually I'm planning to try flutter web for personal site. There's also something I want but still couldn't do it in flutter. Webview(type: script, link: gist link). anyone know a package with that kind of feature? by the way, great video, learn something new. Thanks Robert
@RohanSingh-qg1jw
@RohanSingh-qg1jw 3 года назад
I'm pretty new to coding- what are controllers and repositories?
@SamSam-rg4lk
@SamSam-rg4lk 2 года назад
In Folder by Feature structure, what's the difference between a repository and a service?
@lambda-dev
@lambda-dev 2 года назад
I use repository for infrastructure, so storing data or calling apis. Services should contain and transform business logic independent of the view. Hope this helps :)
@RobinJesba
@RobinJesba 3 года назад
What Theme do you use for VS code?
@RobertBrunhage
@RobertBrunhage 3 года назад
One Dark Pro :)
@budisetiawan2499
@budisetiawan2499 3 года назад
well the packages structure is the default structure in android studio so i would suggest anroid studio, IMPO
@rebarius
@rebarius 3 года назад
🍪🍪🍪 All my cookies for you 🍪 never thought of structure by feature 🍪
@RobertBrunhage
@RobertBrunhage 3 года назад
It's super easy to work it, and I like it a lot :)
@fethi2436
@fethi2436 3 года назад
What is the theme you are having on vs code, folder icons look nice
@lambda-dev
@lambda-dev 2 года назад
I think it is material icon theme, looks great :)
@void4904
@void4904 3 года назад
I would be really happy with English subtitles 🤣
@hosannaamane6031
@hosannaamane6031 3 года назад
Awesome \(uu)/
@RobertBrunhage
@RobertBrunhage 3 года назад
Thanks, glad you enjoyed it!
@nagcvlogs
@nagcvlogs 3 года назад
How can i give 1Million likes to this video......
@RobertBrunhage
@RobertBrunhage 3 года назад
If you click a lot of times and really fast maybe we can get 1 like on it!!!!
@sergiorodrigoroyo5079
@sergiorodrigoroyo5079 9 месяцев назад
I can't believe some people still structure folders by layer. It must need some real inclination towards BDSM.
@munawir7013
@munawir7013 3 года назад
sub english please
@ThEGeEeK
@ThEGeEeK 2 года назад
Please make tutorial: folder by feature architect + riverpod hooks + flutter hooks + firebase
Далее
Learn Flutter Life Cycle In 10 Minutes
10:02
Просмотров 73 тыс.
Files and Folder Structure in Flutter & Dart
20:23
Просмотров 18 тыс.
Flutter File Structure for Big Projects
9:40
Просмотров 57 тыс.
How to build a package in Dart
14:23
Просмотров 17 тыс.
Learn Flutter Hooks and Maximize Your Code Reuse
10:36
Flutter Testing For Beginners - The Ultimate Guide
13:05
State Management Like A Pro - Flutter Riverpod
10:30
Просмотров 76 тыс.
Flutter Responsive Design Guide
11:59
Просмотров 54 тыс.
Top 70 Flutter Tips, Widgets & Packages
16:22
Просмотров 126 тыс.