• Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
Wednesday, December 2, 2026
No Result
View All Result
Subscribe Now
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    Inside The New York Times: Analyzing Supreme Court Arguments with Depth and Insight

    Inside The New York Times: Analyzing Supreme Court Arguments with Depth and Insight

    GOP Advances Controversial “Buffer Zone” Bill Aimed at Limiting Protests in Key Committee Vote

    GOP Advances Controversial “Buffer Zone” Bill Aimed at Limiting Protests in Key Committee Vote

    Duterte’s Defense Asserts Drug War Killings Do Not Constitute Crimes Against Humanity, Urges ICC to Dismiss Allegations

    Duterte’s Defense Asserts Drug War Killings Do Not Constitute Crimes Against Humanity, Urges ICC to Dismiss Allegations

    Taika Waititi’s Instagram Setback: A Modern-Day Trumpian Tale of Disappointment

    Taika Waititi’s Instagram Setback: A Modern-Day Trumpian Tale of Disappointment

    Cyber Monday Poised to Break Daily Online Spending Records

    Cyber Monday Poised to Break Daily Online Spending Records

    Clemson and South Carolina Ignite Tensions with Intense Brawl Following Controversial Quarterback Hit

    Clemson and South Carolina Ignite Tensions with Intense Brawl Following Controversial Quarterback Hit

    Lions’ Jahmyr Gibbs and Nicole Anderson End Three-Year Relationship

    Lions’ Jahmyr Gibbs and Nicole Anderson End Three-Year Relationship

    California Sees Record-Breaking Ocean Temperatures, Sparking Concerns Over Flooding Risks

    California Sees Record-Breaking Ocean Temperatures, Sparking Concerns Over Flooding Risks

    Thanksgiving Weather Woes, Black Friday Buzz, and SCOTUS’s Asylum Rulings: A Comprehensive Update

    Thanksgiving Weather Woes, Black Friday Buzz, and SCOTUS’s Asylum Rulings: A Comprehensive Update

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
The Insight Post
  • Home
  • Insight
  • Blog
  • Business
  • Entertainment
  • Health
  • Politics
  • Shop
    • Gift Shop
    • Value Shop
    • Store
    • Bargain Shop
    • Discount
  • Sports
  • Tech
  • Travel
  • USA
    Inside The New York Times: Analyzing Supreme Court Arguments with Depth and Insight

    Inside The New York Times: Analyzing Supreme Court Arguments with Depth and Insight

    GOP Advances Controversial “Buffer Zone” Bill Aimed at Limiting Protests in Key Committee Vote

    GOP Advances Controversial “Buffer Zone” Bill Aimed at Limiting Protests in Key Committee Vote

    Duterte’s Defense Asserts Drug War Killings Do Not Constitute Crimes Against Humanity, Urges ICC to Dismiss Allegations

    Duterte’s Defense Asserts Drug War Killings Do Not Constitute Crimes Against Humanity, Urges ICC to Dismiss Allegations

    Taika Waititi’s Instagram Setback: A Modern-Day Trumpian Tale of Disappointment

    Taika Waititi’s Instagram Setback: A Modern-Day Trumpian Tale of Disappointment

    Cyber Monday Poised to Break Daily Online Spending Records

    Cyber Monday Poised to Break Daily Online Spending Records

    Clemson and South Carolina Ignite Tensions with Intense Brawl Following Controversial Quarterback Hit

    Clemson and South Carolina Ignite Tensions with Intense Brawl Following Controversial Quarterback Hit

    Lions’ Jahmyr Gibbs and Nicole Anderson End Three-Year Relationship

    Lions’ Jahmyr Gibbs and Nicole Anderson End Three-Year Relationship

    California Sees Record-Breaking Ocean Temperatures, Sparking Concerns Over Flooding Risks

    California Sees Record-Breaking Ocean Temperatures, Sparking Concerns Over Flooding Risks

    Thanksgiving Weather Woes, Black Friday Buzz, and SCOTUS’s Asylum Rulings: A Comprehensive Update

    Thanksgiving Weather Woes, Black Friday Buzz, and SCOTUS’s Asylum Rulings: A Comprehensive Update

  • Video
  • World
    • Asia
    • Africa
    • South America
    • North America
    • Europe
    • Oceania
No Result
View All Result
No Result
View All Result
Home Mobile

Flutter Tutorial: Organizing Your Flutter App

by Theinsightpost
August 17, 2022
in Mobile
0 0
0
Flutter Tutorial: Organizing Your Flutter App


Flutter 102 and a half by Scott Stoll

You may have noticed that Flutter apps aren’t organized like other apps. You may have also noticed that there doesn’t seem to be a lot of guidance on how to organise your Flutter app. Let’s dig in.

Flutter app organization rules

It’s kind of like the old movie Fight Club: “The first rule of Fight Club is don’t talk about Fight Club”.

After two years of Fluttering, I haven’t seen many people talking about how to organize an app, either.

Rule #1: There are almost no rules.

This is the source of both freedom and chaos. People know to shove things into their lib directory, and not much else. Some use directories called pages, others routes, some put an asset folder in their lib directory and others have it outside of lib. Which way should you do it?

Rule #2: You don’t have to do what others do.

I’m not about to say what you “should” do, but I’ll tell you what you could do. The best guideline I have is to make sure you, and anyone else maintaining your app, can find what you’re looking for quickly, easily and intuitively. That said, let’s take a look at some options.

Where are your objects?

Are you using encapsulation objects like Models and BLoC? They could have their own place, easy to find and directly under lib. Maybe something like lib/models

You might want to organise those assets.

Oddly enough, this is the one place you see people agreeing that they like to have them outside the lib folder. Even further, it’s a good practice to organize them with subfolders. The asset folder is usually a sibling of lib, not in it. So while your lib folder is at package_name/lib, your asset folder would be at package_name/assets. Then, under assets, we can break each type down into subfolders like:

  1. …/assets/images
  2. …/assets/svg
  3. …/assets/fonts

The app files are crucial.

This is for anything that is app-wide. In Flutter, we often make files for colors, strings, text styles, themes, localization and even variables for asset values and vector graphics. This way all of these values are kept in one, easy to find place that should make life easier for the person who gets stuck with maintaining your app. The examples below were so small I decided to put them in one file, but I’d recommend breaking each class out into its own file, and then putting them somewhere like lib/app.

An AppColors.dart File With Some Material Color Sets Pre-Defined

You probably have a backend.

I mean, your app isn’t all UI, is it? You might want to think about a backend folder, maybe with some subfolders for utils, services, and managers?

lib
...
  backend
    services
    utils
    managers

Data can be real or fake.

Personally, I use a data folder for the real stuff and, inside of it, I place a mock folder for the fake data I use during development.

Pages and Routes.

You’ll probably want to keep all the files that are the base of a page together. They can, and almost certainly will call in all sorts of Widgets, but the file we normally consider the page is the one that has the highest widgets of the tree that are currently being displayed. This is usually a Scaffold and AppBar, but if you’re doing something that’s full-page then this could easily be a Container, Material, Center or SizedBox, too.

Your widgets folder could easily end up being the largest folder in your app. If it’s a Widget that’s smaller than a page or route, then it could go in here. This is especially true of any Widgets that get reused over and over, in many different parts of your app.

The rest of the story…

Wrapping up, for things like Firebase I’ve seen the Firebase related Dart files put in a folder under lib while all of the Firebase files that are not Dart files were put in a Firebase folder directly under the project folder, as a sibling of lib.

In the end, you want to make sure that not only can you find what you’re looking for, but the poor sucker who has to follow you a year from now can easily find what they’re looking for, too.

That means things need to follow a pattern of organization that makes sense to a human being.

So take a moment to ask yourself one, simple question:

“Is the way this is organized understandable to anyone, or only to an engineer?”

As the levels of abstraction in modern frameworks goes higher and higher, people are coming to the software world from all kinds of different backgrounds. This is especially true in Flutter, which is (hopefully) about to be inundated with web developers looking for a better way to write their apps. And don’t forget that Flutter will let them release their creations to a lot more places than just the web.

If you came from Android and want to use a similar organization system with things like res/drawable and res/values, there’s nothing stopping you. There’s no rule that says you can’t, but take a moment to think about this:

Right now, the vast majority of Flutter devs will understand that system without any problem at all because the vast majority of us have at least some experience with Android development, but that’s starting to change. Backend devs who have always wanted to try their hand at front end and mobile are seeing that the learning curve is now easier than ever. To them, front end development suddenly seems like something they might actually have come within their reach. And as I mentioned, we’re probably going to see a lot of web developers branching into Flutter, too.

This means it won’t be long before the majority of Flutter devs don’t have any Android experience, so you might want to think about organizing your app not in a way that today’s Flutter devs will understand, but one that tomorrow’s Flutter devs will.

You can stalk the author on Twitter at @scottstoll2017, or LinkedIn.

Continue with the first Flutter tutorial by Scott Stoll on Flutter Layout System





