-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.dart
More file actions
47 lines (44 loc) · 1.37 KB
/
Copy pathmain.dart
File metadata and controls
47 lines (44 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/// useful quick code to save time;
///copywith Constructor to store value in a model class and get it anywhere in flutte project;
class TripDataClass {
String destination;
DateTime checkIn;
DateTime checkOut;
String partner;
List<String> interestList;
String interestListOptional;
String budgetType;
String specificBudgetTypeOptional;
TripDataClass({
required this.destination,
required this.checkIn,
required this.checkOut,
required this.partner,
required this.interestList,
required this.interestListOptional,
required this.budgetType,
required this.specificBudgetTypeOptional,
});
TripDataClass copyWith({
String? destination,
DateTime? checkIn,
DateTime? checkOut,
String? partner,
List<String>? interestList,
String? interestListOptional,
String? budgetType,
String? specificBudgetTypeOptional,
}) {
return TripDataClass(
destination: destination ?? this.destination,
checkIn: checkIn ?? this.checkIn,
checkOut: checkOut ?? this.checkOut,
partner: partner ?? this.partner,
interestList: interestList ?? this.interestList,
interestListOptional: interestListOptional ?? this.interestListOptional,
budgetType: budgetType ?? this.budgetType,
specificBudgetTypeOptional:
specificBudgetTypeOptional ?? this.specificBudgetTypeOptional,
);
}
}