Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nbonamy/stanley
Common flutter widgets and helper methods.
https://github.com/nbonamy/stanley
flutter flutter-package flutter-ui
Last synced: 2 days ago
JSON representation
Common flutter widgets and helper methods.
- Host: GitHub
- URL: https://github.com/nbonamy/stanley
- Owner: nbonamy
- License: apache-2.0
- Created: 2020-04-15T22:31:20.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-13T20:37:08.000Z (11 months ago)
- Last Synced: 2024-10-12T18:07:33.241Z (about 1 month ago)
- Topics: flutter, flutter-package, flutter-ui
- Language: Dart
- Size: 137 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# stanley
Common flutter widgets and helper methods.
## Dependencies
As of now, stanley is an opiniated package which includes dependencies to:
- [easy_localization](https://pub.dev/packages/easy_localization)## Main classes
### Decorator
A all-in-one widget to manage layout and styling of other widgets. Based on the properties set, `Decorator` will encapsulate the child wigdet with whatever is needed to support:
- Sizing
- Margins
- Paddings
- Borders (including rounded)
- Background color
- Tap handlerPaddings and margins can be specified with various parameters that can be used to override defaults. For instance:
- `paddingAll`: 16
- `paddingHoriz`: 8
- `paddingLeft`: 4Will result in:
- Top and bottom = 16 (paddingAll)
- Right = 8 (overriden by paddingHoriz)
- Left = 4 (overriden by paddingLeft)The `example` uses `Decorator` for the buttons displayed on the page.
### Native Dialog
A class to display native dialogs and alert sheets on iOS and Android with unified interface. The `example` demonstrates several uses of this.
### Other UI Helpers
Other helpers include `scaffold`, `text` which basically embrace the same philosophy as `Decorator`: pass all required parmeters and these classes will do the work.
### Forms
A set of classes to quickly create vertical forms (definitely more Material than iOS). Those were mostly created for non-white backgrounds as they override a number decorations to fit your style. You can override `PaddedFormField.textColor` (defaults to white) if needed.
All widgets include the possibility to attach an icon as decoration that can be clicked to get help.
Widgets include:
- `DecoratedTextFormField`: safe explanatory
- `DropdownField`: encapsulated `DropdownButtonFormField`
- `ToggleFormField`: specialized `DropdownField` for boolean choices