Source link

ShareTweetSend
Previous Post

Kenya presidential wildcard vows to erase debt with ‘ganja solution’

Next Post

Is Elon Musk really buying Manchester United?

Related News

UK App Developers Can Now File Claims in Google Play Settlement
Mobile

UK App Developers Can Now File Claims in Google Play Settlement

December 1, 2026
Navigating Your Options: 12 Key Risks to Avoid When Selecting a Software Development Partner
Mobile

Navigating Your Options: 12 Key Risks to Avoid When Selecting a Software Development Partner

November 30, 2026
Revolutionizing Technology: The Shift from Open-Source Solutions to Automated Agentic Testing
Mobile

Revolutionizing Technology: The Shift from Open-Source Solutions to Automated Agentic Testing

November 29, 2026
Top 7 Alternatives to Zendesk Sell in 2026: A Comprehensive Pricing Comparison
Mobile

Top 7 Alternatives to Zendesk Sell in 2026: A Comprehensive Pricing Comparison

November 29, 2026
Next Post
Is Elon Musk really buying Manchester United?

Is Elon Musk really buying Manchester United?

Discussion about this post

Subscribe To Our Newsletters

    Advertise With Us

    Reach millions of global readers across Business, Politics, Tech & Travel.

    60-Day Business Ad FREE
    Sponsored Feature $75
    Display Banners Custom
    GET STARTED NOW
    henryychi24@gmail.com • (832) 795-1420

    Customer Support


    1251 Wilcrest Drive
    Houston, Texas
    77042 USA
    Call-832.795.1420
    e-mail – news@theinsightpost.com

    Subscribe To Our Newsletters

      Categories

      • Africa
      • Africa-East
      • African Sports
      • American Sports
      • Arts
      • Asia
      • Australia
      • Business
      • Business Asia
      • Business- Africa
      • Canada
      • Defense
      • Education
      • Egypt
      • Energy
      • Entertainment
      • Europe
      • European Soccer
      • Finance
      • Germany
      • Ghana
      • Health
      • Insight
      • International
      • Investing
      • Japan
      • Latest Headlines
      • Life & Living
      • Markets
      • Mobile
      • Movies
      • New Zealand
      • Nigeria
      • Politics
      • Scholarships
      • Science
      • South Africa
      • South America
      • Sports
      • Tech
      • Travel
      • Travel-Africa
      • UK
      • USA
      • Weather
      • World
      No Result
      View All Result

      Recent News

      Innovative Ice Towers: A Sustainable Solution to Kyrgyzstan’s Glacier Decline

      Innovative Ice Towers: A Sustainable Solution to Kyrgyzstan’s Glacier Decline

      December 2, 2026
      Insta360 Unveils Pro 3: Experience Cutting-Edge Photography with a 1/1.1-Inch Square Sensor and Interchangeable Lenses

      Insta360 Unveils Pro 3: Experience Cutting-Edge Photography with a 1/1.1-Inch Square Sensor and Interchangeable Lenses

      December 2, 2026
      Late November Storms Indicate a Shift in Weather Patterns

      Late November Storms Indicate a Shift in Weather Patterns

      December 2, 2026
      Salesforce Shares Plummet Amid Investor Concerns Over AI Growth and Earnings Report

      Salesforce Shares Plummet Amid Investor Concerns Over AI Growth and Earnings Report

      December 2, 2026
      • Home
      • Advertise With Us
      • About Us
      • Corporate
      • Consumer Rewards
      • Forum
      • Privacy Policy
      • Social Trends

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      Welcome Back!

      Login to your account below

      Forgotten Password?

      Retrieve your password

      Please enter your username or email address to reset your password.

      Log In

      Add New Playlist

      We are using cookies to give you the best experience on our website.

      You can find out more about which cookies we are using or switch them off in .

      No Result
      View All Result
      • Home
      • Insight
      • Blog
      • Business
      • Entertainment
      • Health
      • Politics
      • Shop
        • Gift Shop
        • Value Shop
        • Store
        • Bargain Shop
        • Discount
      • Sports
      • Tech
      • Travel
      • USA
      • Video
      • World
        • Asia
        • Africa
        • South America
        • North America
        • Europe
        • Oceania

      Theinsightpost ©2026 | All Rights Reserved. Theinsightpost is an Elnegy LLC company, registered in Texas, USA

      The Insight Post
      Powered by  GDPR Cookie Compliance
      Privacy Overview

      This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

      Strictly Necessary Cookies

      Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

      Cookie Policy

      More information about our Cookie Policy