Skip to content

Commit 1659182

Browse files
committed
fix(shopinbit): render locked country as disabled text field
1 parent 9f558ea commit 1659182

1 file changed

Lines changed: 9 additions & 40 deletions

File tree

lib/pages/shopinbit/shopinbit_shipping_view.dart

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import '../../utilities/text_styles.dart';
1616
import '../../utilities/util.dart';
1717
import '../../widgets/background.dart';
1818
import '../../widgets/custom_buttons/app_bar_icon_button.dart';
19+
import '../../widgets/detail_item.dart';
1920
import '../../widgets/desktop/desktop_dialog_close_button.dart';
2021
import '../../widgets/desktop/primary_button.dart';
2122
import '../../widgets/dialogs/s_dialog.dart';
@@ -265,52 +266,20 @@ class _ShopInBitShippingViewState extends ConsumerState<ShopInBitShippingView> {
265266
);
266267
}
267268

268-
// Read-only display of the locked delivery country. Looks like the other
269-
// fields but isn't editable; the country was fixed when the offer was priced.
270-
Widget _buildLockedCountryField(
271-
BuildContext context, {
272-
required bool isDesktop,
273-
}) {
269+
// Read-only display of the locked delivery country: it was fixed when the
270+
// offer was priced and can't change here.
271+
Widget _buildLockedCountryField() {
274272
final label =
275273
_countries
276274
.where((c) => c['iso'] == _selectedCountryIso)
277275
.map((c) => c['label'] as String)
278276
.firstOrNull ??
279277
(_selectedCountryIso ?? "");
280278

281-
return Container(
282-
decoration: BoxDecoration(
283-
color: Theme.of(context).extension<StackColors>()!.textFieldDefaultBG,
284-
borderRadius: BorderRadius.circular(
285-
Constants.size.circularBorderRadius,
286-
),
287-
),
288-
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 16),
289-
child: Row(
290-
mainAxisAlignment: MainAxisAlignment.spaceBetween,
291-
children: [
292-
Text(
293-
"Country",
294-
style: isDesktop
295-
? STextStyles.desktopTextExtraSmall(context).copyWith(
296-
color: Theme.of(
297-
context,
298-
).extension<StackColors>()!.textFieldDefaultSearchIconLeft,
299-
)
300-
: STextStyles.fieldLabel(context),
301-
),
302-
Text(
303-
label,
304-
style: isDesktop
305-
? STextStyles.desktopTextExtraSmall(context).copyWith(
306-
color: Theme.of(
307-
context,
308-
).extension<StackColors>()!.textFieldActiveText,
309-
)
310-
: STextStyles.w500_14(context),
311-
),
312-
],
313-
),
279+
return DetailItem(
280+
title: "Country",
281+
detail: label,
282+
disableSelectableText: true,
314283
);
315284
}
316285

@@ -503,7 +472,7 @@ class _ShopInBitShippingViewState extends ConsumerState<ShopInBitShippingView> {
503472
// back with no country, so we let the user supply one (and warn that it
504473
// may not match what the offer was priced for).
505474
if (_countryLocked)
506-
_buildLockedCountryField(context, isDesktop: isDesktop)
475+
_buildLockedCountryField()
507476
else ...[
508477
_buildCountryDropdown(context, isDesktop: isDesktop),
509478
SizedBox(height: isDesktop ? 8 : 6),

0 commit comments

Comments
 (0)