Amer Bešo’s Post

View profile for Amer Bešo, graphic

Flutter Developer @ Siemens Energy | Writing about Flutter, App Development and Remote Work

Do you use ‘sealed’ classes in your Flutter apps? With sealed classes, you can: - Create a known, enumerable set of subclasses - Use switch case over subclasses you create - Add properties and methods, differently from enums - Catch errors at compile time, reducing the amount of errors at runtime Also, you can only create a subclass of the ‘sealed’ class in the same file. This allows you to have better readability and maintainability of the abstract class and its subclasses. Do you ever use sealed classes in your Flutter apps? #flutter #flutterdevelopment

  • How to use sealed classes in Flutter
Amer Bešo

Flutter Developer @ Siemens Energy | Writing about Flutter, App Development and Remote Work

6mo

📌 Here you can read more about sealed classes: https://dart.dev/language/class-modifiers

Salahuddin Shaikh

Mobile Application Developer | Flutter | Firebase | React | Typescript | Software Developer for Banking and Enterprise Agencies | 5 Years of Mobile App Development

6mo

I could use an abstract class. What is the use of a sealed class then?

Jigar Patel

Freelance Flutter developer

6mo

Looks good, but Indian compiler will disagree at line 18.

  • No alternative text description for this image
Romana Tahir

Fluttering Towards Excellence | Computer Science Student

5mo

Informative

Steven Morris

System Integration | Data | Digital Transformation

5mo

Aaron Villa This might be up your alley mate.

See more comments

To view or add a comment, sign in

Explore topics