Flutter File Structure for Large Projects

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024

ความคิดเห็น • 78

  • @hammadpervez4568
    @hammadpervez4568 4 ปีที่แล้ว +11

    One of the best video about how to structure an app in easiet way and amazing illustration

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      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

    • @hammadpervez4568
      @hammadpervez4568 4 ปีที่แล้ว +2

      @@tadaspetra 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. :)

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +3

      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

  • @FlutterExplained
    @FlutterExplained 4 ปีที่แล้ว +4

    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.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Sounds like a necessity for scripting. I haven't done much scripting for flutter, but i will definitely look into it

  • @heyyou7945
    @heyyou7945 4 ปีที่แล้ว +1

    The Slav Squat
    I see you nailed it

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      hey you been practicing for years 😂

  • @S_.H._C
    @S_.H._C 3 ปีที่แล้ว

    Your video is help me a lot. This is great structure. Thank you sir. from south korea in seoul.

  • @dawidniegrebecki2205
    @dawidniegrebecki2205 4 ปีที่แล้ว +2

    Your video helped me a lot. Thank you!!!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      No problem! Glad it helped!

  • @leonmartinez7798
    @leonmartinez7798 4 ปีที่แล้ว +1

    Thanks for share your knowledge my friend!.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      Leon Martinez thank you for watching!

  • @mahmoudeslami1145
    @mahmoudeslami1145 3 ปีที่แล้ว +1

    Thanks for share , One of the best video about how struct an app in easiest way *_*.

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Thank you! Really appreciate it

  • @egunezasca2036
    @egunezasca2036 3 ปีที่แล้ว

    Thank you for sharing

  • @jacobmiller38
    @jacobmiller38 3 ปีที่แล้ว

    One word: Awesome!

  • @ndsnds1342
    @ndsnds1342 3 ปีที่แล้ว

    thank you so much. This video useful for me

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      Thank you for watching. 😊

  • @christiankentorasmussen7492
    @christiankentorasmussen7492 4 ปีที่แล้ว +1

    Such a good video, thanks!

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Thanks for watching 😊

  • @marufhassan634
    @marufhassan634 4 ปีที่แล้ว +1

    Great video, loved it.

  • @ronalddumeloo1031
    @ronalddumeloo1031 4 ปีที่แล้ว +2

    Your explanation made me subscribe. I love the way you take your time to explain. Awesome🔥

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Ronald Dumeloo thank you 🙌 and yes I really like to break it down so others and myself can really understand

    • @ronalddumeloo1031
      @ronalddumeloo1031 4 ปีที่แล้ว +1

      Thanks very much

  • @MultiECommerce
    @MultiECommerce 4 ปีที่แล้ว +1

    Great video, thanks.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      MultiECommerce thanks for watching

  • @urvashisharma7415
    @urvashisharma7415 4 ปีที่แล้ว +1

    loved this video...thank you

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      thank you for watching!

    • @urvashisharma7415
      @urvashisharma7415 4 ปีที่แล้ว +1

      @@tadaspetra it was totally my pleasure...

  • @CleanupStack
    @CleanupStack 3 ปีที่แล้ว +1

    The only drawback of this approach is when the app grows there would be numerous files inside models, services, screens etc. It would be hard to navigate or to understand which feature maps to which classes or functionalities.
    I would have something like this.
    Lib
    - global
    - models
    - services
    - utils
    - widgets
    - features
    - home
    - widgets
    - services
    - models
    - login
    - services
    - models
    - widgets
    Etc
    What do you think about this folder structure?

    • @CleanupStack
      @CleanupStack 3 ปีที่แล้ว

      Typing on the phone.. not sure whether the folder structure has come out right. Basically the idea is to group all the global classes under a folder and others based on features. Improves readability I feel.

  • @abhayrawal4928
    @abhayrawal4928 3 ปีที่แล้ว +1

    Cool

  • @budescode_academy
    @budescode_academy 4 ปีที่แล้ว +1

    Thanks bro

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Thank you for watching

  • @mecazor
    @mecazor 4 ปีที่แล้ว +1

    Good video

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Uday Garg thank you 🙌

  • @mgkaung4542
    @mgkaung4542 4 ปีที่แล้ว +1

    Your video is help me a lot . This is great structure. Thank you sir.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      No problem! Glad it could help!

  • @emreaka3965
    @emreaka3965 2 ปีที่แล้ว

    Cool.

  • @jordybaylac9470
    @jordybaylac9470 4 ปีที่แล้ว

    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.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      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!

    • @jordybaylac9470
      @jordybaylac9470 4 ปีที่แล้ว +2

      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

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      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)

  • @mrvfino
    @mrvfino 3 ปีที่แล้ว

    Finally, something simple. Thanks.

  • @brianmartindunn
    @brianmartindunn 4 ปีที่แล้ว +4

    Do you use providers for state management? If so, where do you store them? Do you just put them in the models folder?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      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

  • @mitzukodavis7393
    @mitzukodavis7393 4 ปีที่แล้ว +1

    Good video :D

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Mitzuko Davis thank you!

  • @xcraftminebb
    @xcraftminebb 3 ปีที่แล้ว

    I love this method. Thank you !

  • @vipinmalik4243
    @vipinmalik4243 4 ปีที่แล้ว +1

    Good video.

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      Thank you, I appreciate it!

  • @moazelsawaf2000
    @moazelsawaf2000 3 ปีที่แล้ว

    Thanks a lot ❤
    Great and simple structure ❤

  • @wesleybarnes5376
    @wesleybarnes5376 2 ปีที่แล้ว

    Is it a also a good to localise methods in a "methods" folder, as well as your providers maybe?

    • @tadaspetra
      @tadaspetra  2 ปีที่แล้ว +1

      No I don’t necessarily think that’s a good idea. I would take a look at some newer state management videos especially with Riverpod. The functions related to managing your state should be within your provider(specifically statenotifierprovider) but methods are usually pretty different throughout the apps. But if you do have some that are used throughout having something like in the utils folder would be good

    • @wesleybarnes5376
      @wesleybarnes5376 2 ปีที่แล้ว

      @@tadaspetra thanks for the answer, using Riverpod, so cool - been doing that with my methods actually as you say but could be better. Your video has helped me feel much better about managing a larger project.

  • @SirJagerYT
    @SirJagerYT 2 ปีที่แล้ว

    For small projects this is ok. but i wouldn't personally use this for big projects even for medium one.

    • @lambda-dev
      @lambda-dev 2 ปีที่แล้ว

      I would create feature folders first and then put controllers, services and the other layer-files for that features in there. What structure do you like?

  • @Inthusan
    @Inthusan 3 ปีที่แล้ว +1

    Thank you for your video. For Flutter we should use the BLOC Design Pattern. Do you think this will not fit for larger projects?

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      I think bloc works just fine for bigger projects. I personally prefer riverpod. But I got no problem with bloc

  • @techstudio7331
    @techstudio7331 4 ปีที่แล้ว +1

    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?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +1

      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!

  • @medmelek2662
    @medmelek2662 4 ปีที่แล้ว +1

    function directory under assets and font ( can y explain more the his utility )

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      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

  • @cafeflutter
    @cafeflutter 3 ปีที่แล้ว +1

    Hi, what is the name of this software that you drew in it?

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว

      it is Microsoft OneNote

  • @jeevacanessane2245
    @jeevacanessane2245 4 ปีที่แล้ว +2

    hello, it is a superbe way to organize the project, so thank you ! Do you use BLoC state management or using setState for screens ?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว +2

      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!

    • @muhammadyusoffjamaluddin
      @muhammadyusoffjamaluddin 3 ปีที่แล้ว +1

      @@tadaspetra Looking forward for Provider AND Riverpod!

  • @WorstDeveloper
    @WorstDeveloper 4 ปีที่แล้ว +1

    What hardware and software do you use to draw like this?

    • @tadaspetra
      @tadaspetra  4 ปีที่แล้ว

      CodeBit I use OneNote. And the laptop is a Lenovo X1 Yoga so it comes with a touchscreen and a pen

    • @WorstDeveloper
      @WorstDeveloper 4 ปีที่แล้ว

      @@tadaspetra Thanks for the answer, and the video. :)

  • @ankitchopkar7787
    @ankitchopkar7787 4 ปีที่แล้ว

    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.

  • @yogeshwaran2759
    @yogeshwaran2759 3 ปีที่แล้ว +1

    Came here after bitfumes

    • @tadaspetra
      @tadaspetra  3 ปีที่แล้ว +1

      Wow that is awesome thank you!!