มืด

Flutter File Structure for Large Projects

Tadas Petra
ติดตาม
มุมมอง 9 868
99% 98 1

Flutter File Structure for Large Projects
File structure is something that I have struggled with, and I know a lot of people struggle with it as well. In this video I show off the file structure that I have come to work with. This has been adapted from other peoples structure and made my own.
I suggest you try it out and then adapt it to suit your needs as well.
Link To Example Project:
github.com/tadaspetra/flutter_starter_templates/tree/master/001_file_structure
If you have any questions or want me to follow up on any of these topics, leave a comment.
Share this video with any of your flutter friends if you think it is helpful!
Thanks for Watching.
Laptop I use for drawing, recording, and editing:
Lenovo Thinkpad X1 Yoga: amzn.to/2RqFB8U
Super cheap, quality mouse. And batteries last forever:
VicTsing: amzn.to/2UWUimf
Docking station to keep everything organized:
Dell: amzn.to/3ea0sao
Also my favorite book ever, just so more people can read it :)
Brave New World by Aldous Huxley: amzn.to/3c7o91c
#flutter #flutterdev #app #development #dart

เผยแพร่เมื่อ

 

16 ม.ค. 2020

แชร์:

แชร์:

ดาวน์โหลด:

โหลดลิงค์.....

เพิ่มลงใน:

