Skip to content

Commit

Permalink
undo last two commits to main (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd authored Feb 12, 2024
1 parent 561a0d5 commit 87f1584
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 46 deletions.
9 changes: 1 addition & 8 deletions lib/features/payments/search_payment_methods_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class SearchPaymentMethodsPage extends HookWidget {
@override
Widget build(BuildContext context) {
final searchText = useState('');
final focusNode = useFocusNode();

return Scaffold(
appBar: AppBar(scrolledUnderElevation: 0),
Expand All @@ -34,15 +33,9 @@ class SearchPaymentMethodsPage extends HookWidget {
mainAxisSize: MainAxisSize.min,
children: [
TextFormField(
focusNode: focusNode,
onTapOutside: (_) => focusNode.unfocus(),
enableSuggestions: false,
autocorrect: false,
decoration: InputDecoration(
labelText: Loc.of(context).search,
prefixIcon: const Padding(
padding: EdgeInsets.only(top: Grid.xs),
child: Icon(Icons.search)),
prefixIcon: const Icon(Icons.search),
),
onChanged: (value) => searchText.value = value,
),
Expand Down
3 changes: 3 additions & 0 deletions lib/features/send/send_did_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class SendDidPage extends HookWidget {
Expanded(
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
floatingLabelBehavior:
FloatingLabelBehavior.never,
labelText: Loc.of(context).didTag),
enableSuggestions: false,
autocorrect: false,
Expand Down
40 changes: 18 additions & 22 deletions lib/shared/json_schema_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,20 @@ class JsonSchemaForm extends HookWidget {
@override
Widget build(BuildContext context) {
final jsonSchema = json.decode(schema);

List<Widget> formFields = [];
jsonSchema['properties']?.forEach(
(key, value) {
final focusNode = useFocusNode();

formFields.add(
TextFormField(
focusNode: focusNode,
onTapOutside: (_) => focusNode.unfocus(),
enableSuggestions: false,
autocorrect: false,
decoration: InputDecoration(
labelText: value['title'] ?? key,
),
textInputAction: TextInputAction.next,
validator: (value) => _validateField(key, value, jsonSchema),
onSaved: (value) => formData[key] = value ?? '',
jsonSchema['properties']?.forEach((key, value) {
formFields.add(TextFormField(
decoration: InputDecoration(
labelText: value['title'] ?? key,
labelStyle: TextStyle(
color: Theme.of(context).colorScheme.outlineVariant,
),
);
},
);
border: InputBorder.none,
),
validator: (value) => _validateField(key, value, jsonSchema),
onSaved: (value) => formData[key] = value ?? '',
));
});

return Form(
key: _formKey,
Expand All @@ -49,8 +41,12 @@ class JsonSchemaForm extends HookWidget {
child: SingleChildScrollView(
physics: const BouncingScrollPhysics(),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: Grid.side),
child: Column(children: formFields),
padding: const EdgeInsets.symmetric(
horizontal: Grid.side,
),
child: Column(
children: formFields,
),
),
),
),
Expand Down
16 changes: 0 additions & 16 deletions lib/shared/theme/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,6 @@ ThemeData lightTheme(BuildContext context) => ThemeData(
),
),
),
inputDecorationTheme: InputDecorationTheme(
border: InputBorder.none,
floatingLabelBehavior: FloatingLabelBehavior.never,
alignLabelWithHint: true,
labelStyle: TextStyle(
color: lightColorScheme.outlineVariant,
),
),
);

ThemeData darkTheme(BuildContext context) => ThemeData(
Expand Down Expand Up @@ -73,12 +65,4 @@ ThemeData darkTheme(BuildContext context) => ThemeData(
),
),
),
inputDecorationTheme: InputDecorationTheme(
border: InputBorder.none,
floatingLabelBehavior: FloatingLabelBehavior.never,
alignLabelWithHint: true,
labelStyle: TextStyle(
color: darkColorScheme.outlineVariant,
),
),
);

0 comments on commit 87f1584

Please sign in to comment.