APIX is a Flutter package designed to facilitate and accelerate Dart code writing by introducing various useful extensions.
To use the apix
package, add it to your project's Flutter dependencies by modifying the pubspec.yaml
file:
apix:
git:
url: https://github.com/Stefano-Trinca/apix.git
ref: 0.0.4
After adding the package, you can import it into your Dart project:
import 'package:apix/apix.dart';
Here are some examples of how the extensions provided by apix
can be used to improve and simplify your code:
int x = 10;
int y = x.plus(5); // 15
Using extensions on BuildContext
can provide quick access to theme-specific data and metrics, enhancing the way your app responds to different screen sizes and themes.
double deviceWidth = context.sizes.width; // Gets the device width
bool isDarkModeEnabled = context.isDarkMode; // Returns true if dark mode is enabled
Capitalize the first letter of a string, or every word in a string, to enhance readability or conform to stylistic guidelines.
Assuming an extension capitalizeFirst
exists:
String greeting = 'hello world'.capitalizeFirst(); // 'Hello world'
And for capitalize
, assuming it capitalizes the first letter of each word:
String title = 'hello world'.capitalize(); // 'Hello World'
For more information on the extensions provided and how to use them, visit the official documentation.
If you wish to contribute to the apix
package, you are welcome! Check out the open issues or submit a pull request.
This package is released under the Apache License 2.0. See the LICENSE file for more details.