เพลย์ลิสต์ของฉัน
ดูภายหลัง
ความคิดเห็น 28
Mahmoud Eslami
Mahmoud Eslami วันที่ผ่านมา
Thanks for share , One of the best video about how struct an app in easiest way *_*.
Tadas Petra
Tadas Petra วันที่ผ่านมา
Thank you! Really appreciate it
yogesh waran
yogesh waran 3 วันที่ผ่านมา
Came here after bitfumes
Tadas Petra
Tadas Petra 3 วันที่ผ่านมา
Wow that is awesome thank you!!
Christian Kento Rasmussen
Christian Kento Rasmussen หลายเดือนก่อน
Such a good video, thanks!
Tadas Petra
Tadas Petra หลายเดือนก่อน
Thanks for watching 😊
yakine fort
yakine fort หลายเดือนก่อน
Truly slow and boring... Camon man you should never talk while writing... Take example from fireship. And I hope next time you'll show some real example of what's written in these files. Words are nothing without their examples. Good content though. Thx
Med Melek
Med Melek หลายเดือนก่อน
function directory under assets and font ( can y explain more the his utility )
Tadas Petra
Tadas Petra หลายเดือนก่อน
So the functions, assets, and fonts are on the same level, outside of the lib folder. These are because it's not directly tied to the app and how it works and rather just pieces that the app uses
Urvashi Sharma
Urvashi Sharma หลายเดือนก่อน
loved this video...thank you
Urvashi Sharma
Urvashi Sharma หลายเดือนก่อน
@Tadas Petra it was totally my pleasure...
Tadas Petra
Tadas Petra หลายเดือนก่อน
thank you for watching!
MultiECommerce
MultiECommerce 2 หลายเดือนก่อน
Great video, thanks.
Tadas Petra
Tadas Petra 2 หลายเดือนก่อน
MultiECommerce thanks for watching
Brian Dunn
Brian Dunn 2 หลายเดือนก่อน
Do you use providers for state management? If so, where do you store them? Do you just put them in the models folder?
Tadas Petra
Tadas Petra 2 หลายเดือนก่อน
Brian Dunn I have gone through a whole state management journey since this video with almost all the state management solutions it seems 😂. But with provider I set up a “providers” folder as well. And then I also use GetX in the newer videos and there I have a “controllers” folder which is pretty similar
Ankit Chopkar
Ankit Chopkar 2 หลายเดือนก่อน
hello sir please help to solve my issue Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from developer.android.com/studio/index.html On first launch, it will assist you in installing the Android SDK components. (or visit flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, set ANDROID_SDK_ROOT to that location. You may also want to add it to your PATH environment variable.
Entertainment
Entertainment 3 หลายเดือนก่อน
Best video to waste our time!
Uday Garg
Uday Garg 3 หลายเดือนก่อน
Good video
Tadas Petra
Tadas Petra 3 หลายเดือนก่อน
Uday Garg thank you 🙌
Ronald Dumeloo
Ronald Dumeloo 3 หลายเดือนก่อน
Your explanation made me subscribe. I love the way you take your time to explain. Awesome🔥
Ronald Dumeloo
Ronald Dumeloo 3 หลายเดือนก่อน
Thanks very much
Tadas Petra
Tadas Petra 3 หลายเดือนก่อน
Ronald Dumeloo thank you 🙌 and yes I really like to break it down so others and myself can really understand
Omonbude Emmanuel
Omonbude Emmanuel 4 หลายเดือนก่อน
Thanks bro
Tadas Petra
Tadas Petra 4 หลายเดือนก่อน
Thank you for watching
Leon Martinez
Leon Martinez 4 หลายเดือนก่อน
Thanks for share your knowledge my friend!.
Tadas Petra
Tadas Petra 4 หลายเดือนก่อน
Leon Martinez thank you for watching!
hey you
hey you 5 หลายเดือนก่อน
The Slav Squat I see you nailed it
Tadas Petra
Tadas Petra 5 หลายเดือนก่อน
hey you been practicing for years 😂
Mg Kaung
Mg Kaung 5 หลายเดือนก่อน
Your video is help me a lot . This is great structure. Thank you sir.
Tadas Petra
Tadas Petra 5 หลายเดือนก่อน
No problem! Glad it could help!
Jeeva Canessane
Jeeva Canessane 5 หลายเดือนก่อน
hello, it is a superbe way to organize the project, so thank you ! Do you use BLoC state management or using setState for screens ?
Muhammadim Yusoff Jamaluddin
Muhammadim Yusoff Jamaluddin 22 วันที่ผ่านมา
@Tadas Petra Looking forward for Provider AND Riverpod!
Tadas Petra
Tadas Petra 5 หลายเดือนก่อน
Thank you. I appreciate it! But I've tried both Bloc, and provider. And in the current book club app I'm building I use Provider and I think I like it so far!
Tech Studio
Tech Studio 6 หลายเดือนก่อน
Do you do this writing stuff on a tablet? I wonder if i have android phone and like windows 10's onenote better can i use my phone as a touch surface for windows and that too like a tablet?
Tadas Petra
Tadas Petra 6 หลายเดือนก่อน
TECH STUDIO I have a Lenovo x1 yoga. So it makes it pretty easy to do things like this. It has a touch screen and comes with a pen. And I’m not too sure how that would work with the phone as the touch input. But it sounds like it could be possible. Give it a shot!
Maruf Hassan
Maruf Hassan 6 หลายเดือนก่อน
Great video, loved it.
Mitzuko Davis
Mitzuko Davis 6 หลายเดือนก่อน
Good video :D
Tadas Petra
Tadas Petra 6 หลายเดือนก่อน
Mitzuko Davis thank you!
Hammad Pervez
Hammad Pervez 6 หลายเดือนก่อน
One of the best video about how to structure an app in easiet way and amazing illustration
Tadas Petra
Tadas Petra 6 หลายเดือนก่อน
Hammad Pervez I’ve been wanting to make a best practices. But I want to double check that they’re not just my personal best practices. But also universally accepted for flutter
Hammad Pervez
Hammad Pervez 6 หลายเดือนก่อน
@Tadas Petra yes I really want to hear more from you. I request you to make a video on Best Practice in flutter and how to optimize an app. How can we design a responsive design in flutter. These are my requested topic. Kindly make a video when you have time. :)
Tadas Petra
Tadas Petra 6 หลายเดือนก่อน
Hammad Pervez thanks man I appreciate it. I feel like I gotta get back to doing more illustrations to help explain some of the topics
Dawid Niegrebecki
Dawid Niegrebecki 6 หลายเดือนก่อน
Your video helped me a lot. Thank you!!!
Tadas Petra
Tadas Petra 6 หลายเดือนก่อน
No problem! Glad it helped!
CodeBit
CodeBit 8 หลายเดือนก่อน
What hardware and software do you use to draw like this?
CodeBit
CodeBit 8 หลายเดือนก่อน
@Tadas Petra Thanks for the answer, and the video. :)
Tadas Petra
Tadas Petra 8 หลายเดือนก่อน
CodeBit I use OneNote. And the laptop is a Lenovo X1 Yoga so it comes with a touchscreen and a pen
Hussain Bharmal
Hussain Bharmal 9 หลายเดือนก่อน
Is it possible for you to setup a github repo with your example folder structure and code... it will help a lot. Thanks!!!
Tadas Petra
Tadas Petra 9 หลายเดือนก่อน
No problem. Glad to help!
Hussain Bharmal
Hussain Bharmal 9 หลายเดือนก่อน
wow that was quick!! I really really appreciate it. Thank you
Tadas Petra
Tadas Petra 9 หลายเดือนก่อน
I put together a quick example project: github.com/creatorbro/flutter_tutorials/tree/master/flutter_file_structure This link is also added to the description of the video. I will me starting a series soon in the upcoming weeks and i'll be following this structure for the most part, so stay tuned!
Maksim Lin
Maksim Lin 9 หลายเดือนก่อน
Thanks, this is a good introduction to people new to Flutter, but one thing I would warn against is the utils folder. This is generally considered an anit-pattern and no matter which language or framework you are working with, not just Fluttter, it will most likely end up as a dumping ground for assortment of *unrelated* things, the bigger the project, the worse it will be. Instead I would recommend either putting things into the relevant file if only used there, into other folders if only used there (eg. validation only for Home Screen goes in there) or in own top-level folder if it's genuiely used across multiple independent parts of your codebase. Plus in a genuinely large codebase, things that start of as a small function or class will usually grow quickly as the codebase does. Writings on this include: dave.cheney.net/2019/01/08/avoid-package-names-like-base-util-or-common and lostechies.com/chrismissal/2009/06/01/anti-patterns-and-worst-practices-utils-class/ but there is plenty more advice out there.
Tadas Petra
Tadas Petra 9 หลายเดือนก่อน
I agree with most of that. But in the article it mentions using packages per feature. Couldn't you put all those packages into a folder and maybe rename 'utils' to 'packages'?
Flutter Explained
Flutter Explained 9 หลายเดือนก่อน
I really like this structure so far, it works for most of my cases. I always add a scripts folder for more significant projects, where I put some of my SH Scripts inside so that I can create for example keys for internationalisation.
Tadas Petra
Tadas Petra 9 หลายเดือนก่อน
Sounds like a necessity for scripting. I haven't done much scripting for flutter, but i will definitely look into it
Jordy Baylac
Jordy Baylac 10 หลายเดือนก่อน
That’s a good file structure and common for small to medium apps. I don’t agree it suits very large projects cause the coupling of concerns will make maintainability harder. Large projects with several developers will benefit from having a microfronted instead of a big monolithic with 40+ models in the same folder.
Tadas Petra
Tadas Petra 10 หลายเดือนก่อน
I agree that modular structure would be a good way to do it as well. As for my widgets/ folder that is more of a "global widgets" or widgets used throughout the app. I usually put things like an app bar that is consistent throughout most of the screens, post format, things like that. Any local widgets, that are only used in one screen I tend to keep them within the screen folder so the scope isn't any bigger then it needs to be. In the widgets/ (aka global widgets) folder I put things that are related to parts throughout the app. So it wouldn't really make any sense to put it in a specific screens folder. And the last part I definitely agree on, before starting a big project with a team, a lot of factors need to be accessed including what folder structure fits best for the project. I think I mentioned in the video that this isn't a perfect solution for all scenarios and should be amended to fit the project. (i just checked and i had mentioned that in the description, not in the video)
Jordy Baylac
Jordy Baylac 10 หลายเดือนก่อน
Folder structure is part of the architecture and means a lot for the liability that project is carrying on. I thinks that a modular structure just like feature modules works in android will work in situations like this. Another thing that I don’t agree is in having a widgets/ folder, when everything in flutter is a Widget, it may not be obvious where to create a widget (inside my screens/onboarding/or inside widgets/), this can cause the separation of concern I was talking about, meaning that code that is suppose to be related (and close) is now split across different places. Also note that your folder structure would be a go to for me and it is similar to the one I use in my projects. For large projects I would rethink depending on the team and business we are solving. There is no a 1 size fits all
Tadas Petra
Tadas Petra 10 หลายเดือนก่อน
If you are talking about large projects with high coupling not being maintainable, I think that is a concern with the application architecture. Architecture should push for low coupling and high cohesion. I hope I'm understanding your point correctly. As for projects with lots of models I would definitely recommend to organize that a bit more, but I would think that could be done within the models folder as well. Do you have any examples or something that would be a better structure for larger projects? I would love to see it and improve the way I organize :) Anyway thanks for the feedback!
vipin malik
vipin malik 10 หลายเดือนก่อน
Good video.
Tadas Petra
Tadas Petra 10 หลายเดือนก่อน
Thank you, I appreciate it!
ต่อไป
Flutter File Structure for Big Projects
09:40
Switching Houses w/ MissRemiAshten!!
14:05
มุมมอง 799 147
BTS (방탄소년단) 'Life Goes On' Official MV
3:51
Flutter Crash Course
59:20
มุมมอง 228 000
Top 12 Flutter Tips & Tricks
09:32
มุมมอง 155 000
The Art of Code - Dylan Beattie
1:00:49
มุมมอง 1 000 000
BLACKPINK - AROUND THE WORLD
0:31
มุมมอง 5 733 738
ตราบ - TaitosmitH |Official MV|
5:22
มุมมอง 235 914
Dua Lipa - ‘Levitating’ at the AMAs 2020
3:58