Add `PrimaryButton` and `SecondaryButton`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
Direzione di ricerca
L’issue non indica file, test o punti di ingresso. Individua innanzitutto le convenzioni esistenti del template per i widget condivisi e lo styling, quindi verifica come i costruttori richiesti di PrimaryButton e SecondaryButton si integrano con esse. Il lavoro è completato quando entrambe le varianti del pulsante supportano le API default, custom e child elencate, con gli stati enabled e loading.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
These are pretty common and we recreate them almost on every project. Would be cool to have them in-place and to design them after we create a project from the template.
The most common parameters would be:
String textVoidCallback onPressedbool isEnabledbool isLoading
As most of the time we will use preconfigured button sizes, paddings etc, we could create a named constructor .custom to be able to configure the following parameters:
double paddingVerticaldouble paddingHorizontalColor backgroundColorColor foregroundColorTextStyle textStyle
And also a constructor for a custom child, if we ever need to use sth like an icon, e.g. withChild
So the interface is the following. Same for SecondaryButton.
final defaultButton = PrimaryButton(
String text, {
VoidCallback? onPressed,
bool isEnabled = true,
bool isLoading = false,
}
);
final defaultButtonWithChild = PrimaryButton.withChild(
{
VoidCallback? onPressed,
bool isEnabled = true,
bool isLoading = false,
required Widget child,
}
);
final customButton = PrimaryButton.custom(
String text, {
VoidCallback? onPressed,
bool isEnabled = true,
bool isLoading = false,
TextStyle? textStyle,
double paddingVertical = 4.0, // or whatever
double paddingHorizontal = 12.0, // or whatever
Color? backgroundColor, // in the build method, we will be able to use this custom color
Color? foregroundColor, // in the build method, we will be able to use this custom color
}
);
final customButtonWithChild = PrimaryButton.customWithChild(
{
VoidCallback? onPressed,
bool isEnabled = true,
bool isLoading = false,
TextStyle? textStyle,
double paddingVertical = 4.0, // or whatever
double paddingHorizontal = 12.0, // or whatever
Color? backgroundColor, // in the build method, we will be able to use this custom color
Color? foregroundColor, // in the build method, we will be able to use this custom color
required Widget child,
}
);
- Lingua principale
- Dart
- Stelle
- 36
- Fork
- 23
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ml-opensource/flutter-template
-
Add `LazyLoadingListener` widgetForse di nuovo libera @nivisi l’ha presa 1231 giorni fa e non c’è nessuna pull request aperta. Aperta
ml-opensource/flutter-template#123 · 1 assegnatario ·
-
Introduce & Standardize a way to play HapticsForse di nuovo libera @nivisi l’ha presa 1247 giorni fa e non c’è nessuna pull request aperta. ApertaTBD
ml-opensource/flutter-template#120 · 1 assegnatario ·
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
ml-opensource/flutter-template#113 · 1 commento · 2 reazioni ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Setup `retrofit`Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
Tutte le issue di ml-opensource/flutter-template
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
aaronified/fluenough#466 ·
I maintainer di solito rispondono entro 1 giorno
-
Concurrent sshnp/npt started in the same millisecond collide on per-session storage (lock failed)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
atsign-foundation/noports#2986 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
difficulty: easy duration: small priority: medium type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
duobaseio/forui#1215 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
`toAbsoluteRect` and `canSee` are wrong for a child of an ancestor that is rotated by a non-right angleForse già presa @ufrshubham l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
flame-engine/flame#4108 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
fossasia/badgemagic-app#1989 ·
I maintainer di solito rispondono entro 1 giorno