This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Shared enum for all verticals | |
| enum TravelDomain { stay, flight, bus, train, store } | |
| // Domain-specific implementation | |
| TravelFilterCriteria buildStayFilterCriteria({ | |
| required MasterFilters masterFilters, | |
| required int totalCount, | |
| required StaySearchRequest initialRequest, | |
| required StayService stayService, | |
| }) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TravelFilterController { | |
| MasterFilters? masterFilters; | |
| MasterFilters? userSelectedFilters; | |
| MasterFilters? lastAppliedFilters; | |
| bool get hasAnyFilterApplied => | |
| userSelectedFilters?.selectionFilters?.isFilterApplied ?? false; | |
| void onFilterOptionTapped(String filterId, String optionId) { | |
| // delegate to selection/slider/toggle controller managing their state |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "sortInfo": { | |
| "sortOptions": [ | |
| { | |
| "id": "PRICE_LOW_TO_HIGH", | |
| "isApplied": false, | |
| "presentation": { | |
| "title": "Price: Low to High" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Check if pubspec.yaml file exists | |
| if [ ! -f "pubspec.yaml" ]; then | |
| echo "⚠️ Please run command in a Flutter project" | |
| exit 1 | |
| fi | |
| # Get the value of "name: value" | |
| projectName=$(awk '/name:/ {print $2}' pubspec.yaml) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:convert'; | |
| import 'package:http/http.dart' as http; | |
| void main() async { | |
| var empResponse = await getEmployeeById(256); | |
| if(empResponse.employee != null){ | |
| print("EMPLOYEE NAME: "+empResponse.employee.name); | |
| }else{ | |
| print("EMPLOYEE DOES NOT EXIST"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "basics": { | |
| "name": "Taosif Jamal", | |
| "label": "Software Engineer", | |
| "image": "", | |
| "email": "[email protected]", | |
| "phone": "(91) 9638804660", | |
| "summary": "A summary of John Doe…", | |
| "location": { | |
| "address": "6th Block, Kormangala", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:math'; | |
| import 'package:flutter/foundation.dart'; | |
| class ListValueNotifier<T> extends ChangeNotifier implements ValueListenable<Iterable<T>>, List<T> { | |
| ListValueNotifier(this._value); | |
| List<T> _value; | |
| @override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal EnableDelayedExpansion | |
| REM ## Remove diff file if exists | |
| if exist diff-filelist.txt del /f diff-filelist.txt | |
| REM ## set output file name | |
| set "outputFileName=%2" | |
| IF "%~2" == "" ( SET "outputFileName=output.zip" ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Function to round a number to a precision multiple | |
| * | |
| * @param float $number original number | |
| * @param float $pointMultiple the point multiple to which it needs to be rounded | |
| * @param bool $roundDown whether to round up or down | |
| * @param int $precision precision for rounding | |
| * @return float rounded float number | |
| */ | |
| function roundToPrecisionMultiple(float $number, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<List<R>> transposeList<R>(List<List<R>> input) { | |
| List<List<R>> output = []; | |
| // Check for rectangle matrix | |
| if (input.any((element) => element.length != input[0].length)) { | |
| throw FormatException('Not a rectangle Matrix'); | |
| } | |
| for (int i = 0; i < input[0].length; i++) { | |
| output.add(List<R>.generate(input.length, (idx) => null)); |
NewerOlder