This document covers the unique aspects, limitations, and unexpected behaviors when working with PocketBase's embedded JavaScript engine (Goja). These are critical differences from standard Node.js or browser JavaScript environments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:core'; | |
| /// Démo d’égalité, hashCode et comparaison d’entités. | |
| /// | |
| /// Points clés: | |
| /// - L’égalité logique (operator ==) est basée sur l’ID en minuscules. | |
| /// - Le hashCode est cohérent avec == (utilise le même critère). | |
| /// - compareTo (Comparable<MyEntity>) illustre un ordre de tri. | |
| /// | |
| /// Subtilités: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'package:provider/provider.dart'; | |
| class MyBudgetModel { | |
| final Set<String> activeCategories; | |
| MyBudgetModel(this.activeCategories); | |
| } | |
| class MyBudgetController extends ChangeNotifier { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| import json | |
| import os | |
| import platform | |
| import sys | |
| import urllib.request | |
| import zipfile | |
| from pathlib import Path |
- ALWAYS use english for code and documentation
- ALWAYS prefer conventions over configurations
- ALWAYS Create small, focused components and files instead of large files
- ALWAYS use tests, and static analysis tools if available
- ALWAYS consider whether the code needs refactoring given the latest request. Maybe there is code that is not used anymore. If it does, refactor the code to be more efficient and maintainable. Spaghetti code is your enemy.
- ALWAYS be generous with golden testing and code documentation
- ALWAYS consider their is a CI (github workflows or other)
- ALWAYS use the best accessibility semantics and tools. To ensure accessibility is always working, use ARIA labels for web and Semantics Widget for flutter. use them for testing also.
- Follow the project's conventions if present.
- When exploring a project, if you struggle to search, write python scripts to explore the project and write some markdown files to make it easier next time.
Ce document présente toutes les fonctionnalités et améliorations majeures apparues dans Dart entre les versions 3.5 (août 2024) et 3.8 (mai 2025).
La fonctionnalité principale de Dart 3.6 est l'introduction des séparateurs de chiffres pour améliorer la lisibilité des nombres.
Copyright :
- https://medium.com/@sharma-deepak/write-flutter-like-google-895d6066c6fe
- https://medium.com/@sharma-deepak/write-flutter-like-google-part-2-d73d29a7007a
There are countless Flutter coding conventions floating around. From the popular “Flutter Clean Architecture” to community-driven style guides, developers have been following external conventions for years. I was one of them.
For the past 5 years, I followed community best practices, enforced strict linting rules, and structured my Flutter apps according to popular Medium articles and YouTube tutorials. My code was “clean,” and my architecture was “proper.”
- Flutter app, with provider for dependency management.
- Always run flutter analyze to fix all errors, when there is errors, just run
dart fix --applybefore trying to manipulate the code by yourself - Always ensure your code is fully tested, with flutter test() or widgetTest(), add be generous with goldenTest and screen captures also
- Always prefer type-safe alternative to
dynamic,lateand other risky behaviors - Do not cast with
askeyword, but always prefer pattern matching to safely cast and test types - Never use the
dynamickeyword, norlate, but preferObject?which is safer - Always use flutter theme extension to allow UI customization, for every group of UI widgets you build, add a theme extension and refer to hit using context to customize the widgets.
NewerOlder