Skip to content

Commit 71c7185

Browse files
committed
chore : add grid margin token
1 parent 7a55f22 commit 71c7185

3 files changed

Lines changed: 193 additions & 213 deletions

File tree

app/lib/ui/components/checkbox/checkbox_item_demo_screen.dart

Lines changed: 50 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -149,93 +149,61 @@ class _CheckboxItemDemoState extends State<_CheckboxItemDemo> {
149149
ThemeBox(
150150
themeContract: themeController!.currentTheme,
151151
themeMode: themeController!.isInverseDarkTheme ? ThemeMode.light : ThemeMode.dark,
152-
child: Column(
153-
children: [
154-
OudsCheckboxItem(
155-
value: isCheckedFirst,
156-
onChanged: customizationState!.hasEnabled
157-
? (bool? newValue) {
158-
setState(() {
159-
isCheckedFirst = newValue;
160-
});
161-
}
162-
: null,
163-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
164-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
165-
reversed: customizationState!.hasReversed ? true : false,
166-
readOnly: customizationState!.hasReadOnly ? true : false,
167-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
168-
isError: customizationState!.hasError ? true : false,
169-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
170-
divider: customizationState!.hasDivider ? true : false,
171-
tristate: widget.indeterminate,
172-
),
173-
OudsCheckboxItem(
174-
value: isCheckedSecond,
175-
onChanged: customizationState!.hasEnabled
176-
? (bool? newValue) {
177-
setState(() {
178-
isCheckedSecond = newValue;
179-
});
180-
}
181-
: null,
182-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
183-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
184-
reversed: customizationState!.hasReversed ? true : false,
185-
readOnly: customizationState!.hasReadOnly ? true : false,
186-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
187-
isError: customizationState!.hasError ? true : false,
188-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
189-
divider: customizationState!.hasDivider ? true : false,
190-
tristate: widget.indeterminate,
191-
),
192-
],
152+
child: Padding(
153+
padding: EdgeInsetsDirectional.symmetric(horizontal: themeController!.currentTheme.gridScheme(context).margin),
154+
child: Column(
155+
children: [
156+
OudsCheckboxItem(
157+
value: isCheckedFirst,
158+
onChanged: customizationState!.hasEnabled
159+
? (bool? newValue) {
160+
setState(() {
161+
isCheckedFirst = newValue;
162+
});
163+
}
164+
: null,
165+
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
166+
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
167+
reversed: customizationState!.hasReversed ? true : false,
168+
readOnly: customizationState!.hasReadOnly ? true : false,
169+
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
170+
isError: customizationState!.hasError ? true : false,
171+
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
172+
divider: customizationState!.hasDivider ? true : false,
173+
tristate: widget.indeterminate,
174+
),
175+
],
176+
),
193177
),
194178
),
195179
ThemeBox(
196180
themeContract: themeController!.currentTheme,
197181
themeMode: themeController!.isInverseDarkTheme ? ThemeMode.dark : ThemeMode.light,
198-
child: Column(
199-
children: [
200-
OudsCheckboxItem(
201-
value: isCheckedFirst,
202-
onChanged: customizationState!.hasEnabled
203-
? (bool? newValue) {
204-
setState(() {
205-
isCheckedFirst = newValue;
206-
});
207-
}
208-
: null,
209-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
210-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
211-
reversed: customizationState!.hasReversed ? true : false,
212-
readOnly: customizationState!.hasReadOnly ? true : false,
213-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
214-
isError: customizationState!.hasError ? true : false,
215-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
216-
divider: customizationState!.hasDivider ? true : false,
217-
tristate: widget.indeterminate,
218-
),
219-
OudsCheckboxItem(
220-
value: isCheckedSecond,
221-
onChanged: customizationState!.hasEnabled
222-
? (bool? newValue) {
223-
setState(() {
224-
isCheckedSecond = newValue;
225-
});
226-
}
227-
: null,
228-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
229-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
230-
reversed: customizationState!.hasReversed ? true : false,
231-
readOnly: customizationState!.hasReadOnly ? true : false,
232-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
233-
isError: customizationState!.hasError ? true : false,
234-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
235-
divider: customizationState!.hasDivider ? true : false,
236-
tristate: widget.indeterminate,
237-
),
238-
],
182+
child: Padding(
183+
padding: EdgeInsetsDirectional.symmetric(horizontal: themeController!.currentTheme.gridScheme(context).margin),
184+
child: Column(
185+
children: [
186+
OudsCheckboxItem(
187+
value: isCheckedFirst,
188+
onChanged: customizationState!.hasEnabled
189+
? (bool? newValue) {
190+
setState(() {
191+
isCheckedFirst = newValue;
192+
});
193+
}
194+
: null,
195+
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
196+
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
197+
reversed: customizationState!.hasReversed ? true : false,
198+
readOnly: customizationState!.hasReadOnly ? true : false,
199+
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
200+
isError: customizationState!.hasError ? true : false,
201+
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
202+
divider: customizationState!.hasDivider ? true : false,
203+
tristate: widget.indeterminate,
204+
),
205+
],
206+
),
239207
),
240208
)
241209
]);

app/lib/ui/components/radio_button/radio_button_item_demo_screen.dart

Lines changed: 95 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -149,101 +149,107 @@ class _RadioButtonItemDemoState extends State<_RadioButtonItemDemo> {
149149
ThemeBox(
150150
themeContract: themeController!.currentTheme,
151151
themeMode: themeController!.isInverseDarkTheme ? ThemeMode.light : ThemeMode.dark,
152-
child: Column(
153-
children: [
154-
OudsRadioButtonItem<RadioOption>(
155-
value: RadioOption.first,
156-
groupValue: _selectedOption,
157-
onChanged: customizationState!.hasEnabled
158-
? (RadioOption? value) {
159-
setState(() {
160-
_selectedOption = value!;
161-
});
162-
}
163-
: null,
164-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
165-
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
166-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
167-
outlined: customizationState!.hasOutlined ? true : false,
168-
reversed: customizationState!.hasReversed ? true : false,
169-
readOnly: customizationState!.hasReadOnly ? true : false,
170-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
171-
isError: customizationState!.hasError ? true : false,
172-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
173-
divider: customizationState!.hasDivider ? true : false,
152+
child: MergeSemantics(
153+
child: Padding(
154+
padding: EdgeInsetsDirectional.symmetric(horizontal: themeController!.currentTheme.gridScheme(context).margin),
155+
child: Column(
156+
children: [
157+
OudsRadioButtonItem<RadioOption>(
158+
value: RadioOption.first,
159+
groupValue: _selectedOption,
160+
onChanged: customizationState!.hasEnabled
161+
? (RadioOption? value) {
162+
setState(() {
163+
_selectedOption = value!;
164+
});
165+
}
166+
: null,
167+
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
168+
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
169+
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
170+
outlined: customizationState!.hasOutlined ? true : false,
171+
reversed: customizationState!.hasReversed ? true : false,
172+
readOnly: customizationState!.hasReadOnly ? true : false,
173+
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
174+
isError: customizationState!.hasError ? true : false,
175+
divider: customizationState!.hasDivider ? true : false,
176+
),
177+
OudsRadioButtonItem<RadioOption>(
178+
value: RadioOption.second,
179+
groupValue: _selectedOption,
180+
onChanged: customizationState!.hasEnabled
181+
? (RadioOption? value) {
182+
setState(() {
183+
_selectedOption = value!;
184+
});
185+
}
186+
: null,
187+
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
188+
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
189+
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
190+
outlined: customizationState!.hasOutlined ? true : false,
191+
reversed: customizationState!.hasReversed ? true : false,
192+
readOnly: customizationState!.hasReadOnly ? true : false,
193+
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
194+
isError: customizationState!.hasError ? true : false,
195+
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
196+
divider: customizationState!.hasDivider ? true : false,
197+
),
198+
],
174199
),
175-
OudsRadioButtonItem<RadioOption>(
176-
value: RadioOption.second,
177-
groupValue: _selectedOption,
178-
onChanged: customizationState!.hasEnabled
179-
? (RadioOption? value) {
180-
setState(() {
181-
_selectedOption = value!;
182-
});
183-
}
184-
: null,
185-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
186-
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
187-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
188-
outlined: customizationState!.hasOutlined ? true : false,
189-
reversed: customizationState!.hasReversed ? true : false,
190-
readOnly: customizationState!.hasReadOnly ? true : false,
191-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
192-
isError: customizationState!.hasError ? true : false,
193-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
194-
divider: customizationState!.hasDivider ? true : false,
195-
),
196-
],
200+
),
197201
),
198202
),
199203
ThemeBox(
200204
themeContract: themeController!.currentTheme,
201205
themeMode: themeController!.isInverseDarkTheme ? ThemeMode.dark : ThemeMode.light,
202-
child: Column(
203-
children: [
204-
OudsRadioButtonItem<RadioOption>(
205-
value: RadioOption.first,
206-
groupValue: _selectedOption,
207-
onChanged: customizationState!.hasEnabled
208-
? (RadioOption? value) {
209-
setState(() {
210-
_selectedOption = value!;
211-
});
212-
}
213-
: null,
214-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
215-
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
216-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
217-
outlined: customizationState!.hasOutlined ? true : false,
218-
reversed: customizationState!.hasReversed ? true : false,
219-
readOnly: customizationState!.hasReadOnly ? true : false,
220-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
221-
isError: customizationState!.hasError ? true : false,
222-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
223-
divider: customizationState!.hasDivider ? true : false,
224-
),
225-
OudsRadioButtonItem<RadioOption>(
226-
value: RadioOption.second,
227-
groupValue: _selectedOption,
228-
onChanged: customizationState!.hasEnabled
229-
? (RadioOption? value) {
230-
setState(() {
231-
_selectedOption = value!;
232-
});
233-
}
234-
: null,
235-
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
236-
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
237-
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
238-
outlined: customizationState!.hasOutlined ? true : false,
239-
reversed: customizationState!.hasReversed ? true : false,
240-
readOnly: customizationState!.hasReadOnly ? true : false,
241-
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
242-
isError: customizationState!.hasError ? true : false,
243-
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
244-
divider: customizationState!.hasDivider ? true : false,
245-
),
246-
],
206+
child: Padding(
207+
padding: EdgeInsetsDirectional.symmetric(horizontal: themeController!.currentTheme.gridScheme(context).margin),
208+
child: Column(
209+
children: [
210+
OudsRadioButtonItem<RadioOption>(
211+
value: RadioOption.first,
212+
groupValue: _selectedOption,
213+
onChanged: customizationState!.hasEnabled
214+
? (RadioOption? value) {
215+
setState(() {
216+
_selectedOption = value!;
217+
});
218+
}
219+
: null,
220+
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
221+
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
222+
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
223+
outlined: customizationState!.hasOutlined ? true : false,
224+
reversed: customizationState!.hasReversed ? true : false,
225+
readOnly: customizationState!.hasReadOnly ? true : false,
226+
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
227+
isError: customizationState!.hasError ? true : false,
228+
divider: customizationState!.hasDivider ? true : false,
229+
),
230+
OudsRadioButtonItem<RadioOption>(
231+
value: RadioOption.second,
232+
groupValue: _selectedOption,
233+
onChanged: customizationState!.hasEnabled
234+
? (RadioOption? value) {
235+
setState(() {
236+
_selectedOption = value!;
237+
});
238+
}
239+
: null,
240+
title: ControlItemCustomizationUtils.getLabelText(customizationState!),
241+
additionalLabel: ControlItemCustomizationUtils.getAdditionalLabelText(customizationState!),
242+
helperTitle: ControlItemCustomizationUtils.getHelperLabelText(customizationState!),
243+
outlined: customizationState!.hasOutlined ? true : false,
244+
reversed: customizationState!.hasReversed ? true : false,
245+
readOnly: customizationState!.hasReadOnly ? true : false,
246+
icon: customizationState!.hasIcon ? AppAssets.icons.functionalSocialAndEngagementHeartEmpty(themeController!) : null,
247+
isError: customizationState!.hasError ? true : false,
248+
errorText: ControlItemCustomizationUtils.getErrorMessageLabelText(customizationState!),
249+
divider: customizationState!.hasDivider ? true : false,
250+
),
251+
],
252+
),
247253
),
248254
),
249255
],

0 commit comments

Comments
 (0)