| # RydMike LINTER Preferences v2.6.0 | |
| # | |
| # Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c | |
| # | |
| # We include and activate all_lint_rules, then below we disable the not used or desired ones. | |
| # You can find a list of all lint rules to put in your all_lint_rules.yaml file here: | |
| # https://dart.dev/tools/linter-rules/all | |
| # | |
| # This version is updated for Flutter 3.38 and Dart 3.10. | |
| # |
Enable Material components (Card, Dialog, TextField, Chip, etc.) to render full decoration styling (gradients, multiple shadows, inner shadows, images) through their existing shape property by introducing a new ShapeBorder subclass that carries decoration data and modifying the Material widget to render it.
| import 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/rendering.dart'; | |
| void main() { | |
| runApp(MyApp()); | |
| } | |
| class MyApp extends StatelessWidget { | |
| @override |
| import 'universal_platform_web.dart' | |
| if (dart.library.io) 'universal_platform_vm.dart'; | |
| /// A universal platform checker. | |
| /// | |
| /// Can be used to check active physical Flutter platform on all platforms. | |
| /// | |
| /// To check what host platform the app is running on use: | |
| /// | |
| /// * PlatformIs.android |
| // MIT License | |
| // | |
| // Copyright (c) 2022 Simon Lightfoot | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
A simple benchmark of jogboms/registry.dart vs MelbourneDeveloper/ioc_container vs fluttercommunity/get_it for educational purposes
get_it -> 7.6.0
ioc_container -> 1.0.12
registry -> https://github.com/jogboms/registry.dart/commit/c93055554a589cc8e8b03b7ff35502438cfc235f
| import 'dart:async' show Future; | |
| import 'package:flutter/material.dart'; | |
| import 'package:flutter/services.dart' show rootBundle; | |
| import 'package:flutter_svg/flutter_svg.dart'; | |
| /// Displays an SVG image provided in the applications asset bundle. | |
| /// | |
| /// The [assetName] is the path and name of the SVG file in the asset bundle. | |
| /// This SVG asset display widget is tuned for usage with the Undraw images |
| class CustomTrianglePainter extends CustomPainter { | |
| final Color color; | |
| late Paint _paint; | |
| CustomTrianglePainter(this.color) { | |
| _paint = Paint() | |
| ..color = color | |
| ..style = PaintingStyle.fill; | |
| } |
This gist demonstrates jank observed during a large filesystem operation. There is a lint called avoid_slow_async_io that recommends people not use async io methods. These methods are definitely slower than the sync methods, but they provide concurrency which is critical to a Flutter application. We are exploring if the linter recommendation introduces jank in a flutter app or not.
If you use sync io methods that are of moderate to large size, it will freeze the ui.
If you use the linter recommendations, the result is nearly identical to using async methods as a default. I have seen some dropped frames on Simulator but it's barely noticable.