https://github.com/venhdev/flutter_codekit
flutter_codekit
https://github.com/venhdev/flutter_codekit
Last synced: 4 months ago
JSON representation
flutter_codekit
- Host: GitHub
- URL: https://github.com/venhdev/flutter_codekit
- Owner: venhdev
- License: mit
- Created: 2025-06-09T08:21:00.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-16T20:50:46.000Z (about 1 year ago)
- Last Synced: 2025-06-16T21:41:54.870Z (about 1 year ago)
- Language: Dart
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
A collection of essential utilities and extensions for Flutter and Dart development, designed to streamline common tasks and enhance productivity.
## Features
- **`indentJson` function**: Formats JSON data with a specified indent.
- **`stringify` function**: Converts various data types to their string representations, handling JSON serialization for Maps and Iterables.
## Getting started
To use `codekit`, add it to your `pubspec.yaml` file:
```yaml
dependencies:
codekit: ^0.0.5 # Or the latest version
```
Then, run `flutter pub get` or `dart pub get`.
## Usage
### `indentJson` and `stringify` functions
```dart
import 'package:codekit/codekit.dart';
void main() {
// Example of indentJson
final Map data = {
'name': 'Codekit',
'version': '1.0.0',
'features': ['indentJson', 'stringify'],
'nested': {
'key': 'value'
}
};
print('Indented JSON:');
print(indentJson(data));
// Example of indentJson with maxFieldLength
print('\nIndented JSON with maxFieldLength:');
print(indentJson(data, maxFieldLength: 20));
// Example of stringify
print('\nStringify a function:');
print(stringify(() => 'This is from a function'));
print('\nStringify a list:');
print(stringify([1, 2, 3]));
print('\nStringify a string:');
print(stringify('Hello Codekit!'));
print('\nStringify null:');
print(stringify(null));
}
```
For more examples, see the `example` folder and `lib/src/codekit_example_new.dart`.
## Additional information
Feel free to contribute to this package by submitting issues or pull requests on GitHub. Your feedback and contributions are highly appreciated!