first commit for mih package toolkit
This commit is contained in:
121
README.md
121
README.md
@@ -11,29 +11,126 @@ and the Flutter guide for
|
||||
[developing packages and plugins](https://flutter.dev/to/develop-packages).
|
||||
-->
|
||||
|
||||
TODO: Put a short description of the package here that helps potential users
|
||||
know whether this package might be useful for them.
|
||||
# mih_package_toolkit
|
||||
|
||||
A comprehensive UI toolkit and utility library specifically designed to help developers build **MIH Packages** for the MIH app ecosystem.
|
||||
|
||||
This toolkit provides a curated set of widgets, forms, and design utilities—ranging from custom buttons and input fields to complex layout components like floating menus and package windows.
|
||||
|
||||
---
|
||||
|
||||
## Features
|
||||
|
||||
TODO: List what your package can do. Maybe include images, gifs, or videos.
|
||||
This toolkit provides everything you need to maintain visual and functional consistency within the MIH ecosystem:
|
||||
|
||||
* **Form Elements**: Includes `MihForm`, `MihTextField`, `MihDateField`, and `MihDropdownField` for streamlined data entry.
|
||||
* **Navigation & Layout**: Complex structural components like `MihFloatingMenu`, `MihPackageWindow`, and `MihPackageToolBody`.
|
||||
* **Feedback & Progress**: Pre-styled `MihSnackBar` and `MihLoadingCircle` for user interaction.
|
||||
* **Design Tokens**: Built-in access to `MihColors` and `MihIcons` to ensure brand compliance.
|
||||
* **Specialized Controls**: Widgets like `MihNumericStepper`, `MihRadioOptions`, and `MihToggle`.
|
||||
|
||||
## Getting started
|
||||
|
||||
TODO: List prerequisites and provide or point to information on how to
|
||||
start using the package.
|
||||
To use this library, Add the package to your `pubspec.yaml`:
|
||||
|
||||
```bash
|
||||
flutter pub add mih_package_toolkit
|
||||
```
|
||||
|
||||
and simply add the import to your Dart file:
|
||||
|
||||
```dart
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
TODO: Include short and useful examples for package users. Add longer examples
|
||||
to `/example` folder.
|
||||
|
||||
```dart
|
||||
const like = 'sample';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:mih_package_toolkit/mih_package_toolkit.dart';
|
||||
|
||||
class ExamplePackage extends StatefulWidget {
|
||||
const ExamplePackage({super.key});
|
||||
|
||||
@override
|
||||
State<ExamplePackage> createState() => _ExamplePackageState();
|
||||
}
|
||||
|
||||
class _ExamplePackageState extends State<ExamplePackage> {
|
||||
int selectedbodyIndex = 0; // Important for state management of the body
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MihPackage(
|
||||
packageActionButton: actionButton(),
|
||||
packageTools: tools(),
|
||||
packageToolBodies: toolBodies(),
|
||||
packageToolTitles: appToolTitles(),
|
||||
selectedBodyIndex: selectedbodyIndex,
|
||||
onIndexChange: (newIndex) {
|
||||
setState(() {
|
||||
selectedbodyIndex = newIndex;
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget actionButton() {
|
||||
return MihPackageAction(
|
||||
icon: Icon(Icons.arrow_back),
|
||||
iconSize: 35,
|
||||
onTap: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
List<String> appToolTitles() {
|
||||
List<String> toolTitles = ["Tool 1", "Tool 2"];
|
||||
return toolTitles;
|
||||
}
|
||||
|
||||
MihPackageTools tools() {
|
||||
Map<Widget, void Function()?> temp = {};
|
||||
temp[const Icon(Icons.calculate)] = () {
|
||||
setState(() {
|
||||
selectedbodyIndex = 0;
|
||||
});
|
||||
};
|
||||
temp[const Icon(Icons.money)] = () {
|
||||
setState(() {
|
||||
selectedbodyIndex = 1;
|
||||
});
|
||||
};
|
||||
return MihPackageTools(tools: temp, selectedIndex: selectedbodyIndex);
|
||||
}
|
||||
|
||||
List<Widget> toolBodies() {
|
||||
return [
|
||||
MihPackageToolBody(
|
||||
backgroundColor: MihColors.primary(),
|
||||
bodyItem: Center(child: Text("Tool Body One")),
|
||||
),
|
||||
MihPackageToolBody(
|
||||
backgroundColor: MihColors.secondary(),
|
||||
bodyItem: Center(child: Text("Tool Body Two")),
|
||||
),
|
||||
];
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Additional information
|
||||
|
||||
TODO: Tell users more about the package: where to find more information, how to
|
||||
contribute to the package, how to file issues, what response they can expect
|
||||
from the package authors, and more.
|
||||
For more details about MIH Package Toolkit, including usage instructions and updates, please visit the [MIH Gitea repository](https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit).
|
||||
|
||||
### Contributing
|
||||
Contributions are welcome! If you'd like to improve the package, please fork the repository, make your changes, and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.
|
||||
|
||||
### Reporting Issues
|
||||
If you encounter any bugs or have feature requests, please file an issue on the [MIH Gitea Issues page](https://git.mzansi-innovation-hub.co.za/yaso_meth/mih_package_toolkit/issues). Provide as much detail as possible to help us address the problem promptly.
|
||||
|
||||
### Support and Response
|
||||
We strive to respond to issues and pull requests in a timely manner. While this package is maintained voluntarily, we appreciate your patience and community involvement.
|
||||
|
||||
Thank you for using the MIH Package Toolkit!
|
||||
Reference in New Issue
Block a user