What changed, and why it matters
This commit is a routine UI cleanup of a travel-booking form inside the Stack Wallet app. It removes unused date-mode options (flexible dates, trip length, month/year pickers), simplifies the arrangement choices, reorders a text box, and changes one label to mention that users can paste a link. There is no security-relevant change visible in the code.
No security action needed. Review as normal UI refactor if desired.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies lib/pages/shopinbit/step_4_components/shopinbit_travel_form.dart. It deletes constants and state variables for flexible-date booking, removes the ‘Flights + Hotels’ arrangement option, replaces conditional date widgets with a single StackDateRangePicker, moves the arrangement-details text field lower in the form, and updates its label to ‘Describe your travel needs or paste a LINK here’. No input validation, sanitization, network, crypto, or authentication logic is changed.
Changed components
lib/pages/shopinbit/step_4_components/shopinbit_travel_form.dartInspect captured patch +31 / −141
diff --git a/lib/pages/shopinbit/step_4_components/shopinbit_travel_form.dart b/lib/pages/shopinbit/step_4_components/shopinbit_travel_form.dart
index a9cedbd..71e65d8 100644
--- a/lib/pages/shopinbit/step_4_components/shopinbit_travel_form.dart
+++ b/lib/pages/shopinbit/step_4_components/shopinbit_travel_form.dart
@@ -16,40 +16,12 @@ import "shopinbit_step4_submit.dart";
import "shopinbit_step4_submit_button.dart";
import "shopinbit_traveler_counter.dart";
-const String _exactDates = "Exact dates";
-const String _flexibleDates = "Flexible dates";
-
const List<String> _arrangements = [
"Flights Only",
"Hotels Only",
- "Flights + Hotels",
"Full Service",
];
-const List<String> _dateModes = [_exactDates, _flexibleDates];
-
-const List<String> _flexibilities = [
- "Exact",
- "\u00B1 1 day",
- "\u00B1 2-3 days",
- "+ 1 week",
-];
-
-const List<String> _months = [
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
-];
-
const int _minTravelBudget = 1000;
const int _minArrangementDetailsLength = 10;
@@ -82,10 +54,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
DateTime? _departureDate;
DateTime? _returnDate;
- final TextEditingController _tripLengthController = TextEditingController();
- final FocusNode _tripLengthFocusNode = FocusNode();
- bool _tripLengthTouched = false;
-
final TextEditingController _travelBudgetController = TextEditingController(
text: "5000",
);
@@ -94,10 +62,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
String? _selectedArrangement;
String? _selectedDepartureCountryIso;
- String? _selectedDateMode;
- String? _selectedFlexibility;
- String? _selectedYear;
- String? _selectedMonthSeason;
int _adults = 1;
int _children = 0;
@@ -119,7 +83,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
() => _departureCityTouched = true,
);
_wireTouchOnBlur(_destinationsFocusNode, () => _destinationsTouched = true);
- _wireTouchOnBlur(_tripLengthFocusNode, () => _tripLengthTouched = true);
_wireTouchOnBlur(_travelBudgetFocusNode, () => _travelBudgetTouched = true);
}
@@ -138,21 +101,12 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
_departureCityFocusNode.dispose();
_destinationsController.dispose();
_destinationsFocusNode.dispose();
- _tripLengthController.dispose();
- _tripLengthFocusNode.dispose();
_travelBudgetController.dispose();
_travelBudgetFocusNode.dispose();
super.dispose();
}
- bool get _hasValidDates => switch (_selectedDateMode) {
- _flexibleDates =>
- _selectedYear != null &&
- _selectedMonthSeason != null &&
- _tripLengthController.text.trim().isNotEmpty,
- _exactDates => _departureDate != null && _returnDate != null,
- _ => false,
- };
+ bool get _hasValidDates => _departureDate != null && _returnDate != null;
bool get _canContinue {
final int? travelBudgetValue = int.tryParse(
@@ -166,7 +120,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
_selectedDepartureCountryIso != null &&
_departureCityController.text.trim().isNotEmpty &&
_destinationsController.text.trim().isNotEmpty &&
- _selectedDateMode != null &&
_hasValidDates &&
_adults >= 1 &&
travelBudgetValue != null &&
@@ -189,21 +142,10 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
parts.add("Destinations: ${_destinationsController.text.trim()}");
- if (_selectedDateMode == _exactDates) {
- final String flex =
- _selectedFlexibility != null && _selectedFlexibility != "Exact"
- ? " ($_selectedFlexibility)"
- : "";
- parts.add(
- "Dates: ${_formatDate(_departureDate!)} - "
- "${_formatDate(_returnDate!)}$flex",
- );
- } else if (_selectedDateMode == _flexibleDates) {
- parts.add(
- "Dates: $_selectedMonthSeason $_selectedYear, "
- "${_tripLengthController.text.trim()} nights",
- );
- }
+ parts.add(
+ "Dates: ${_formatDate(_departureDate!)} - "
+ "${_formatDate(_returnDate!)}",
+ );
final List<String> travelers = ["$_adults adult${_adults > 1 ? 's' : ''}"];
if (_children > 0) {
@@ -263,11 +205,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
? "Required"
: null;
- final String? tripLengthError =
- _tripLengthTouched && _tripLengthController.text.trim().isEmpty
- ? "Required"
- : null;
-
final String travelBudgetText = _travelBudgetController.text.trim();
final int? travelBudgetValue = int.tryParse(travelBudgetText);
final String? travelBudgetError =
@@ -278,8 +215,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
? "Minimum budget is 1,000 EUR"
: null;
- final int currentYear = DateTime.now().year;
-
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
@@ -297,20 +232,6 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
hintText: "Arrangement type",
onChanged: (value) => setState(() => _selectedArrangement = value),
),
- SizedBox(height: isDesktop ? 24 : 16),
- AdaptiveTextField(
- controller: _arrangementDetailsController,
- focusNode: _arrangementDetailsFocusNode,
- labelText:
- "Describe your specific requirements "
- "(luggage, cabin class, hotel stars, etc.)",
- minLines: 3,
- maxLines: 6,
- autocorrect: false,
- enableSuggestions: false,
- errorText: arrangementDetailsError,
- onChanged: (_) => setState(() {}),
- ),
SizedBox(height: isDesktop ? 24 : 16),
_TravelSectionLabel(text: "Where", isDesktop: isDesktop),
@@ -336,72 +257,28 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
AdaptiveTextField(
controller: _destinationsController,
focusNode: _destinationsFocusNode,
- labelText: "Destination city",
+ labelText: "Destination (City, Country, Region)",
autocorrect: false,
enableSuggestions: false,
errorText: destinationsError,
onChanged: (_) => setState(() {}),
),
+
SizedBox(height: isDesktop ? 24 : 16),
_TravelSectionLabel(text: "When", isDesktop: isDesktop),
SizedBox(height: isDesktop ? 12 : 8),
- ShopInBitStep4Dropdown(
- value: _selectedDateMode,
- items: _dateModes,
- hintText: "Date mode",
- onChanged: (value) => setState(() => _selectedDateMode = value),
+ StackDateRangePicker(
+ fromDate: _departureDate,
+ toDate: _returnDate,
+ firstDate: DateTime.now(),
+ lastDate: DateTime.now().add(const Duration(days: 3650)),
+ onChanged: (from, to) {
+ setState(() {
+ _departureDate = from;
+ _returnDate = to;
+ });
+ },
),
- SizedBox(height: isDesktop ? 24 : 16),
-
- if (_selectedDateMode == _exactDates) ...[
- StackDateRangePicker(
- fromDate: _departureDate,
- toDate: _returnDate,
- firstDate: DateTime.now(),
- lastDate: DateTime.now().add(const Duration(days: 3650)),
- onChanged: (from, to) {
- setState(() {
- _departureDate = from;
- _returnDate = to;
- });
- },
- ),
- SizedBox(height: isDesktop ? 24 : 16),
- ShopInBitStep4Dropdown(
- value: _selectedFlexibility,
- items: _flexibilities,
- hintText: "Flexibility",
- onChanged: (value) => setState(() => _selectedFlexibility = value),
- ),
- ],
-
- if (_selectedDateMode == _flexibleDates) ...[
- ShopInBitStep4Dropdown(
- value: _selectedYear,
- items: ["$currentYear", "${currentYear + 1}"],
- hintText: "Year",
- onChanged: (value) => setState(() => _selectedYear = value),
- ),
- SizedBox(height: isDesktop ? 24 : 16),
- ShopInBitStep4Dropdown(
- value: _selectedMonthSeason,
- items: _months,
- hintText: "Month",
- onChanged: (value) => setState(() => _selectedMonthSeason = value),
- ),
- SizedBox(height: isDesktop ? 24 : 16),
- AdaptiveTextField(
- controller: _tripLengthController,
- focusNode: _tripLengthFocusNode,
- labelText: "Number of nights",
- keyboardType: TextInputType.number,
- inputFormatters: [FilteringTextInputFormatter.digitsOnly],
- autocorrect: false,
- enableSuggestions: false,
- errorText: tripLengthError,
- onChanged: (_) => setState(() {}),
- ),
- ],
SizedBox(height: isDesktop ? 24 : 16),
_TravelSectionLabel(text: "Who", isDesktop: isDesktop),
@@ -447,6 +324,19 @@ class _ShopInBitTravelFormState extends ConsumerState<ShopInBitTravelForm> {
onChanged: (_) => setState(() {}),
),
+ SizedBox(height: isDesktop ? 24 : 16),
+ AdaptiveTextField(
+ controller: _arrangementDetailsController,
+ focusNode: _arrangementDetailsFocusNode,
+ labelText: "Describe your travel needs or paste a LINK here",
+ minLines: 3,
+ maxLines: 6,
+ autocorrect: false,
+ enableSuggestions: false,
+ errorText: arrangementDetailsError,
+ onChanged: (_) => setState(() {}),
+ ),
+
// Travel doesn't collect delivery country: destinations are in the
// form and the API field is set to "DE" on submit.
const SizedBox(height: 24),
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.