Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iconica-development/flutter_iconica_utilities
Small package that can be included in your app to access regularly used utility functions.
https://github.com/iconica-development/flutter_iconica_utilities
component
Last synced: 2 days ago
JSON representation
Small package that can be included in your app to access regularly used utility functions.
- Host: GitHub
- URL: https://github.com/iconica-development/flutter_iconica_utilities
- Owner: Iconica-Development
- License: bsd-3-clause
- Created: 2022-10-19T08:23:08.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-31T08:15:56.000Z (3 months ago)
- Last Synced: 2024-11-30T04:28:33.735Z (2 months ago)
- Topics: component
- Language: Dart
- Size: 48.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Iconica utilities
Small package that can be included in your app to access regularly used utility functions.
## Installation
To add this package in your project, add to your pubspec.yaml:
```yaml
iconica_utilities:
git:
url: [email protected]:iconicadevs/iconica_utilities.git
ref: 0.0.4
```## Features
[Bidirectional sorter](#Bidirectional%20Sorter)
[Highlighted text](#Highlighted%20text)
## Bidirectional Sorter
Generic implementation of sorter for lists. It can sort primitive and complex objects, Both in descendig and ascending order. Can also sort multiple fields at the same time for complex objects using sortMulti
### Usage
```dart
import 'package:iconica_utilities/iconica_utilities.dart';// Creating list of Strings
List listToSort = [];
for (int i = 0; i < 10; i++) {
listToSort.add("name$i");
}// Calling the sort method
sort(SortDirection.descending, listToSort);print(listToSort)
// Returns
[name9, name8, name7, name6, name5, name4, name3, name2, name1, name0]
```## Highlighted text
Generic implementation of the highlighted text widget, can be used as an extension of the regular text widget. Highlighted style, mainstyle and highlight matchers can be given as parameters. A fourth parameter is provided to add a tap recognizer called "onTapRecognizer" which takes a VoidCallback.
### Usage
```dart
import 'package:iconica_utilities/iconica_utilities.dart';// This creates a widget showing the text, This is a test, where the word test is colored red.
List highlightMatchers = ['test']
Text('This is a test').highlight(highlightMatchers,
highlighStyle: TextStyle(
color: toTestColor,
),
),
``````dart
import 'package:iconica_utilities/iconica_utilities.dart';// This creates a widget showing the text, "This is a red, and this blue", where the word red is colored red and the word is colored blue.
Text('This is a red, and this blue').multiHighlight([
HighlightModel(
['red'],
highlightStyle: TextStyle(
color: Colors.red,
),
),
HighlightModel(
['blue'],
highlightStyle: TextStyle(
color: Colors.blue,
),
),
],
),
```## Contributing
When contributing create a branch and send in a pull-request. This request will then be reviewed and merged.
Make sure, everthing listed down below is done.
- Sensable tests are written for each future (with atleast 90% coverage)
- All other tests stil work
- [dartfmt](https://dart.dev/tools/dart-format) is ran
- [dartdoc](https://dart.dev/tools/dartdoc) is written (using ///)
- Version number is increased in the [pubspec.yaml](./pubspec.yaml)
- [changelog](./CHANGELOG.md) is updated
- Your feature is added to the [README.md](./README.md) (See examples of already added features for template)NOTE: To check your coverage, run the tests with the `--coverage` option. Then run `genhtml -o coverage coverage/lcov.info`
If all of the above are done, a PR can be created.