Useful arguments in the log function (from dart:developer)

The humble log function has many arguments that can be used to customize the appearance of your logs. Here's how to use them. https://codewithandrea.com/tips/log-function-args/

Use unawaited for your analytics calls

When tracking analytics events in your code, consider using unawaited from dart:async (analytics calls should be fire & forget). https://codewithandrea.com/tips/use-unawaited-analytics-calls/

How to use --dart-define-from-file with .env and json files

--dart-define-from-file supports both .env and json files. Here's how to use each variant. https://codewithandrea.com/tips/dart-define-from-file-env-json/

Get the current method name from the Stack Trace (Hack)

By doing some string manipulation on the current stack trace, you can extract the current method name (useful for logging). https://codewithandrea.com/tips/get-method-name-stack-trace/

July 2024: Flutter CTO Report, FlutterCon Takeaways, Interviews from Google I/O, Rewriting Freezed with Macros

Also included: Code Push with Flutter, Flutter adaptive theming guide, building an enterprise mobile application with 2.3M lines of code. https://codewithandrea.com/newsletter/july-2024/

Hugeicons (4,000 stroke Flutter icons)

The hugeicons package was recently released, featuring a collection of over 4,000 stroke Flutter icons. https://codewithandrea.com/tips/hugeicons-flutter-stroke-icons/

How to Cancel HTTP Requests with CancelToken and Riverpod

You can use CancelToken to stop unnecessary data fetches when users navigate away or to implement "cancel" buttons in your Flutter apps. https://codewithandrea.com/tips/dio-cancel-token-riverpod/

TextField with Selection Height Style

You can use BoxHeightStyle to change the selection height style of a TextField (useful for multi-language apps) https://codewithandrea.com/tips/textfield-selection-height-style/

How to Render Transparent Images with the Opacity Argument

If you need to show a semi-transparent image, use the opacity argument with AlwaysStoppedAnimation rather than adding a parent Opacity widget. https://codewithandrea.com/tips/transparent-images-with-opacity/

The widget build method: DOs and DON'Ts

The widget build method can potentially be called in every frame and should not have any side effects. https://codewithandrea.com/tips/widget-build-method-do-dont/


Tagok



Keresés