https://github.com/maxbritto/extension_flutter_tools
Useful Widgets and class extensions for Flutter apps
https://github.com/maxbritto/extension_flutter_tools
Last synced: 4 months ago
JSON representation
Useful Widgets and class extensions for Flutter apps
- Host: GitHub
- URL: https://github.com/maxbritto/extension_flutter_tools
- Owner: maxbritto
- License: bsd-3-clause
- Created: 2022-05-12T08:56:25.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-05-28T12:11:21.000Z (about 1 year ago)
- Last Synced: 2025-10-22T22:22:55.327Z (8 months ago)
- Language: Dart
- Homepage: https://www.purplegiraffe.fr
- Size: 44.9 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Useful Widgets and class extensions for Flutter apps
## Features
### Widgets
- `CopyToClipboardButton` : A button that will copy a text to the clipboard when pressed. The text to copy is passed as a parameter to the widget.
- `ConfirmWrapper` : Wrap any tappable widget with a graphical confirmation from the user. Useful for delete button, dangerous operations, etc.
- `DateTimeButton` : A button that allows the user to select a date (and optionnaly a time). The buttons displays the selected date.
- `EditableLabel` : A simple text with an edit button next to it. When clicked, a `TextField` allows to edit the value and save it.
- `NetworkOrFileImage` : A widgets that receives an image Uri and checks if it is a local image, an app asset or a network url. Then uses the correct API to fetch and display the image. For network images, it uses the [cached_network_image](https://pub.dev/packages/cached_network_image) library to download and cache the image before displaying it.
- `ErrorView` : A simple ErrorView with at minimum a *title*, but can also have a *subtitle*, *details* (with a disclose button), a configurable *fix it* button.
### Extensions :
- `Color` to hexadecimal : allows conversion from `Color` objects to a `String` Hexadecimal representation and also in reverse order (from `String` to `Color`)
### Test tools
Added some static functions useful for unit tests for Flutter apps.
- `runTestableWidgetScreen` and `runTestableComponent` allow to launch a widget for testing with some parameters
- `loadStringFromFile` allows to load a string from a file in any test. Useful for loading JSON files for example.
- `generateLongString` generates a string of a given length and optionnaly we can decide which repeating character should be used. Useful for testing long texts in UI of widgets.
## Getting started
Add the package as a dependency in your pubspec.yaml file
```yaml
dependencies:
flutter:
sdk: flutter
extension_flutter_tools:
git: https://github.com/maxbritto/extension_flutter_tools.git
```
## External contributions
If you want to add new widgets or extensions, please keep in mind before submitting a PR :
- Widgets and extensions must be generic enough to be usable in many projects
- Unit tests and automated tests are mandatory. 100% coverage is required for any newly added code
Thanks for your contributions!
Happy Coding.
Maxime