text method
WidgetbookUseCase
text()
Implementation
WidgetbookUseCase text() {
return WidgetbookUseCase(
name: 'METext',
builder: (context) => Container(
width: double.infinity,
height: double.infinity,
color: Colors.white,
child: Center(
child: Text(
context.knobs.string(
initialValue: "Lorem ipsum dolor sit amet",
label: "text",
),
style: TextStyle(
fontWeight: context.knobs.list(
label: "fontWeight",
options: textWeight,
description: "merubah ketebalan font"),
color: context.knobs.list(
label: "fontColor",
description: "Mengganti warna pada font",
options: colorOption),
fontSize: context.knobs
.double.input(label: "fontSize", description: "Merubah ukuran font")
.toDouble(),
letterSpacing: context.knobs.double.slider(
label: "leterSpaccing",
description: "Menambah jarak spasi pada text",
initialValue: 0.5,
min: 0,
max: 5),
height: context.knobs.double.slider(
label: "height",
description: "Menambah jarak kebawah antar text",
initialValue: 1,
min: 0,
max: 5),
overflow: context.knobs.list(label: "Overflow", options: const [
TextOverflow.clip,
TextOverflow.ellipsis,
TextOverflow.fade,
TextOverflow.visible,
]),
),
maxLines: context.knobs
.double.input(
label: "maxLine",
description: "Melakukan setting maksimal baris",
initialValue: 15)
.toInt(),
),
),
),
);
}