weekday_selector 0.1.1 weekday_selector: ^0.1.1 copied to clipboard
A collection of Flutter widgets and classes to help you select weekdays in your apps. Perfect for recurring events, alarms.
weekday_selector
#
A collection of Flutter widgets and classes to help you select weekdays in your apps. Perfect for recurring events, alarms.
Important links #
- Read the source code and star the repo!
- Check package info on
pub.dev
- Open an issue
- Read the docs
- This Dart package is created by the SMAHO development team.
Usage #
You can find the best examples in the example
project on GitHub. We also give a couple of examples in this README
.
Basic usage #
-
Add the package as dependency. Open your project's
pubspec.yaml
file and write:# your pubspec.yaml file name: your_app dependencies: # Look up the version at: https://pub.dev/packages/weekday_selector#-installing-tab- weekday_selector: ^0.0.0 # TODO: Change version
-
Install the package by executing
flutter pub get
or use your IDE to install it for you. -
Import the package and use it!
import 'package:weekday_selector/weekday_selector.dart'; // Somewhere in your build method... MaterialWeekdaySelector( // Don't change anything for now, just print the index of the day // that should be changed. Use % 7 onChanged: print, // Example: weekends are selected values: [ true, // Sunday false, // Monday false, // Tuesday false, // Wednesday false, // Thursday false, // Friday true, // Saturday ], ),
MaterialWeekdaySelector
#
- requires a material app as parent
https://api.dart.dev/stable/2.7.1/dart-core/DateTime/weekday.html
Internationalization/Localization (i18n, l10n) #
Use the narrowWeekdays
and weekdays
named parameters to customize the letters on the buttons and their tooltips.
The tooltips are visible when the user long-presses a button. If omitted, English is used.
If you plan to use other languages in your application, I recommend you to use the intl
package.
Contribute #
In case something does not work as expected, or you are not sure how to solve a problem, open an issue on GitHub. We are looking forward to your contributions: open an issue, clarify the documentation, clean up the code, or fix a bug! Thank you for your help!
Development #
Here are a couple of useful commands that you should know if you want to work on the library itself (as opposed to just using it as a dependency).
flutter format .
- Format codeflutter test
- Run all testsflutter analyze
- Run the analyzer on thelib
andtest
foldersbash coverage.sh
- Run tests, collect coverage and generate HTML report