Skip to content

☂️ Reinforcement: Add more basic components to the core framework #97496

@Hawmex

Description

@Hawmex

This issue tracks proposals and development for net-new widgets and functionalities to be added to the core widgets library.

This effort is the other side of the coin to our reinforcement work, see the refactoring side as well. While the refactoring issue focuses on moving existing code, this issue is dedicated to identifying and building new, foundational, style-agnostic primitives that are missing from the core widgets library today. The goal is to fill gaps in the core and make it an even more powerful foundation for building any design system.

Note

Some of these may be best informed by a UXR study. Before considering contributing one of these net-new widgets, reach out to the team on Discord to confirm.

Propose a New Core Widget! 💡

What foundational widget or capability do you wish existed in Flutter's core? If you have an idea for a new, un-opinionated "headless" widget that would be broadly useful, this is the place to propose it. Please provide a clear use case and rationale for why it belongs in the core framework.

Up for consideration (to convert to tracking issues):

  • Basic Button (wrapper)
    • Functionality, semantics over style, for use in composing anything to be a button, would contain:
      • Focus
      • Semantics
      • Gestures
      • MouseRegion
  • Bottom bar
    • Similar to BottomAppBAr/BottomNavigationBar, simpler generic interface, safe area handling
  • TabBar
    • Navigation oriented, or still scrolling PageView?
  • Theme object
    • We discussed a new base theme object as making sense. For use in the WidgetsApp, containing:
      • ThemeExtensions, or something similar
      • High contrast (a11y)
      • Brightness (dark mode)
      • defaultTargetPlatform
      • Font family and fallback
      • Perhaps others…
  • Top bar
    • Similar to App Bar, simpler generic interface, safe area handling

OP Hi, It's been 2 months since I've ditched HTML, CSS, and JS for Flutter and I haven't looked back. I love the declarative style of Flutter and Dart itself.

What's the problem?

What really bothers me is I find it hard to implement completely Custom UIs. I mean even when I wanted to use a custom font, I had to depend on material.dart and use Scaffold to make it work. I don't even want to start talking about the frustrations of theming a material app in flutter. But this was not a problem using HTML, CSS, JS. They basically give you simple and minimal elements and then let you do whatever you want with them or use whatever UI package you want, such as Tailwind, MUI, etc.
So, It's either a matter of Flutter lacking documentation on Custom UIs or me not reading enough docs about them.

Any other problems?

Well, if you just take a look at the reported issues, they're mostly about material.dart and cupertino.dart. I feel like Flutter Team is spending most of their time, effort and energy on these two UIs instead of the framework itself. And still, Flutter is far behind from Material 3 spec (and even Material 2, because material.dart uses 2014 typography by default.).

My Ideal Flutter

So my ideal is:

  • The main Flutter package should contain and export basic widgets of the framework (GestureDetector, StatelessWidget, StatefulWidget, etc.). These can be currently found in widgets.dart. This way, Flutter Team's efforts are concentrated on the framework itself.
  • material and cupertino should come in seperate packages (and export the main Flutter package) and be maintained by Flutter community more.
  • More tutorials and docs should be provided on making UIs with the main Flutter package rather than making them with material or cupertino. This way more people will know how underlying widgets of material and cupertino work and can take part in maintaining them or even make their own UIs in their apps and packages.

This way we will be able to see more Flutter UI packages and a more diverse set of Flutter apps in terms of UI on the market.

After all, these are just my ideals and may be far from reality but I really like to see some discussion on this matter and finding the best solution to it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: proposalA detailed proposal for a change to Fluttercustomer: crowdAffects or could affect many people, though not necessarily a specific customer.f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions