build static method
- BuildContext context
Returns the Widgets of this FieldsSection.
Implementation
static List<Widget> build(BuildContext context) {
final style = Theme.of(context).style;
return [
Headlines(
children: [
(
headline: 'ReactiveTextField',
widget: ReactiveTextField(
state: TextFieldState(approvable: true),
hint: 'Hint',
label: 'Label',
),
),
(
headline: 'ReactiveTextField(error)',
widget: ReactiveTextField(
state: TextFieldState(
text: 'Text',
error: 'Error text',
editable: false,
),
hint: 'Hint',
label: 'Label',
),
),
(
headline: 'ReactiveTextField(subtitle)',
widget: ReactiveTextField(
key: const Key('LoginField'),
state: TextFieldState(text: 'Text'),
onSuffixPressed: () {},
trailing: Transform.translate(
offset: const Offset(0, -1),
child: const SvgIcon(SvgIcons.copy),
),
label: 'Label',
hint: 'Hint',
subtitle: RichText(
text: TextSpan(
children: [
TextSpan(
text: 'Subtitle with: ',
style: style.fonts.small.regular.secondary,
),
TextSpan(
text: 'clickable.',
style: style.fonts.small.regular.primary,
recognizer: TapGestureRecognizer()..onTap = () {},
),
],
),
),
),
),
(
headline: 'ReactiveTextField(obscure)',
widget: ObxValue((b) {
return ReactiveTextField(
state: TextFieldState(text: 'Text'),
label: 'Obscured text',
obscure: b.value,
onSuffixPressed: b.toggle,
treatErrorAsStatus: false,
trailing: SvgImage.asset(
'assets/icons/${b.value ? 'visible_off' : 'visible_on'}.svg',
width: 17.07,
height: b.value ? 15.14 : 11.97,
),
);
}, RxBool(true)),
),
],
),
Headline(
child: CopyableTextField(
state: TextFieldState(text: 'Text to copy', editable: false),
label: 'Label',
),
),
Headline(child: SharableTextField(text: 'Text to share', label: 'Label')),
Headline(
child: MessageFieldView(
controller: MessageFieldController(null, null, null),
),
),
Headline(
headline: 'CustomAppBar(search)',
child: SizedBox(
height: 60,
width: 400,
child: CustomAppBar(
top: false,
border: Border.all(color: style.colors.primary, width: 2),
title: Theme(
data: MessageFieldView.theme(context),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Transform.translate(
offset: const Offset(0, 1),
child: ReactiveTextField(
state: TextFieldState(),
hint: 'Search',
maxLines: 1,
filled: false,
dense: true,
padding: const EdgeInsets.symmetric(vertical: 8),
style: style.fonts.medium.regular.onBackground,
onChanged: () {},
),
),
),
),
leading: [
AnimatedButton(
decorator:
(child) => Container(
padding: const EdgeInsets.only(left: 20, right: 6),
height: double.infinity,
child: child,
),
onPressed: () {},
child: const SvgIcon(SvgIcons.back),
),
],
),
),
),
Headline(
headline: 'ReactiveTextField(search)',
child: ReactiveTextField(
key: const Key('SearchTextField'),
state: TextFieldState(),
label: 'Search',
style: style.fonts.normal.regular.onBackground,
onChanged: () {},
),
),
const Headline(child: UserLoginField(null)),
const Headline(child: UserNameField(null)),
const Headline(child: UserBioField(null)),
const Headline(
child: UserStatusCopyable(UserTextStatus.unchecked('Status')),
),
const Headline(child: DirectLinkField(null)),
Headline(
child: BlocklistRecordWidget(
BlocklistRecord(
userId: const UserId('me'),
at: PreciseDateTime.now(),
),
),
),
];
}