/flutter-tips-and-tricks

My Flutter Tips & Tricks on Twitter 👇

Primary LanguageDartMIT LicenseMIT

Flutter Tips & Tricks

A collection of all the Flutter tips & tricks I share on Twitter and LinkedIn. If you find this useful, give it a star! 🌟

Preview

Full List

I'm adding new tips regularly (newest at the top 👇).

ID View on GitHub (this repo) Twitter Post LinkedIn Post Link on codewithandrea.com
150 Preloading SVG assets in Flutter link link
149 Environment variables in Dart link link
148 Determinate Circular Progress Indicator link link
147 How to bundle assets based on flavor link link
146 Extension methods vs types (Dart 3.3) link link
145 Write reusable widgets! link link
144 Scheduling microtasks in Dart link link
143 We need to talk about FlutterFlow! link link link
142 Launching your Flutter app with flavors link link
141 ⚠️ debugPrint prints in release mode ⚠️ link link
140 Toggle Inlay Hints in VSCode link link
139 GitHub Copilot Tips for Flutter Devs link link link
138 Opening URLs with xcrun / adb link link
137 Combining Streams with RxDart link link link
136 Use IntrinsicWidth, not fixed width link link
135 Replace Container with nested widgets link link
134 Debug Paint Size (DevTools) link link
133 SelectionArea across multiple widgets link link
132 Highlight oversized images with the Flutter DevTools link link
131 Async Dependency Initialization with requireValue (Riverpod) link link
130 8 Steps to Follow When Building Your Next Flutter App link link link
129 VSCode Debug Toolbar in Command Center link link
128 Error Handling during App Startup link link
127 Full-Text Search: Firestore Extensions link link
126 How to work with webhooks? link link link
125 Xcode 15 DT_TOOLCHAIN_DIR issue link link
124 Payment options on mobile and web link link
123 Top reasons for using a realtime backend link link
122 First steps to tackle when starting a new mobile app link link
121 Fetching vs Mutating data with Riverpod link link link
120 Flutter web: redirect to an external URL link
119 VSCode Quick Fix: Create constructor for final fields, required named link
118 How to Inspect Network Requests with the Flutter DevTools link
117 Are global variables bad? link
116 Measuring execution time in Dart link
115 Find the Invalid Switch Expression 🧐 link
114 6 steps to minimize your Firebase Bill link
113 Conditional JSON parsing in Dart 3 link
112 Switch Matrix in Dart 3 link
111 Destructuring Lists in Dart link
110 Getting a Future from a FutureProvider with Riverpod link
109 Record Equality in Dart 3 link
108 MediaQuery as InheritedModel link
107 Happy Birthday with records in Dart 3 link
106 Return without async/await link
105 Creating an empty Flutter project link
104 [core/duplicate-app] A Firebase App named "[DEFAULT]" already exists link
103 Firebase Auth flow in 5 minutes link
102 Storing API keys in a JSON file link
101 Backend-agnostic Flutter apps link
100 Firestore Security Rules Playground link
99 Firestore OR queries 🔥 link
98 Pagination with FirestoreListView link
97 Riverpod Notifier with build arguments link
96 Cloud Firestore - Cache Size link
95 StreamProvider with Riverpod Generator link
94 Fix missing ProviderScope error with Riverpod Lint link
93 Add a part file with Riverpod Snippets link
92 Firebase Billing and Cost Calculator link
91 Got linter issues? Use dart fix --apply link link
90 Using context.mounted in Flutter 3.7 link
89 Using serverTimestamp() in Firestore link
88 Get a single item from a list link
87 The Accessibility Tools package link
86 Dart code samples in the Firebase docs link
85 Use ChatGPT to do custom styling in Flutter link
84 Using the query builder UI in Cloud Firestore link
83 Update packages with the Version Lens VSCode extension link link
82 Cloud Firestore collection count link
81 How to use the new Riverpod Generator package link link
80 How to use Future.wait() in Dart link
79 String multiplication in Dart link
78 How to nest generated files in VSCode link
77 Using AnimatedContainer to animate Container properties link
76 Enable sticky scroll in VSCode link
75 Using build_runner in watch mode link
74 Functions as arguments (with tear-off) link
73 How to define type aliases in Dart link
72 Use type annotations for safer code link
71 Prefer const over final over var link
70 Flutter app localization in 5 min link
69 When to use SizedBox.shrink() to return an empty box link
68 --enable-asserts flag in Dart / Flutter link
67 REST Client extension for VSCode link
66 The HtmlUnescape package link
65 How kIsWeb works in Flutter link
64 When to use each Riverpod provider? link
63 Explicit error types with Either link link
62 Exception handling: try/catch vs Result link link
61 Errors vs Exceptions in Flutter link
60 Do not use BuildContexts across async gaps (and what to do instead) link
59 Flutter Riverpod: How to Register a Listener during App Startup link link
58 Using test tags in Flutter link
57 Singletons in Flutter: Drawbacks link link
56 Riverpod: Async init with Provider Overrides link
55 How to run multiple test variants link
54 Riverpod tip for less boilerplate (Passing Ref) link
53 How to Create DartPad Examples from GitHub Gists link link
52 How to Add a Custom Test Timeout in Flutter link link
51 Golden Image Testing with Robot Testing link
50 Dart 2.17: Enhanced Enums with Members link link
49 Dart 2.17: Super Initializers link link
48 Testing functions that throw link link
47 Why write automated tests? link
46 Riverpod: difference between ref.watch, ref.read, ref.listen link
45 The Map.update() method link link
44 AsyncValue.guard() vs try/catch link link
43 How to write a reactive in-memory store with RxDart link
42 How to Generate and Analyze a Flutter Test Coverage Report in VSCode link link
41 Using Fake Repositories for Testing link
40 Anatomy of a Riverpod Provider link
39 Flutter Project Structure: Feature-first or Layer-first? link link
38 Popular architectures for Flutter development link link
37 Rules to follow for good app architecture link
36 GoRouter: go vs push link link
35 AsyncValue vs FutureBuilder & StreamBuilder link link
34 How to use WidgetsBindingObserver link
33 VSCode extensions to speed-up your Flutter workflow link link
32 Flutter tip: use composition aggressively link
31 How to use the Flutter Widget Inspector link
30 VSCode launch configurations link
29 Domain-Driven Exception Handling link
28 DDD: The Domain Model link
27 Better Comments Extension for VSCode link
26 Running tests with GitHub actions link
25 How to run Flutter Integration Tests at Hyper Speed link
24 Simplified Flutter App Localization link link
23 The Gap Widget link
22 App Development workflow in 6 steps link
21 Repositories as abstract classes (program to interfaces, not implementations) link link
20 How to configure multiple Firebase environments with FlutterFire CLI link
19 How to use Robot Testing to write more readable widget tests link
18 How to create a Flutter GridView with content-sized items link link
17 6 common sources of errors in Flutter apps link
16 Easily handle loading and error states link
15 AsyncValueWidget: a reusable Flutter widget to work with AsyncValue (using Riverpod) link link
14 How to navigate programmatically between tabs in Flutter link
13 Responsive Flutter card layout with SizedBox & Center link
12 How to Validate a TextField in Flutter link link
11 How to Style an ElevatedButton in Flutter link link
10 How to Generate Fake data with the Faker package link
9 Chat UI with message bubbles (revisited) link
8 Chat UI with message bubbles link link
7 How to set the border radius on a Flutter container link
6 Flutter Fix all command link
5 Use the DevTools to identify Jank and Shader compilation issues link
4 Flutter Lints package link
3 Accept payments with the Stripe SDK link
2 Flutter create --sample link
1 Flutter reusable Split View on mobile, desktop and web link link

Spread the word!

If these tips have helped you, make sure to star this repo 🌟 and share this tweet! 🙏

This way others can benefit too and everyone can learn! 👍

How to Contribute

If you find any typos, errors, broken links, or other mistakes, feel free to open a PR.

If you have more Flutter tip ideas, please send me a DM on Twitter.

Thank you for all your input!