Your Flutter App Doesn’t Have to Use Material Components - Introduce The Styled Components

Your Flutter App Doesn’t Have to Use Material Components - Introduce The Styled Components

Your Flutter app doesn’t have to use Material components - introduce the styled components. Create beautiful and customizable UI components like buttons, checkboxes, switches, sliders in Flutter. I love the fact that Flutter lets you create beautiful and customizable UI.

I love the fact that Flutter lets you create beautiful and customizable UI. There are many built-in widgets for you to use, and if you want even more customization, you can use the CustomPainter and paint the screen however you like. But when it comes to UI components like buttons, switches, checkboxes, sliders, etc, we typically just use the built-in widgets. They are easy to use and offer you some customization ability, but they have to follow the Material or Cupertino design guidelines. If that’s what you are aiming for, they are great to use. But if you want to have your own design style or tweaks beyond what those widgets offer, you might want to look for some third-party packages. There are plenty of packages on pub.dev that do this. However, customizabilities are still generally limited. If some package gives you many parameters to tweak, you need to remember them and learn how to use them correctly.

What are the key ingredients of a button?

A button is just a rectangular region that can be pressed, hovered, or disabled. If you look into the built-in component widgets' code, they are displayed according to their internal MaterialState property.

final Set<MaterialState> _states = <MaterialState>{};

bool get _hovered => _states.contains(MaterialState.hovered);
bool get _focused => _states.contains(MaterialState.focused);
bool get _pressed => _states.contains(MaterialState.pressed);
bool get _disabled => _states.contains(MaterialState.disabled);

What if we provide complete styles for those different states?

flutter-web flutter-widget flutter

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Google's Flutter 1.20 stable announced with new features - Navoki

Google has announced new flutter 1.20 stable with many improvements, and features, enabling flutter for Desktop and Web

What is Flutter and why you should learn it?

Flutter is an open-source UI toolkit for mobile developers, so they can use it to build native-looking Android and iOS applications from the same code base for both platforms. Flutter is also working to make Flutter apps for Web, PWA (progressive Web-App) and Desktop platform (Windows,macOS,Linux).

Build a scrollbar for Flutter Web

Because that seems to be the only thing Flutter web doesn’t include.

Flutter Quick Tips & Tricks

Here you will see some quick Flutter Coding Tips & Tricks. Flutter Tips & Tricks. Dismiss Keyboard. To dismiss Keyboard, we have to set focus on a different node as shown in the example below using ...

Flutter: Stateful Widget vs. Stateless Widget

Flutter is all about widgets. If you want to develop an application you have to first decide which widgets you are going to use. Each widget has its state. Flutter: Stateful Widget vs. Stateless Widget