Enforce stricter types in Flutter

Example: Strings

Pendatic comes to help

doStuff() {
doOtherStuff();
}
doStuff() has the return type dynamic.
void doStuff() {
doOtherStuff();
}

Configuring pedantic

dev_dependencies:
flutter_test:
sdk: flutter
pedantic: ^1.9.0
include: package:pedantic/analysis_options.1.9.0.yamlanalyzer:
exclude: [build/**]
strong-mode:
implicit-casts: false
implicit-dynamic: false
Dart being pedantic on my code.

--

--

--

Software Developer, http://felix-blaschke.de

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Tech Blog — Part 2 — NFT Auction Platform Tech Stack Overview

Going For Go For Web APIs

Writing Active Record Database Validation Methods

Livin’ La Vida Low Code

Learning Android Development the Hard Way

Things you dont need for all apps.

How to set up a ledge grab system for platformer in Unity

MongoDB Realm JWT Meta Data and Custom User Data

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Felix Blaschke

Felix Blaschke

Software Developer, http://felix-blaschke.de

More from Medium

Flutter + Git Hooks

BottomNavigationBar Widget in Flutter

Receive Sharing Files To Flutter App From Another App

Thoughts about Clean Architecture in Flutter apps