forked from mirrors/material_3_expressive
Remove unused dynamic field lookup and redundant utility methods; clean up pubspec dependency paths and update READMEs with detailed package guides.
This commit is contained in:
parent
80a27714a6
commit
401dd103a6
30 changed files with 799 additions and 64 deletions
|
|
@ -23,3 +23,60 @@ flutter run -d chrome
|
|||
```
|
||||
|
||||
_Last updated: 2025-10-23_
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Detailed Guide
|
||||
|
||||
### What this package provides
|
||||
Material 3 Expressive buttons with 5 variants (filled, tonal, elevated, outlined, text), sizes XS–XL, round/square shapes, and optional toggle selection.
|
||||
|
||||
### Installation
|
||||
- Monorepo (local path): already configured in this repo alongside m3e_design.
|
||||
- Pub (when published):
|
||||
```yaml
|
||||
dependencies:
|
||||
button_m3e: ^0.1.0
|
||||
m3e_design: ^0.1.0
|
||||
```
|
||||
|
||||
Minimum SDK: Dart >=3.5.0; Flutter >=3.19.0.
|
||||
|
||||
### Dependencies
|
||||
- flutter
|
||||
- m3e_design
|
||||
|
||||
### Quick start
|
||||
```dart
|
||||
ButtonM3E.filled(
|
||||
onPressed: () {},
|
||||
label: const Text('Save'),
|
||||
icon: const Icon(Icons.save),
|
||||
size: ButtonM3ESize.md,
|
||||
shapeFamily: ButtonM3EShapeFamily.round,
|
||||
);
|
||||
```
|
||||
|
||||
### Key parameters
|
||||
- onPressed / onLongPress: callbacks for activation/long-press.
|
||||
- label: Widget? — Button label; omit for icon-only variants.
|
||||
- icon: Widget? — Optional leading icon.
|
||||
- isSelected: bool — Toggle selection state (for toggleable styles).
|
||||
- variant/style: ButtonM3EVariant — filled | tonal | elevated | outlined | text.
|
||||
- size: ButtonM3ESize — xs | sm | md | lg | xl.
|
||||
- shapeFamily: ButtonM3EShapeFamily — round or square.
|
||||
- tooltip / semanticsLabel: String? — Accessibility hints.
|
||||
- enabled: bool — Whether the button is interactive.
|
||||
|
||||
### Theming with m3e_design
|
||||
Buttons take colors, shapes, and spacing from M3ETheme. Override via properties or ThemeData when needed.
|
||||
|
||||
### Accessibility
|
||||
- Ensures minimum 48×48 dp tap target size via layout tokens.
|
||||
- Focus, hover, and pressed states follow Material 3 guidance.
|
||||
|
||||
### Links
|
||||
- Repository: https://github.com/EmilyMoonstone/material_3_expressive/tree/main/packages/button_m3e
|
||||
- Issue tracker: https://github.com/EmilyMonestone/material_3_expressive/issues
|
||||
- Changelog: ./CHANGELOG.md
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue