https://github.com/alexcmgit/flutter-shared-tools
A set of Flutter tools that I often use in my projects.
https://github.com/alexcmgit/flutter-shared-tools
common flutter secretvault set tools utils
Last synced: about 1 year ago
JSON representation
A set of Flutter tools that I often use in my projects.
- Host: GitHub
- URL: https://github.com/alexcmgit/flutter-shared-tools
- Owner: alexcmgit
- License: mit
- Created: 2022-07-11T14:40:28.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-30T14:49:57.000Z (over 2 years ago)
- Last Synced: 2025-06-14T21:08:06.723Z (about 1 year ago)
- Topics: common, flutter, secretvault, set, tools, utils
- Language: Dart
- Homepage: https://github.com/alexrintt/flutter-shared-tools
- Size: 32.2 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## How to install
(Recommended) Fork and depend of your fork instead using this one. This is a really unstable installation since it's not from _pub.dev_.
```yaml
dependencies:
# ...
flutter_shared_tools:
git:
url: https://github.com/alexrintt/flutter-shared-tools
ref: master
# ...
```
And use as:
```dart
import 'package:flutter_shared_tools/flutter_shared_tools.dart';
```
## Features
Check out full list of features.
### Available extensions
- `MediaQueryAlias`.
```dart
// Allow usage of:
context.width; // Alias for MediaQuery.of(context).size.width;
context.height; // Alias for MediaQuery.of(context).size.height;
// Many others, check [MediaQueryAlias] extension for full list of alias
```
- `NavigatorAlias`.
```dart
// Use context to manage routes:
context.push(...);
context.pop(...);
context.maybePop(...);
// Instead of:
Navigator.of(context).push(...);
Navigator.of(context).pop(...);
Navigator.of(context).maybePop(...);
```
- `ScrollControllerUtils`.
```dart
// Use to build an infinite scroll
scrollController.addOffsetListener(
() {
loadMoreItemFromApi(); // Will be called everytime scroll reaches the bottom
},
context.height / 2, // Optionally set an offset from the bottom to load before it reaches the real bottom
);
```
- `ThemeAlias`.
```dart
if (context.isDark) { /* ... */ }
context.primaryColor; // ...
context.colorScheme; // ...
context.onPrimary; // ...
// ...etc. See full list at [ThemeAlias] extension.
```
### GitHub color schemes
See [primer.style/primitives/colors](https://primer.style/primitives/colors), the official website of color scheme of GitHub theme.
This module allows you use it inside Flutter.
```dart
// Object with all colors of the GitHub Light theme
const kGitHubLight = GitHubLightColors();
// Object with all colors of the GitHub Dark Dimmed theme
const kGitHubDarkDimmed = GitHubDarkDimmedColors();
// Object with all colors of the GitHub Dark theme
const kGitHubDark = GitHubDarkColors();
// Object with all colors of the GitHub Light Colorblind theme
const kGitHubLightColorblind = GitHubLightColorblindColors();
```
### Widgets
- `SkeletonAnimation`. Useful to display as loading indicators rather than the `CircularProgressIndicator()`.
```dart
Container(
child: SkeletonAnimation(
child: SizedBox(width: 100, height: 25), // Define Skeleton size
),
);
```
### Constants
- Border Radius constants.
```dart
const BorderRadius kBRadius8 = BorderRadius.all(kRadius8);
const BorderRadius kBRadius4 = BorderRadius.all(kRadius4);
const BorderRadius kBRadius2 = BorderRadius.all(kRadius2);
```
- Radius constants.
```dart
const Radius kRadius8 = Radius.circular(8);
const Radius kRadius4 = Radius.circular(4);
const Radius kRadius2 = Radius.circular(2);
```
Open Source
Copyright © 2022-present, Alex Rintt.
Flutter Shared Tools is MIT licensed 💖