repo_id
stringlengths 21
168
| file_path
stringlengths 36
210
| content
stringlengths 1
9.98M
| __index_level_0__
int64 0
0
|
---|---|---|---|
mirrored_repositories/RideFlutter/rider-app | mirrored_repositories/RideFlutter/rider-app/lib/query_result_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class QueryResultView extends StatelessWidget {
final QueryResult queryResult;
const QueryResultView(this.queryResult, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
if (queryResult.isLoading) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CupertinoActivityIndicator(),
const SizedBox(height: 8),
Text(
S.of(context).loading,
style: Theme.of(context).textTheme.caption,
)
],
));
}
if (queryResult.hasException) {
if (queryResult.exception
.toString()
.contains("Connection closed before full header was received")) {
return Column(
children: const [Text("Network error, Please try again later.")],
);
}
return Center(
child: Text(queryResult.exception.toString()),
);
}
return const SizedBox();
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/enter_coupon_code_sheet_view.dart | import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class EnterCouponCodeSheetView extends StatefulWidget {
const EnterCouponCodeSheetView({Key? key}) : super(key: key);
@override
State<EnterCouponCodeSheetView> createState() =>
_EnterCouponCodeSheetViewState();
}
class _EnterCouponCodeSheetViewState extends State<EnterCouponCodeSheetView> {
String code = "";
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).enter_coupon_dialog_title,
closeAction: () => Navigator.pop(context),
),
Text(
S.of(context).enter_coupon_dialog_body,
style: Theme.of(context).textTheme.bodyLarge,
),
const SizedBox(height: 16),
TextField(
onChanged: (value) => setState(() {
code = value;
}),
decoration: InputDecoration(
isDense: true,
prefixIcon: const Icon(Ionicons.pricetag),
hintText: S.of(context).enter_coupon_placeholder),
),
const SizedBox(height: 16),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: code.isEmpty
? null
: () {
Navigator.pop(context, code);
},
child: Text(S.of(context).action_confirm))),
],
)
],
));
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/ride_preferences_sheet_view.dart | import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
class RidePreferencesSheetView extends StatefulWidget {
final GetFare$Query$CalculateFareDTO$ServiceCategory$Service service;
final List<String> defaultSelectedOptions;
const RidePreferencesSheetView(this.service, this.defaultSelectedOptions,
{Key? key})
: super(key: key);
@override
State<RidePreferencesSheetView> createState() =>
_RidePreferencesSheetViewState();
}
class _RidePreferencesSheetViewState extends State<RidePreferencesSheetView> {
late List<String> selectedOptions = widget.defaultSelectedOptions;
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).ride_preferences_title,
closeAction: () => Navigator.pop(context)),
...widget.service.options.map((e) => RidePreferenceItem(
option: e,
isSelected: selectedOptions.contains(e.id),
onSelectionChanged: (selected) {
setState(() {
if (selected) {
selectedOptions.add(e.id);
} else {
selectedOptions.remove(e.id);
}
});
})),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {
if (listEquals(
selectedOptions, widget.defaultSelectedOptions)) {
Navigator.pop(context);
} else {
Navigator.pop(context, selectedOptions);
}
},
child: Text(S.of(context).action_confirm_and_continue),
))
],
)
],
));
}
}
class RidePreferenceItem extends StatelessWidget {
final GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption
option;
final bool isSelected;
final Function(bool) onSelectionChanged;
const RidePreferenceItem(
{required this.option,
required this.isSelected,
required this.onSelectionChanged,
Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.only(bottom: 12),
child: GestureDetector(
onTap: () => onSelectionChanged(!isSelected),
child: Row(
children: [
AnimatedContainer(
duration: const Duration(milliseconds: 250),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(
width: 1,
color: isSelected
? CustomTheme.primaryColors
: Colors.transparent,
),
color: isSelected
? CustomTheme.primaryColors.shade200
: CustomTheme.neutralColors.shade200),
child: Icon(
getOptionIcon(),
size: 32,
color: isSelected
? CustomTheme.primaryColors
: CustomTheme.neutralColors.shade400,
),
),
const SizedBox(width: 12),
Text(
option.name,
style: Theme.of(context).textTheme.titleMedium,
)
],
),
),
);
}
IconData getOptionIcon() {
switch (option.icon) {
case ServiceOptionIcon.pet:
return Ionicons.paw;
case ServiceOptionIcon.twoWay:
return Ionicons.repeat;
case ServiceOptionIcon.luggage:
return Ionicons.briefcase;
case ServiceOptionIcon.packageDelivery:
return Ionicons.cube;
case ServiceOptionIcon.shopping:
return Ionicons.cart;
case ServiceOptionIcon.custom1:
return Ionicons.help;
case ServiceOptionIcon.custom2:
return Ionicons.help;
case ServiceOptionIcon.custom3:
return Ionicons.help;
case ServiceOptionIcon.custom4:
return Ionicons.help;
case ServiceOptionIcon.custom5:
return Ionicons.help;
case ServiceOptionIcon.artemisUnknown:
return Ionicons.help;
}
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/drawer_logged_out.dart | import 'package:client_shared/config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/main/bloc/jwt_cubit.dart';
import '../login/login_number_view.dart';
import 'package:client_shared/theme/theme.dart';
class DrawerLoggedOut extends StatelessWidget {
const DrawerLoggedOut({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(children: [
const SizedBox(height: 64),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.log_in),
minLeadingWidth: 20.0,
title: Text(S.of(context).menu_login,
style: Theme.of(context).textTheme.titleMedium),
onTap: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 600),
builder: (context) {
return BlocProvider.value(
value: context.read<JWTCubit>(),
child: const LoginNumberView(),
);
});
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.information),
minLeadingWidth: 20.0,
title: Text(S.of(context).menu_about,
style: Theme.of(context).textTheme.titleMedium),
onTap: () async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
showAboutDialog(
context: context,
applicationIcon: Image.asset(
'images/logo.png',
width: 100,
height: 100,
),
applicationVersion:
"${packageInfo.version} (Build ${packageInfo.buildNumber})",
applicationName: packageInfo.appName,
applicationLegalese:
S.of(context).copyright_notice(companyName));
},
)
]),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/service_selection_card_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/main/reserve_confirmation_sheet_view.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../login/login_number_view.dart';
import 'bloc/jwt_cubit.dart';
import 'bloc/main_bloc.dart';
import '../main/select_service_view.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
class ServiceSelectionCardView extends StatelessWidget {
const ServiceSelectionCardView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
return BlocBuilder<MainBloc, MainBlocState>(builder: (context, state) {
return Query(
options: QueryOptions(
document: GET_FARE_QUERY_DOCUMENT,
variables: GetFareArguments(
points: (state as OrderPreview)
.points
.map((e) => PointInput(
lat: e.latlng.latitude, lng: e.latlng.longitude))
.toList(),
selectedOptionIds: state.selectedOptions,
couponCode: state.couponCode)
.toJson()),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading) {
return Card(child: const CupertinoActivityIndicator().p16());
}
if (result.hasException) {
if (result.exception!.graphqlErrors
.filter((element) => element.message == 'REGION_UNSUPPORTED')
.isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
final snackBar = SnackBar(
content: Text(S.of(context).error_region_unsupported));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
mainBloc.add(ResetState());
});
}
if (result.exception!.graphqlErrors
.filter((element) =>
element.message == 'Coupon expired' ||
element.message == 'Incorrect code')
.isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
final snackBar = SnackBar(
content: Text(S.of(context).alert_coupon_unavailable));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
mainBloc.add(ShowPreview(
points: state.points,
selectedOptions: [],
couponCode: null));
});
}
return Center(
child: Text(result.exception!.graphqlErrors
.map((e) => e.message)
.join(',')),
);
}
final fareResult = GetFare$Query.fromJson(result.data!).getFare;
if ((state.directions == null || state.directions!.isEmpty) &&
fareResult.directions.isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
mainBloc.add(
ShowPreviewDirections(directions: fareResult.directions));
});
}
if (state.selectedService == null &&
fareResult.services.isNotEmpty &&
fareResult.services.first.services.isNotEmpty) {
WidgetsBinding.instance.addPostFrameCallback((_) {
mainBloc.add(SelectService(fareResult.services[0].services[0]));
});
}
return Mutation(
options:
MutationOptions(document: CREATE_ORDER_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return SelectServiceView(
data: fareResult,
onServiceSelect:
(String serviceId, int intervalMinutes) async {
if (Hive.box('user').get('jwt') == null) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 600),
builder: (context) {
return BlocProvider.value(
value: context.read<JWTCubit>(),
child: const LoginNumberView(),
);
});
return;
}
final fcmId = await getFcmId(context);
final args = CreateOrderArguments(
input: CreateOrderInput(
serviceId: int.parse(state.selectedService!.id),
intervalMinutes: intervalMinutes,
optionIds: state.selectedOptions
.filter((selectedOption) => state
.selectedService!.options
.map((e) => e.id)
.contains(selectedOption))
.toList(),
points: state.points
.map((e) => PointInput(
lat: e.latlng.latitude,
lng: e.latlng.longitude))
.toList(),
couponCode: state.couponCode,
addresses: state.points
.map((e) => e.address)
.toList()),
notificationPlayerId: fcmId ?? "")
.toJson();
final result = await runMutation(args).networkResult;
if (result!.hasException) {
final snackBar = SnackBar(
content: Text(result.exception?.graphqlErrors
.map((e) => e.message)
.join(', ') ??
"Unknown error"));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
return;
}
final order =
CreateOrder$Mutation.fromJson(result.data!).createOrder;
if (order.status == OrderStatus.booked) {
await showModalBottomSheet(
context: context,
builder: (context) {
return const ReserveConfirmationSheetView();
});
mainBloc.add(ResetState());
} else {
mainBloc.add(CurrentOrderUpdated(order));
}
},
);
},
);
});
});
}
}
Future<String?> getFcmId(BuildContext context) async {
FirebaseMessaging messaging = FirebaseMessaging.instance;
NotificationSettings settings = await messaging.requestPermission(
alert: true,
announcement: true,
badge: true,
carPlay: true,
criticalAlert: false,
provisional: true,
sound: true,
);
if (settings.authorizationStatus == AuthorizationStatus.denied) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(S.of(context).message_notification_permission_title),
content: Text(S
.of(context)
.message_notification_permission_denined_message),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(S.of(context).action_ok),
)
],
));
return null;
} else {
return messaging.getToken(
vapidKey: "",
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/order_status_sheet_view.dart | import 'dart:math';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/components/light_colored_button.dart';
import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:client_shared/components/rounded_button.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:ridy/main/enter_coupon_code_sheet_view.dart';
import 'package:ridy/main/enter_gift_code_sheet_view.dart';
import 'package:ridy/main/pay_for_ride_sheet_view.dart';
import 'package:ridy/main/ride_options_sheet_view.dart';
import 'package:ridy/main/ride_safety_sheet_view.dart';
import 'package:ridy/main/wait_time_sheet_view.dart';
import 'package:client_shared/theme/theme.dart';
import '../config.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:timeago_flutter/timeago_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:intl/intl.dart';
import 'bloc/main_bloc.dart';
class OrderStatusSheetView extends StatelessWidget {
const OrderStatusSheetView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final now = DateTime.now();
final mainBloc = context.read<MainBloc>();
return Subscription(
options: SubscriptionOptions(
document: DRIVER_LOCATION_UPDATED_SUBSCRIPTION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result) {
if (result.data != null) {
final location =
DriverLocationUpdated$Subscription.fromJson(result.data!);
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
mainBloc.add(
DriverLocationUpdatedEvent(location.driverLocationUpdated));
});
}
return RidySheetView(child: BlocBuilder<MainBloc, MainBlocState>(
builder: (context, state) {
state as OrderInProgress;
return Column(
children: [
if (state.order.status == OrderStatus.driverAccepted)
Timeago(
builder: (_, value) => SheetTitleView(
title:
((state.order.etaPickup ?? now).isBefore(now) ||
state.order.etaPickup == null)
? S.of(context).order_status_should_be_arrived
: S.of(context).order_status_arriving_in(state
.order.etaPickup
?.difference(DateTime.now())
.inMinutes ??
0)),
date: state.order.etaPickup ?? now,
allowFromNow: true,
)
else if (state.order.status == OrderStatus.arrived)
SheetTitleView(
title: S.of(context).status_title_driver_arrived)
else if (state.order.status == OrderStatus.started)
SheetTitleView(
title: S.of(context).status_title_trip_started),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
state.order.driver?.car?.name ?? "",
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 4),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade400,
borderRadius: BorderRadius.circular(10)),
child: Text(
state.order.driver?.carPlate ?? "",
style: Theme.of(context).textTheme.titleMedium,
),
)
]),
const Spacer(),
Stack(
children: [
Image.network(
serverUrl + state.order.service.media.address,
width: 117,
height: 70)
.pOnly(bottom: 16),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 0),
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade400,
borderRadius: BorderRadius.circular(10)),
child: Text(
NumberFormat.simpleCurrency(
name: state.order.currency)
.format(state.currentOrder.costAfterCoupon),
style: Theme.of(context).textTheme.titleMedium,
textAlign: TextAlign.center,
softWrap: false,
),
),
)
],
)
],
),
const Divider(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
UserAvatarView(
urlPrefix: serverUrl,
url: state.order.driver?.media?.address,
size: 50,
cornerRadius: 25,
),
const SizedBox(
width: 8,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text("${state.order.driver!.firstName} ${state.order.driver!.lastName}",
style: Theme.of(context).textTheme.bodySmall)
.pOnly(left: 4, bottom: 4),
if (state.order.driver?.rating != null)
Row(
children: [
const Icon(
Icons.star,
color: Color(0xffe6bb4d),
),
Text(
(state.order.driver!.rating!.toDouble() / 20)
.toStringAsFixed(1),
style:
Theme.of(context).textTheme.labelMedium,
).pOnly(left: 4)
],
)
],
),
const Spacer(),
RoundedButton(
icon: Ionicons.mail,
onPressed: () =>
Navigator.pushNamed(context, 'chat')),
const SizedBox(width: 8),
Transform(
alignment: Alignment.center,
transform: Matrix4.rotationY(pi),
child: RoundedButton(
icon: Ionicons.call,
onPressed: () => _launchUrl(context,
"tel://+${state.order.driver?.mobileNumber}")),
),
],
).pSymmetric(v: 8),
const Divider(),
Row(
children: [
Mutation(
options: MutationOptions(
document: UPDATE_ORDER_MUTATION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder:
(RunMutation runMutation, QueryResult? result) {
if (result?.data != null) {
final order =
UpdateOrder$Mutation.fromJson(result!.data!)
.updateOneOrder;
mainBloc.add(CurrentOrderUpdated(order));
}
return LightColoredButton(
icon: Ionicons.list,
text: S.of(context).action_ride_options,
onPressed: () async {
final result = await showModalBottomSheet<
RideOptionsResult>(
context: context,
builder: (context) {
return const RideOptionsSheetView();
});
switch (result) {
case RideOptionsResult.waitTime:
final result =
await showModalBottomSheet<int>(
context: context,
builder: (context) {
return WaitTimeSheetView(
selectedMinute:
state.order.waitMinutes,
);
});
if (result == null) return;
await runMutation(UpdateOrderArguments(
id: state.order.id,
update: UpdateOrderInput(
waitMinutes: result))
.toJson())
.networkResult;
break;
case null:
case RideOptionsResult.none:
return;
case RideOptionsResult.couponCode:
final result =
await showModalBottomSheet<String>(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(
maxWidth: 600),
builder: (context) {
return const EnterCouponCodeSheetView();
});
if (result == null) return;
await runMutation(UpdateOrderArguments(
id: state.order.id,
update: UpdateOrderInput(
couponCode: result))
.toJson())
.networkResult;
break;
case RideOptionsResult.giftCode:
await showModalBottomSheet(
context: context,
builder: (context) {
return const EnterGiftCodeSheetView();
});
break;
case RideOptionsResult.cancel:
if (state.order.service
.cancellationTotalFee >
0) {
final cancelFee =
NumberFormat.simpleCurrency(
name: state.order.currency)
.format(state.order.service
.cancellationTotalFee);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(S
.of(context)
.message_title_warning),
content: Text(S
.of(context)
.cancelation_fee_confirmation_body(
cancelFee)),
actions: [
TextButton(
onPressed: () =>
Navigator.of(context)
.pop(),
child: Text(S
.of(context)
.action_cancel)),
TextButton(
onPressed: () async {
Navigator.of(context)
.pop();
final result = await runMutation(UpdateOrderArguments(
id: state
.order
.id,
update: UpdateOrderInput(
status: OrderStatus
.riderCanceled,
tipAmount:
0,
waitMinutes:
0))
.toJson())
.networkResult;
final order =
UpdateOrder$Mutation
.fromJson(
result!
.data!);
mainBloc.add(
CurrentOrderUpdated(
order
.updateOneOrder));
},
child: Text(S
.of(context)
.action_confirm))
],
);
});
} else {
final result = await runMutation(
UpdateOrderArguments(
id: state.order.id,
update: UpdateOrderInput(
status: OrderStatus
.riderCanceled,
waitMinutes: 0,
tipAmount: 0))
.toJson())
.networkResult;
final order =
UpdateOrder$Mutation.fromJson(
result!.data!);
mainBloc.add(CurrentOrderUpdated(
order.updateOneOrder));
}
break;
}
}).pSymmetric(v: 4);
}),
const Spacer(),
LightColoredButton(
icon: Ionicons.shield,
text: S.of(context).button_ride_safety,
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) {
return RideSafetySheetView(
order: state.order);
});
}).pSymmetric(v: 4),
],
),
const SizedBox(height: 8),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {
showBarModalBottomSheet(
context: context,
builder: (context) {
return PayForRideSheetView(
onClosePressed: () => Navigator.pop(context),
order: state.order,
);
});
},
child: Text(S.of(context).action_pay_for_ride),
))
],
)
],
);
},
));
});
}
_launchUrl(BuildContext context, String url) async {
final uri = Uri.parse(url);
final canLaunch = await canLaunchUrl(uri);
if (!canLaunch) {
const snackBar = SnackBar(content: Text("Command is not supported"));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
launchUrl(uri);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/reserve_confirmation_sheet_view.dart | import 'package:flutter/material.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class ReserveConfirmationSheetView extends StatelessWidget {
const ReserveConfirmationSheetView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(title: S.of(context).ride_reserved_dialog_title),
Flex(
direction: Axis.horizontal,
children: [
Flexible(
child: Text(
S.of(context).ride_reserved_dialog_body,
style: Theme.of(context).textTheme.bodyMedium,
).pOnly(right: 16)),
Image.asset(
"images/booking_confirmed.png",
width: 200,
height: 200,
).pSymmetric(v: 8)
],
),
Row(
children: [
Expanded(
child: OutlinedButton(
style: ButtonStyle(
padding:
MaterialStateProperty.all(const EdgeInsets.all(8))),
onPressed: () =>
Navigator.popAndPushNamed(context, 'reserves'),
child: Text(S.of(context).action_see_reserved_rides)
.pSymmetric(v: 8),
),
),
const SizedBox(
width: 8,
),
Expanded(
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
child: Text(S.of(context).action_confirm),
))
],
)
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/enter_gift_code_sheet_view.dart | import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class EnterGiftCodeSheetView extends StatelessWidget {
const EnterGiftCodeSheetView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).gift_card_title,
closeAction: () => Navigator.pop(context),
),
Text(S.of(context).gift_card_body,
style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 10),
TextField(
decoration: InputDecoration(
isDense: true,
prefixIcon: const Icon(Ionicons.gift),
hintText: S.of(context).gift_card_text_placeholder),
),
const SizedBox(height: 16),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () {},
child: Text(S.of(context).action_apply))),
],
)
],
));
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/rate_ride_sheet_view.dart | import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:ridy/main/bloc/main_bloc.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:ridy/query_result_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
class RateRideSheetView extends StatefulWidget {
const RateRideSheetView({Key? key}) : super(key: key);
@override
State<RateRideSheetView> createState() => _RateRideSheetViewState();
}
class _RateRideSheetViewState extends State<RateRideSheetView> {
int? tripRating;
String? reviewText;
List<String> selectedParameters = [];
@override
Widget build(BuildContext context) {
return RidySheetView(
child: Column(
children: [
SheetTitleView(title: S.of(context).rate_ride_title),
Text(
S.of(context).rate_ride_body,
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 4),
RatingBar.builder(
allowHalfRating: true,
itemPadding: const EdgeInsets.symmetric(horizontal: 4.0),
itemBuilder: (context, _) => const Icon(
Icons.star,
color: Color(0xffefc868),
),
onRatingUpdate: (rating) {
setState(() {
tripRating = (rating * 20).toInt();
});
},
),
if (tripRating == null) const SizedBox(height: 35),
if (tripRating != null)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 8),
const Divider(),
Query(
options: QueryOptions(
document: GET_REVIEW_PARAMETERS_QUERY_DOCUMENT),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
final parameters =
GetReviewParameters$Query.fromJson(result.data!)
.feedbackParameters;
return Row(
children: [
Expanded(
child: Column(
children: [
const Icon(
Ionicons.heart_circle,
size: 56,
color: Color(0xff108910),
),
const SizedBox(height: 4),
Text(
S.of(context).rate_ride_good_points,
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 8),
...parameters
.where((element) => element.isGood)
.map((e) => RateParameter(
name: e.title,
isGood: e.isGood,
onValueChanged: (selected) {
if (selected) {
selectedParameters.add(e.id);
} else {
selectedParameters.remove(e.id);
}
},
)),
],
),
),
const SizedBox(width: 10),
Expanded(
child: Column(
children: [
const Icon(
Ionicons.heart_dislike_circle,
size: 56,
color: Color(0xffb20d0e),
),
const SizedBox(height: 4),
Text(S.of(context).rate_ride_negative_points,
style:
Theme.of(context).textTheme.titleSmall),
const SizedBox(height: 8),
...parameters
.where((element) => !element.isGood)
.map((e) => RateParameter(
name: e.title,
isGood: e.isGood,
onValueChanged: (selected) {
if (selected) {
selectedParameters.add(e.id);
} else {
selectedParameters.remove(e.id);
}
},
)),
],
),
)
],
);
}),
const Divider(),
const SizedBox(height: 8),
Text(
S.of(context).rate_ride_comment_title,
style: Theme.of(context).textTheme.titleSmall,
),
const SizedBox(height: 4),
TextField(
minLines: 3,
maxLines: 6,
decoration: InputDecoration(
hintText: S.of(context).rate_ride_comment_placeholder,
isDense: true,
fillColor: CustomTheme.neutralColors.shade100),
),
const SizedBox(height: 16),
Row(
children: [
Expanded(
child: Mutation(
options: MutationOptions(
document: SUBMIT_FEEDBACK_MUTATION_DOCUMENT,
update: (GraphQLDataProxy cache,
QueryResult? result) {
// cache.writeQuery(
// Operation(document: GET_CURRENT_ORDER_QUERY_DOCUMENT)
// .asRequest(),
// data: {
// "currentOrderWithLocation": {
// "order": result!.data!['submitReview'],
// "driverLocation": {"lat": 10, "lng": 10}
// },
// });
context.read<MainBloc>().add(ResetState());
}),
builder:
(RunMutation runMutation, QueryResult? result) {
return ElevatedButton(
onPressed: () {
final bloc = context.read<MainBloc>();
if (bloc.state is! OrderReview) return;
runMutation(SubmitFeedbackArguments(
score: tripRating!,
description: reviewText ?? "",
parameterIds: selectedParameters,
orderId: (bloc.state as OrderReview)
.currentOrder
.id)
.toJson());
},
child:
Text(S.of(context).action_send_feedback));
})),
],
)
],
)
],
),
);
}
}
class RateParameter extends StatefulWidget {
final bool isGood;
final String name;
final Function(bool) onValueChanged;
const RateParameter(
{required this.name,
required this.isGood,
required this.onValueChanged,
Key? key})
: super(key: key);
@override
State<RateParameter> createState() => _RateParameterState();
}
class _RateParameterState extends State<RateParameter> {
bool isSelected = false;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: (() {
widget.onValueChanged(!isSelected);
setState(() {
isSelected = !isSelected;
});
}),
child: Padding(
padding: const EdgeInsets.all(4),
child: Row(
children: [
Expanded(
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
padding: const EdgeInsets.symmetric(vertical: 4, horizontal: 8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: !isSelected
? CustomTheme.primaryColors.shade100
: (widget.isGood
? const Color(0xffc9ffc9)
: const Color(0xffffd1d1)),
border: Border.all(
color: !isSelected
? Colors.transparent
: (widget.isGood
? const Color(0xff108910)
: const Color(0xffb20d0e)))),
child: Center(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 5),
child: Text(
widget.name,
style: Theme.of(context).textTheme.labelSmall?.copyWith(
letterSpacing: -0.3,
color: !isSelected
? CustomTheme.neutralColors
: (widget.isGood
? const Color(0xff108910)
: const Color(0xffb20d0e))),
),
),
),
),
),
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/wait_time_sheet_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
// ignore: must_be_immutable
class WaitTimeSheetView extends StatelessWidget {
final items = [0, 3, 5, 10, 15, 20, 30, 40, 60];
int selectedMinute;
WaitTimeSheetView({required this.selectedMinute, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).title_wait_time,
closeAction: () => Navigator.pop(context),
),
SizedBox(
height: 150,
child: CupertinoPicker.builder(
itemExtent: 45,
childCount: items.length,
scrollController: FixedExtentScrollController(
initialItem: items
.indexWhere((element) => element == selectedMinute)),
onSelectedItemChanged: (index) {
selectedMinute = items[index];
},
itemBuilder: (context, index) {
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
S.of(context).minutes_format(index == 0
? items[index]
: "${items[index - 1]}-${items[index]}"),
style: Theme.of(context).textTheme.titleLarge,
),
],
);
}),
),
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () {
Navigator.pop(context, selectedMinute);
},
child: Text(S.of(context).action_confirm)))
],
));
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/reserve_ride_sheet_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class ReserveRideSheetView extends StatefulWidget {
const ReserveRideSheetView({Key? key}) : super(key: key);
@override
State<ReserveRideSheetView> createState() => _ReserveRideSheetViewState();
}
class _ReserveRideSheetViewState extends State<ReserveRideSheetView> {
DateTime? dateTime;
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(mainAxisSize: MainAxisSize.min, children: [
SheetTitleView(
title: S.of(context).title_reserve_ride,
closeAction: () => Navigator.pop(context),
),
const SizedBox(height: 8),
SizedBox(
height: 250,
child: CupertinoDatePicker(
initialDateTime:
DateTime.now().add(const Duration(minutes: 40)),
minimumDate: DateTime.now().add(const Duration(minutes: 30)),
onDateTimeChanged: ((value) => setState(() {
dateTime = value;
})))),
const Divider(),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: dateTime == null
? null
: () {
Navigator.pop(context, dateTime);
},
child:
Text(S.of(context).action_confirm_and_reserve_ride))),
],
)
]),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/service_item_view.dart | import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import '../config.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:intl/intl.dart';
import 'package:client_shared/theme/theme.dart';
import 'bloc/main_bloc.dart';
class ServiceItemView extends StatelessWidget {
final bool isSelected;
final GetFare$Query$CalculateFareDTO$ServiceCategory$Service service;
final String currency;
const ServiceItemView(
{Key? key,
required this.isSelected,
required this.service,
required this.currency})
: super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
return GestureDetector(
onTap: () => mainBloc.add(SelectService(service)),
child: AnimatedContainer(
duration: const Duration(milliseconds: 250),
padding: const EdgeInsets.symmetric(horizontal: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: isSelected
? CustomTheme.primaryColors.shade100
: CustomTheme.primaryColors.shade50),
child: Row(
children: [
Image.network(
serverUrl + service.media.address,
width: 75,
height: 75,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
service.name,
style: Theme.of(context).textTheme.titleMedium,
),
if (service.description?.isNotEmpty ?? false)
Text(
service.description ?? "",
style: Theme.of(context).textTheme.labelMedium,
).pOnly(top: 4)
],
),
),
const Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Text(
NumberFormat.simpleCurrency(name: currency)
.format(service.cost),
style: Theme.of(context).textTheme.titleMedium?.copyWith(
decoration: (service.costAfterCoupon != null &&
service.cost != service.costAfterCoupon)
? TextDecoration.lineThrough
: TextDecoration.none,
color: (service.costAfterCoupon != null &&
service.cost != service.costAfterCoupon)
? CustomTheme.neutralColors.shade300
: CustomTheme.neutralColors.shade800),
),
if (service.costAfterCoupon != null &&
service.cost != service.costAfterCoupon)
Text(
NumberFormat.simpleCurrency(name: currency)
.format(service.costAfterCoupon),
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(color: const Color(0xff108910)),
).pOnly(top: 4)
],
).pOnly(top: 4, right: 8)
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/pay_for_ride_sheet_view.dart | import 'package:client_shared/components/user_avatar_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:ridy/config.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:client_shared/wallet/payment_method_item.dart';
import 'package:client_shared/wallet/money_presets_group.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:intl/intl.dart';
import '../graphql/generated/graphql_api.graphql.dart';
class PayForRideSheetView extends StatefulWidget {
static const List<double> tipPresets = [10, 20, 50];
final CurrentOrderMixin order;
final Function()? onClosePressed;
const PayForRideSheetView(
{required this.order, required this.onClosePressed, Key? key})
: super(key: key);
@override
State<PayForRideSheetView> createState() => _PayForRideSheetViewState();
}
class _PayForRideSheetViewState extends State<PayForRideSheetView> {
double tipAmount = 0;
String? selectedGatewayId;
double customAmount = 0;
double balance = 0;
@override
Widget build(BuildContext context) {
return RidySheetView(
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SheetTitleView(
title: S.of(context).add_credit_dialog_title,
closeAction: widget.onClosePressed == null
? null
: () => widget.onClosePressed!(),
),
if (widget.order.driver != null)
TipDriverSection(
driver: widget.order.driver!,
onTipSelected: (value) => setState(() => tipAmount = value),
),
Query(
options: QueryOptions(document: PAY_FOR_RIDE_QUERY_DOCUMENT),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading) {
return const Center(
child: CupertinoActivityIndicator(),
);
}
final queryResult = PayForRide$Query.fromJson(result.data!);
balance = queryResult.riderWallets
.firstWhereOrNull((element) =>
element.currency == widget.order.currency)
?.balance ??
0;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).add_credit_select_payment_method,
style: Theme.of(context).textTheme.headlineMedium,
).pOnly(bottom: 8),
...queryResult.paymentGateways.map((gateway) =>
PaymentMethodItem(
id: gateway.id,
title: gateway.title,
selectedValue: selectedGatewayId,
imageAddress: gateway.media != null
? (serverUrl + gateway.media!.address)
: null,
onSelected: (value) {
setState(() => selectedGatewayId = gateway.id);
})),
PayForRideInvoiceContainer(
serviceName: widget.order.service.name,
currency: widget.order.currency,
serviceFee: widget.order.costAfterCoupon,
tip: tipAmount,
walletCredit: balance,
customAmountUpdated: (value) {
customAmount = value;
},
).pOnly(top: 16, bottom: 16),
SizedBox(
width: double.infinity,
child: Mutation(
options: MutationOptions(
document: PAY_RIDE_MUTATION_DOCUMENT),
builder: (RunMutation runMutation,
QueryResult? result) {
return ElevatedButton(
onPressed: selectedGatewayId == null ||
getTotal() < 0
? null
: () async {
final mutationResult =
await runMutation(PayRideArguments(
orderId:
widget.order.id,
tipAmount:
tipAmount,
input: TopUpWalletInput(
gatewayId:
selectedGatewayId!,
amount:
getTotal(),
currency: widget
.order
.currency),
shouldPreauth: widget
.order
.status ==
OrderStatus
.waitingForPrePay)
.toJson())
.networkResult;
final resultParsed =
PayRide$Mutation.fromJson(
mutationResult!.data!);
launchUrl(
Uri.parse(resultParsed
.topUpWallet.url),
mode: LaunchMode
.externalApplication);
if (!mounted) {
return;
}
// Navigator.pop(context);
},
child: Text(
S.of(context).action_confirm_and_pay));
}))
],
);
}),
],
),
),
);
}
double getTotal() {
final orderFee = widget.order.service.prepayPercent > 0
? (widget.order.costAfterCoupon *
widget.order.service.prepayPercent /
100)
: widget.order.costAfterCoupon;
return orderFee + tipAmount - balance + customAmount;
}
}
class TipDriverSection extends StatelessWidget {
final CurrentOrderMixin$Driver driver;
final Function(double) onTipSelected;
const TipDriverSection(
{required this.driver, required this.onTipSelected, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).notice_tip_title,
style: Theme.of(context).textTheme.headlineMedium,
),
const SizedBox(height: 2),
Text(
S.of(context).notice_tip_description,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 8),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
UserAvatarView(
urlPrefix: serverUrl,
url: driver.media?.address,
cornerRadius: 12,
size: 30,
),
]),
const SizedBox(height: 4),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
Text(
"${driver.firstName} ${driver.lastName}",
style: Theme.of(context).textTheme.titleMedium,
),
]),
MoneyPresetsGroup(
onAmountChanged: (amount) => onTipSelected(amount),
).pOnly(top: 8, bottom: 16),
],
);
}
}
class PayForRideInvoiceContainer extends StatefulWidget {
final String serviceName;
final String currency;
final double serviceFee;
final double tip;
final double walletCredit;
final Function(double) customAmountUpdated;
const PayForRideInvoiceContainer(
{required this.serviceName,
required this.currency,
required this.serviceFee,
required this.tip,
required this.walletCredit,
required this.customAmountUpdated,
Key? key})
: super(key: key);
@override
State<PayForRideInvoiceContainer> createState() =>
_PayForRideInvoiceContainerState();
}
class _PayForRideInvoiceContainerState
extends State<PayForRideInvoiceContainer> {
double? customCredit;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade100,
borderRadius: BorderRadius.circular(10)),
child: Column(
children: [
Row(
children: [
Text(
S.of(context).add_credit_custom_credit_placeholder,
style: Theme.of(context).textTheme.bodySmall,
),
const Spacer(),
SizedBox(
width: 70,
child: TextField(
onChanged: (value) {
final parsedVal = double.tryParse(value);
if (parsedVal == null) return;
setState(() => customCredit = parsedVal);
widget.customAmountUpdated(parsedVal);
},
decoration: InputDecoration(
isDense: true,
fillColor: Colors.transparent,
prefixIconConstraints:
const BoxConstraints(minWidth: 0, minHeight: 0),
hintText: S
.of(context)
.add_credit_custom_credit_text_placeholder,
hintStyle: Theme.of(context).textTheme.labelMedium,
contentPadding: EdgeInsets.zero,
prefixIcon: const Icon(Ionicons.add)),
),
)
],
),
const Divider(),
Row(
children: [
Text(
widget.serviceName,
style: Theme.of(context).textTheme.bodySmall,
),
const Spacer(),
Text(
NumberFormat.simpleCurrency(name: widget.currency)
.format(widget.serviceFee),
style: Theme.of(context).textTheme.bodySmall)
],
).pOnly(bottom: 4),
const Divider(),
Row(
children: [
Text(S.of(context).invoice_item_tip,
style: Theme.of(context).textTheme.bodySmall),
const Spacer(),
Text(
NumberFormat.simpleCurrency(name: widget.currency)
.format(widget.tip),
style: Theme.of(context).textTheme.bodySmall)
],
).pOnly(top: 4),
const Divider(),
Row(
children: [
Text(S.of(context).invoice_item_wallet,
style: Theme.of(context).textTheme.bodySmall),
const Spacer(),
Text(
NumberFormat.simpleCurrency(name: widget.currency)
.format(widget.walletCredit),
style: Theme.of(context).textTheme.bodySmall)
],
).pOnly(top: 4, bottom: 4),
const Divider(
thickness: 1.5,
),
Row(
children: [
Text(
S.of(context).invoice_item_total,
style: Theme.of(context).textTheme.headlineMedium,
),
const Spacer(),
Text(
NumberFormat.simpleCurrency(name: widget.currency).format(
widget.tip +
widget.serviceFee -
widget.walletCredit +
(customCredit ?? 0)),
style: Theme.of(context).textTheme.headlineLarge,
)
],
),
],
),
);
}
}
extension FirstWhereOrNullExtension<E> on Iterable<E> {
E? firstWhereOrNull(bool Function(E) test) {
for (E element in this) {
if (test(element)) return element;
}
return null;
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/select_service_view.dart | import 'package:client_shared/components/light_colored_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/main/enter_coupon_code_sheet_view.dart';
import 'package:ridy/main/reserve_ride_sheet_view.dart';
import 'package:ridy/main/ride_preferences_sheet_view.dart';
import 'package:client_shared/theme/theme.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../main/service_item_view.dart';
import 'package:velocity_x/velocity_x.dart';
import 'bloc/main_bloc.dart';
class SelectServiceView extends StatefulWidget {
const SelectServiceView(
{Key? key, required this.data, required this.onServiceSelect})
: super(key: key);
final GetFare$Query$CalculateFareDTO data;
final ServiceSelectCallback onServiceSelect;
@override
State<SelectServiceView> createState() => _SelectServiceViewState();
}
class _SelectServiceViewState extends State<SelectServiceView> {
@override
Widget build(BuildContext context) {
final mainBloc = (context.read<MainBloc>().state) as OrderPreview;
return RidySheetView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
OrderPreviewServices(
serviceCategories: widget.data.services,
currency: widget.data.currency),
// DefaultTabController(
// length: widget.data.services.length,
// child: Column(
// mainAxisSize: MainAxisSize.min,
// children: [
// ],
// )),
Row(children: [
Expanded(
child: ElevatedButton(
onPressed: mainBloc.selectedService == null
? null
: () async {
widget.onServiceSelect(
mainBloc.selectedService.toString(), 0);
},
child: Text(S.of(context).service_selection_book_now),
)),
const SizedBox(width: 10),
ElevatedButton(
style: ButtonStyle(
padding: MaterialStateProperty.all(
const EdgeInsets.symmetric(vertical: 10))),
onPressed: mainBloc.selectedService == null
? null
: () async {
final dialogResult =
await showModalBottomSheet<DateTime>(
context: context,
builder: (context) =>
const ReserveRideSheetView());
if (dialogResult == null) return;
final difference =
dialogResult.difference(DateTime.now()).inMinutes;
widget.onServiceSelect(
mainBloc.selectedService!.id, difference);
},
child: const Icon(
Ionicons.calendar,
size: 28,
).pOnly(bottom: 4)),
]).pOnly(top: 10)
],
),
);
}
}
class OrderPreviewServices extends StatelessWidget {
final List<GetFare$Query$CalculateFareDTO$ServiceCategory> serviceCategories;
final String currency;
const OrderPreviewServices(
{required this.serviceCategories, required this.currency, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
return DefaultTabController(
length: serviceCategories.length,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
TabBar(
dividerColor: Colors.transparent,
unselectedLabelStyle: Theme.of(context).textTheme.labelMedium,
labelStyle: Theme.of(context).textTheme.titleSmall,
isScrollable: true,
tabs: serviceCategories
.map((e) => Tab(
height: 28,
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 16, vertical: 0),
child: Text(e.name)),
))
.toList()),
const Divider(),
SizedBox(
height: 225,
child: TabBarView(
children: serviceCategories.map((e) {
return ListView(
padding: EdgeInsets.zero,
children: e.services
.map((e) => ServiceItemView(
service: e,
isSelected: e.id ==
(mainBloc.state as OrderPreview)
.selectedService
?.id,
currency: currency,
))
.toList(),
);
}).toList(),
),
),
const Divider(),
Row(
children: [
BlocBuilder<MainBloc, MainBlocState>(
builder: (context, state) {
if (state is! OrderPreview ||
state.selectedService == null ||
state.selectedService!.options.isEmpty) {
return const SizedBox();
}
return LightColoredButton(
icon: Ionicons.options,
text: S.of(context).action_ride_preferences,
onPressed: () async {
final dialogResult = await showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 500),
builder: (context) {
return RidePreferencesSheetView(
state.selectedService!,
state.selectedOptions);
});
if (dialogResult != null) {
final points = state.points;
context.read<MainBloc>().add(ShowPreview(
points: points,
selectedOptions: dialogResult,
couponCode: state.couponCode));
}
});
},
),
const Spacer(),
LightColoredButton(
icon: Ionicons.pricetag,
text: S.of(context).action_coupon_code,
onPressed: () async {
final bloc = context.read<MainBloc>();
(bloc.state as OrderPreview);
final code = await showModalBottomSheet<String>(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 500),
builder: (context) {
return const EnterCouponCodeSheetView();
});
if (code.isEmptyOrNull) return;
bloc.add(ShowPreview(
points: (bloc.state as OrderPreview).points,
selectedOptions:
(bloc.state as OrderPreview).selectedOptions,
couponCode: code));
})
],
).pSymmetric(v: 4)
],
),
);
}
}
typedef ServiceSelectCallback = void Function(
String serviceId, int intervalMinutes);
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/ride_safety_sheet_view.dart | import 'package:client_shared/components/ride_option_item.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:intl/intl.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:share_plus/share_plus.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class RideSafetySheetView extends StatelessWidget {
final CurrentOrderMixin order;
const RideSafetySheetView({required this.order, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).ride_safety_title,
closeAction: () => Navigator.pop(context),
),
RideOptionItem(
icon: Ionicons.shield,
text: S.of(context).ride_safety_share_trip_information,
onPressed: () {
Navigator.pop(context);
var text = S.of(context).share_trip_text_locations(
order.addresses.last, order.addresses.first);
if (order.driver != null) {
text += S.of(context).share_trip_text_driver(
order.driver!.firstName ?? "",
order.driver!.lastName ?? "",
order.driver!.mobileNumber);
}
if (order.startTimestamp != null) {
text += S.of(context).share_trip_started_time(
DateFormat('HH:mm a').format(order.startTimestamp!),
(order.durationBest / 60) + order.waitMinutes);
} else {
text += S.of(context).share_trip_not_arrived_time(
(order.durationBest / 60) + order.waitMinutes);
}
Share.share(text);
}),
const SizedBox(height: 8),
Mutation(
options:
MutationOptions(document: SEND_S_O_S_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return RideOptionItem(
icon: Ionicons.warning,
text: S.of(context).ride_safety_sos,
onPressed: () {
Navigator.pop(context);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(S.of(context).sos_title),
content: Text(S.of(context).sos_body),
actions: [
TextButton(
onPressed: () async {
final distressArgs =
SendSOSArguments(orderId: order.id)
.toJson();
await runMutation(distressArgs)
.networkResult;
final snackBar = SnackBar(
content: Text(
S.of(context).sos_sent_alert));
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
Navigator.pop(context);
},
child: Text(
S.of(context).sos_ok_action,
style:
TextStyle(color: Color(0xffb20d0e)),
)),
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(S.of(context).action_cancel))
],
);
});
});
}),
],
));
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/drawer_logged_in.dart | import 'package:client_shared/config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:hive/hive.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:ridy/address/address_list_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:ridy/main/bloc/current_location_cubit.dart';
import 'package:ridy/main/bloc/jwt_cubit.dart';
import 'package:ridy/main/bloc/main_bloc.dart';
import 'package:ridy/main/bloc/rider_profile_cubit.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:url_launcher/url_launcher.dart';
import '../config.dart';
import 'package:velocity_x/velocity_x.dart';
class DrawerLoggedIn extends StatelessWidget {
final GetCurrentOrder$Query$Rider rider;
const DrawerLoggedIn({required this.rider, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: SingleChildScrollView(
child: Column(mainAxisSize: MainAxisSize.min, children: [
const SizedBox(
height: 48,
),
Row(
children: [
UserAvatarView(
urlPrefix: serverUrl,
url: rider.media?.address,
cornerRadius: 10,
size: 50,
backgroundColor: CustomTheme.primaryColors.shade300,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
rider.firstName != null || rider.lastName != null
? "${rider.firstName ?? " "} ${rider.lastName ?? " "}"
: "-",
style: Theme.of(context).textTheme.titleLarge,
),
),
],
),
const SizedBox(
height: 32,
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.person),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_profile,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'profile');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.notifications),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_announcements,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'announcements');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.wallet),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_wallet,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'wallet');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.compass),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_saved_locations,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) => BlocProvider.value(
value: BlocProvider.of<CurrentLocationCubit>(context),
child: const AddressListView(),
),
),
);
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.calendar),
minLeadingWidth: 20.0,
trailing:
BlocBuilder<MainBloc, MainBlocState>(builder: (context, state) {
if (state is! SelectingPoints || state.bookingsCount == 0) {
return const SizedBox(
width: 5,
height: 5,
);
}
return Container(
padding: const EdgeInsets.all(5),
decoration: BoxDecoration(
color: Colors.red, borderRadius: BorderRadius.circular(50)),
child: Text(
state.bookingsCount.toString(),
style: const TextStyle(color: Colors.white),
),
);
}),
title: Text(
S.of(context).menu_reserved_rides,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'reserves');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.time),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_trip_history,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'history');
},
),
if (!websiteUrl.isEmptyOrNull)
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.globe),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_website,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
launchUrl(Uri.parse(websiteUrl!));
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.information),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_about,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
showAboutDialog(
context: context,
applicationIcon: Image.asset(
'images/logo.png',
width: 100,
height: 100,
),
applicationVersion:
"${packageInfo.version} (Build ${packageInfo.buildNumber})",
applicationName: packageInfo.appName,
applicationLegalese:
S.of(context).copyright_notice(companyName));
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.log_out),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_logout,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () async {
await Hive.box('user').delete('jwt');
Future.delayed(const Duration(milliseconds: 200), () {
context.read<JWTCubit>().logOut();
});
Future.delayed(const Duration(milliseconds: 500), () {
context.read<RiderProfileCubit>().updateProfile(null);
});
//exit(1);
},
)
]),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/graphql_provider.dart | import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter/material.dart';
import 'package:ridy/config.dart';
import 'package:ridy/main/bloc/jwt_cubit.dart';
/*String get host {
if (Platform.isAndroid) {
return '10.0.2.2';
} else {
return 'localhost';
}
}
final client = getClient(
uri: "http://localhost:3001/graphql",
subscriptionUri: "ws:localhost:3001/graphql",
);
final cache = GraphQLCache(store: InMemoryStore());
GraphQLClient getClient({
required String uri,
String? subscriptionUri,
}) {
Link link = HttpLink(uri);
if (subscriptionUri != null) {
final WebSocketLink websocketLink = WebSocketLink(
subscriptionUri,
config: SocketClientConfig(
autoReconnect: true,
inactivityTimeout: Duration(seconds: 30),
),
);
// link = link.concat(websocketLink);
link = Link.split((request) => request.isSubscription, websocketLink, link);
}
return GraphQLClient(
cache: cache,
link: link,
);
}*/
ValueNotifier<GraphQLClient> clientFor(
{required String uri, required String subscriptionUri, String? jwtToken}) {
final WebSocketLink websocketLink = jwtToken != null
? WebSocketLink(subscriptionUri,
config: SocketClientConfig(
initialPayload: {"authToken": jwtToken},
inactivityTimeout: const Duration(minutes: 30)))
: WebSocketLink(subscriptionUri);
final HttpLink httpLink = jwtToken != null
? HttpLink(uri, defaultHeaders: {"Authorization": "Bearer $jwtToken"})
: HttpLink(uri);
final Link link =
Link.split((request) => request.isSubscription, websocketLink, httpLink);
//final GraphQLCache cache = GraphQLCache(store: HiveStore());
return ValueNotifier<GraphQLClient>(
GraphQLClient(
cache: GraphQLCache(),
link: link,
defaultPolicies: DefaultPolicies(
query: Policies(fetch: FetchPolicy.noCache),
mutate: Policies(fetch: FetchPolicy.noCache),
subscribe: Policies(fetch: FetchPolicy.noCache))),
);
}
/// Wraps the root application with the `graphql_flutter` client.
/// We use the cache for all state management.
class _MyGraphqlProvider extends StatelessWidget {
_MyGraphqlProvider(
{Key? key,
required this.child,
required String uri,
required String subscriptionUri,
String? jwt})
: client = clientFor(
uri: uri, subscriptionUri: subscriptionUri, jwtToken: jwt),
super(key: key);
final Widget child;
final ValueNotifier<GraphQLClient> client;
@override
Widget build(BuildContext context) {
return GraphQLProvider(
client: client,
child: child,
);
}
}
class MyGraphqlProvider extends StatelessWidget {
final Widget child;
const MyGraphqlProvider({required this.child, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BlocBuilder<JWTCubit, String?>(
builder: (context, state) {
return _MyGraphqlProvider(
uri: "${serverUrl}graphql",
subscriptionUri: "${wsUrl}graphql",
jwt: state,
child: child);
},
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/main/ride_options_sheet_view.dart | import 'package:client_shared/components/ride_option_item.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class RideOptionsSheetView extends StatelessWidget {
const RideOptionsSheetView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).ride_options_title,
closeAction: () => Navigator.pop(context),
),
RideOptionItem(
icon: Ionicons.time,
text: S.of(context).ride_options_wait_time_action,
onPressed: () =>
Navigator.pop(context, RideOptionsResult.waitTime)),
const SizedBox(height: 8),
RideOptionItem(
icon: Ionicons.pricetag,
text: S.of(context).action_coupon_code,
onPressed: () =>
Navigator.pop(context, RideOptionsResult.couponCode)),
const SizedBox(height: 8),
// TODO: Add redeem gift card code
// RideOptionItem(
// icon: Ionicons.gift,
// text: S.of(context).action_redeem_gift_card,
// onPressed: () =>
// Navigator.pop(context, RideOptionsResult.giftCode)),
// const SizedBox(height: 8),
RideOptionItem(
icon: Ionicons.close,
text: S.of(context).action_cancel_ride,
onPressed: () =>
Navigator.pop(context, RideOptionsResult.cancel)),
],
));
}
}
enum RideOptionsResult { none, waitTime, couponCode, giftCode, cancel }
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/main | mirrored_repositories/RideFlutter/rider-app/lib/main/map_providers/google_map_provider.dart | import 'dart:async';
import 'dart:ui';
import 'package:client_shared/config.dart';
import 'package:flutter/services.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:hive/hive.dart';
import 'package:osm_nominatim/osm_nominatim.dart';
import 'package:ridy/config.dart';
import 'package:ridy/location_selection/location_selection_parent_view.dart';
import 'package:ridy/main/bloc/current_location_cubit.dart';
import 'package:geolocator/geolocator.dart' as geo;
import '../bloc/main_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
class GoogleMapProvider extends StatefulWidget {
const GoogleMapProvider({Key? key}) : super(key: key);
@override
State<GoogleMapProvider> createState() => _GoogleMapProviderState();
}
class _GoogleMapProviderState extends State<GoogleMapProvider> {
final Completer<GoogleMapController> _controller = Completer();
LatLng? center;
var taxiMarker = getBytesFromAsset('images/marker_taxi.png', 96);
var positionMarker = getBytesFromAsset('images/marker.png', 128);
static final CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(fallbackLocation.latitude, fallbackLocation.longitude),
zoom: 14.4746,
);
@override
void initState() {
geo.Geolocator.getLastKnownPosition().then((value) async {
if (value == null) return;
(await _controller.future).animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: LatLng(value.latitude, value.longitude), zoom: 15),
),
);
});
// if (Platform.isAndroid) {
// AndroidGoogleMapsFlutter.useAndroidViewSurface = true;
// }
super.initState();
}
@override
Widget build(BuildContext context) {
return FutureBuilder(
future: Future.wait([taxiMarker, positionMarker]),
builder: (builder, AsyncSnapshot<List<Uint8List>> iconsBytesSnapshot) =>
BlocConsumer<MainBloc, MainBlocState>(
listener: (context, state) async {
if (state is SelectingPoints && center != null) {
(await _controller.future).animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: LatLng(center!.latitude, center!.longitude),
zoom: 15),
),
);
}
if (state is OrderPreview ||
state is OrderInProgress ||
state is OrderReview ||
state is OrderInvoice) {
(await _controller.future).animateCamera(
CameraUpdate.newLatLngBounds(
boundsFromLatLngList(state.markers
.map((e) => LatLng(
e.position.latitude, e.position.longitude))
.toList()),
50));
}
},
builder: (context, state) => Column(
children: [
Expanded(
child: GoogleMap(
initialCameraPosition: _kGooglePlex,
zoomGesturesEnabled: false,
rotateGesturesEnabled: false,
tiltGesturesEnabled: false,
scrollGesturesEnabled: false,
myLocationEnabled: true,
zoomControlsEnabled: false,
trafficEnabled: false,
myLocationButtonEnabled: false,
onCameraMove: (position) => center = position.target,
onCameraIdle: () async {
if (center == null) return;
setCurrentLocation(context, center!);
},
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
markers: state.markers
.map((e) => e.toGoogleMarker(
iconsBytesSnapshot.data?[0] ??
Uint8List.fromList([]),
iconsBytesSnapshot.data?[1] ??
Uint8List.fromList([])))
.toSet(),
),
),
SizedBox(
height: getStateSize(state),
)
],
),
));
}
void setCurrentLocation(BuildContext context, LatLng position) async {
final geocodeResult = await Nominatim.reverseSearch(
lat: position.latitude, lon: position.longitude, nameDetails: true);
final fullLocation = geocodeResult.toFullLocation();
try {
context.read<CurrentLocationCubit>().updateLocation(fullLocation);
// ignore: empty_catches
} catch (error) {}
final httpLink = HttpLink(
"${serverUrl}graphql",
);
final authLink = AuthLink(
getToken: () async => 'Bearer ${Hive.box('user').get('jwt')}',
);
Link link = authLink.concat(httpLink);
final GraphQLClient client = GraphQLClient(
cache: GraphQLCache(),
link: link,
);
final result = await client.mutate(MutationOptions(
document: GET_DRIVERS_LOCATION_QUERY_DOCUMENT,
variables: GetDriversLocationArguments(
point:
PointInput(lat: position.latitude, lng: position.longitude))
.toJson(),
fetchPolicy: FetchPolicy.noCache));
final locations = GetDriversLocation$Query.fromJson(result.data!)
.getDriversLocation
.map((e) => e.toLatLng())
.toList();
context.read<MainBloc>().add(SetDriversLocations(locations));
}
double getStateSize(MainBlocState state) {
if (state is SelectingPoints) return 140;
if (state is OrderPreview || state is OrderInProgress) return 390;
if (state is OrderLooking) return 160;
if (state is OrderReview || state is OrderInvoice) return 160;
return 0;
}
}
Future<Uint8List> getBytesFromAsset(String path, int width) async {
ByteData data = await rootBundle.load(path);
Codec codec = await instantiateImageCodec(data.buffer.asUint8List(),
targetWidth: width);
FrameInfo fi = await codec.getNextFrame();
return (await fi.image.toByteData(format: ImageByteFormat.png))!
.buffer
.asUint8List();
}
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
double? x0, x1, y0, y1;
for (LatLng latLng in list) {
if (x0 == null) {
x0 = x1 = latLng.latitude;
y0 = y1 = latLng.longitude;
} else {
if (latLng.latitude > (x1 ?? 0)) x1 = latLng.latitude;
if (latLng.latitude < x0) x0 = latLng.latitude;
if (latLng.longitude > (y1 ?? 0)) y1 = latLng.longitude;
if (latLng.longitude < (y0 ?? 0)) y0 = latLng.longitude;
}
}
return LatLngBounds(northeast: LatLng(x1!, y1!), southwest: LatLng(x0!, y0!));
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/main | mirrored_repositories/RideFlutter/rider-app/lib/main/map_providers/open_street_map_provider.dart | import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:latlong2/latlong.dart';
import 'package:osm_nominatim/osm_nominatim.dart';
import 'package:velocity_x/velocity_x.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
import '../../location_selection/location_selection_parent_view.dart';
import '../../location_selection/welcome_card/place_search_sheet_view.dart';
import '../bloc/current_location_cubit.dart';
import '../bloc/main_bloc.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:geolocator/geolocator.dart';
class OpenStreetMapProvider extends StatefulWidget {
const OpenStreetMapProvider({Key? key}) : super(key: key);
@override
OpenStreetMapState createState() => OpenStreetMapState();
}
class OpenStreetMapState extends State<OpenStreetMapProvider>
with TickerProviderStateMixin {
MapController? controller = MapController();
@override
Widget build(BuildContext context) {
var mainBloc = context.read<MainBloc>();
return FlutterMap(
mapController: controller,
options: MapOptions(
maxZoom: 20, zoom: 16, interactiveFlags: InteractiveFlag.none),
children: [
if (mapProvider == MapProvider.openStreetMap ||
(mapProvider == MapProvider.googleMap &&
mapBoxAccessToken.isEmptyOrNull))
openStreetTileLayer,
if (mapProvider == MapProvider.mapBox ||
(mapProvider == MapProvider.googleMap &&
!mapBoxAccessToken.isEmptyOrNull))
mapBoxTileLayer,
BlocBuilder<CurrentLocationCubit, FullLocation?>(
builder: (context, state) => state == null
? const SizedBox()
: CurrentLocationLayer(
followOnLocationUpdate: FollowOnLocationUpdate.once)),
BlocConsumer<MainBloc, MainBlocState>(listener: (context, state) {
if (state is OrderPreview) {
controller?.fitBounds(
LatLngBounds.fromPoints(
state.points.map((e) => e.latlng).toList()),
options: fitBoundsOptions);
}
if (state is StateWithActiveOrder) {
controller?.fitBounds(
LatLngBounds.fromPoints(state.currentOrder.points
.map((e) => e.toLatLng())
.toList()),
options: fitBoundsOptions);
}
}, builder: (context, state) {
return Stack(
children: [
if (state is OrderPreview &&
state.directions != null &&
state.directions!.isNotEmpty)
PolylineLayer(saveLayers: true, polylines: [
Polyline(
points: state.directions!,
strokeWidth: 5,
color: CustomTheme.primaryColors)
]),
if (state is StateWithActiveOrder &&
state.currentOrder.directions != null)
PolylineLayer(saveLayers: true, polylines: [
Polyline(
points: state.currentOrder.directions!
.map((e) => LatLng(e.lat, e.lng))
.toList(),
strokeWidth: 5,
color: CustomTheme.primaryColors)
]),
if (state is SelectingPoints)
FutureBuilder<List<Position?>>(
future: Future.wait([
if (!kIsWeb) Geolocator.getLastKnownPosition(),
Geolocator.getCurrentPosition()
]),
builder: (context, snapshot) {
if (snapshot.data?.first != null ||
snapshot.data?.last != null) {
WidgetsBinding.instance.addPostFrameCallback((_) {
setCurrentLocation(context, snapshot.data!);
});
}
return BlocConsumer<CurrentLocationCubit,
FullLocation?>(
listener: (context, currentLocation) {
// This is very important and could potentially fix the big bug we had
if (!mounted || currentLocation == null) return;
controller?.fitBounds(
LatLngBounds.fromPoints(state.driverLocations
.followedBy(
[currentLocation.latlng]).toList()),
options: fitBoundsOptions);
},
builder: (context, currentLocation) {
if (currentLocation == null) {
return const SizedBox();
}
return Query(
options: QueryOptions(
document:
GET_DRIVERS_LOCATION_QUERY_DOCUMENT,
variables: GetDriversLocationArguments(
point:
currentLocation.toPointInput())
.toJson()),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return const SizedBox();
}
final List<LatLng> locations =
GetDriversLocation$Query.fromJson(
result.data!)
.getDriversLocation
.map((e) => e.toLatLng())
.toList();
WidgetsBinding.instance
.addPostFrameCallback((_) {
mainBloc
.add(SetDriversLocations(locations));
});
return const SizedBox();
});
},
);
}),
MarkerLayer(
markers: state.markers
.map((e) => e.toFlutterMapMarker())
.toList())
],
);
})
]);
}
void setCurrentLocation(
BuildContext context, List<Position?> positions) async {
final position = positions.last ?? positions.first;
if (position == null) return;
final geocodeResult = await Nominatim.reverseSearch(
lat: position.latitude, lon: position.longitude, nameDetails: true);
final fullLocation = geocodeResult.toFullLocation();
try {
context.read<CurrentLocationCubit>().updateLocation(fullLocation);
controller?.move(LatLng(position.latitude, position.longitude), 16);
// ignore: empty_catches
} catch (error) {}
}
// void _animatedMapMove(LatLng destLocation, double destZoom) {
// // Create some tweens. These serve to split up the transition from one location to another.
// // In our case, we want to split the transition be<tween> our current map center and the destination.
// final _latTween = Tween<double>(
// begin: mapController.center.latitude, end: destLocation.latitude);
// final _lngTween = Tween<double>(
// begin: mapController.center.longitude, end: destLocation.longitude);
// final _zoomTween = Tween<double>(begin: mapController.zoom, end: destZoom);
// // Create a animation controller that has a duration and a TickerProvider.
// var controller = AnimationController(
// duration: const Duration(milliseconds: 500), vsync: this);
// // The animation determines what path the animation will take. You can try different Curves values, although I found
// // fastOutSlowIn to be my favorite.
// Animation<double> animation =
// CurvedAnimation(parent: controller, curve: Curves.fastOutSlowIn);
// controller.addListener(() {
// mapController.move(
// LatLng(_latTween.evaluate(animation), _lngTween.evaluate(animation)),
// _zoomTween.evaluate(animation));
// });
// animation.addStatusListener((status) {
// if (status == AnimationStatus.completed) {
// controller.dispose();
// } else if (status == AnimationStatus.dismissed) {
// controller.dispose();
// }
// });
// controller.forward();
// }
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/main | mirrored_repositories/RideFlutter/rider-app/lib/main/bloc/main_bloc.dart | import 'dart:typed_data';
import 'package:client_shared/components/marker_new.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart' as google;
import 'package:latlong2/latlong.dart';
import 'package:ridy/location_selection/location_selection_parent_view.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
import 'package:collection/collection.dart';
// Events
abstract class MainBlocEvent {}
class MapMoved extends MainBlocEvent {
LatLng latlng;
MapMoved(this.latlng);
}
class ResetState extends MainBlocEvent {}
class DriverLocationUpdatedEvent extends MainBlocEvent {
PointMixin location;
DriverLocationUpdatedEvent(this.location);
}
class ShowPreview extends MainBlocEvent {
List<FullLocation> points;
List<String> selectedOptions;
String? couponCode;
ShowPreview(
{required this.points, required this.selectedOptions, this.couponCode});
}
class SelectService extends MainBlocEvent {
GetFare$Query$CalculateFareDTO$ServiceCategory$Service service;
SelectService(this.service);
}
class ShowPreviewDirections extends MainBlocEvent {
List<GetFare$Query$CalculateFareDTO$Point> directions;
ShowPreviewDirections({required this.directions});
}
class SelectBookingTime extends MainBlocEvent {
DateTime time;
SelectBookingTime(this.time);
}
class ProfileUpdated extends MainBlocEvent {
GetCurrentOrder$Query$Rider profile;
PointMixin? driverLocation;
ProfileUpdated({required this.profile, this.driverLocation});
}
class VersionStatusEvent extends MainBlocEvent {
VersionStatus status;
VersionStatusEvent(this.status);
}
class CurrentOrderUpdated extends MainBlocEvent {
CurrentOrderMixin order;
PointMixin? driverLocation;
CurrentOrderUpdated(this.order, {this.driverLocation});
}
class SetDriversLocations extends MainBlocEvent {
List<LatLng> driversLocations;
SetDriversLocations(this.driversLocations);
}
// States
abstract class MainBlocState {
List<MarkerDataInterface> markers;
bool isInteractive;
int bookedOrdersCount;
MainBlocState(
{required this.isInteractive,
required this.markers,
this.bookedOrdersCount = 0});
}
class RequireUpdateState extends MainBlocState {
RequireUpdateState() : super(isInteractive: false, markers: []);
}
class SelectingPoints extends MainBlocState {
List<FullLocation> points = [];
List<LatLng> driverLocations = [];
bool loadDrivers;
int bookingsCount = 0;
SelectingPoints(this.points, this.driverLocations, this.loadDrivers,
{this.bookingsCount = 0})
: super(
isInteractive: true,
markers: driverLocations
.mapIndexed((index, e) =>
MarkerDataDriver(id: index.toString(), position: e))
.toList());
}
class OrderPreview extends MainBlocState {
List<FullLocation> points = [];
List<String> selectedOptions = [];
String? couponCode;
GetFare$Query$CalculateFareDTO$ServiceCategory$Service? selectedService;
List<LatLng>? directions;
OrderPreview(
{required this.points,
required this.selectedOptions,
this.selectedService,
required this.directions,
this.couponCode})
: super(
isInteractive: false,
markers: points
.mapIndexed((index, element) => MarkerDataPosition(
id: index.toString(),
position: element.latlng,
address: element.address))
.toList());
}
class StateWithActiveOrder extends MainBlocState {
CurrentOrderMixin currentOrder;
List<FullLocation> locations;
List<MarkerDataInterface> visibleMarkers;
StateWithActiveOrder(this.currentOrder,
{required this.locations, required this.visibleMarkers})
: super(isInteractive: false, markers: visibleMarkers);
}
class OrderLooking extends StateWithActiveOrder {
CurrentOrderMixin order;
OrderLooking(this.order)
: super(order,
locations: order.addresses
.mapIndexed((index, e) => FullLocation(
latlng: order.points[index].toLatLng(),
address: order.addresses[index],
title: "title"))
.toList(),
visibleMarkers: order.points
.mapIndexed((index, element) => MarkerDataPosition(
id: index.toString(),
position: element.toLatLng(),
address: order.addresses[index]))
.toList());
}
class OrderInProgress extends StateWithActiveOrder {
CurrentOrderMixin order;
LatLng? driverLocation;
OrderInProgress(this.order, {this.driverLocation})
: super(order, locations: [], visibleMarkers: []) {
switch (order.status) {
case OrderStatus.driverAccepted:
case OrderStatus.arrived:
markers = <MarkerDataInterface>[
MarkerDataPosition(
id: order.points[0].lat.toString(),
position: LatLng(order.points[0].lat, order.points[0].lng),
address: order.addresses[0])
];
break;
case OrderStatus.started:
markers = order.points
.sublist(1)
.mapIndexed<MarkerDataInterface>((index, point) =>
MarkerDataPosition(
id: point.lat.toString(),
position: LatLng(point.lat, point.lng),
address: order.addresses[index]))
.toList();
break;
default:
}
if (driverLocation != null) {
markers = markers.followedBy([
MarkerDataDriver(
id: driverLocation!.latitude.toString(), position: driverLocation!)
]).toList();
}
}
}
class OrderInvoice extends StateWithActiveOrder {
CurrentOrderMixin order;
OrderInvoice(this.order)
: super(order,
locations: [],
visibleMarkers: order.points
.mapIndexed((index, element) => MarkerDataPosition(
id: index.toString(),
position: element.toLatLng(),
address: order.addresses[index]))
.toList());
}
class OrderReview extends StateWithActiveOrder {
CurrentOrderMixin order;
OrderReview(this.order)
: super(order,
locations: [],
visibleMarkers: order.points
.mapIndexed((index, element) => MarkerDataPosition(
id: index.toString(),
position: element.toLatLng(),
address: order.addresses[index]))
.toList());
}
class MainBloc extends Bloc<MainBlocEvent, MainBlocState> {
MainBloc() : super(SelectingPoints([], [], true)) {
on<VersionStatusEvent>(((event, emit) => emit(RequireUpdateState())));
on<ResetState>((event, emit) => emit(SelectingPoints([], [], true)));
on<ShowPreview>((event, emit) => emit(OrderPreview(
points: event.points,
selectedOptions: event.selectedOptions,
couponCode: event.couponCode,
directions: [])));
on<SelectService>((event, emit) => emit(OrderPreview(
points: (state as OrderPreview).points,
selectedOptions: (state as OrderPreview).selectedOptions,
couponCode: (state as OrderPreview).couponCode,
selectedService: event.service,
directions: (state as OrderPreview).directions)));
on<ShowPreviewDirections>((event, emit) {
emit(OrderPreview(
points: (state as OrderPreview).points,
selectedOptions: (state as OrderPreview).selectedOptions,
couponCode: (state as OrderPreview).couponCode,
selectedService: (state as OrderPreview).selectedService,
directions:
event.directions.map((e) => LatLng(e.lat, e.lng)).toList()));
});
on<ProfileUpdated>((event, emit) {
LatLng? driverLocation = event.driverLocation?.toLatLng();
if (driverLocation == null &&
state is OrderInProgress &&
(state as OrderInProgress).driverLocation != null) {
driverLocation = (state as OrderInProgress).driverLocation;
}
int bookings = event.profile.bookedOrders.first.count?.id ?? 0;
if (event.profile.orders.isEmpty && state is StateWithActiveOrder) {
emit(SelectingPoints([], [], true, bookingsCount: bookings));
return;
}
if (event.profile.orders.isEmpty &&
(state is SelectingPoints || state is OrderPreview)) {
return;
}
GetCurrentOrder$Query$Rider$Order order = event.profile.orders.first;
switch (order.status) {
case OrderStatus.requested:
case OrderStatus.notFound:
case OrderStatus.noCloseFound:
case OrderStatus.found:
case OrderStatus.booked:
emit(OrderLooking(order));
return;
case OrderStatus.driverAccepted:
case OrderStatus.arrived:
case OrderStatus.started:
emit(OrderInProgress(order, driverLocation: driverLocation));
return;
case OrderStatus.expired:
case OrderStatus.finished:
case OrderStatus.riderCanceled:
case OrderStatus.driverCanceled:
case OrderStatus.artemisUnknown:
if (state is! SelectingPoints || state is! OrderPreview) {
emit(SelectingPoints([], [], true, bookingsCount: bookings));
}
return;
case OrderStatus.waitingForPostPay:
case OrderStatus.waitingForPrePay:
emit(OrderInvoice(order));
return;
case OrderStatus.waitingForReview:
emit(OrderReview(order));
return;
}
});
on<CurrentOrderUpdated>(((event, emit) {
LatLng? driverLocation = event.driverLocation?.toLatLng();
if (driverLocation == null &&
state is OrderInProgress &&
(state as OrderInProgress).driverLocation != null) {
driverLocation = (state as OrderInProgress).driverLocation;
}
if (state is StateWithActiveOrder) {
// ignore: no_leading_underscores_for_local_identifiers
final _state = state as StateWithActiveOrder;
if (_state.currentOrder.status == event.order.status &&
_state.currentOrder.costAfterCoupon ==
event.order.costAfterCoupon) {
return;
}
}
switch (event.order.status) {
case OrderStatus.requested:
case OrderStatus.notFound:
case OrderStatus.noCloseFound:
case OrderStatus.found:
case OrderStatus.booked:
emit(OrderLooking(event.order));
return;
case OrderStatus.driverAccepted:
case OrderStatus.arrived:
case OrderStatus.started:
emit(OrderInProgress(event.order, driverLocation: driverLocation));
return;
case OrderStatus.expired:
case OrderStatus.finished:
case OrderStatus.riderCanceled:
case OrderStatus.driverCanceled:
case OrderStatus.artemisUnknown:
emit(SelectingPoints([], [], true, bookingsCount: 0));
return;
case OrderStatus.waitingForPostPay:
case OrderStatus.waitingForPrePay:
emit(OrderInvoice(event.order));
return;
case OrderStatus.waitingForReview:
emit(OrderReview(event.order));
return;
}
}));
on<DriverLocationUpdatedEvent>((event, emit) {
if (state is OrderInProgress) {
emit(OrderInProgress((state as OrderInProgress).currentOrder,
driverLocation: LatLng(event.location.lat, event.location.lng)));
}
});
on<SetDriversLocations>((event, emit) {
if (state is SelectingPoints &&
(state as SelectingPoints).driverLocations.length ==
event.driversLocations.length) return;
if (state is! SelectingPoints) return;
emit(SelectingPoints(
(state as SelectingPoints).points, event.driversLocations, false,
bookingsCount: (state as SelectingPoints).bookingsCount));
});
}
}
abstract class MarkerDataInterface {
String id;
LatLng position;
MarkerDataInterface({required this.id, required this.position});
Marker toFlutterMapMarker();
google.Marker toGoogleMarker(
Uint8List carIconBytes, Uint8List positionIconBytes);
}
class MarkerDataPosition extends MarkerDataInterface {
String address;
MarkerDataPosition(
{required this.address, required String id, required LatLng position})
: super(id: id, position: position);
@override
google.Marker toGoogleMarker(
Uint8List carIconBytes, Uint8List positionIconBytes) {
return google.Marker(
markerId: google.MarkerId(id),
position: google.LatLng(position.latitude, position.longitude),
icon: google.BitmapDescriptor.fromBytes(positionIconBytes));
}
@override
Marker toFlutterMapMarker() {
return Marker(
width: 240,
height: 63,
point: position,
anchorPos: AnchorPos.exactly(Anchor(120, 1)),
builder: (context) => MarkerNew(address: address));
}
}
class MarkerDataDriver extends MarkerDataInterface {
String assetAddress = 'images/marker_taxi.png';
MarkerDataDriver({required String id, required LatLng position})
: super(id: id, position: position);
@override
google.Marker toGoogleMarker(
Uint8List carIconBytes, Uint8List positionIconBytes) {
return google.Marker(
markerId: google.MarkerId(id),
position: google.LatLng(position.latitude, position.longitude),
icon: google.BitmapDescriptor.fromBytes(carIconBytes));
}
@override
Marker toFlutterMapMarker() {
return Marker(
width: 48,
height: 48,
point: position,
builder: (context) => Image.asset(assetAddress));
}
}
extension RiderAddressToFullLocation on CurrentOrderMixin$Point {
LatLng toLatLng() {
return LatLng(lat, lng);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/main | mirrored_repositories/RideFlutter/rider-app/lib/main/bloc/current_location_cubit.dart | import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
class CurrentLocationCubit extends Cubit<FullLocation?> {
CurrentLocationCubit() : super(null);
void updateLocation(FullLocation location) {
if (state == null ||
state!.latlng.latitude - location.latlng.latitude > 0.0001) {
emit(location);
}
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/main | mirrored_repositories/RideFlutter/rider-app/lib/main/bloc/jwt_cubit.dart | import 'package:flutter_bloc/flutter_bloc.dart';
class JWTCubit extends Cubit<String?> {
JWTCubit() : super(null);
login(String jwt) {
emit(jwt);
}
logOut() {
emit(null);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/main | mirrored_repositories/RideFlutter/rider-app/lib/main/bloc/rider_profile_cubit.dart | import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
class RiderProfileCubit extends Cubit<GetCurrentOrder$Query$Rider?> {
RiderProfileCubit() : super(null);
void updateProfile(GetCurrentOrder$Query$Rider? rider) {
emit(rider);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/announcements/announcements_list_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:shimmer/shimmer.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:intl/intl.dart';
import 'package:client_shared/components/empty_state_card_view.dart';
import 'package:client_shared/components/list_shimmer_skeleton.dart';
class AnnouncementsListView extends StatelessWidget {
const AnnouncementsListView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Query(
options:
QueryOptions(document: GET_ANNOUNCEMENTS_QUERY_DOCUMENT),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading) {
return Shimmer.fromColors(
baseColor: CustomTheme.neutralColors.shade300,
highlightColor: CustomTheme.neutralColors.shade100,
enabled: true,
child: const ListShimmerSkeleton(),
);
}
final announcements =
GetAnnouncements$Query.fromJson(result.data!)
.announcements
.edges;
if (announcements.isEmpty) {
return EmptyStateCard(
title: S.of(context).announcements_empty_state_title,
description:
S.of(context).announcements_empty_state_body,
icon: Ionicons.notifications_off_circle);
}
return Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: announcements.length,
itemBuilder: (context, index) {
return CupertinoButton(
padding: const EdgeInsets.all(0),
onPressed: announcements[index]
.node
.url
.isEmptyOrNull
? null
: () {
launchUrl(
Uri.parse(
announcements[index].node.url!),
mode: LaunchMode.externalApplication);
},
child: Card(
child: ListTile(
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
DateFormat('yyyy-MM-dd').format(
announcements[index].node.startAt),
style:
Theme.of(context).textTheme.caption,
),
Text(announcements[index].node.title),
],
),
subtitle:
Text(announcements[index].node.description)
.pOnly(top: 6),
).pOnly(bottom: 10, top: 8),
),
);
}),
);
}),
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/history/submit_complaint_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class SubmitComplaintView extends StatefulWidget {
final String orderId;
const SubmitComplaintView({Key? key, required this.orderId})
: super(key: key);
@override
State<SubmitComplaintView> createState() => _SubmitComplaintViewState();
}
class _SubmitComplaintViewState extends State<SubmitComplaintView> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
String? subject;
String? content;
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
top: 16,
right: 16,
left: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Text(S.of(context).issue_submit_title,
style: Theme.of(context).textTheme.headlineLarge),
const SizedBox(height: 8),
Text(S.of(context).issue_submit_description,
style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 16),
Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
initialValue: subject,
onChanged: (value) => setState(() {
subject = value;
}),
decoration: InputDecoration(
prefixIcon: const Icon(
Ionicons.ellipse,
color: CustomTheme.neutralColors,
size: 12,
),
isDense: true,
hintStyle: Theme.of(context).textTheme.labelLarge,
hintText: S.of(context).issue_subject_placeholder,
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).error_field_cant_be_empty;
}
return null;
},
),
const SizedBox(height: 12),
TextFormField(
initialValue: content,
onChanged: (value) => setState(() {
content = value;
}),
minLines: 3,
maxLines: 5,
decoration: InputDecoration(
isDense: true,
hintStyle: Theme.of(context).textTheme.labelLarge,
hintText: S.of(context).issue_description_placeholder,
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).error_field_cant_be_empty;
}
return null;
},
),
],
),
),
const Spacer(),
Mutation(
options:
MutationOptions(document: SUBMIT_COMPLAINT_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: content.isEmptyOrNull || subject.isEmptyOrNull
? null
: () async {
await runMutation(SubmitComplaintArguments(
id: widget.orderId,
subject: subject!,
content: content!)
.toJson())
.networkResult;
Navigator.pop(context);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Text(S
.of(context)
.complaint_submit_success_message),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child:
Text(S.of(context).action_ok))
]);
});
},
child: Text(S.of(context).issue_submit_button)),
);
})
]),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/history/trip_history_details_view.dart | import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:latlong2/latlong.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:client_shared/components/marker_new.dart';
import 'package:ridy/history/submit_complaint_view.dart';
import 'package:ridy/query_result_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:intl/intl.dart';
import 'package:velocity_x/velocity_x.dart';
import '../config.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
// ignore: must_be_immutable
class TripHistoryDetailsView extends StatelessWidget {
final String orderId;
MapController? controller;
TripHistoryDetailsView({required this.orderId, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 8),
Expanded(
child: Query(
options: QueryOptions(
document: GET_ORDER_DETAILS_QUERY_DOCUMENT,
variables:
GetOrderDetailsArguments(id: orderId).toJson()),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
final order =
GetOrderDetails$Query.fromJson(result.data!).order!;
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
DateFormat('MMM.dd.yyyy')
.format(order.expectedTimestamp),
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 8),
Container(
height: 300,
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
color: Color(0x10000000),
offset: Offset(1, 2),
blurRadius: 20)
]),
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
child: FlutterMap(
mapController: controller,
options: MapOptions(
interactiveFlags: InteractiveFlag.none,
onMapReady: () {
Future.delayed(
const Duration(milliseconds: 500),
() {
controller?.fitBounds(
LatLngBounds.fromPoints(order.points
.map((e) => e.toLatLng())
.toList()),
options: const FitBoundsOptions(
padding: EdgeInsets.symmetric(
horizontal: 130,
vertical: 65)));
});
},
),
children: [
if (mapProvider ==
MapProvider.openStreetMap ||
(mapProvider == MapProvider.googleMap &&
mapBoxAccessToken.isEmptyOrNull))
openStreetTileLayer,
if (mapProvider == MapProvider.mapBox ||
(mapProvider == MapProvider.googleMap &&
!mapBoxAccessToken.isEmptyOrNull))
mapBoxTileLayer,
MarkerLayer(
markers: order.points
.asMap()
.entries
.map((e) => Marker(
width: 240,
height: 63,
point: e.value.toLatLng(),
builder: (context) => MarkerNew(
address: order
.addresses[e.key])))
.toList())
],
),
),
),
Container(
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: BorderRadius.circular(18)),
child: Row(
children: [
Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
if (order.driver != null)
Row(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Text(
("${order.driver?.firstName ?? ""} ${order.driver?.lastName ?? ""}"),
style: Theme.of(context)
.textTheme
.headlineMedium,
),
const SizedBox(width: 8),
const Icon(
Ionicons.star,
color: Color(0xffefc868),
size: 15,
),
const SizedBox(width: 4),
Text(
order.driver?.rating
?.toString() ??
"-",
style: Theme.of(context)
.textTheme
.labelSmall,
)
],
),
Text(
order.service.name,
style: Theme.of(context)
.textTheme
.labelSmall,
),
const SizedBox(height: 8),
Text(
order.driver?.car?.name ?? "-",
style: Theme.of(context)
.textTheme
.titleSmall,
),
const SizedBox(height: 8),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: CustomTheme
.primaryColors.shade400,
borderRadius:
BorderRadius.circular(10)),
child: Text(
order.driver?.carPlate ?? "Unknown",
style: Theme.of(context)
.textTheme
.titleSmall,
),
)
]),
const Spacer(),
Stack(
children: [
Padding(
padding: const EdgeInsets.only(
bottom: 8,
top: 8,
right: 8,
left: 8),
child: Image.network(
serverUrl +
order.service.media.address,
width: 80,
height: 80),
),
if (order.driver?.media != null)
Positioned(
top: 0,
right: 0,
child: UserAvatarView(
urlPrefix: serverUrl,
url: order
.driver?.media?.address,
cornerRadius: 30,
size: 15)),
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: CustomTheme
.primaryColors.shade400,
borderRadius:
BorderRadius.circular(10)),
child: Center(
child: Text(
NumberFormat.simpleCurrency(
name: order.currency)
.format(
order.costAfterCoupon),
style: Theme.of(context)
.textTheme
.headlineMedium,
),
),
))
],
)
],
),
),
Container(
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
color: CustomTheme.primaryColors.shade100),
child: Row(children: [
Text(
S.of(context).payment_method_title,
style:
Theme.of(context).textTheme.titleMedium,
),
const Spacer(),
if (order.paymentGateway == null)
const Icon(
Ionicons.cash,
color: CustomTheme.neutralColors,
),
if (order.paymentGateway?.media != null)
Image.network(
serverUrl +
order.paymentGateway!.media!.address,
width: 24,
height: 24,
),
const SizedBox(width: 8),
Text(
order.paymentGateway == null
? S.of(context).payment_in_cash
: order.paymentGateway!.title,
style: Theme.of(context).textTheme.bodySmall,
)
]),
),
Container(
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
color: CustomTheme.primaryColors.shade100),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.stretch,
children: [
Text(
S.of(context).trip_information_title,
style: Theme.of(context)
.textTheme
.titleMedium,
),
Row(
children: [
Icon(
Ionicons.navigate,
color: CustomTheme
.neutralColors.shade500,
),
const SizedBox(width: 6),
Expanded(
child: Text(
order.addresses.first,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(
overflow:
TextOverflow.ellipsis),
),
),
const SizedBox(width: 6),
Text(
order.startTimestamp != null
? DateFormat('HH:mm a').format(
order.startTimestamp!)
: "-",
style: Theme.of(context)
.textTheme
.labelSmall)
],
),
const Padding(
padding: EdgeInsets.only(
left: 12, top: 4, bottom: 4),
child: DottedLine(
direction: Axis.vertical,
dashColor: CustomTheme.neutralColors,
lineLength: 20,
lineThickness: 2.0,
),
),
Row(
children: [
Icon(
Ionicons.location,
color: CustomTheme
.neutralColors.shade500,
),
const SizedBox(width: 6),
Expanded(
child: Text(
order.addresses.last,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(
overflow:
TextOverflow.ellipsis),
),
),
const SizedBox(width: 6),
Text(
order.finishTimestamp != null
? DateFormat('HH:mm a').format(
order.finishTimestamp!)
: "-",
style: Theme.of(context)
.textTheme
.labelSmall)
],
)
]),
),
const SizedBox(height: 50)
],
),
);
}),
),
SizedBox(
width: double.infinity,
child: OutlinedButton(
onPressed: () async {
showBarModalBottomSheet(
context: context,
builder: (context) {
return SubmitComplaintView(orderId: orderId);
});
},
style: OutlinedButton.styleFrom(
backgroundColor: Colors.transparent,
side:
const BorderSide(width: 1.5, color: Color(0xffed4346)),
),
child: Text(
S.of(context).issue_submit_button,
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(color: const Color(0xffb20d0e)),
),
),
)
],
)),
);
}
}
extension PointMixinHeper on PointMixin {
LatLng toLatLng() {
return LatLng(lat, lng);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/history/trip_history_list_view.dart | import 'package:client_shared/components/empty_state_card_view.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:ridy/history/trip_history_details_view.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../query_result_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:client_shared/components/trip_history_item_view.dart';
class TripHistoryListView extends StatefulWidget {
const TripHistoryListView({Key? key}) : super(key: key);
@override
State<TripHistoryListView> createState() => _TripHistoryListViewState();
}
class _TripHistoryListViewState extends State<TripHistoryListView> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Query(
options: QueryOptions(
document: GET_HISTORY_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.hasException || result.isLoading) {
return Expanded(child: QueryResultView(result));
}
final query = GetHistory$Query.fromJson(result.data!);
final orders = query.orders.edges;
if (orders.isEmpty) {
return EmptyStateCard(
title: S.of(context).trip_history_empty_state_title,
description: S.of(context).trip_history_empty_state_message,
icon: Ionicons.cloud_offline,
);
}
return Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: orders.length,
itemBuilder: (context, index) {
final item = orders[index].node;
return TripHistoryItemView(
id: item.id,
canceledText: S.of(context).order_status_canceled,
title: item.service.name,
dateTime: item.createdOn,
currency: item.currency,
price: item.costAfterCoupon,
isCanceled:
item.status == OrderStatus.riderCanceled ||
item.status == OrderStatus.driverCanceled,
onPressed: (id) {
Navigator.of(context).push(
MaterialPageRoute(
builder: (_) =>
TripHistoryDetailsView(orderId: id),
),
);
// showBarModalBottomSheet(
// context: context,
// builder: (context) {
// return TripHistoryDetailsView(
// orderId: id,
// );
// });
});
}),
);
},
),
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/login/login_verification_code_view.dart | import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:pinput/pinput.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../main/bloc/jwt_cubit.dart';
class LoginVerificationCodeView extends StatefulWidget {
final String verificationId;
const LoginVerificationCodeView({Key? key, required this.verificationId})
: super(key: key);
@override
State<LoginVerificationCodeView> createState() =>
_LoginVerificationCodeViewState();
}
class _LoginVerificationCodeViewState extends State<LoginVerificationCodeView> {
bool isLoading = false;
final TextEditingController codeController = TextEditingController();
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
left: 16,
right: 16,
top: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Mutation(
options: MutationOptions(
document:
LoginMutation(variables: LoginArguments(firebaseToken: ""))
.document),
builder: (RunMutation runMutation, QueryResult? result) {
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SheetTitleView(
title: S.of(context).login_verify_code_title,
closeAction: () => Navigator.pop(context),
),
Text(
S.of(context).login_verify_code_body,
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 8),
Row(
children: [
if (isLoading)
const Flexible(
child: Padding(
padding: EdgeInsets.all(12),
child: Center(child: CupertinoActivityIndicator()),
)),
if (!isLoading)
Flexible(
child: Pinput(
length: 6,
controller: codeController,
autofocus: true,
onCompleted: (value) {
setState(() {
isLoading = true;
});
login(value, runMutation);
},
),
)
],
),
]);
}));
}
void login(String code, RunMutation runMutation) async {
final PhoneAuthCredential credential = PhoneAuthProvider.credential(
verificationId: widget.verificationId, smsCode: code);
try {
final UserCredential cr =
await FirebaseAuth.instance.signInWithCredential(credential);
final String? firebaseToken = await cr.user?.getIdToken();
final QueryResult? qe =
await runMutation({"firebaseToken": firebaseToken}).networkResult;
if (qe?.data == null) {
codeController.clear();
final snackBar =
SnackBar(content: Text("Unable to connect to the backend"));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
setState(() {
isLoading = false;
});
return;
}
final String jwt = Login$Mutation.fromJson(qe!.data!).login.jwtToken;
final Box box = await Hive.openBox('user');
box.put("jwt", jwt);
context.read<JWTCubit>().login(jwt);
if (!mounted) return;
Navigator.pop(context);
} on FirebaseAuthException catch (e) {
codeController.clear();
final snackBar = SnackBar(content: Text(e.message ?? e.code));
ScaffoldMessenger.of(context).showSnackBar(snackBar);
setState(() {
isLoading = false;
});
}
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/login/login_number_view.dart | import 'package:client_shared/config.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:country_codes/country_codes.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import '../login/login_verification_code_view.dart';
import '../main/bloc/jwt_cubit.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
class LoginNumberView extends StatefulWidget {
const LoginNumberView({Key? key}) : super(key: key);
@override
State<LoginNumberView> createState() => _LoginNumberViewState();
}
class _LoginNumberViewState extends State<LoginNumberView> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
String phoneNumber = "";
String countryCode = !kIsWeb
? (CountryCodes.detailsForLocale().dialCode ?? defaultCountryCode)
: defaultCountryCode;
bool agreedToTerms = false;
bool isLoading = false;
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
left: 16,
right: 16,
top: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Form(
key: _formKey,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SheetTitleView(
title: S.of(context).login_title,
closeAction: () => Navigator.pop(context),
),
Text(
S.of(context).login_body,
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 8),
Row(
children: [
Container(
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(10)),
child: CountryCodePicker(
boxDecoration: BoxDecoration(
color: CustomTheme.neutralColors.shade100,
borderRadius: BorderRadius.circular(10)),
initialSelection: countryCode,
onChanged: (code) => countryCode = code.dialCode!,
),
),
const SizedBox(width: 5),
Flexible(
child: TextFormField(
keyboardType: TextInputType.phone,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isDense: true,
hintText: S.of(context).login_cell_number_textfield_hint,
),
onChanged: (value) => phoneNumber = value,
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).login_cell_number_empty_error;
}
return null;
},
),
),
],
),
if (loginTermsAndConditionsUrl.isNotEmpty)
Row(
children: [
Checkbox(
value: agreedToTerms,
onChanged: (value) =>
setState(() => agreedToTerms = value ?? false)),
RichText(
text: TextSpan(children: [
TextSpan(
style: const TextStyle(color: Colors.black),
text: S.of(context).terms_and_condition_text),
TextSpan(
style: const TextStyle(color: Colors.blue),
text: S.of(context).terms_and_condition_button,
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(Uri.parse(loginTermsAndConditionsUrl));
})
])),
],
).pOnly(top: 8),
Container(
padding: const EdgeInsets.only(top: 20),
width: double.infinity,
child: Mutation(
options: MutationOptions(document: LOGIN_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return ElevatedButton(
onPressed: (!agreedToTerms &&
loginTermsAndConditionsUrl.isNotEmpty ||
(result?.isLoading ?? false))
? null
: () async {
if (!kIsWeb) {
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: countryCode + phoneNumber,
verificationCompleted:
(PhoneAuthCredential credential) async {
final UserCredential cr =
await FirebaseAuth.instance
.signInWithCredential(credential);
final String firebaseToken =
await cr.user!.getIdToken();
final QueryResult qe = await runMutation(
{"firebaseToken": firebaseToken})
.networkResult!;
final String jwt =
Login$Mutation.fromJson(qe.data!)
.login
.jwtToken;
final Box box =
await Hive.openBox('user');
box.put("jwt", jwt);
if (!mounted) return;
Navigator.pop(context);
context.read<JWTCubit>().login(jwt);
},
verificationFailed:
(FirebaseAuthException e) async {
if (e.message != null) {
showDialog(
context: context,
builder: (context) => AlertDialog(
content: Text(e.message!),
actions: [
TextButton(
onPressed: () {
Navigator.pop(
context);
},
child: Text(S
.of(context)
.action_ok))
],
));
}
await FirebaseCrashlytics.instance
.recordError(e, e.stackTrace,
reason: 'Login error');
},
codeSent: (String verificationId,
int? resendToken) async {
await showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints:
const BoxConstraints(maxWidth: 600),
builder: (context) {
return LoginVerificationCodeView(
verificationId: verificationId);
},
);
Navigator.pop(context);
},
codeAutoRetrievalTimeout:
(String verificationId) {},
);
} else {
//Navigator.pop(context);
final result = await FirebaseAuth.instance
.signInWithPhoneNumber(
countryCode + phoneNumber);
if (!mounted) return;
await showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints:
const BoxConstraints(maxWidth: 600),
builder: (context) {
return LoginVerificationCodeView(
verificationId:
result.verificationId);
},
);
Navigator.pop(context);
}
},
child: Text(S.of(context).action_continue));
}),
)
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/login/login_token_entry_view.dart | import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class LoginTokenEntryView extends StatefulWidget {
const LoginTokenEntryView({Key? key}) : super(key: key);
@override
State<LoginTokenEntryView> createState() => _LoginTokenEntryState();
}
class _LoginTokenEntryState extends State<LoginTokenEntryView> {
final myController = TextEditingController();
@override
void dispose() {
// Clean up the controller when the widget is disposed.
myController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(10),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 10),
const Text(
"Enter the JWT",
style: TextStyle(fontSize: 18, fontWeight: FontWeight.w700),
),
const SizedBox(height: 10),
const SizedBox(height: 10),
Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom),
child: Row(
children: [
const SizedBox(width: 5),
Flexible(
child: TextField(
controller: myController,
),
),
],
),
),
Container(
padding: const EdgeInsets.only(top: 20, bottom: 10),
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
final Box box = await Hive.openBox('user');
box.put("jwt", myController.text);
if (!mounted) return;
Navigator.pop(context);
},
style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(15), elevation: 0),
child: Text(
S.of(context).action_next,
style: const TextStyle(fontSize: 16),
),
),
)
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/onboarding/onboarding_get_rewards_view.dart | import 'package:client_shared/theme/theme.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class OnboardingGetRewards extends StatelessWidget {
final Function() onNextClicked;
const OnboardingGetRewards({Key? key, required this.onNextClicked})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Stack(
children: [
Flex(
direction: Axis.horizontal,
children: [
Flexible(
flex: 5,
child: Container(
height: 370,
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(70),
bottomRight: Radius.circular(70))),
),
),
const SizedBox(width: 50),
Flexible(
child: Container(
height: 370,
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(70),
bottomLeft: Radius.circular(70))),
),
),
],
),
Center(
child: Column(
children: [
const SizedBox(height: 24),
Container(
constraints:
const BoxConstraints(maxWidth: 400, maxHeight: 400),
child: Image.asset(
"images/onboarding-2.png",
),
),
const SizedBox(height: 24),
DotsIndicator(
dotsCount: 4,
position: 1,
decorator: DotsDecorator(
size: const Size.square(9.0),
activeSize: const Size(24.0, 9.0),
color: CustomTheme.neutralColors.shade300,
activeColor: CustomTheme.primaryColors,
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
),
),
],
),
),
],
),
const SizedBox(height: 32),
Text(
S.of(context).onboarding_second_page_title,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
child: Text(
S.of(context).onboarding_second_page_body,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodySmall,
),
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: () {
onNextClicked();
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 64),
child: Text(S.of(context).action_next),
))
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/onboarding/onboarding_welcome_view.dart | import 'package:client_shared/config.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class OnboardingWelcome extends StatelessWidget {
final Function() onNextClicked;
const OnboardingWelcome({Key? key, required this.onNextClicked})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Stack(
children: [
Flex(
direction: Axis.horizontal,
children: [
const SizedBox(width: 20),
Flexible(
child: Container(
height: 370,
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(70),
bottomLeft: Radius.circular(70))),
),
),
],
),
Center(
child: Column(
children: [
const SizedBox(height: 24),
Container(
constraints:
const BoxConstraints(maxWidth: 400, maxHeight: 400),
child: Image.asset(
"images/onboarding-1.png",
),
),
const SizedBox(height: 24),
DotsIndicator(
dotsCount: 4,
position: 0,
decorator: DotsDecorator(
size: const Size.square(9.0),
activeSize: const Size(24.0, 9.0),
color: CustomTheme.neutralColors.shade300,
activeColor: CustomTheme.primaryColors,
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
),
),
],
),
),
],
),
const SizedBox(height: 32),
Text(
S.of(context).onboarding_first_page_title(appName),
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
child: Text(
S.of(context).onboarding_first_page_body,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodySmall,
),
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: () {
onNextClicked();
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 64),
child: Text(S.of(context).action_next),
))
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/onboarding/onboarding_view.dart | import 'package:flutter/material.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'onboarding_get_rewards_view.dart';
import 'onboarding_language_view.dart';
import 'onboarding_sign_in.dart';
import 'onboarding_welcome_view.dart';
class OnBoardingView extends StatelessWidget {
final PageController pageController = PageController();
OnBoardingView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, packageInfo) {
return SafeArea(
child: Container(
padding: const EdgeInsets.only(top: 12),
child: Column(
children: [
Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.asset(
"images/logo.png",
width: 32,
height: 32,
),
),
const SizedBox(width: 8),
Text(
packageInfo.data?.appName ?? "",
style: Theme.of(context).textTheme.headlineMedium,
),
],
),
),
const SizedBox(height: 32),
Expanded(
child: PageView.builder(
controller: pageController,
itemCount: 4,
itemBuilder: (context, index) {
switch (index) {
case 0:
return OnboardingWelcome(
onNextClicked: () => nextPage());
case 1:
return OnboardingGetRewards(
onNextClicked: () => nextPage());
case 2:
return OnboardingLanguage(
onNextClicked: () => nextPage());
case 3:
return OnboardingSignIn(
onNextClicked: () => nextPage());
}
return OnboardingWelcome(
onNextClicked: () => nextPage(),
);
}),
)
],
),
),
);
}),
);
}
void nextPage() {
pageController.nextPage(
duration: const Duration(milliseconds: 250), curve: Curves.ease);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/onboarding/onboarding_language_view.dart | import 'dart:io';
import 'package:client_shared/theme/theme.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/material.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class OnboardingLanguage extends StatefulWidget {
final Function() onNextClicked;
static const Map<String, String> languages = {
"en": "English",
"es": "español",
"fr": "Français",
"de": "Deutsch",
"pt": "Português",
"it": "Italiano",
"sv": "Svenska",
"hi": "हिन्दी",
"id": "bahasa Indonesia",
"hy": "հայերեն",
"zh": "中文",
"ar": "عربى",
"ja": "日本",
"ko": "한국어",
"fa": "فارسی",
"ur": "اردو",
"bn": "বাংলা",
"am": "Amharic"
};
const OnboardingLanguage({Key? key, required this.onNextClicked})
: super(key: key);
@override
State<OnboardingLanguage> createState() => _OnboardingLanguageState();
}
class _OnboardingLanguageState extends State<OnboardingLanguage> {
String selectedLanguageCode = "en";
@override
void initState() {
String locale = Platform.localeName.split('_')[0];
Hive.openBox("settings").then((value) {
final languageCode = value.get("language", defaultValue: null);
if (languageCode == null) {
if (OnboardingLanguage.languages.containsKey(locale)) {
OnboardingLanguage.languages.keys
.firstWhere((element) => element == locale);
}
} else {
setState(() {
selectedLanguageCode = OnboardingLanguage.languages.keys
.cast<String?>()
.firstWhere((element) => element == languageCode,
orElse: () => null) ??
"en";
});
}
});
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Stack(
children: [
Flex(
direction: Axis.horizontal,
children: [
Flexible(
child: Container(
height: 370,
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(70),
bottomRight: Radius.circular(70))),
),
),
const SizedBox(width: 50),
Flexible(
flex: 5,
child: Container(
height: 370,
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(70),
bottomLeft: Radius.circular(70))),
),
),
],
),
Center(
child: Column(
children: [
const SizedBox(height: 24),
Container(
constraints:
const BoxConstraints(maxWidth: 400, maxHeight: 400),
child: Image.asset(
"images/onboarding-3.png",
),
),
const SizedBox(height: 24),
DotsIndicator(
dotsCount: 4,
position: 2,
decorator: DotsDecorator(
size: const Size.square(9.0),
activeSize: const Size(24.0, 9.0),
color: CustomTheme.neutralColors.shade300,
activeColor: CustomTheme.primaryColors,
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
),
),
],
),
),
],
),
const SizedBox(height: 16),
Text(
S.of(context).onboarding_select_language_title,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
child: SizedBox(
height: 130,
width: 200,
child: ValueListenableBuilder<Box>(
valueListenable:
Hive.box('settings').listenable(keys: ['language']),
builder: (context, box, widget) {
if (box.get('language') != null) {
selectedLanguageCode = box.get('language');
}
return ListView.builder(
itemCount: OnboardingLanguage.languages.length,
itemBuilder: (context, index) {
return AnimatedContainer(
duration: const Duration(milliseconds: 250),
margin: const EdgeInsets.symmetric(vertical: 4),
decoration: BoxDecoration(
border: Border.all(
color: OnboardingLanguage.languages.keys
.elementAt(index) ==
selectedLanguageCode
? CustomTheme.primaryColors.shade400
: CustomTheme.neutralColors.shade200,
width: 1.5),
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(8)),
child: Row(children: [
Radio<String>(
visualDensity: VisualDensity.compact,
value: OnboardingLanguage.languages.keys
.elementAt(index),
groupValue: selectedLanguageCode,
onChanged: (value) {
setState(() {
if (value != null) {
selectedLanguageCode = value;
}
});
Hive.box('settings').put('language', value);
}),
Text(
OnboardingLanguage.languages.values
.elementAt(index),
style: Theme.of(context).textTheme.titleMedium)
]),
);
});
}),
),
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: () {
widget.onNextClicked();
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 64),
child: Text(S.of(context).action_next),
))
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/onboarding/onboarding_sign_in.dart | import 'package:client_shared/theme/theme.dart';
import 'package:dots_indicator/dots_indicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hive/hive.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../login/login_number_view.dart';
import '../main/bloc/jwt_cubit.dart';
class OnboardingSignIn extends StatelessWidget {
final Function() onNextClicked;
const OnboardingSignIn({Key? key, required this.onNextClicked})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Stack(
children: [
Flex(
direction: Axis.horizontal,
children: [
Flexible(
flex: 5,
child: Container(
height: 370,
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(70),
bottomRight: Radius.circular(70))),
),
),
const SizedBox(width: 10)
],
),
Center(
child: Column(
children: [
const SizedBox(height: 24),
Container(
constraints:
const BoxConstraints(maxWidth: 400, maxHeight: 400),
child: Image.asset(
"images/onboarding-4.png",
),
),
const SizedBox(height: 24),
DotsIndicator(
dotsCount: 4,
position: 3,
decorator: DotsDecorator(
size: const Size.square(9.0),
activeSize: const Size(24.0, 9.0),
color: CustomTheme.neutralColors.shade300,
activeColor: CustomTheme.primaryColors,
activeShape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.0)),
),
),
],
),
),
],
),
const SizedBox(height: 32),
Text(
S.of(context).onboarding_sign_in_title,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 16),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 48),
child: Text(
S.of(context).onboarding_sign_in_body,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodySmall,
),
),
const SizedBox(height: 24),
ElevatedButton(
onPressed: () async {
await showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 600),
builder: (context) {
return BlocProvider.value(
value: context.read<JWTCubit>(),
child: const LoginNumberView(),
);
});
Hive.box('settings').put('onboarding', 1);
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 64),
child: Text(S.of(context).menu_login),
)),
const SizedBox(height: 16),
CupertinoButton(
child: Text(S.of(context).action_skip_for_now),
onPressed: () => Hive.box('settings').put('onboarding', 1))
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/profile/profile_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:client_shared/theme/theme.dart';
import '../config.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../main/bloc/jwt_cubit.dart';
import '../main/bloc/rider_profile_cubit.dart';
import '../query_result_view.dart';
import 'package:http/http.dart' as http;
import 'package:file_picker/file_picker.dart';
// ignore: must_be_immutable
class ProfileView extends StatefulWidget {
const ProfileView({Key? key}) : super(key: key);
@override
State<ProfileView> createState() => _ProfileViewState();
}
class _ProfileViewState extends State<ProfileView> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
TextEditingController firstNameController = TextEditingController();
TextEditingController lastNameController = TextEditingController();
TextEditingController emailController = TextEditingController();
Gender? gender;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Query(
options: QueryOptions(
document: GET_RIDER_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.hasException || result.isLoading) {
return QueryResultView(result);
}
final rider = GetRider$Query.fromJson(result.data!).rider!;
if (rider.firstName != null &&
firstNameController.value == null) {}
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
RidyBackButton(text: S.of(context).action_back),
const Spacer(),
PopupMenuButton(itemBuilder: (context) {
return [
PopupMenuItem(
child:
Text(S.of(context).action_delete_account),
onTap: () {
Future.delayed(
const Duration(seconds: 0),
() => showDialog(
context: context,
builder: (BuildContext ncontext) {
return AlertDialog(
title: Text(S
.of(context)
.message_delete_account_title),
content: Text(S
.of(context)
.message_delete_account_body),
actions: [
Row(
children: [
Padding(
padding:
const EdgeInsets.only(
left: 8),
child: Mutation(
options: MutationOptions(
document:
DELETE_USER_MUTATION_DOCUMENT),
builder: (RunMutation
runMutation,
QueryResult?
result) {
return TextButton(
onPressed:
() async {
await runMutation(
{})
.networkResult;
await Hive.box(
'user')
.delete(
'jwt');
await Hive.box(
'user')
.delete(
'jwt');
context
.read<
RiderProfileCubit>()
.updateProfile(
null);
context
.read<
JWTCubit>()
.logOut();
await Hive.box(
'user')
.delete(
'jwt');
context
.read<
RiderProfileCubit>()
.updateProfile(
null);
context
.read<
JWTCubit>()
.logOut();
Navigator.popUntil(
context,
(route) =>
route
.isFirst);
},
child: Text(
S
.of(context)
.action_delete_account,
textAlign:
TextAlign
.end,
style: TextStyle(
color: Color(
0xffb20d0e)),
));
}),
),
const Spacer(),
TextButton(
onPressed: () =>
Navigator.of(
context)
.pop(),
child: Text(
S
.of(context)
.action_cancel,
textAlign:
TextAlign.end,
))
],
),
],
);
}));
},
)
];
})
],
),
SingleChildScrollView(
child: Column(children: [
const SizedBox(height: 16),
Stack(
children: [
Padding(
padding: const EdgeInsets.all(8),
child: UserAvatarView(
urlPrefix: serverUrl,
url: rider.media?.address,
cornerRadius: 10,
size: 50,
),
),
Positioned(
right: 0,
bottom: 0,
child: Container(
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade300,
borderRadius: BorderRadius.circular(10)),
child: Icon(
Icons.add,
color: CustomTheme.neutralColors.shade500,
),
))
],
),
const SizedBox(height: 15),
Text(
"+${rider.mobileNumber}",
style: Theme.of(context).textTheme.headlineLarge,
),
CupertinoButton(
minSize: 0,
padding: const EdgeInsets.symmetric(
vertical: 4, horizontal: 0),
child: Text(S.of(context).action_add_photo),
onPressed: () async {
FilePickerResult? result = await FilePicker
.platform
.pickFiles(type: FileType.image);
if (result != null &&
result.files.single.path != null) {
await uploadFile(result.files.single.path!);
refetch!();
}
}),
Form(
key: _formKey,
child: Column(children: [
const SizedBox(height: 20),
TextFormField(
controller: firstNameController
..text = rider.firstName ?? "",
decoration: InputDecoration(
labelText: S.of(context).profile_firstname,
fillColor:
CustomTheme.primaryColors.shade100),
),
const SizedBox(height: 10),
TextFormField(
controller: lastNameController
..text = rider.lastName ?? "",
decoration: InputDecoration(
fillColor: CustomTheme.primaryColors.shade100,
labelText: S.of(context).profile_lastname),
),
const SizedBox(height: 10),
TextFormField(
controller: emailController
..text = rider.email ?? "",
decoration: InputDecoration(
fillColor: CustomTheme.primaryColors.shade100,
labelText: S.of(context).profile_email),
),
const SizedBox(height: 10),
DropdownButtonFormField<Gender>(
value: rider.gender,
decoration: InputDecoration(
fillColor:
CustomTheme.primaryColors.shade100,
labelText: S.of(context).profile_gender),
icon: const Icon(Ionicons.chevron_down),
items: <DropdownMenuItem<Gender>>[
DropdownMenuItem(
value: Gender.male,
child:
Text(S.of(context).enum_gender_male)),
DropdownMenuItem(
value: Gender.female,
child: Text(
S.of(context).enum_gender_female)),
DropdownMenuItem(
value: Gender.unknown,
child: Text(
S.of(context).enum_gender_unknown))
],
onChanged: (Gender? value) => gender = value),
]),
),
])),
const Spacer(),
Row(
children: [
Expanded(
child: Mutation(
options: MutationOptions(
document:
UPDATE_PROFILE_MUTATION_DOCUMENT),
builder: (RunMutation runMutation,
QueryResult? result) {
return ElevatedButton(
child: Text(S.of(context).action_save),
onPressed: () async {
if (_formKey.currentState?.validate() !=
true) return;
final args = UpdateProfileArguments(
firstName: firstNameController.text,
lastName: lastNameController.text,
email: emailController.text,
gender: gender);
await runMutation(args.toJson())
.networkResult;
refetch!();
},
);
}))
],
)
],
);
})));
}
uploadFile(String path) async {
var postUri = Uri.parse("${serverUrl}upload_profile");
var request = http.MultipartRequest("POST", postUri);
request.headers['Authorization'] =
'Bearer ${Hive.box('user').get('jwt').toString()}';
request.files.add(await http.MultipartFile.fromPath('file', path));
await request.send();
// var response = await http.Response.fromStream(streamedResponse);
// var json = jsonDecode(response.body);
// setState(() {});
// json['address'];
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/location_selection_parent_view.dart | import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:lifecycle/lifecycle.dart';
import 'package:osm_nominatim/osm_nominatim.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:ridy/location_selection/reservation_messages/looking_sheet_view.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
import 'package:ridy/main/bloc/current_location_cubit.dart';
import 'package:ridy/main/bloc/jwt_cubit.dart';
import 'package:ridy/main/bloc/rider_profile_cubit.dart';
import 'package:ridy/main/map_providers/google_map_provider.dart';
import 'package:ridy/main/map_providers/open_street_map_provider.dart';
import 'package:ridy/main/pay_for_ride_sheet_view.dart';
import 'package:ridy/main/rate_ride_sheet_view.dart';
import 'package:client_shared/theme/theme.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../main/bloc/main_bloc.dart';
import '../main/drawer_logged_in.dart';
import '../main/drawer_logged_out.dart';
import '../main/order_status_sheet_view.dart';
import '../main/service_selection_card_view.dart';
import 'welcome_card/welcome_card_view.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:latlong2/latlong.dart';
import 'package:geolocator/geolocator.dart';
// ignore: must_be_immutable
class LocationSelectionParentView extends StatelessWidget {
late GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
Refetch? refetch;
MapController? controller;
LocationSelectionParentView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
final mainBloc = context.read<MainBloc>();
final jwt = Hive.box('user').get('jwt').toString();
if (!jwt.isEmptyOrNull) {
context.read<JWTCubit>().login(jwt);
}
return Scaffold(
key: scaffoldKey,
drawer: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Drawer(
backgroundColor: CustomTheme.primaryColors.shade100,
child: BlocBuilder<RiderProfileCubit, GetCurrentOrder$Query$Rider?>(
builder: (context, state) => state == null
? const DrawerLoggedOut()
: DrawerLoggedIn(rider: state)),
),
),
body: Stack(children: [
if (mapProvider == MapProvider.mapBox ||
mapProvider == MapProvider.openStreetMap)
const OpenStreetMapProvider(),
if (mapProvider == MapProvider.googleMap) const GoogleMapProvider(),
LifecycleWrapper(
onLifecycleEvent: (event) {
if (event == LifecycleEvent.visible && refetch != null) {
refetch!();
}
},
child: FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
return BlocBuilder<JWTCubit, String?>(
builder: (context, jwtState) {
return Query(
options: QueryOptions(
document: GET_CURRENT_ORDER_QUERY_DOCUMENT,
variables: GetCurrentOrderArguments(
versionCode: int.parse(
snapshot.data?.buildNumber ?? "99999"))
.toJson(),
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading) {
return const Center(
child: CircularProgressIndicator.adaptive());
}
this.refetch = refetch;
final query = result.data != null
? GetCurrentOrder$Query.fromJson(result.data!)
: null;
if (result.data != null && query != null) {
context
.read<RiderProfileCubit>()
.updateProfile(query.rider!);
//mainBloc.add(ProfileUpdated(profile: query.rider!));
if (query.requireUpdate ==
VersionStatus.mandatoryUpdate) {
mainBloc
.add(VersionStatusEvent(query.requireUpdate));
} else {
WidgetsBinding.instance
.addPostFrameCallback((timeStamp) {
mainBloc.add(ProfileUpdated(
profile: query.rider!,
driverLocation:
query.getCurrentOrderDriverLocation));
});
}
}
return const SizedBox();
});
});
}),
),
BlocBuilder<MainBloc, MainBlocState>(builder: (context, state) {
return Stack(children: [
if (state is OrderPreview)
SmallBackFloatingActionButton(
onPressed: () => context.read<MainBloc>().add(ResetState())),
if (state is SelectingPoints)
MenuButton(
onPressed: () {
scaffoldKey.currentState?.openDrawer();
},
bookingCount: state.bookingsCount),
Container(
constraints: const BoxConstraints(maxWidth: 500),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).size.width >
CustomTheme.tabletBreakpoint
? 16
: 0),
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (state is SelectingPoints) const WelcomeCardView(),
if (state is OrderPreview) const ServiceSelectionCardView(),
if (state is StateWithActiveOrder)
Subscription(
options: SubscriptionOptions(
document: UPDATED_ORDER_SUBSCRIPTION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result) {
if (result.data != null) {
final order =
GetCurrentOrder$Query$Rider$Order.fromJson(
result.data!['orderUpdated']);
WidgetsBinding.instance.addPostFrameCallback((_) {
mainBloc.add(CurrentOrderUpdated(order));
});
}
if (state is OrderInProgress) {
return const OrderStatusSheetView();
}
if (state is OrderInvoice) {
return Mutation(
options: MutationOptions(
document: UPDATE_ORDER_MUTATION_DOCUMENT),
builder: (RunMutation runMutation,
QueryResult? result) {
return PayForRideSheetView(
onClosePressed: state.order.status ==
OrderStatus.waitingForPostPay
? null
: () async {
final result = await runMutation(
UpdateOrderArguments(
id:
state
.order.id,
update: UpdateOrderInput(
status: OrderStatus
.riderCanceled,
waitMinutes:
0,
tipAmount: 0))
.toJson())
.networkResult;
final order =
UpdateOrder$Mutation.fromJson(
result!.data!);
mainBloc.add(CurrentOrderUpdated(
order.updateOneOrder));
},
order: state.order,
);
});
}
if (state is OrderReview) {
return const RateRideSheetView();
}
if (state is OrderLooking) {
return const LookingSheetView();
}
return const Text("Unacceptable state");
}),
]),
).centered()
]);
})
]),
);
}
void setCurrentLocation(BuildContext context, Position position) async {
final geocodeResult = await Nominatim.reverseSearch(
lat: position.latitude, lon: position.longitude, nameDetails: true);
final fullLocation = geocodeResult.toFullLocation();
try {
context.read<CurrentLocationCubit>().updateLocation(fullLocation);
// ignore: empty_catches
} catch (error) {}
}
}
class SmallBackFloatingActionButton extends StatelessWidget {
final Function onPressed;
const SmallBackFloatingActionButton({
required this.onPressed,
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: FloatingActionButton.small(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
elevation: 2,
onPressed: () => onPressed(),
backgroundColor: CustomTheme.primaryColors.shade50,
child: Icon(
Ionicons.arrow_back,
color: CustomTheme.primaryColors.shade800,
),
),
);
}
}
class MenuButton extends StatelessWidget {
const MenuButton({
Key? key,
required this.onPressed,
required this.bookingCount,
}) : super(key: key);
final Function onPressed;
final int bookingCount;
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: FloatingActionButton(
heroTag: 'menuFab',
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
onPressed: () => onPressed(),
backgroundColor: Colors.white,
child: bookingCount == 0
? Icon(
Ionicons.menu,
color: CustomTheme.primaryColors.shade800,
)
: Container(
decoration: BoxDecoration(
color: Colors.red, borderRadius: BorderRadius.circular(50)),
child: SizedBox(
width: 25,
height: 25,
child: Center(
child: Text(
bookingCount.toString(),
style: const TextStyle(color: Colors.white),
),
),
),
),
),
);
}
}
extension PlaceToFullLocation on Place {
FullLocation toFullLocation() {
return FullLocation(
latlng: LatLng(lat, lon),
address: displayName,
title: nameDetails?['name'] ?? "");
}
}
extension PointMixinHelper on PointMixin {
LatLng toLatLng() {
return LatLng(lat, lng);
}
}
extension FullLocationHelper on FullLocation {
PointInput toPointInput() {
return PointInput(lat: latlng.latitude, lng: latlng.longitude);
}
}
const fitBoundsOptions = FitBoundsOptions(
padding: EdgeInsets.only(top: 100, bottom: 500, left: 130, right: 130));
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/location_selection | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/welcome_card/place_search_sheet_view.dart | import 'dart:async';
import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:osm_nominatim/osm_nominatim.dart';
import 'package:ridy/location_selection/welcome_card/place_confirm_sheet_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:latlong2/latlong.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:google_maps_webservice/places.dart';
import 'package:google_api_headers/google_api_headers.dart';
import 'package:latlong2/latlong.dart' as lat_lng;
import '../../config.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class PlaceSearchSheetView extends StatelessWidget {
final FullLocation? currentLocation;
const PlaceSearchSheetView(this.currentLocation, {Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => SuggestionsCubit(),
child: PlaceSearchSheetViewChild(currentLocation),
);
}
}
class PlaceSearchSheetViewChild extends StatefulWidget {
final FullLocation? currentLocation;
const PlaceSearchSheetViewChild(this.currentLocation, {Key? key})
: super(key: key);
@override
State<PlaceSearchSheetViewChild> createState() =>
_PlaceSearchSheetViewChildState();
}
class _PlaceSearchSheetViewChildState extends State<PlaceSearchSheetViewChild> {
bool showChooseOnMap = true;
Timer? _debounce;
List<FullLocation?> selectedLocations = [];
int selectedIndex = 1;
@override
initState() {
selectedIndex = widget.currentLocation == null ? 0 : 1;
selectedLocations = [null, null];
super.initState();
}
@override
void dispose() {
_debounce?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Row(children: [
IconButton(
onPressed: () => Navigator.pop(context),
icon: const Icon(Icons.close),
splashRadius: 20,
)
]),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: CustomTheme.neutralColors.shade100),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Column(
children: selectedLocations.mapIndexed((e, index) {
return Column(
children: [
Icon(
index == 0
? Ionicons.navigate
: (index == selectedLocations.length - 1
? Ionicons.location
: Ionicons.flag),
color: index == selectedLocations.length - 1
? CustomTheme.primaryColors
: CustomTheme.neutralColors,
).p4(),
if (index != selectedLocations.length - 1)
const DottedLine(
direction: Axis.vertical,
dashColor: CustomTheme.neutralColors,
lineLength: 20,
lineThickness: 2.0,
)
],
);
}).toList()),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
...selectedLocations.mapIndexed((location, index) {
final suggestionsCubit = context.read<SuggestionsCubit>();
return Column(
children: [
Row(
children: [
Expanded(
child: TextField(
autofocus: widget.currentLocation == null
? index == 0
: index == 1,
controller: TextEditingController(
text: location?.address),
onTap: (() {
setState(() {
if (!showChooseOnMap) {
showChooseOnMap = true;
}
});
selectedIndex = index;
}),
onChanged: (value) async {
if (value.isEmptyOrNull &&
suggestionsCubit
.state.suggestions.isNotEmpty) {
suggestionsCubit.clearSuggestions();
return;
}
if (!value.isEmptyOrNull) {
if (_debounce?.isActive ?? false) {
_debounce?.cancel();
}
_debounce = Timer(
const Duration(milliseconds: 500),
() async {
if (mapProvider == MapProvider.mapBox ||
mapProvider ==
MapProvider.openStreetMap) {
final res =
await Nominatim.searchByName(
query: value,
countryCodes:
nominatimCountries,
addressDetails: true,
nameDetails: true);
if (mounted) {
suggestionsCubit.showSuggestions(res
.map((e) =>
e.convertToFullLocation())
.toList());
}
} else if (mapProvider ==
MapProvider.googleMap) {
final placesAPI = GoogleMapsPlaces(
apiKey: placesApiKey,
apiHeaders:
await const GoogleApiHeaders()
.getHeaders(),
);
final placesPredictions =
await placesAPI
.autocomplete(value);
final fullLocations =
placesPredictions.predictions
.filter((element) =>
element.placeId != null)
.map((e) async {
final detail = await placesAPI
.getDetailsByPlaceId(
e.placeId!);
final location = detail
.result.geometry!.location;
return FullLocation(
latlng: lat_lng.LatLng(
location.lat, location.lng),
address: e.description ?? "",
title: detail.result.name);
}).toList();
final awaitedLocations =
await Future.wait(fullLocations);
if (mounted) {
suggestionsCubit.showSuggestions(
awaitedLocations);
}
}
});
}
},
decoration: noBorderInputDecoration.copyWith(
hintText: index == 0
? S.of(context).current_location
: (index <
selectedLocations.length - 1
? S.of(context).add_stop
: S.of(context).your_destination),
hintStyle: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color: index ==
selectedLocations.length -
1
? CustomTheme.primaryColors
: CustomTheme.neutralColors)),
),
),
if (index == selectedLocations.length - 1 &&
selectedLocations.length < 5)
CupertinoButton(
onPressed: () {
setState(() {
selectedLocations = selectedLocations
.followedBy([null]).toList();
});
},
padding: const EdgeInsets.all(4),
minSize: 0,
child: const Icon(
Icons.add,
color: CustomTheme.neutralColors,
),
),
if (index > 0 &&
index < selectedLocations.length - 1)
CupertinoButton(
onPressed: () {
setState(() {
selectedLocations = [
selectedLocations.first,
...selectedLocations.sublist(2)
];
});
},
padding: const EdgeInsets.all(4),
minSize: 0,
child: const Icon(
Icons.remove,
color: CustomTheme.neutralColors,
),
)
],
),
if (index < selectedLocations.length - 1)
const Divider(),
],
);
}),
],
),
)
],
).p4(),
).pOnly(right: 12, left: 12, bottom: 8),
Container(
height: 8,
decoration:
BoxDecoration(color: Colors.grey.shade50, boxShadow: const [
BoxShadow(
color: Color(0x0f000000),
offset: Offset(0, 2),
blurRadius: 12,
spreadRadius: 0)
]),
),
if (showChooseOnMap)
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.grey.shade300,
blurRadius: 1,
spreadRadius: -1,
offset: const Offset(0, -3)),
const BoxShadow(
color: Color(0xfff2f5fa), blurRadius: 10, spreadRadius: 5),
]),
child: Center(
child: CupertinoButton(
onPressed: () async {
final result = await showBarModalBottomSheet<FullLocation>(
enableDrag: false,
context: context,
builder: (context) {
return PlaceConfirmSheetView(widget.currentLocation);
});
if (result == null) return;
setLocation(result);
},
minSize: 0,
padding: const EdgeInsets.all(0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Ionicons.locate,
color: CustomTheme.neutralColors.shade600,
).pOnly(right: 8),
Text(
S.of(context).action_choose_on_map,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: CustomTheme.neutralColors.shade600),
),
],
),
),
),
),
Container(
height: 10,
color: Colors.grey.shade50,
),
BlocBuilder<SuggestionsCubit, SuggestionsState>(
builder: (context, state) {
if (state.suggestions.isEmpty) {
return const SizedBox();
// return Expanded(
// child: ValueListenableBuilder(
// valueListenable: Hive.box<List<LocationHistoryItem>>("history2")
// .listenable(),
// builder: (context, Box box, widget) => ListView.builder(
// itemCount: (box.get("items",
// defaultValue:
// List<LocationHistoryItem>.from([]))
// as List<LocationHistoryItem>)
// .length,
// itemBuilder: (context, index) {
// final historyItem = box.get("items",
// defaultValue:
// List<LocationHistoryItem>.from([]))[index]
// as LocationHistoryItem;
// return _recentSearch(
// context,
// FullLocation(
// latlng: historyItem.toLatLng(),
// address: historyItem.details,
// title: historyItem.name),
// true,
// (location) => setLocation(location));
// }),
// ),
// );
} else {
return Expanded(
child: ListView.builder(
itemCount: state.suggestions.length,
itemBuilder: ((context, index) {
return LocationSearchResultItem(
location: state.suggestions[index],
isHistory: false,
onSelected: (location) => setLocation(location));
})),
);
}
})
],
);
}
void setLocation(FullLocation location) {
selectedLocations[selectedIndex] = location;
if (selectedLocations
.withoutFirst()
.toList()
.indexWhere((element) => element == null) <
0) {
if (selectedLocations[0] == null && widget.currentLocation == null) {
showPickupLocationCanNotBeEmptyDialog(context);
return;
}
final List<FullLocation> locations = [
selectedLocations[0] ?? widget.currentLocation!,
...(selectedLocations.withoutFirst()).whereType<FullLocation>()
];
Navigator.pop(context, locations);
return;
}
setState(() {
selectedLocations[selectedIndex] = location;
});
}
void showPickupLocationCanNotBeEmptyDialog(BuildContext context) async {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(S.of(context).message_title_location),
content: Text(S.of(context).message_body_location),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child:
Text(S.of(context).action_ok, textAlign: TextAlign.end))
],
);
});
}
}
class LocationSearchResultItem extends StatelessWidget {
final FullLocation location;
final bool isHistory;
final Function(FullLocation) onSelected;
const LocationSearchResultItem(
{required this.location,
required this.isHistory,
required this.onSelected,
Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return CupertinoButton(
padding: EdgeInsets.zero,
onPressed: () async {
final result = await showBarModalBottomSheet<FullLocation>(
context: context,
enableDrag: false,
builder: (context) {
return PlaceConfirmSheetView(location);
});
if (result == null) return;
onSelected(result);
},
child: Column(
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
isHistory ? Ionicons.time : Ionicons.compass,
color: CustomTheme.neutralColors.shade400,
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
location.title,
style: Theme.of(context).textTheme.titleMedium,
).pOnly(bottom: 4),
Text(
location.address,
overflow: TextOverflow.fade,
style: Theme.of(context).textTheme.labelMedium,
)
],
).pOnly(left: 16),
)
],
).pSymmetric(h: 16, v: 8),
const Divider()
],
),
);
}
}
const noBorderInputDecoration = InputDecoration(
isDense: true,
contentPadding: EdgeInsets.all(8),
filled: false,
enabledBorder: OutlineInputBorder(borderSide: BorderSide.none),
focusedBorder: OutlineInputBorder(borderSide: BorderSide.none));
class FullLocation {
String title;
String address;
LatLng latlng;
FullLocation(
{required this.latlng, required this.address, required this.title});
}
extension ConvertToFullLocation on Place {
FullLocation convertToFullLocation() {
return FullLocation(
latlng: LatLng(lat, lon),
address: displayName,
title: nameDetails?['name'] ?? "Unknown");
}
}
class SuggestionsCubit extends Cubit<SuggestionsState> {
SuggestionsCubit() : super(SuggestionsState([]));
void clearSuggestions() => emit(SuggestionsState([]));
void showSuggestions(List<FullLocation> suggestions) =>
emit(SuggestionsState(suggestions));
}
class SuggestionsState {
List<FullLocation> suggestions = [];
SuggestionsState(this.suggestions);
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/location_selection | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/welcome_card/location_history_item.dart | import 'package:hive/hive.dart';
import 'package:latlong2/latlong.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
@HiveType(typeId: 0)
class LocationHistoryItem extends HiveObject {
@HiveField(0)
String name;
@HiveField(1)
String details;
@HiveField(2)
double lat;
@HiveField(3)
double lng;
LocationHistoryItem(
{required this.name,
required this.details,
required this.lat,
required this.lng});
}
extension LocationHistoryHelper on LocationHistoryItem {
LatLng toLatLng() {
return LatLng(lat, lng);
}
FullLocation toFullLocation(String address, String title) {
return FullLocation(latlng: toLatLng(), address: address, title: title);
}
}
extension FullLocationHelper on FullLocation {
LocationHistoryItem toLocationHistoryItem() {
return LocationHistoryItem(
name: title,
details: address,
lat: latlng.latitude,
lng: latlng.longitude);
}
}
class LocationHistoryItemAdapter extends TypeAdapter<LocationHistoryItem> {
@override
final int typeId = 0;
@override
LocationHistoryItem read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return LocationHistoryItem(
name: fields[0] as String,
details: fields[1] as String,
lat: fields[2] as double,
lng: fields[3] as double,
);
}
@override
void write(BinaryWriter writer, LocationHistoryItem obj) {
writer
..writeByte(4)
..writeByte(0)
..write(obj.name)
..writeByte(1)
..write(obj.details)
..writeByte(2)
..write(obj.lat)
..writeByte(3)
..write(obj.lng);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is LocationHistoryItemAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/location_selection | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/welcome_card/welcome_card_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../../address/address_details_view.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
import 'package:ridy/main/bloc/main_bloc.dart';
import 'package:ridy/main/bloc/rider_profile_cubit.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:latlong2/latlong.dart';
import '../../address/address_item_view.dart';
import '../../address/address_list_view.dart';
import '../../main/bloc/current_location_cubit.dart';
class WelcomeCardView extends StatelessWidget {
const WelcomeCardView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return RidySheetView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
BlocBuilder<RiderProfileCubit, GetCurrentOrder$Query$Rider?>(
builder: (context, state) {
return Text(
S.of(context).welcome_card_greeting(
state?.firstName != null ? " ${state!.firstName}" : ""),
style: Theme.of(context).textTheme.labelMedium,
);
},
).pOnly(bottom: 2),
Text(
S.of(context).welcome_card_subtitle,
style: Theme.of(context).textTheme.headlineMedium,
).pOnly(),
CupertinoButton(
padding: const EdgeInsets.symmetric(vertical: 8),
onPressed: () async {
final List<FullLocation>? result = await showBarModalBottomSheet(
useRootNavigator: true,
context: context,
builder: (context) => PlaceSearchSheetView(
context.read<CurrentLocationCubit>().state));
if (result == null) return;
context.read<MainBloc>().add(ShowPreview(
points: result, selectedOptions: [], couponCode: null));
},
child: Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade100,
borderRadius: BorderRadius.circular(10)),
child: Row(
children: [
const Icon(
Ionicons.search,
color: CustomTheme.primaryColors,
).pOnly(bottom: 4),
Text(S.of(context).welcome_card_textbox_placeholder,
style: Theme.of(context).textTheme.labelLarge)
.pOnly(left: 8)
],
)),
),
BlocBuilder<RiderProfileCubit, GetCurrentOrder$Query$Rider?>(
builder: (context, state) {
if (state == null) {
return const SizedBox();
}
return Query(
options: QueryOptions(document: GET_ADDRESSES_QUERY_DOCUMENT),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading) {
return const Center(
child: CupertinoActivityIndicator(),
);
}
final addresses = result.data != null
? GetAddresses$Query.fromJson(result.data!).riderAddresses
: <GetAddresses$Query$RiderAddress>[];
return Column(children: [
Container(
constraints: const BoxConstraints(maxHeight: 150),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: addresses
.map((GetAddresses$Query$RiderAddress address) =>
WelcomeCardSavedLocationButton(
onTap: () {
final currentLocation = context
.read<CurrentLocationCubit>()
.state;
if (currentLocation == null) {
showLocationNotDeterminedDialog(
context);
return;
}
context.read<MainBloc>().add(
ShowPreview(points: [
currentLocation,
address.toFullLocation()
], selectedOptions: []));
},
type: address.type,
address: address.details))
.toList(),
),
),
),
AddressListAddLocationButton(onTap: () async {
final currentLocation =
context.read<CurrentLocationCubit>().state;
await showBarModalBottomSheet(
context: context,
builder: (_) {
return BlocProvider.value(
value: BlocProvider.of<CurrentLocationCubit>(
context),
child: AddressDetailsView(
currentLocation: currentLocation));
});
refetch!();
})
]);
});
})
],
),
);
}
void showLocationNotDeterminedDialog(BuildContext context) {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(S.of(context).location_not_found_alert_dialog_title),
content: Text(S.of(context).location_not_found_alert_dialog_body),
actions: [
TextButton(
onPressed: () => Navigator.of(context).pop(),
child:
Text(S.of(context).action_ok, textAlign: TextAlign.end))
],
);
});
}
}
extension RiderAddressToFullLocation on GetAddresses$Query$RiderAddress {
FullLocation toFullLocation() {
return FullLocation(
latlng: LatLng(location.lat, location.lng),
address: details,
title: title);
}
}
class WelcomeCardSavedLocationButton extends StatelessWidget {
final Function() onTap;
final RiderAddressType type;
final String address;
const WelcomeCardSavedLocationButton(
{required this.onTap,
required this.type,
required this.address,
Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return CupertinoButton(
padding: const EdgeInsets.symmetric(vertical: 8),
onPressed: onTap,
child: Row(mainAxisSize: MainAxisSize.min, children: [
AddressListIcon(getAddressTypeIcon(type)),
const SizedBox(width: 8),
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
getAddressTypeName(context, type),
style: Theme.of(context).textTheme.titleMedium,
),
Text(
address,
style: Theme.of(context).textTheme.labelMedium,
)
],
),
)
]));
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/location_selection | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/welcome_card/welcome_card_address_view.dart | import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class WelcomeCardAddressView extends StatelessWidget {
const WelcomeCardAddressView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Colors.grey.shade200),
child: Icon(
Icons.add,
color: Colors.grey.shade600,
).p4(),
),
Column(
children: [
Text(
S.of(context).action_add_favorite_location,
style: Theme.of(context).textTheme.titleMedium,
).p4()
],
)
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/location_selection | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/welcome_card/place_confirm_sheet_view.dart | import 'dart:async';
import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:latlong2/latlong.dart';
import 'package:osm_nominatim/osm_nominatim.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
import 'package:client_shared/components/marker_new.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class PlaceConfirmSheetView extends StatefulWidget {
final FullLocation? defaultLocation;
const PlaceConfirmSheetView(this.defaultLocation, {Key? key})
: super(key: key);
@override
State<PlaceConfirmSheetView> createState() => _PlaceConfirmSheetViewState();
}
class _PlaceConfirmSheetViewState extends State<PlaceConfirmSheetView> {
final MapController mapController = MapController();
String? address;
late StreamSubscription<MapEvent> subscription;
LatLng? center;
@override
void initState() {
address ??= widget.defaultLocation?.address;
super.initState();
}
@override
Widget build(BuildContext context) {
return FlutterMap(
mapController: mapController,
options: MapOptions(
onMapReady: () {
center = mapController.center;
subscription =
mapController.mapEventStream.listen((MapEvent mapEvent) async {
if (mapEvent is MapEventMoveStart) {
setState(() {
address = null;
});
} else if (mapEvent is MapEventMoveEnd) {
final reverseSearchResult = await Nominatim.reverseSearch(
lat: mapController.center.latitude,
lon: mapController.center.longitude,
nameDetails: true);
final fullLocation =
reverseSearchResult.convertToFullLocation();
center = mapController.center;
if (!mounted) return;
setState(() {
address = fullLocation.address;
});
}
});
},
maxZoom: 20,
zoom: 16,
center: widget.defaultLocation?.latlng ?? fallbackLocation,
interactiveFlags: InteractiveFlag.drag |
InteractiveFlag.pinchMove |
InteractiveFlag.pinchZoom |
InteractiveFlag.doubleTapZoom),
children: [
if (mapProvider == MapProvider.openStreetMap ||
(mapProvider == MapProvider.googleMap &&
mapBoxAccessToken.isEmptyOrNull))
openStreetTileLayer,
if (mapProvider == MapProvider.mapBox ||
(mapProvider == MapProvider.googleMap &&
!mapBoxAccessToken.isEmptyOrNull))
mapBoxTileLayer,
CurrentLocationLayer(
followOnLocationUpdate: FollowOnLocationUpdate.never),
Center(
child: Padding(
padding: const EdgeInsets.only(bottom: 63),
child: MarkerNew(address: address),
),
),
Align(
alignment: Alignment.bottomCenter,
child: SafeArea(
minimum: const EdgeInsets.all(16),
child: SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: address == null
? null
: () {
final newLocation = FullLocation(
latlng: mapController.center,
address: address!,
title: widget.defaultLocation?.title ?? "");
// final box =
// Hive.box<List<LocationHistoryItem>>(
// "history2");
// var items = (box.get("items",
// defaultValue:
// List<LocationHistoryItem>.from(
// []))
// as List<LocationHistoryItem>);
// if (items.length > 9) {
// items.removeRange(9, items.length - 1);
// }
// items = [
// newLocation.toLocationHistoryItem()
// ].followedBy(items).toList();
// box.put("items", items);
Navigator.of(context).pop(newLocation);
},
child: Text(S.of(context).action_confirm_location)),
),
),
)
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/location_selection | mirrored_repositories/RideFlutter/rider-app/lib/location_selection/reservation_messages/looking_sheet_view.dart | import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
import '../../main/bloc/main_bloc.dart';
class LookingSheetView extends StatelessWidget {
const LookingSheetView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
return Container(
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(12)),
child: SafeArea(
minimum: const EdgeInsets.all(16),
top: false,
child: Column(
children: [
Text(
S.of(context).looking_dialog_title,
style: Theme.of(context).textTheme.headlineMedium,
),
const LinearProgressIndicator().pSymmetric(v: 8),
Flex(
direction: Axis.horizontal,
children: [
Flexible(
child: Text(
S.of(context).looking_dialog_body,
style: Theme.of(context).textTheme.bodyMedium,
).pOnly(right: 16)),
Flexible(
child: Image.asset(
"images/searching.png",
).pSymmetric(v: 8))
],
),
Row(
children: [
Mutation(
options: MutationOptions(
document: CANCEL_ORDER_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return Expanded(
child: OutlinedButton(
onPressed: () async {
final net = await runMutation({}).networkResult;
if (net?.data == null) {
mainBloc.add(ResetState());
return;
}
final order =
CancelOrder$Mutation.fromJson(net!.data!)
.cancelOrder;
mainBloc.add(CurrentOrderUpdated(order));
},
child: Text(
S.of(context).action_cancel_request,
style: Theme.of(context).textTheme.titleMedium,
)),
);
})
],
)
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/chat/chat_cubit.dart | import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
class ChatCubit extends Cubit<List<types.TextMessage>> {
ChatCubit() : super([]);
void setMessages(List<types.TextMessage> messages) => emit(messages);
void addMessage(types.TextMessage message) =>
emit([message].followedBy(state).toList());
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/chat/chat_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/chat/chat_cubit.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:ridy/config.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:ridy/query_result_view.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
import 'package:client_shared/theme/theme.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class ChatView extends StatelessWidget {
const ChatView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => ChatCubit(),
lazy: false,
child: Builder(builder: (context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
return Scaffold(
body: Query(
options: QueryOptions(
document: GET_MESSAGES_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
var cubit = context.read<ChatCubit>();
var order =
GetMessages$Query.fromJson(result.data!).currentOrder;
var messages = order.conversations
.map((e) => e.toTextMessage(order.rider, order.driver!))
.toList();
cubit.setMessages(messages);
return Subscription(
options: SubscriptionOptions(
document: NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult subscriptionResult) {
if (subscriptionResult.data != null) {
var message = NewMessageReceived$Subscription.fromJson(
subscriptionResult.data!)
.newMessageReceived
.toTextMessage(order.rider, order.driver!);
cubit.addMessage(message);
}
return Mutation(
options: MutationOptions(
document: SEND_MESSAGE_MUTATION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (RunMutation runMutation,
QueryResult? mutationResult) {
return BlocBuilder<ChatCubit,
List<types.TextMessage>>(
builder: (context, state) {
return Column(
children: [
SafeArea(
minimum: const EdgeInsets.all(16),
child: Row(
children: [
RidyBackButton(
text:
S.of(context).action_back),
const Spacer(),
CupertinoButton(
child: Container(
padding:
const EdgeInsets.all(8),
decoration: BoxDecoration(
color: CustomTheme
.neutralColors
.shade200,
borderRadius:
BorderRadius.circular(
20)),
child: Icon(
Ionicons.call,
color: CustomTheme
.neutralColors.shade600,
),
),
onPressed: () {
launchUrl(Uri.parse(
"tel://+${order.driver!.mobileNumber}"));
})
],
)),
Expanded(
child: Chat(
theme: DefaultChatTheme(
primaryColor:
CustomTheme.primaryColors,
backgroundColor: CustomTheme
.primaryColors.shade50,
inputBackgroundColor: CustomTheme
.neutralColors.shade200,
inputTextColor: Colors.black),
messages: state,
onSendPressed: (text) async {
var args = SendMessageArguments(
content: text.text,
requestId: order.id)
.toJson();
var result = await runMutation(args)
.networkResult;
var message =
SendMessage$Mutation.fromJson(
result!.data!);
cubit.addMessage(message
.createOneOrderMessage
.toTextMessage(order.rider,
order.driver!));
},
user: order.rider.toUser()),
),
],
);
},
);
});
});
}),
);
}),
);
}
}
extension ChatDriverExtension on ChatDriverMixin {
types.User toUser() => types.User(
id: 'd$id',
firstName: firstName,
lastName: lastName,
imageUrl: media == null ? null : serverUrl + media!.address);
}
extension ChatRiderExtension on ChatRiderMixin {
types.User toUser() => types.User(
id: 'r$id',
firstName: firstName,
lastName: lastName,
imageUrl: media == null ? null : serverUrl + media!.address);
}
extension ChatMeessageExtension on ChatMessageMixin {
types.TextMessage toTextMessage(
ChatRiderMixin rider, ChatDriverMixin driver) =>
types.TextMessage(
id: id,
text: content,
author: sentByDriver ? driver.toUser() : rider.toUser());
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/reservations/reservation_list_view.dart | import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/empty_state_card_view.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:intl/intl.dart';
import 'package:ridy/query_result_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
class ReservationListView extends StatelessWidget {
const ReservationListView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
Query(
options: QueryOptions(
document: RESERVATIONS_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return Expanded(child: QueryResultView(result));
}
final reservations =
Reservations$Query.fromJson(result.data!).orders.edges;
if (reservations.isEmpty) {
return EmptyStateCard(
title: S.of(context).reservation_empty_state_title,
description:
S.of(context).reservation_empty_state_body,
icon: Ionicons.notifications_off);
}
return Expanded(
child: Mutation(
options: MutationOptions(
document: CANCEL_BOOKING_MUTATION_DOCUMENT),
builder:
(RunMutation runMutation, QueryResult? result) {
return ListView.builder(
itemCount: reservations.length,
itemBuilder: (context, index) {
return ReservationItem(
reservation: reservations[index].node,
onCancelSelected: (id) async {
final args =
CancelBookingArguments(id: id)
.toJson();
await runMutation(args).networkResult;
refetch!();
},
);
});
}),
);
})
],
)),
);
}
}
class ReservationItem extends StatelessWidget {
final Reservations$Query$OrderConnection$OrderEdge$Order reservation;
final Function(String) onCancelSelected;
const ReservationItem(
{required this.reservation, required this.onCancelSelected, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.only(top: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
color: CustomTheme.primaryColors.shade100),
child: Column(
children: [
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: BorderRadius.circular(10),
border: Border.all(
color: CustomTheme.primaryColors.shade400, width: 0.5),
boxShadow: const [
BoxShadow(
color: Color(0x14000000),
offset: Offset(0, 3),
blurRadius: 5)
],
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
Ionicons.time,
color: CustomTheme.primaryColors.shade800,
),
const SizedBox(width: 4),
Text(
DateFormat('dd.MMM.yyyy')
.format(reservation.expectedTimestamp),
style: Theme.of(context).textTheme.titleMedium,
),
const Spacer(),
Text(
DateFormat('HH:mm a').format(reservation.expectedTimestamp),
style: Theme.of(context).textTheme.titleMedium,
)
],
),
),
Padding(
padding:
const EdgeInsets.only(left: 16, right: 16, top: 16, bottom: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Row(
children: [
Icon(
Ionicons.navigate,
color: CustomTheme.neutralColors.shade500,
),
const SizedBox(width: 6),
Expanded(
child: Text(
reservation.addresses.first,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(overflow: TextOverflow.ellipsis),
),
)
],
),
const Padding(
padding: EdgeInsets.only(left: 10, top: 4, bottom: 4),
child: DottedLine(
direction: Axis.vertical,
dashColor: CustomTheme.neutralColors,
lineLength: 20,
lineThickness: 2.0,
),
),
Row(
children: [
Icon(
Ionicons.location,
color: CustomTheme.neutralColors.shade500,
),
const SizedBox(width: 6),
Expanded(
child: Text(
reservation.addresses.last,
style: Theme.of(context).textTheme.labelMedium,
),
)
],
)
]),
),
const Divider(),
Row(
mainAxisSize: MainAxisSize.max,
children: [
const Spacer(),
CupertinoButton(
padding: const EdgeInsets.only(bottom: 12),
minSize: 0,
child: Row(
children: [
Icon(
Ionicons.close,
color: CustomTheme.neutralColors.shade500,
),
Text(
S.of(context).action_cancel_ride,
style: Theme.of(context).textTheme.bodySmall,
)
],
),
onPressed: () => onCancelSelected(reservation.id)),
const Spacer()
],
)
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/graphql | mirrored_repositories/RideFlutter/rider-app/lib/graphql/scalars/timestamp.dart | DateTime fromGraphQLTimestampToDartDateTime(int data) =>
DateTime.fromMillisecondsSinceEpoch(data);
int fromDartDateTimeToGraphQLTimestamp(DateTime data) =>
data.millisecondsSinceEpoch;
int? fromDartDateTimeNullableToGraphQLTimestampNullable(DateTime? datetime) =>
datetime?.millisecondsSinceEpoch;
DateTime? fromGraphQLTimestampNullableToDartDateTimeNullable(
int? milSinceEpoch) =>
milSinceEpoch != null
? DateTime.fromMillisecondsSinceEpoch(milSinceEpoch)
: null;
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/graphql | mirrored_repositories/RideFlutter/rider-app/lib/graphql/scalars/connection_cursor.dart | String fromGraphQLConnectionCursorToDartString(String data) => data;
String fromDartStringToGraphQLConnectionCursor(String data) => data;
String? fromGraphQLConnectionCursorToDartStringNullable(String? data) => data;
String? fromDartStringToGraphQLConnectionCursorNullable(String? data) => data;
String? fromGraphQLConnectionCursorNullableToDartStringNullable(String? data) =>
data;
String? fromDartStringNullableToGraphQLConnectionCursorNullable(String? data) =>
data;
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/graphql | mirrored_repositories/RideFlutter/rider-app/lib/graphql/generated/graphql_api.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
export 'graphql_api.graphql.dart';
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/graphql | mirrored_repositories/RideFlutter/rider-app/lib/graphql/generated/graphql_api.graphql.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
part of 'graphql_api.graphql.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GetMessages$Query$Order$Rider _$GetMessages$Query$Order$RiderFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Order$Rider()
..id = json['id'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..mobileNumber = json['mobileNumber'] as String
..media = json['media'] == null
? null
: ChatRiderMixin$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$GetMessages$Query$Order$RiderToJson(
GetMessages$Query$Order$Rider instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
val['mobileNumber'] = instance.mobileNumber;
writeNotNull('media', instance.media?.toJson());
return val;
}
GetMessages$Query$Order$Driver _$GetMessages$Query$Order$DriverFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Order$Driver()
..id = json['id'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..mobileNumber = json['mobileNumber'] as String
..media = json['media'] == null
? null
: ChatDriverMixin$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$GetMessages$Query$Order$DriverToJson(
GetMessages$Query$Order$Driver instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
val['mobileNumber'] = instance.mobileNumber;
writeNotNull('media', instance.media?.toJson());
return val;
}
GetMessages$Query$Order$OrderMessage
_$GetMessages$Query$Order$OrderMessageFromJson(Map<String, dynamic> json) =>
GetMessages$Query$Order$OrderMessage()
..id = json['id'] as String
..content = json['content'] as String
..sentByDriver = json['sentByDriver'] as bool;
Map<String, dynamic> _$GetMessages$Query$Order$OrderMessageToJson(
GetMessages$Query$Order$OrderMessage instance) =>
<String, dynamic>{
'id': instance.id,
'content': instance.content,
'sentByDriver': instance.sentByDriver,
};
GetMessages$Query$Order _$GetMessages$Query$OrderFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Order()
..id = json['id'] as String
..rider = GetMessages$Query$Order$Rider.fromJson(
json['rider'] as Map<String, dynamic>)
..driver = json['driver'] == null
? null
: GetMessages$Query$Order$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..conversations = (json['conversations'] as List<dynamic>)
.map((e) => GetMessages$Query$Order$OrderMessage.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetMessages$Query$OrderToJson(
GetMessages$Query$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'rider': instance.rider.toJson(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['conversations'] = instance.conversations.map((e) => e.toJson()).toList();
return val;
}
GetMessages$Query _$GetMessages$QueryFromJson(Map<String, dynamic> json) =>
GetMessages$Query()
..currentOrder = GetMessages$Query$Order.fromJson(
json['currentOrder'] as Map<String, dynamic>);
Map<String, dynamic> _$GetMessages$QueryToJson(GetMessages$Query instance) =>
<String, dynamic>{
'currentOrder': instance.currentOrder.toJson(),
};
ChatRiderMixin$Media _$ChatRiderMixin$MediaFromJson(
Map<String, dynamic> json) =>
ChatRiderMixin$Media()..address = json['address'] as String;
Map<String, dynamic> _$ChatRiderMixin$MediaToJson(
ChatRiderMixin$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
ChatDriverMixin$Media _$ChatDriverMixin$MediaFromJson(
Map<String, dynamic> json) =>
ChatDriverMixin$Media()..address = json['address'] as String;
Map<String, dynamic> _$ChatDriverMixin$MediaToJson(
ChatDriverMixin$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
SendMessage$Mutation$OrderMessage _$SendMessage$Mutation$OrderMessageFromJson(
Map<String, dynamic> json) =>
SendMessage$Mutation$OrderMessage()
..id = json['id'] as String
..content = json['content'] as String
..sentByDriver = json['sentByDriver'] as bool;
Map<String, dynamic> _$SendMessage$Mutation$OrderMessageToJson(
SendMessage$Mutation$OrderMessage instance) =>
<String, dynamic>{
'id': instance.id,
'content': instance.content,
'sentByDriver': instance.sentByDriver,
};
SendMessage$Mutation _$SendMessage$MutationFromJson(
Map<String, dynamic> json) =>
SendMessage$Mutation()
..createOneOrderMessage = SendMessage$Mutation$OrderMessage.fromJson(
json['createOneOrderMessage'] as Map<String, dynamic>);
Map<String, dynamic> _$SendMessage$MutationToJson(
SendMessage$Mutation instance) =>
<String, dynamic>{
'createOneOrderMessage': instance.createOneOrderMessage.toJson(),
};
NewMessageReceived$Subscription$OrderMessage
_$NewMessageReceived$Subscription$OrderMessageFromJson(
Map<String, dynamic> json) =>
NewMessageReceived$Subscription$OrderMessage()
..id = json['id'] as String
..content = json['content'] as String
..sentByDriver = json['sentByDriver'] as bool;
Map<String, dynamic> _$NewMessageReceived$Subscription$OrderMessageToJson(
NewMessageReceived$Subscription$OrderMessage instance) =>
<String, dynamic>{
'id': instance.id,
'content': instance.content,
'sentByDriver': instance.sentByDriver,
};
NewMessageReceived$Subscription _$NewMessageReceived$SubscriptionFromJson(
Map<String, dynamic> json) =>
NewMessageReceived$Subscription()
..newMessageReceived =
NewMessageReceived$Subscription$OrderMessage.fromJson(
json['newMessageReceived'] as Map<String, dynamic>);
Map<String, dynamic> _$NewMessageReceived$SubscriptionToJson(
NewMessageReceived$Subscription instance) =>
<String, dynamic>{
'newMessageReceived': instance.newMessageReceived.toJson(),
};
Reservations$Query$OrderConnection$OrderEdge$Order
_$Reservations$Query$OrderConnection$OrderEdge$OrderFromJson(
Map<String, dynamic> json) =>
Reservations$Query$OrderConnection$OrderEdge$Order()
..id = json['id'] as String
..expectedTimestamp = fromGraphQLTimestampToDartDateTime(
json['expectedTimestamp'] as int)
..addresses = (json['addresses'] as List<dynamic>)
.map((e) => e as String)
.toList();
Map<String, dynamic> _$Reservations$Query$OrderConnection$OrderEdge$OrderToJson(
Reservations$Query$OrderConnection$OrderEdge$Order instance) =>
<String, dynamic>{
'id': instance.id,
'expectedTimestamp':
fromDartDateTimeToGraphQLTimestamp(instance.expectedTimestamp),
'addresses': instance.addresses,
};
Reservations$Query$OrderConnection$OrderEdge
_$Reservations$Query$OrderConnection$OrderEdgeFromJson(
Map<String, dynamic> json) =>
Reservations$Query$OrderConnection$OrderEdge()
..node = Reservations$Query$OrderConnection$OrderEdge$Order.fromJson(
json['node'] as Map<String, dynamic>);
Map<String, dynamic> _$Reservations$Query$OrderConnection$OrderEdgeToJson(
Reservations$Query$OrderConnection$OrderEdge instance) =>
<String, dynamic>{
'node': instance.node.toJson(),
};
Reservations$Query$OrderConnection _$Reservations$Query$OrderConnectionFromJson(
Map<String, dynamic> json) =>
Reservations$Query$OrderConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) => Reservations$Query$OrderConnection$OrderEdge.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$Reservations$Query$OrderConnectionToJson(
Reservations$Query$OrderConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
};
Reservations$Query _$Reservations$QueryFromJson(Map<String, dynamic> json) =>
Reservations$Query()
..orders = Reservations$Query$OrderConnection.fromJson(
json['orders'] as Map<String, dynamic>);
Map<String, dynamic> _$Reservations$QueryToJson(Reservations$Query instance) =>
<String, dynamic>{
'orders': instance.orders.toJson(),
};
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$AnnouncementFromJson(
Map<String, dynamic> json) =>
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement()
..id = json['id'] as String
..title = json['title'] as String
..startAt = fromGraphQLTimestampToDartDateTime(json['startAt'] as int)
..description = json['description'] as String
..url = json['url'] as String?;
Map<String, dynamic>
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$AnnouncementToJson(
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement
instance) {
final val = <String, dynamic>{
'id': instance.id,
'title': instance.title,
'startAt': fromDartDateTimeToGraphQLTimestamp(instance.startAt),
'description': instance.description,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('url', instance.url);
return val;
}
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdgeFromJson(
Map<String, dynamic> json) =>
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge()
..node =
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement
.fromJson(json['node'] as Map<String, dynamic>);
Map<String, dynamic>
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdgeToJson(
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge
instance) =>
<String, dynamic>{
'node': instance.node.toJson(),
};
GetAnnouncements$Query$AnnouncementConnection
_$GetAnnouncements$Query$AnnouncementConnectionFromJson(
Map<String, dynamic> json) =>
GetAnnouncements$Query$AnnouncementConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) =>
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge
.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetAnnouncements$Query$AnnouncementConnectionToJson(
GetAnnouncements$Query$AnnouncementConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
};
GetAnnouncements$Query _$GetAnnouncements$QueryFromJson(
Map<String, dynamic> json) =>
GetAnnouncements$Query()
..announcements = GetAnnouncements$Query$AnnouncementConnection.fromJson(
json['announcements'] as Map<String, dynamic>);
Map<String, dynamic> _$GetAnnouncements$QueryToJson(
GetAnnouncements$Query instance) =>
<String, dynamic>{
'announcements': instance.announcements.toJson(),
};
GetRider$Query$Rider$Media _$GetRider$Query$Rider$MediaFromJson(
Map<String, dynamic> json) =>
GetRider$Query$Rider$Media()..address = json['address'] as String;
Map<String, dynamic> _$GetRider$Query$Rider$MediaToJson(
GetRider$Query$Rider$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
GetRider$Query$Rider _$GetRider$Query$RiderFromJson(
Map<String, dynamic> json) =>
GetRider$Query$Rider()
..id = json['id'] as String
..mobileNumber = json['mobileNumber'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..gender = $enumDecodeNullable(_$GenderEnumMap, json['gender'],
unknownValue: Gender.artemisUnknown)
..email = json['email'] as String?
..media = json['media'] == null
? null
: GetRider$Query$Rider$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$GetRider$Query$RiderToJson(
GetRider$Query$Rider instance) {
final val = <String, dynamic>{
'id': instance.id,
'mobileNumber': instance.mobileNumber,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('gender', _$GenderEnumMap[instance.gender]);
writeNotNull('email', instance.email);
writeNotNull('media', instance.media?.toJson());
return val;
}
const _$GenderEnumMap = {
Gender.male: 'Male',
Gender.female: 'Female',
Gender.unknown: 'Unknown',
Gender.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
GetRider$Query _$GetRider$QueryFromJson(Map<String, dynamic> json) =>
GetRider$Query()
..rider = json['rider'] == null
? null
: GetRider$Query$Rider.fromJson(
json['rider'] as Map<String, dynamic>);
Map<String, dynamic> _$GetRider$QueryToJson(GetRider$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('rider', instance.rider?.toJson());
return val;
}
UpdateProfile$Mutation$Rider _$UpdateProfile$Mutation$RiderFromJson(
Map<String, dynamic> json) =>
UpdateProfile$Mutation$Rider()..id = json['id'] as String;
Map<String, dynamic> _$UpdateProfile$Mutation$RiderToJson(
UpdateProfile$Mutation$Rider instance) =>
<String, dynamic>{
'id': instance.id,
};
UpdateProfile$Mutation _$UpdateProfile$MutationFromJson(
Map<String, dynamic> json) =>
UpdateProfile$Mutation()
..updateOneRider = UpdateProfile$Mutation$Rider.fromJson(
json['updateOneRider'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateProfile$MutationToJson(
UpdateProfile$Mutation instance) =>
<String, dynamic>{
'updateOneRider': instance.updateOneRider.toJson(),
};
DeleteUser$Mutation$Rider _$DeleteUser$Mutation$RiderFromJson(
Map<String, dynamic> json) =>
DeleteUser$Mutation$Rider()..id = json['id'] as String;
Map<String, dynamic> _$DeleteUser$Mutation$RiderToJson(
DeleteUser$Mutation$Rider instance) =>
<String, dynamic>{
'id': instance.id,
};
DeleteUser$Mutation _$DeleteUser$MutationFromJson(Map<String, dynamic> json) =>
DeleteUser$Mutation()
..deleteUser = DeleteUser$Mutation$Rider.fromJson(
json['deleteUser'] as Map<String, dynamic>);
Map<String, dynamic> _$DeleteUser$MutationToJson(
DeleteUser$Mutation instance) =>
<String, dynamic>{
'deleteUser': instance.deleteUser.toJson(),
};
GetAddresses$Query$RiderAddress$Point
_$GetAddresses$Query$RiderAddress$PointFromJson(
Map<String, dynamic> json) =>
GetAddresses$Query$RiderAddress$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$GetAddresses$Query$RiderAddress$PointToJson(
GetAddresses$Query$RiderAddress$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
GetAddresses$Query$RiderAddress _$GetAddresses$Query$RiderAddressFromJson(
Map<String, dynamic> json) =>
GetAddresses$Query$RiderAddress()
..id = json['id'] as String
..title = json['title'] as String
..type = $enumDecode(_$RiderAddressTypeEnumMap, json['type'],
unknownValue: RiderAddressType.artemisUnknown)
..details = json['details'] as String
..location = GetAddresses$Query$RiderAddress$Point.fromJson(
json['location'] as Map<String, dynamic>);
Map<String, dynamic> _$GetAddresses$Query$RiderAddressToJson(
GetAddresses$Query$RiderAddress instance) =>
<String, dynamic>{
'id': instance.id,
'title': instance.title,
'type': _$RiderAddressTypeEnumMap[instance.type]!,
'details': instance.details,
'location': instance.location.toJson(),
};
const _$RiderAddressTypeEnumMap = {
RiderAddressType.home: 'Home',
RiderAddressType.work: 'Work',
RiderAddressType.partner: 'Partner',
RiderAddressType.gym: 'Gym',
RiderAddressType.parent: 'Parent',
RiderAddressType.cafe: 'Cafe',
RiderAddressType.park: 'Park',
RiderAddressType.other: 'Other',
RiderAddressType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
GetAddresses$Query _$GetAddresses$QueryFromJson(Map<String, dynamic> json) =>
GetAddresses$Query()
..riderAddresses = (json['riderAddresses'] as List<dynamic>)
.map((e) => GetAddresses$Query$RiderAddress.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetAddresses$QueryToJson(GetAddresses$Query instance) =>
<String, dynamic>{
'riderAddresses': instance.riderAddresses.map((e) => e.toJson()).toList(),
};
CreateAddress$Mutation$RiderAddress
_$CreateAddress$Mutation$RiderAddressFromJson(Map<String, dynamic> json) =>
CreateAddress$Mutation$RiderAddress()..id = json['id'] as String;
Map<String, dynamic> _$CreateAddress$Mutation$RiderAddressToJson(
CreateAddress$Mutation$RiderAddress instance) =>
<String, dynamic>{
'id': instance.id,
};
CreateAddress$Mutation _$CreateAddress$MutationFromJson(
Map<String, dynamic> json) =>
CreateAddress$Mutation()
..createOneRiderAddress = CreateAddress$Mutation$RiderAddress.fromJson(
json['createOneRiderAddress'] as Map<String, dynamic>);
Map<String, dynamic> _$CreateAddress$MutationToJson(
CreateAddress$Mutation instance) =>
<String, dynamic>{
'createOneRiderAddress': instance.createOneRiderAddress.toJson(),
};
CreateRiderAddressInput _$CreateRiderAddressInputFromJson(
Map<String, dynamic> json) =>
CreateRiderAddressInput(
title: json['title'] as String,
details: json['details'] as String,
location: PointInput.fromJson(json['location'] as Map<String, dynamic>),
type: $enumDecodeNullable(_$RiderAddressTypeEnumMap, json['type'],
unknownValue: RiderAddressType.artemisUnknown),
);
Map<String, dynamic> _$CreateRiderAddressInputToJson(
CreateRiderAddressInput instance) {
final val = <String, dynamic>{
'title': instance.title,
'details': instance.details,
'location': instance.location.toJson(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('type', _$RiderAddressTypeEnumMap[instance.type]);
return val;
}
PointInput _$PointInputFromJson(Map<String, dynamic> json) => PointInput(
lat: (json['lat'] as num).toDouble(),
lng: (json['lng'] as num).toDouble(),
);
Map<String, dynamic> _$PointInputToJson(PointInput instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
UpdateAddress$Mutation$RiderAddress
_$UpdateAddress$Mutation$RiderAddressFromJson(Map<String, dynamic> json) =>
UpdateAddress$Mutation$RiderAddress()..id = json['id'] as String;
Map<String, dynamic> _$UpdateAddress$Mutation$RiderAddressToJson(
UpdateAddress$Mutation$RiderAddress instance) =>
<String, dynamic>{
'id': instance.id,
};
UpdateAddress$Mutation _$UpdateAddress$MutationFromJson(
Map<String, dynamic> json) =>
UpdateAddress$Mutation()
..updateOneRiderAddress = UpdateAddress$Mutation$RiderAddress.fromJson(
json['updateOneRiderAddress'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateAddress$MutationToJson(
UpdateAddress$Mutation instance) =>
<String, dynamic>{
'updateOneRiderAddress': instance.updateOneRiderAddress.toJson(),
};
DeleteAddress$Mutation$RiderAddressDeleteResponse
_$DeleteAddress$Mutation$RiderAddressDeleteResponseFromJson(
Map<String, dynamic> json) =>
DeleteAddress$Mutation$RiderAddressDeleteResponse()
..id = json['id'] as String?;
Map<String, dynamic> _$DeleteAddress$Mutation$RiderAddressDeleteResponseToJson(
DeleteAddress$Mutation$RiderAddressDeleteResponse instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('id', instance.id);
return val;
}
DeleteAddress$Mutation _$DeleteAddress$MutationFromJson(
Map<String, dynamic> json) =>
DeleteAddress$Mutation()
..deleteOneRiderAddress =
DeleteAddress$Mutation$RiderAddressDeleteResponse.fromJson(
json['deleteOneRiderAddress'] as Map<String, dynamic>);
Map<String, dynamic> _$DeleteAddress$MutationToJson(
DeleteAddress$Mutation instance) =>
<String, dynamic>{
'deleteOneRiderAddress': instance.deleteOneRiderAddress.toJson(),
};
GetHistory$Query$OrderConnection _$GetHistory$Query$OrderConnectionFromJson(
Map<String, dynamic> json) =>
GetHistory$Query$OrderConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) => HistoryOrderItemMixin$OrderEdge.fromJson(
e as Map<String, dynamic>))
.toList()
..pageInfo = HistoryOrderItemMixin$PageInfo.fromJson(
json['pageInfo'] as Map<String, dynamic>);
Map<String, dynamic> _$GetHistory$Query$OrderConnectionToJson(
GetHistory$Query$OrderConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
'pageInfo': instance.pageInfo.toJson(),
};
GetHistory$Query _$GetHistory$QueryFromJson(Map<String, dynamic> json) =>
GetHistory$Query()
..orders = GetHistory$Query$OrderConnection.fromJson(
json['orders'] as Map<String, dynamic>);
Map<String, dynamic> _$GetHistory$QueryToJson(GetHistory$Query instance) =>
<String, dynamic>{
'orders': instance.orders.toJson(),
};
HistoryOrderItemMixin$OrderEdge$Order$Service$Media
_$HistoryOrderItemMixin$OrderEdge$Order$Service$MediaFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge$Order$Service$Media()
..address = json['address'] as String;
Map<String, dynamic>
_$HistoryOrderItemMixin$OrderEdge$Order$Service$MediaToJson(
HistoryOrderItemMixin$OrderEdge$Order$Service$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
HistoryOrderItemMixin$OrderEdge$Order$Service
_$HistoryOrderItemMixin$OrderEdge$Order$ServiceFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge$Order$Service()
..media =
HistoryOrderItemMixin$OrderEdge$Order$Service$Media.fromJson(
json['media'] as Map<String, dynamic>)
..name = json['name'] as String;
Map<String, dynamic> _$HistoryOrderItemMixin$OrderEdge$Order$ServiceToJson(
HistoryOrderItemMixin$OrderEdge$Order$Service instance) =>
<String, dynamic>{
'media': instance.media.toJson(),
'name': instance.name,
};
HistoryOrderItemMixin$OrderEdge$Order
_$HistoryOrderItemMixin$OrderEdge$OrderFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..createdOn =
fromGraphQLTimestampToDartDateTime(json['createdOn'] as int)
..addresses = (json['addresses'] as List<dynamic>)
.map((e) => e as String)
.toList()
..currency = json['currency'] as String
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..service = HistoryOrderItemMixin$OrderEdge$Order$Service.fromJson(
json['service'] as Map<String, dynamic>);
Map<String, dynamic> _$HistoryOrderItemMixin$OrderEdge$OrderToJson(
HistoryOrderItemMixin$OrderEdge$Order instance) =>
<String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'createdOn': fromDartDateTimeToGraphQLTimestamp(instance.createdOn),
'addresses': instance.addresses,
'currency': instance.currency,
'costAfterCoupon': instance.costAfterCoupon,
'service': instance.service.toJson(),
};
const _$OrderStatusEnumMap = {
OrderStatus.requested: 'Requested',
OrderStatus.notFound: 'NotFound',
OrderStatus.noCloseFound: 'NoCloseFound',
OrderStatus.found: 'Found',
OrderStatus.driverAccepted: 'DriverAccepted',
OrderStatus.arrived: 'Arrived',
OrderStatus.waitingForPrePay: 'WaitingForPrePay',
OrderStatus.driverCanceled: 'DriverCanceled',
OrderStatus.riderCanceled: 'RiderCanceled',
OrderStatus.started: 'Started',
OrderStatus.waitingForPostPay: 'WaitingForPostPay',
OrderStatus.waitingForReview: 'WaitingForReview',
OrderStatus.finished: 'Finished',
OrderStatus.booked: 'Booked',
OrderStatus.expired: 'Expired',
OrderStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
HistoryOrderItemMixin$OrderEdge _$HistoryOrderItemMixin$OrderEdgeFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge()
..node = HistoryOrderItemMixin$OrderEdge$Order.fromJson(
json['node'] as Map<String, dynamic>);
Map<String, dynamic> _$HistoryOrderItemMixin$OrderEdgeToJson(
HistoryOrderItemMixin$OrderEdge instance) =>
<String, dynamic>{
'node': instance.node.toJson(),
};
HistoryOrderItemMixin$PageInfo _$HistoryOrderItemMixin$PageInfoFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$PageInfo()
..hasNextPage = json['hasNextPage'] as bool?
..endCursor = fromGraphQLConnectionCursorNullableToDartStringNullable(
json['endCursor'] as String?)
..startCursor = fromGraphQLConnectionCursorNullableToDartStringNullable(
json['startCursor'] as String?)
..hasPreviousPage = json['hasPreviousPage'] as bool?;
Map<String, dynamic> _$HistoryOrderItemMixin$PageInfoToJson(
HistoryOrderItemMixin$PageInfo instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('hasNextPage', instance.hasNextPage);
writeNotNull(
'endCursor',
fromDartStringNullableToGraphQLConnectionCursorNullable(
instance.endCursor));
writeNotNull(
'startCursor',
fromDartStringNullableToGraphQLConnectionCursorNullable(
instance.startCursor));
writeNotNull('hasPreviousPage', instance.hasPreviousPage);
return val;
}
GetOrderDetails$Query$Order$Point _$GetOrderDetails$Query$Order$PointFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$GetOrderDetails$Query$Order$PointToJson(
GetOrderDetails$Query$Order$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
GetOrderDetails$Query$Order$Driver$Media
_$GetOrderDetails$Query$Order$Driver$MediaFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Driver$Media()
..address = json['address'] as String;
Map<String, dynamic> _$GetOrderDetails$Query$Order$Driver$MediaToJson(
GetOrderDetails$Query$Order$Driver$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
GetOrderDetails$Query$Order$Driver$CarModel
_$GetOrderDetails$Query$Order$Driver$CarModelFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Driver$CarModel()
..name = json['name'] as String;
Map<String, dynamic> _$GetOrderDetails$Query$Order$Driver$CarModelToJson(
GetOrderDetails$Query$Order$Driver$CarModel instance) =>
<String, dynamic>{
'name': instance.name,
};
GetOrderDetails$Query$Order$Driver _$GetOrderDetails$Query$Order$DriverFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Driver()
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..rating = json['rating'] as int?
..carPlate = json['carPlate'] as String?
..media = json['media'] == null
? null
: GetOrderDetails$Query$Order$Driver$Media.fromJson(
json['media'] as Map<String, dynamic>)
..car = json['car'] == null
? null
: GetOrderDetails$Query$Order$Driver$CarModel.fromJson(
json['car'] as Map<String, dynamic>);
Map<String, dynamic> _$GetOrderDetails$Query$Order$DriverToJson(
GetOrderDetails$Query$Order$Driver instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('rating', instance.rating);
writeNotNull('carPlate', instance.carPlate);
writeNotNull('media', instance.media?.toJson());
writeNotNull('car', instance.car?.toJson());
return val;
}
GetOrderDetails$Query$Order$Service$Media
_$GetOrderDetails$Query$Order$Service$MediaFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Service$Media()
..address = json['address'] as String;
Map<String, dynamic> _$GetOrderDetails$Query$Order$Service$MediaToJson(
GetOrderDetails$Query$Order$Service$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
GetOrderDetails$Query$Order$Service
_$GetOrderDetails$Query$Order$ServiceFromJson(Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Service()
..name = json['name'] as String
..media = GetOrderDetails$Query$Order$Service$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$GetOrderDetails$Query$Order$ServiceToJson(
GetOrderDetails$Query$Order$Service instance) =>
<String, dynamic>{
'name': instance.name,
'media': instance.media.toJson(),
};
GetOrderDetails$Query$Order$PaymentGateway$Media
_$GetOrderDetails$Query$Order$PaymentGateway$MediaFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$PaymentGateway$Media()
..address = json['address'] as String;
Map<String, dynamic> _$GetOrderDetails$Query$Order$PaymentGateway$MediaToJson(
GetOrderDetails$Query$Order$PaymentGateway$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
GetOrderDetails$Query$Order$PaymentGateway
_$GetOrderDetails$Query$Order$PaymentGatewayFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$PaymentGateway()
..title = json['title'] as String
..media = json['media'] == null
? null
: GetOrderDetails$Query$Order$PaymentGateway$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$GetOrderDetails$Query$Order$PaymentGatewayToJson(
GetOrderDetails$Query$Order$PaymentGateway instance) {
final val = <String, dynamic>{
'title': instance.title,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('media', instance.media?.toJson());
return val;
}
GetOrderDetails$Query$Order _$GetOrderDetails$Query$OrderFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order()
..points = (json['points'] as List<dynamic>)
.map((e) => GetOrderDetails$Query$Order$Point.fromJson(
e as Map<String, dynamic>))
.toList()
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..currency = json['currency'] as String
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..finishTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['finishTimestamp'] as int?)
..expectedTimestamp =
fromGraphQLTimestampToDartDateTime(json['expectedTimestamp'] as int)
..driver = json['driver'] == null
? null
: GetOrderDetails$Query$Order$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = GetOrderDetails$Query$Order$Service.fromJson(
json['service'] as Map<String, dynamic>)
..paymentGateway = json['paymentGateway'] == null
? null
: GetOrderDetails$Query$Order$PaymentGateway.fromJson(
json['paymentGateway'] as Map<String, dynamic>);
Map<String, dynamic> _$GetOrderDetails$Query$OrderToJson(
GetOrderDetails$Query$Order instance) {
final val = <String, dynamic>{
'points': instance.points.map((e) => e.toJson()).toList(),
'addresses': instance.addresses,
'costAfterCoupon': instance.costAfterCoupon,
'currency': instance.currency,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
writeNotNull(
'finishTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.finishTimestamp));
val['expectedTimestamp'] =
fromDartDateTimeToGraphQLTimestamp(instance.expectedTimestamp);
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull('paymentGateway', instance.paymentGateway?.toJson());
return val;
}
GetOrderDetails$Query _$GetOrderDetails$QueryFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query()
..order = json['order'] == null
? null
: GetOrderDetails$Query$Order.fromJson(
json['order'] as Map<String, dynamic>);
Map<String, dynamic> _$GetOrderDetails$QueryToJson(
GetOrderDetails$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('order', instance.order?.toJson());
return val;
}
CancelBooking$Mutation$Order _$CancelBooking$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
CancelBooking$Mutation$Order()..id = json['id'] as String;
Map<String, dynamic> _$CancelBooking$Mutation$OrderToJson(
CancelBooking$Mutation$Order instance) =>
<String, dynamic>{
'id': instance.id,
};
CancelBooking$Mutation _$CancelBooking$MutationFromJson(
Map<String, dynamic> json) =>
CancelBooking$Mutation()
..cancelBooking = CancelBooking$Mutation$Order.fromJson(
json['cancelBooking'] as Map<String, dynamic>);
Map<String, dynamic> _$CancelBooking$MutationToJson(
CancelBooking$Mutation instance) =>
<String, dynamic>{
'cancelBooking': instance.cancelBooking.toJson(),
};
SubmitComplaint$Mutation$Complaint _$SubmitComplaint$Mutation$ComplaintFromJson(
Map<String, dynamic> json) =>
SubmitComplaint$Mutation$Complaint()..id = json['id'] as String;
Map<String, dynamic> _$SubmitComplaint$Mutation$ComplaintToJson(
SubmitComplaint$Mutation$Complaint instance) =>
<String, dynamic>{
'id': instance.id,
};
SubmitComplaint$Mutation _$SubmitComplaint$MutationFromJson(
Map<String, dynamic> json) =>
SubmitComplaint$Mutation()
..createOneComplaint = SubmitComplaint$Mutation$Complaint.fromJson(
json['createOneComplaint'] as Map<String, dynamic>);
Map<String, dynamic> _$SubmitComplaint$MutationToJson(
SubmitComplaint$Mutation instance) =>
<String, dynamic>{
'createOneComplaint': instance.createOneComplaint.toJson(),
};
Wallet$Query$RiderWallet _$Wallet$Query$RiderWalletFromJson(
Map<String, dynamic> json) =>
Wallet$Query$RiderWallet()
..id = json['id'] as String
..balance = (json['balance'] as num).toDouble()
..currency = json['currency'] as String;
Map<String, dynamic> _$Wallet$Query$RiderWalletToJson(
Wallet$Query$RiderWallet instance) =>
<String, dynamic>{
'id': instance.id,
'balance': instance.balance,
'currency': instance.currency,
};
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacionFromJson(
Map<String, dynamic> json) =>
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion()
..createdAt =
fromGraphQLTimestampToDartDateTime(json['createdAt'] as int)
..amount = (json['amount'] as num).toDouble()
..currency = json['currency'] as String
..refrenceNumber = json['refrenceNumber'] as String?
..deductType = $enumDecodeNullable(
_$RiderDeductTransactionTypeEnumMap, json['deductType'],
unknownValue: RiderDeductTransactionType.artemisUnknown)
..action = $enumDecode(_$TransactionActionEnumMap, json['action'],
unknownValue: TransactionAction.artemisUnknown)
..rechargeType = $enumDecodeNullable(
_$RiderRechargeTransactionTypeEnumMap, json['rechargeType'],
unknownValue: RiderRechargeTransactionType.artemisUnknown);
Map<String, dynamic>
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacionToJson(
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion
instance) {
final val = <String, dynamic>{
'createdAt': fromDartDateTimeToGraphQLTimestamp(instance.createdAt),
'amount': instance.amount,
'currency': instance.currency,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('refrenceNumber', instance.refrenceNumber);
writeNotNull(
'deductType', _$RiderDeductTransactionTypeEnumMap[instance.deductType]);
val['action'] = _$TransactionActionEnumMap[instance.action]!;
writeNotNull('rechargeType',
_$RiderRechargeTransactionTypeEnumMap[instance.rechargeType]);
return val;
}
const _$RiderDeductTransactionTypeEnumMap = {
RiderDeductTransactionType.orderFee: 'OrderFee',
RiderDeductTransactionType.withdraw: 'Withdraw',
RiderDeductTransactionType.correction: 'Correction',
RiderDeductTransactionType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
const _$TransactionActionEnumMap = {
TransactionAction.recharge: 'Recharge',
TransactionAction.deduct: 'Deduct',
TransactionAction.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
const _$RiderRechargeTransactionTypeEnumMap = {
RiderRechargeTransactionType.bankTransfer: 'BankTransfer',
RiderRechargeTransactionType.gift: 'Gift',
RiderRechargeTransactionType.correction: 'Correction',
RiderRechargeTransactionType.inAppPayment: 'InAppPayment',
RiderRechargeTransactionType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdgeFromJson(
Map<String, dynamic> json) =>
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge()
..node =
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion
.fromJson(json['node'] as Map<String, dynamic>);
Map<String,
dynamic> _$Wallet$Query$RiderTransacionConnection$RiderTransacionEdgeToJson(
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge instance) =>
<String, dynamic>{
'node': instance.node.toJson(),
};
Wallet$Query$RiderTransacionConnection
_$Wallet$Query$RiderTransacionConnectionFromJson(
Map<String, dynamic> json) =>
Wallet$Query$RiderTransacionConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) =>
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge
.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$Wallet$Query$RiderTransacionConnectionToJson(
Wallet$Query$RiderTransacionConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
};
Wallet$Query _$Wallet$QueryFromJson(Map<String, dynamic> json) => Wallet$Query()
..riderWallets = (json['riderWallets'] as List<dynamic>)
.map((e) => Wallet$Query$RiderWallet.fromJson(e as Map<String, dynamic>))
.toList()
..riderTransacions = Wallet$Query$RiderTransacionConnection.fromJson(
json['riderTransacions'] as Map<String, dynamic>);
Map<String, dynamic> _$Wallet$QueryToJson(Wallet$Query instance) =>
<String, dynamic>{
'riderWallets': instance.riderWallets.map((e) => e.toJson()).toList(),
'riderTransacions': instance.riderTransacions.toJson(),
};
PaymentGateways$Query$PaymentGateway$Media
_$PaymentGateways$Query$PaymentGateway$MediaFromJson(
Map<String, dynamic> json) =>
PaymentGateways$Query$PaymentGateway$Media()
..address = json['address'] as String;
Map<String, dynamic> _$PaymentGateways$Query$PaymentGateway$MediaToJson(
PaymentGateways$Query$PaymentGateway$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
PaymentGateways$Query$PaymentGateway
_$PaymentGateways$Query$PaymentGatewayFromJson(Map<String, dynamic> json) =>
PaymentGateways$Query$PaymentGateway()
..id = json['id'] as String
..title = json['title'] as String
..type = $enumDecode(_$PaymentGatewayTypeEnumMap, json['type'],
unknownValue: PaymentGatewayType.artemisUnknown)
..publicKey = json['publicKey'] as String?
..media = json['media'] == null
? null
: PaymentGateways$Query$PaymentGateway$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$PaymentGateways$Query$PaymentGatewayToJson(
PaymentGateways$Query$PaymentGateway instance) {
final val = <String, dynamic>{
'id': instance.id,
'title': instance.title,
'type': _$PaymentGatewayTypeEnumMap[instance.type]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('publicKey', instance.publicKey);
writeNotNull('media', instance.media?.toJson());
return val;
}
const _$PaymentGatewayTypeEnumMap = {
PaymentGatewayType.stripe: 'Stripe',
PaymentGatewayType.brainTree: 'BrainTree',
PaymentGatewayType.payPal: 'PayPal',
PaymentGatewayType.paytm: 'Paytm',
PaymentGatewayType.razorpay: 'Razorpay',
PaymentGatewayType.paystack: 'Paystack',
PaymentGatewayType.payU: 'PayU',
PaymentGatewayType.instamojo: 'Instamojo',
PaymentGatewayType.flutterwave: 'Flutterwave',
PaymentGatewayType.payGate: 'PayGate',
PaymentGatewayType.mips: 'MIPS',
PaymentGatewayType.mercadoPago: 'MercadoPago',
PaymentGatewayType.amazonPaymentServices: 'AmazonPaymentServices',
PaymentGatewayType.myTMoney: 'MyTMoney',
PaymentGatewayType.wayForPay: 'WayForPay',
PaymentGatewayType.myFatoorah: 'MyFatoorah',
PaymentGatewayType.sberBank: 'SberBank',
PaymentGatewayType.customLink: 'CustomLink',
PaymentGatewayType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
PaymentGateways$Query _$PaymentGateways$QueryFromJson(
Map<String, dynamic> json) =>
PaymentGateways$Query()
..paymentGateways = (json['paymentGateways'] as List<dynamic>)
.map((e) => PaymentGateways$Query$PaymentGateway.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$PaymentGateways$QueryToJson(
PaymentGateways$Query instance) =>
<String, dynamic>{
'paymentGateways':
instance.paymentGateways.map((e) => e.toJson()).toList(),
};
PayForRide$Query$PaymentGateway$Media
_$PayForRide$Query$PaymentGateway$MediaFromJson(
Map<String, dynamic> json) =>
PayForRide$Query$PaymentGateway$Media()
..address = json['address'] as String;
Map<String, dynamic> _$PayForRide$Query$PaymentGateway$MediaToJson(
PayForRide$Query$PaymentGateway$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
PayForRide$Query$PaymentGateway _$PayForRide$Query$PaymentGatewayFromJson(
Map<String, dynamic> json) =>
PayForRide$Query$PaymentGateway()
..id = json['id'] as String
..title = json['title'] as String
..type = $enumDecode(_$PaymentGatewayTypeEnumMap, json['type'],
unknownValue: PaymentGatewayType.artemisUnknown)
..publicKey = json['publicKey'] as String?
..media = json['media'] == null
? null
: PayForRide$Query$PaymentGateway$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$PayForRide$Query$PaymentGatewayToJson(
PayForRide$Query$PaymentGateway instance) {
final val = <String, dynamic>{
'id': instance.id,
'title': instance.title,
'type': _$PaymentGatewayTypeEnumMap[instance.type]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('publicKey', instance.publicKey);
writeNotNull('media', instance.media?.toJson());
return val;
}
PayForRide$Query$RiderWallet _$PayForRide$Query$RiderWalletFromJson(
Map<String, dynamic> json) =>
PayForRide$Query$RiderWallet()
..id = json['id'] as String
..balance = (json['balance'] as num).toDouble()
..currency = json['currency'] as String;
Map<String, dynamic> _$PayForRide$Query$RiderWalletToJson(
PayForRide$Query$RiderWallet instance) =>
<String, dynamic>{
'id': instance.id,
'balance': instance.balance,
'currency': instance.currency,
};
PayForRide$Query _$PayForRide$QueryFromJson(Map<String, dynamic> json) =>
PayForRide$Query()
..paymentGateways = (json['paymentGateways'] as List<dynamic>)
.map((e) => PayForRide$Query$PaymentGateway.fromJson(
e as Map<String, dynamic>))
.toList()
..riderWallets = (json['riderWallets'] as List<dynamic>)
.map((e) =>
PayForRide$Query$RiderWallet.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$PayForRide$QueryToJson(PayForRide$Query instance) =>
<String, dynamic>{
'paymentGateways':
instance.paymentGateways.map((e) => e.toJson()).toList(),
'riderWallets': instance.riderWallets.map((e) => e.toJson()).toList(),
};
PayRide$Mutation$TopUpWalletResponse
_$PayRide$Mutation$TopUpWalletResponseFromJson(Map<String, dynamic> json) =>
PayRide$Mutation$TopUpWalletResponse()
..status = $enumDecode(_$TopUpWalletStatusEnumMap, json['status'],
unknownValue: TopUpWalletStatus.artemisUnknown)
..url = json['url'] as String;
Map<String, dynamic> _$PayRide$Mutation$TopUpWalletResponseToJson(
PayRide$Mutation$TopUpWalletResponse instance) =>
<String, dynamic>{
'status': _$TopUpWalletStatusEnumMap[instance.status]!,
'url': instance.url,
};
const _$TopUpWalletStatusEnumMap = {
TopUpWalletStatus.ok: 'OK',
TopUpWalletStatus.redirect: 'Redirect',
TopUpWalletStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
PayRide$Mutation$Order _$PayRide$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
PayRide$Mutation$Order()..id = json['id'] as String;
Map<String, dynamic> _$PayRide$Mutation$OrderToJson(
PayRide$Mutation$Order instance) =>
<String, dynamic>{
'id': instance.id,
};
PayRide$Mutation _$PayRide$MutationFromJson(Map<String, dynamic> json) =>
PayRide$Mutation()
..topUpWallet = PayRide$Mutation$TopUpWalletResponse.fromJson(
json['topUpWallet'] as Map<String, dynamic>)
..updateOneOrder = PayRide$Mutation$Order.fromJson(
json['updateOneOrder'] as Map<String, dynamic>);
Map<String, dynamic> _$PayRide$MutationToJson(PayRide$Mutation instance) =>
<String, dynamic>{
'topUpWallet': instance.topUpWallet.toJson(),
'updateOneOrder': instance.updateOneOrder.toJson(),
};
TopUpWalletInput _$TopUpWalletInputFromJson(Map<String, dynamic> json) =>
TopUpWalletInput(
gatewayId: json['gatewayId'] as String,
amount: (json['amount'] as num).toDouble(),
currency: json['currency'] as String,
token: json['token'] as String?,
pin: (json['pin'] as num?)?.toDouble(),
otp: (json['otp'] as num?)?.toDouble(),
transactionId: json['transactionId'] as String?,
orderNumber: json['orderNumber'] as String?,
);
Map<String, dynamic> _$TopUpWalletInputToJson(TopUpWalletInput instance) {
final val = <String, dynamic>{
'gatewayId': instance.gatewayId,
'amount': instance.amount,
'currency': instance.currency,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('token', instance.token);
writeNotNull('pin', instance.pin);
writeNotNull('otp', instance.otp);
writeNotNull('transactionId', instance.transactionId);
writeNotNull('orderNumber', instance.orderNumber);
return val;
}
TopUpWallet$Mutation$TopUpWalletResponse
_$TopUpWallet$Mutation$TopUpWalletResponseFromJson(
Map<String, dynamic> json) =>
TopUpWallet$Mutation$TopUpWalletResponse()
..status = $enumDecode(_$TopUpWalletStatusEnumMap, json['status'],
unknownValue: TopUpWalletStatus.artemisUnknown)
..url = json['url'] as String;
Map<String, dynamic> _$TopUpWallet$Mutation$TopUpWalletResponseToJson(
TopUpWallet$Mutation$TopUpWalletResponse instance) =>
<String, dynamic>{
'status': _$TopUpWalletStatusEnumMap[instance.status]!,
'url': instance.url,
};
TopUpWallet$Mutation _$TopUpWallet$MutationFromJson(
Map<String, dynamic> json) =>
TopUpWallet$Mutation()
..topUpWallet = TopUpWallet$Mutation$TopUpWalletResponse.fromJson(
json['topUpWallet'] as Map<String, dynamic>);
Map<String, dynamic> _$TopUpWallet$MutationToJson(
TopUpWallet$Mutation instance) =>
<String, dynamic>{
'topUpWallet': instance.topUpWallet.toJson(),
};
GetCurrentOrder$Query$Rider$Media _$GetCurrentOrder$Query$Rider$MediaFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query$Rider$Media()..address = json['address'] as String;
Map<String, dynamic> _$GetCurrentOrder$Query$Rider$MediaToJson(
GetCurrentOrder$Query$Rider$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
GetCurrentOrder$Query$Rider$Order _$GetCurrentOrder$Query$Rider$OrderFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query$Rider$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: CurrentOrderMixin$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..durationBest = json['durationBest'] as int;
Map<String, dynamic> _$GetCurrentOrder$Query$Rider$OrderToJson(
GetCurrentOrder$Query$Rider$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['durationBest'] = instance.durationBest;
return val;
}
GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate
_$GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregateFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate()
..id = json['id'] as int?;
Map<String, dynamic>
_$GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregateToJson(
GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate
instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('id', instance.id);
return val;
}
GetCurrentOrder$Query$Rider$BookedOrders
_$GetCurrentOrder$Query$Rider$BookedOrdersFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query$Rider$BookedOrders()
..count = json['count'] == null
? null
: GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate
.fromJson(json['count'] as Map<String, dynamic>);
Map<String, dynamic> _$GetCurrentOrder$Query$Rider$BookedOrdersToJson(
GetCurrentOrder$Query$Rider$BookedOrders instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('count', instance.count?.toJson());
return val;
}
GetCurrentOrder$Query$Rider _$GetCurrentOrder$Query$RiderFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query$Rider()
..id = json['id'] as String
..mobileNumber = json['mobileNumber'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..gender = $enumDecodeNullable(_$GenderEnumMap, json['gender'],
unknownValue: Gender.artemisUnknown)
..email = json['email'] as String?
..media = json['media'] == null
? null
: GetCurrentOrder$Query$Rider$Media.fromJson(
json['media'] as Map<String, dynamic>)
..orders = (json['orders'] as List<dynamic>)
.map((e) => GetCurrentOrder$Query$Rider$Order.fromJson(
e as Map<String, dynamic>))
.toList()
..bookedOrders = (json['bookedOrders'] as List<dynamic>)
.map((e) => GetCurrentOrder$Query$Rider$BookedOrders.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetCurrentOrder$Query$RiderToJson(
GetCurrentOrder$Query$Rider instance) {
final val = <String, dynamic>{
'id': instance.id,
'mobileNumber': instance.mobileNumber,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('gender', _$GenderEnumMap[instance.gender]);
writeNotNull('email', instance.email);
writeNotNull('media', instance.media?.toJson());
val['orders'] = instance.orders.map((e) => e.toJson()).toList();
val['bookedOrders'] = instance.bookedOrders.map((e) => e.toJson()).toList();
return val;
}
GetCurrentOrder$Query$Point _$GetCurrentOrder$Query$PointFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$GetCurrentOrder$Query$PointToJson(
GetCurrentOrder$Query$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
GetCurrentOrder$Query _$GetCurrentOrder$QueryFromJson(
Map<String, dynamic> json) =>
GetCurrentOrder$Query()
..rider = json['rider'] == null
? null
: GetCurrentOrder$Query$Rider.fromJson(
json['rider'] as Map<String, dynamic>)
..requireUpdate = $enumDecode(
_$VersionStatusEnumMap, json['requireUpdate'],
unknownValue: VersionStatus.artemisUnknown)
..getCurrentOrderDriverLocation = json['getCurrentOrderDriverLocation'] ==
null
? null
: GetCurrentOrder$Query$Point.fromJson(
json['getCurrentOrderDriverLocation'] as Map<String, dynamic>);
Map<String, dynamic> _$GetCurrentOrder$QueryToJson(
GetCurrentOrder$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('rider', instance.rider?.toJson());
val['requireUpdate'] = _$VersionStatusEnumMap[instance.requireUpdate]!;
writeNotNull('getCurrentOrderDriverLocation',
instance.getCurrentOrderDriverLocation?.toJson());
return val;
}
const _$VersionStatusEnumMap = {
VersionStatus.latest: 'Latest',
VersionStatus.mandatoryUpdate: 'MandatoryUpdate',
VersionStatus.optionalUpdate: 'OptionalUpdate',
VersionStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
CurrentOrderMixin$Point _$CurrentOrderMixin$PointFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$CurrentOrderMixin$PointToJson(
CurrentOrderMixin$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
CurrentOrderMixin$Driver$Media _$CurrentOrderMixin$Driver$MediaFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Driver$Media()..address = json['address'] as String;
Map<String, dynamic> _$CurrentOrderMixin$Driver$MediaToJson(
CurrentOrderMixin$Driver$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
CurrentOrderMixin$Driver$CarModel _$CurrentOrderMixin$Driver$CarModelFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Driver$CarModel()..name = json['name'] as String;
Map<String, dynamic> _$CurrentOrderMixin$Driver$CarModelToJson(
CurrentOrderMixin$Driver$CarModel instance) =>
<String, dynamic>{
'name': instance.name,
};
CurrentOrderMixin$Driver$CarColor _$CurrentOrderMixin$Driver$CarColorFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Driver$CarColor()..name = json['name'] as String;
Map<String, dynamic> _$CurrentOrderMixin$Driver$CarColorToJson(
CurrentOrderMixin$Driver$CarColor instance) =>
<String, dynamic>{
'name': instance.name,
};
CurrentOrderMixin$Driver _$CurrentOrderMixin$DriverFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Driver()
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..media = json['media'] == null
? null
: CurrentOrderMixin$Driver$Media.fromJson(
json['media'] as Map<String, dynamic>)
..mobileNumber = json['mobileNumber'] as String
..carPlate = json['carPlate'] as String?
..car = json['car'] == null
? null
: CurrentOrderMixin$Driver$CarModel.fromJson(
json['car'] as Map<String, dynamic>)
..carColor = json['carColor'] == null
? null
: CurrentOrderMixin$Driver$CarColor.fromJson(
json['carColor'] as Map<String, dynamic>)
..rating = json['rating'] as int?;
Map<String, dynamic> _$CurrentOrderMixin$DriverToJson(
CurrentOrderMixin$Driver instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('media', instance.media?.toJson());
val['mobileNumber'] = instance.mobileNumber;
writeNotNull('carPlate', instance.carPlate);
writeNotNull('car', instance.car?.toJson());
writeNotNull('carColor', instance.carColor?.toJson());
writeNotNull('rating', instance.rating);
return val;
}
CurrentOrderMixin$Service$Media _$CurrentOrderMixin$Service$MediaFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Service$Media()..address = json['address'] as String;
Map<String, dynamic> _$CurrentOrderMixin$Service$MediaToJson(
CurrentOrderMixin$Service$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
CurrentOrderMixin$Service _$CurrentOrderMixin$ServiceFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Service()
..media = CurrentOrderMixin$Service$Media.fromJson(
json['media'] as Map<String, dynamic>)
..name = json['name'] as String
..prepayPercent = json['prepayPercent'] as int
..cancellationTotalFee = (json['cancellationTotalFee'] as num).toDouble();
Map<String, dynamic> _$CurrentOrderMixin$ServiceToJson(
CurrentOrderMixin$Service instance) =>
<String, dynamic>{
'media': instance.media.toJson(),
'name': instance.name,
'prepayPercent': instance.prepayPercent,
'cancellationTotalFee': instance.cancellationTotalFee,
};
CreateOrder$Mutation$Order _$CreateOrder$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
CreateOrder$Mutation$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: CurrentOrderMixin$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..durationBest = json['durationBest'] as int;
Map<String, dynamic> _$CreateOrder$Mutation$OrderToJson(
CreateOrder$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['durationBest'] = instance.durationBest;
return val;
}
CreateOrder$Mutation$Rider _$CreateOrder$Mutation$RiderFromJson(
Map<String, dynamic> json) =>
CreateOrder$Mutation$Rider()..id = json['id'] as String;
Map<String, dynamic> _$CreateOrder$Mutation$RiderToJson(
CreateOrder$Mutation$Rider instance) =>
<String, dynamic>{
'id': instance.id,
};
CreateOrder$Mutation _$CreateOrder$MutationFromJson(
Map<String, dynamic> json) =>
CreateOrder$Mutation()
..createOrder = CreateOrder$Mutation$Order.fromJson(
json['createOrder'] as Map<String, dynamic>)
..updateOneRider = CreateOrder$Mutation$Rider.fromJson(
json['updateOneRider'] as Map<String, dynamic>);
Map<String, dynamic> _$CreateOrder$MutationToJson(
CreateOrder$Mutation instance) =>
<String, dynamic>{
'createOrder': instance.createOrder.toJson(),
'updateOneRider': instance.updateOneRider.toJson(),
};
CreateOrderInput _$CreateOrderInputFromJson(Map<String, dynamic> json) =>
CreateOrderInput(
serviceId: json['serviceId'] as int,
intervalMinutes: json['intervalMinutes'] as int,
points: (json['points'] as List<dynamic>)
.map((e) => PointInput.fromJson(e as Map<String, dynamic>))
.toList(),
addresses:
(json['addresses'] as List<dynamic>).map((e) => e as String).toList(),
twoWay: json['twoWay'] as bool?,
optionIds: (json['optionIds'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
couponCode: json['couponCode'] as String?,
);
Map<String, dynamic> _$CreateOrderInputToJson(CreateOrderInput instance) {
final val = <String, dynamic>{
'serviceId': instance.serviceId,
'intervalMinutes': instance.intervalMinutes,
'points': instance.points.map((e) => e.toJson()).toList(),
'addresses': instance.addresses,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('twoWay', instance.twoWay);
writeNotNull('optionIds', instance.optionIds);
writeNotNull('couponCode', instance.couponCode);
return val;
}
CancelOrder$Mutation$Order _$CancelOrder$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
CancelOrder$Mutation$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: CurrentOrderMixin$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..durationBest = json['durationBest'] as int;
Map<String, dynamic> _$CancelOrder$Mutation$OrderToJson(
CancelOrder$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['durationBest'] = instance.durationBest;
return val;
}
CancelOrder$Mutation _$CancelOrder$MutationFromJson(
Map<String, dynamic> json) =>
CancelOrder$Mutation()
..cancelOrder = CancelOrder$Mutation$Order.fromJson(
json['cancelOrder'] as Map<String, dynamic>);
Map<String, dynamic> _$CancelOrder$MutationToJson(
CancelOrder$Mutation instance) =>
<String, dynamic>{
'cancelOrder': instance.cancelOrder.toJson(),
};
UpdateOrder$Mutation$Order _$UpdateOrder$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
UpdateOrder$Mutation$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: CurrentOrderMixin$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..durationBest = json['durationBest'] as int;
Map<String, dynamic> _$UpdateOrder$Mutation$OrderToJson(
UpdateOrder$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['durationBest'] = instance.durationBest;
return val;
}
UpdateOrder$Mutation _$UpdateOrder$MutationFromJson(
Map<String, dynamic> json) =>
UpdateOrder$Mutation()
..updateOneOrder = UpdateOrder$Mutation$Order.fromJson(
json['updateOneOrder'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateOrder$MutationToJson(
UpdateOrder$Mutation instance) =>
<String, dynamic>{
'updateOneOrder': instance.updateOneOrder.toJson(),
};
UpdateOrderInput _$UpdateOrderInputFromJson(Map<String, dynamic> json) =>
UpdateOrderInput(
waitMinutes: json['waitMinutes'] as int?,
status: $enumDecodeNullable(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown),
tipAmount: (json['tipAmount'] as num?)?.toDouble(),
couponCode: json['couponCode'] as String?,
);
Map<String, dynamic> _$UpdateOrderInputToJson(UpdateOrderInput instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('waitMinutes', instance.waitMinutes);
writeNotNull('status', _$OrderStatusEnumMap[instance.status]);
writeNotNull('tipAmount', instance.tipAmount);
writeNotNull('couponCode', instance.couponCode);
return val;
}
UpdatedOrder$Subscription$Order$Point
_$UpdatedOrder$Subscription$Order$PointFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$PointToJson(
UpdatedOrder$Subscription$Order$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
UpdatedOrder$Subscription$Order$Driver$Media
_$UpdatedOrder$Subscription$Order$Driver$MediaFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Driver$Media()
..address = json['address'] as String;
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$Driver$MediaToJson(
UpdatedOrder$Subscription$Order$Driver$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
UpdatedOrder$Subscription$Order$Driver$CarModel
_$UpdatedOrder$Subscription$Order$Driver$CarModelFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Driver$CarModel()
..name = json['name'] as String;
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$Driver$CarModelToJson(
UpdatedOrder$Subscription$Order$Driver$CarModel instance) =>
<String, dynamic>{
'name': instance.name,
};
UpdatedOrder$Subscription$Order$Driver$CarColor
_$UpdatedOrder$Subscription$Order$Driver$CarColorFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Driver$CarColor()
..name = json['name'] as String;
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$Driver$CarColorToJson(
UpdatedOrder$Subscription$Order$Driver$CarColor instance) =>
<String, dynamic>{
'name': instance.name,
};
UpdatedOrder$Subscription$Order$Driver
_$UpdatedOrder$Subscription$Order$DriverFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Driver()
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..media = json['media'] == null
? null
: UpdatedOrder$Subscription$Order$Driver$Media.fromJson(
json['media'] as Map<String, dynamic>)
..mobileNumber = json['mobileNumber'] as String
..carPlate = json['carPlate'] as String?
..car = json['car'] == null
? null
: UpdatedOrder$Subscription$Order$Driver$CarModel.fromJson(
json['car'] as Map<String, dynamic>)
..carColor = json['carColor'] == null
? null
: UpdatedOrder$Subscription$Order$Driver$CarColor.fromJson(
json['carColor'] as Map<String, dynamic>)
..rating = json['rating'] as int?;
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$DriverToJson(
UpdatedOrder$Subscription$Order$Driver instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('media', instance.media?.toJson());
val['mobileNumber'] = instance.mobileNumber;
writeNotNull('carPlate', instance.carPlate);
writeNotNull('car', instance.car?.toJson());
writeNotNull('carColor', instance.carColor?.toJson());
writeNotNull('rating', instance.rating);
return val;
}
UpdatedOrder$Subscription$Order$Service$Media
_$UpdatedOrder$Subscription$Order$Service$MediaFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Service$Media()
..address = json['address'] as String;
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$Service$MediaToJson(
UpdatedOrder$Subscription$Order$Service$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
UpdatedOrder$Subscription$Order$Service
_$UpdatedOrder$Subscription$Order$ServiceFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order$Service()
..media = UpdatedOrder$Subscription$Order$Service$Media.fromJson(
json['media'] as Map<String, dynamic>)
..name = json['name'] as String
..prepayPercent = json['prepayPercent'] as int
..cancellationTotalFee =
(json['cancellationTotalFee'] as num).toDouble();
Map<String, dynamic> _$UpdatedOrder$Subscription$Order$ServiceToJson(
UpdatedOrder$Subscription$Order$Service instance) =>
<String, dynamic>{
'media': instance.media.toJson(),
'name': instance.name,
'prepayPercent': instance.prepayPercent,
'cancellationTotalFee': instance.cancellationTotalFee,
};
UpdatedOrder$Subscription$Order _$UpdatedOrder$Subscription$OrderFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) => UpdatedOrder$Subscription$Order$Point.fromJson(
e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: UpdatedOrder$Subscription$Order$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) => UpdatedOrder$Subscription$Order$Point.fromJson(
e as Map<String, dynamic>))
.toList()
..service = UpdatedOrder$Subscription$Order$Service.fromJson(
json['service'] as Map<String, dynamic>)
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..durationBest = json['durationBest'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int;
Map<String, dynamic> _$UpdatedOrder$Subscription$OrderToJson(
UpdatedOrder$Subscription$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
val['service'] = instance.service.toJson();
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['durationBest'] = instance.durationBest;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
return val;
}
UpdatedOrder$Subscription _$UpdatedOrder$SubscriptionFromJson(
Map<String, dynamic> json) =>
UpdatedOrder$Subscription()
..orderUpdated = UpdatedOrder$Subscription$Order.fromJson(
json['orderUpdated'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdatedOrder$SubscriptionToJson(
UpdatedOrder$Subscription instance) =>
<String, dynamic>{
'orderUpdated': instance.orderUpdated.toJson(),
};
DriverLocationUpdated$Subscription$Point
_$DriverLocationUpdated$Subscription$PointFromJson(
Map<String, dynamic> json) =>
DriverLocationUpdated$Subscription$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$DriverLocationUpdated$Subscription$PointToJson(
DriverLocationUpdated$Subscription$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
DriverLocationUpdated$Subscription _$DriverLocationUpdated$SubscriptionFromJson(
Map<String, dynamic> json) =>
DriverLocationUpdated$Subscription()
..driverLocationUpdated =
DriverLocationUpdated$Subscription$Point.fromJson(
json['driverLocationUpdated'] as Map<String, dynamic>);
Map<String, dynamic> _$DriverLocationUpdated$SubscriptionToJson(
DriverLocationUpdated$Subscription instance) =>
<String, dynamic>{
'driverLocationUpdated': instance.driverLocationUpdated.toJson(),
};
SubmitFeedback$Mutation$Order _$SubmitFeedback$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
SubmitFeedback$Mutation$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: CurrentOrderMixin$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..durationBest = json['durationBest'] as int;
Map<String, dynamic> _$SubmitFeedback$Mutation$OrderToJson(
SubmitFeedback$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['durationBest'] = instance.durationBest;
return val;
}
SubmitFeedback$Mutation _$SubmitFeedback$MutationFromJson(
Map<String, dynamic> json) =>
SubmitFeedback$Mutation()
..submitReview = SubmitFeedback$Mutation$Order.fromJson(
json['submitReview'] as Map<String, dynamic>);
Map<String, dynamic> _$SubmitFeedback$MutationToJson(
SubmitFeedback$Mutation instance) =>
<String, dynamic>{
'submitReview': instance.submitReview.toJson(),
};
GetDriversLocation$Query$Point _$GetDriversLocation$Query$PointFromJson(
Map<String, dynamic> json) =>
GetDriversLocation$Query$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$GetDriversLocation$Query$PointToJson(
GetDriversLocation$Query$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
GetDriversLocation$Query _$GetDriversLocation$QueryFromJson(
Map<String, dynamic> json) =>
GetDriversLocation$Query()
..getDriversLocation = (json['getDriversLocation'] as List<dynamic>)
.map((e) => GetDriversLocation$Query$Point.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetDriversLocation$QueryToJson(
GetDriversLocation$Query instance) =>
<String, dynamic>{
'getDriversLocation':
instance.getDriversLocation.map((e) => e.toJson()).toList(),
};
GetReviewParameters$Query$FeedbackParameter
_$GetReviewParameters$Query$FeedbackParameterFromJson(
Map<String, dynamic> json) =>
GetReviewParameters$Query$FeedbackParameter()
..id = json['id'] as String
..title = json['title'] as String
..isGood = json['isGood'] as bool;
Map<String, dynamic> _$GetReviewParameters$Query$FeedbackParameterToJson(
GetReviewParameters$Query$FeedbackParameter instance) =>
<String, dynamic>{
'id': instance.id,
'title': instance.title,
'isGood': instance.isGood,
};
GetReviewParameters$Query _$GetReviewParameters$QueryFromJson(
Map<String, dynamic> json) =>
GetReviewParameters$Query()
..feedbackParameters = (json['feedbackParameters'] as List<dynamic>)
.map((e) => GetReviewParameters$Query$FeedbackParameter.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetReviewParameters$QueryToJson(
GetReviewParameters$Query instance) =>
<String, dynamic>{
'feedbackParameters':
instance.feedbackParameters.map((e) => e.toJson()).toList(),
};
GetFare$Query$CalculateFareDTO$Point
_$GetFare$Query$CalculateFareDTO$PointFromJson(Map<String, dynamic> json) =>
GetFare$Query$CalculateFareDTO$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$GetFare$Query$CalculateFareDTO$PointToJson(
GetFare$Query$CalculateFareDTO$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$MediaFromJson(
Map<String, dynamic> json) =>
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media()
..address = json['address'] as String;
Map<String, dynamic>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$MediaToJson(
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media
instance) =>
<String, dynamic>{
'address': instance.address,
};
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOptionFromJson(
Map<String, dynamic> json) =>
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption()
..id = json['id'] as String
..name = json['name'] as String
..type = $enumDecode(_$ServiceOptionTypeEnumMap, json['type'],
unknownValue: ServiceOptionType.artemisUnknown)
..additionalFee = (json['additionalFee'] as num?)?.toDouble()
..icon = $enumDecode(_$ServiceOptionIconEnumMap, json['icon'],
unknownValue: ServiceOptionIcon.artemisUnknown);
Map<String, dynamic>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOptionToJson(
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption
instance) {
final val = <String, dynamic>{
'id': instance.id,
'name': instance.name,
'type': _$ServiceOptionTypeEnumMap[instance.type]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('additionalFee', instance.additionalFee);
val['icon'] = _$ServiceOptionIconEnumMap[instance.icon]!;
return val;
}
const _$ServiceOptionTypeEnumMap = {
ServiceOptionType.free: 'Free',
ServiceOptionType.paid: 'Paid',
ServiceOptionType.twoWay: 'TwoWay',
ServiceOptionType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
const _$ServiceOptionIconEnumMap = {
ServiceOptionIcon.pet: 'Pet',
ServiceOptionIcon.twoWay: 'TwoWay',
ServiceOptionIcon.luggage: 'Luggage',
ServiceOptionIcon.packageDelivery: 'PackageDelivery',
ServiceOptionIcon.shopping: 'Shopping',
ServiceOptionIcon.custom1: 'Custom1',
ServiceOptionIcon.custom2: 'Custom2',
ServiceOptionIcon.custom3: 'Custom3',
ServiceOptionIcon.custom4: 'Custom4',
ServiceOptionIcon.custom5: 'Custom5',
ServiceOptionIcon.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
GetFare$Query$CalculateFareDTO$ServiceCategory$Service
_$GetFare$Query$CalculateFareDTO$ServiceCategory$ServiceFromJson(
Map<String, dynamic> json) =>
GetFare$Query$CalculateFareDTO$ServiceCategory$Service()
..id = json['id'] as String
..name = json['name'] as String
..description = json['description'] as String?
..personCapacity = json['personCapacity'] as int?
..prepayPercent = json['prepayPercent'] as int
..twoWayAvailable = json['twoWayAvailable'] as bool
..media = GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media
.fromJson(json['media'] as Map<String, dynamic>)
..options = (json['options'] as List<dynamic>)
.map((e) =>
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption
.fromJson(e as Map<String, dynamic>))
.toList()
..cost = (json['cost'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num?)?.toDouble();
Map<String, dynamic>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$ServiceToJson(
GetFare$Query$CalculateFareDTO$ServiceCategory$Service instance) {
final val = <String, dynamic>{
'id': instance.id,
'name': instance.name,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('description', instance.description);
writeNotNull('personCapacity', instance.personCapacity);
val['prepayPercent'] = instance.prepayPercent;
val['twoWayAvailable'] = instance.twoWayAvailable;
val['media'] = instance.media.toJson();
val['options'] = instance.options.map((e) => e.toJson()).toList();
val['cost'] = instance.cost;
writeNotNull('costAfterCoupon', instance.costAfterCoupon);
return val;
}
GetFare$Query$CalculateFareDTO$ServiceCategory
_$GetFare$Query$CalculateFareDTO$ServiceCategoryFromJson(
Map<String, dynamic> json) =>
GetFare$Query$CalculateFareDTO$ServiceCategory()
..id = json['id'] as String
..name = json['name'] as String
..services = (json['services'] as List<dynamic>)
.map((e) => GetFare$Query$CalculateFareDTO$ServiceCategory$Service
.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetFare$Query$CalculateFareDTO$ServiceCategoryToJson(
GetFare$Query$CalculateFareDTO$ServiceCategory instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'services': instance.services.map((e) => e.toJson()).toList(),
};
GetFare$Query$CalculateFareDTO _$GetFare$Query$CalculateFareDTOFromJson(
Map<String, dynamic> json) =>
GetFare$Query$CalculateFareDTO()
..distance = (json['distance'] as num).toDouble()
..duration = (json['duration'] as num).toDouble()
..currency = json['currency'] as String
..directions = (json['directions'] as List<dynamic>)
.map((e) => GetFare$Query$CalculateFareDTO$Point.fromJson(
e as Map<String, dynamic>))
.toList()
..services = (json['services'] as List<dynamic>)
.map((e) => GetFare$Query$CalculateFareDTO$ServiceCategory.fromJson(
e as Map<String, dynamic>))
.toList()
..error = $enumDecodeNullable(_$CalculateFareErrorEnumMap, json['error'],
unknownValue: CalculateFareError.artemisUnknown);
Map<String, dynamic> _$GetFare$Query$CalculateFareDTOToJson(
GetFare$Query$CalculateFareDTO instance) {
final val = <String, dynamic>{
'distance': instance.distance,
'duration': instance.duration,
'currency': instance.currency,
'directions': instance.directions.map((e) => e.toJson()).toList(),
'services': instance.services.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('error', _$CalculateFareErrorEnumMap[instance.error]);
return val;
}
const _$CalculateFareErrorEnumMap = {
CalculateFareError.regionUnsupported: 'RegionUnsupported',
CalculateFareError.noServiceInRegion: 'NoServiceInRegion',
CalculateFareError.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
GetFare$Query _$GetFare$QueryFromJson(Map<String, dynamic> json) =>
GetFare$Query()
..getFare = GetFare$Query$CalculateFareDTO.fromJson(
json['getFare'] as Map<String, dynamic>);
Map<String, dynamic> _$GetFare$QueryToJson(GetFare$Query instance) =>
<String, dynamic>{
'getFare': instance.getFare.toJson(),
};
ApplyCoupon$Mutation$Order _$ApplyCoupon$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
ApplyCoupon$Mutation$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..driver = json['driver'] == null
? null
: CurrentOrderMixin$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..paidAmount = (json['paidAmount'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..waitMinutes = json['waitMinutes'] as int
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..durationBest = json['durationBest'] as int;
Map<String, dynamic> _$ApplyCoupon$Mutation$OrderToJson(
ApplyCoupon$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['service'] = instance.service.toJson();
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['paidAmount'] = instance.paidAmount;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['costBest'] = instance.costBest;
val['currency'] = instance.currency;
val['addresses'] = instance.addresses;
val['waitMinutes'] = instance.waitMinutes;
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
val['durationBest'] = instance.durationBest;
return val;
}
ApplyCoupon$Mutation _$ApplyCoupon$MutationFromJson(
Map<String, dynamic> json) =>
ApplyCoupon$Mutation()
..applyCoupon = ApplyCoupon$Mutation$Order.fromJson(
json['applyCoupon'] as Map<String, dynamic>);
Map<String, dynamic> _$ApplyCoupon$MutationToJson(
ApplyCoupon$Mutation instance) =>
<String, dynamic>{
'applyCoupon': instance.applyCoupon.toJson(),
};
SendSOS$Mutation$Sos _$SendSOS$Mutation$SosFromJson(
Map<String, dynamic> json) =>
SendSOS$Mutation$Sos()..id = json['id'] as String;
Map<String, dynamic> _$SendSOS$Mutation$SosToJson(
SendSOS$Mutation$Sos instance) =>
<String, dynamic>{
'id': instance.id,
};
SendSOS$Mutation _$SendSOS$MutationFromJson(Map<String, dynamic> json) =>
SendSOS$Mutation()
..sosSignal = SendSOS$Mutation$Sos.fromJson(
json['sosSignal'] as Map<String, dynamic>);
Map<String, dynamic> _$SendSOS$MutationToJson(SendSOS$Mutation instance) =>
<String, dynamic>{
'sosSignal': instance.sosSignal.toJson(),
};
Login$Mutation$Login _$Login$Mutation$LoginFromJson(
Map<String, dynamic> json) =>
Login$Mutation$Login()..jwtToken = json['jwtToken'] as String;
Map<String, dynamic> _$Login$Mutation$LoginToJson(
Login$Mutation$Login instance) =>
<String, dynamic>{
'jwtToken': instance.jwtToken,
};
Login$Mutation _$Login$MutationFromJson(Map<String, dynamic> json) =>
Login$Mutation()
..login =
Login$Mutation$Login.fromJson(json['login'] as Map<String, dynamic>);
Map<String, dynamic> _$Login$MutationToJson(Login$Mutation instance) =>
<String, dynamic>{
'login': instance.login.toJson(),
};
SendMessageArguments _$SendMessageArgumentsFromJson(
Map<String, dynamic> json) =>
SendMessageArguments(
requestId: json['requestId'] as String,
content: json['content'] as String,
);
Map<String, dynamic> _$SendMessageArgumentsToJson(
SendMessageArguments instance) =>
<String, dynamic>{
'requestId': instance.requestId,
'content': instance.content,
};
UpdateProfileArguments _$UpdateProfileArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateProfileArguments(
firstName: json['firstName'] as String,
lastName: json['lastName'] as String,
gender: $enumDecodeNullable(_$GenderEnumMap, json['gender'],
unknownValue: Gender.artemisUnknown),
email: json['email'] as String?,
);
Map<String, dynamic> _$UpdateProfileArgumentsToJson(
UpdateProfileArguments instance) {
final val = <String, dynamic>{
'firstName': instance.firstName,
'lastName': instance.lastName,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('gender', _$GenderEnumMap[instance.gender]);
writeNotNull('email', instance.email);
return val;
}
CreateAddressArguments _$CreateAddressArgumentsFromJson(
Map<String, dynamic> json) =>
CreateAddressArguments(
input: CreateRiderAddressInput.fromJson(
json['input'] as Map<String, dynamic>),
);
Map<String, dynamic> _$CreateAddressArgumentsToJson(
CreateAddressArguments instance) =>
<String, dynamic>{
'input': instance.input.toJson(),
};
UpdateAddressArguments _$UpdateAddressArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateAddressArguments(
id: json['id'] as String,
update: CreateRiderAddressInput.fromJson(
json['update'] as Map<String, dynamic>),
);
Map<String, dynamic> _$UpdateAddressArgumentsToJson(
UpdateAddressArguments instance) =>
<String, dynamic>{
'id': instance.id,
'update': instance.update.toJson(),
};
DeleteAddressArguments _$DeleteAddressArgumentsFromJson(
Map<String, dynamic> json) =>
DeleteAddressArguments(
id: json['id'] as String,
);
Map<String, dynamic> _$DeleteAddressArgumentsToJson(
DeleteAddressArguments instance) =>
<String, dynamic>{
'id': instance.id,
};
GetOrderDetailsArguments _$GetOrderDetailsArgumentsFromJson(
Map<String, dynamic> json) =>
GetOrderDetailsArguments(
id: json['id'] as String,
);
Map<String, dynamic> _$GetOrderDetailsArgumentsToJson(
GetOrderDetailsArguments instance) =>
<String, dynamic>{
'id': instance.id,
};
CancelBookingArguments _$CancelBookingArgumentsFromJson(
Map<String, dynamic> json) =>
CancelBookingArguments(
id: json['id'] as String,
);
Map<String, dynamic> _$CancelBookingArgumentsToJson(
CancelBookingArguments instance) =>
<String, dynamic>{
'id': instance.id,
};
SubmitComplaintArguments _$SubmitComplaintArgumentsFromJson(
Map<String, dynamic> json) =>
SubmitComplaintArguments(
id: json['id'] as String,
subject: json['subject'] as String,
content: json['content'] as String,
);
Map<String, dynamic> _$SubmitComplaintArgumentsToJson(
SubmitComplaintArguments instance) =>
<String, dynamic>{
'id': instance.id,
'subject': instance.subject,
'content': instance.content,
};
PayRideArguments _$PayRideArgumentsFromJson(Map<String, dynamic> json) =>
PayRideArguments(
input: TopUpWalletInput.fromJson(json['input'] as Map<String, dynamic>),
orderId: json['orderId'] as String,
tipAmount: (json['tipAmount'] as num?)?.toDouble(),
shouldPreauth: json['shouldPreauth'] as bool,
);
Map<String, dynamic> _$PayRideArgumentsToJson(PayRideArguments instance) {
final val = <String, dynamic>{
'input': instance.input.toJson(),
'orderId': instance.orderId,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('tipAmount', instance.tipAmount);
val['shouldPreauth'] = instance.shouldPreauth;
return val;
}
TopUpWalletArguments _$TopUpWalletArgumentsFromJson(
Map<String, dynamic> json) =>
TopUpWalletArguments(
input: TopUpWalletInput.fromJson(json['input'] as Map<String, dynamic>),
);
Map<String, dynamic> _$TopUpWalletArgumentsToJson(
TopUpWalletArguments instance) =>
<String, dynamic>{
'input': instance.input.toJson(),
};
GetCurrentOrderArguments _$GetCurrentOrderArgumentsFromJson(
Map<String, dynamic> json) =>
GetCurrentOrderArguments(
versionCode: json['versionCode'] as int,
);
Map<String, dynamic> _$GetCurrentOrderArgumentsToJson(
GetCurrentOrderArguments instance) =>
<String, dynamic>{
'versionCode': instance.versionCode,
};
CreateOrderArguments _$CreateOrderArgumentsFromJson(
Map<String, dynamic> json) =>
CreateOrderArguments(
input: CreateOrderInput.fromJson(json['input'] as Map<String, dynamic>),
notificationPlayerId: json['notificationPlayerId'] as String,
);
Map<String, dynamic> _$CreateOrderArgumentsToJson(
CreateOrderArguments instance) =>
<String, dynamic>{
'input': instance.input.toJson(),
'notificationPlayerId': instance.notificationPlayerId,
};
UpdateOrderArguments _$UpdateOrderArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateOrderArguments(
id: json['id'] as String,
update: UpdateOrderInput.fromJson(json['update'] as Map<String, dynamic>),
);
Map<String, dynamic> _$UpdateOrderArgumentsToJson(
UpdateOrderArguments instance) =>
<String, dynamic>{
'id': instance.id,
'update': instance.update.toJson(),
};
DriverLocationUpdatedArguments _$DriverLocationUpdatedArgumentsFromJson(
Map<String, dynamic> json) =>
DriverLocationUpdatedArguments(
driverId: json['driverId'] as String,
);
Map<String, dynamic> _$DriverLocationUpdatedArgumentsToJson(
DriverLocationUpdatedArguments instance) =>
<String, dynamic>{
'driverId': instance.driverId,
};
SubmitFeedbackArguments _$SubmitFeedbackArgumentsFromJson(
Map<String, dynamic> json) =>
SubmitFeedbackArguments(
score: json['score'] as int,
description: json['description'] as String,
orderId: json['orderId'] as String,
parameterIds: (json['parameterIds'] as List<dynamic>)
.map((e) => e as String)
.toList(),
);
Map<String, dynamic> _$SubmitFeedbackArgumentsToJson(
SubmitFeedbackArguments instance) =>
<String, dynamic>{
'score': instance.score,
'description': instance.description,
'orderId': instance.orderId,
'parameterIds': instance.parameterIds,
};
GetDriversLocationArguments _$GetDriversLocationArgumentsFromJson(
Map<String, dynamic> json) =>
GetDriversLocationArguments(
point: json['point'] == null
? null
: PointInput.fromJson(json['point'] as Map<String, dynamic>),
);
Map<String, dynamic> _$GetDriversLocationArgumentsToJson(
GetDriversLocationArguments instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('point', instance.point?.toJson());
return val;
}
GetFareArguments _$GetFareArgumentsFromJson(Map<String, dynamic> json) =>
GetFareArguments(
points: (json['points'] as List<dynamic>)
.map((e) => PointInput.fromJson(e as Map<String, dynamic>))
.toList(),
couponCode: json['couponCode'] as String?,
selectedOptionIds: (json['selectedOptionIds'] as List<dynamic>?)
?.map((e) => e as String)
.toList(),
);
Map<String, dynamic> _$GetFareArgumentsToJson(GetFareArguments instance) {
final val = <String, dynamic>{
'points': instance.points.map((e) => e.toJson()).toList(),
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('couponCode', instance.couponCode);
writeNotNull('selectedOptionIds', instance.selectedOptionIds);
return val;
}
ApplyCouponArguments _$ApplyCouponArgumentsFromJson(
Map<String, dynamic> json) =>
ApplyCouponArguments(
code: json['code'] as String,
);
Map<String, dynamic> _$ApplyCouponArgumentsToJson(
ApplyCouponArguments instance) =>
<String, dynamic>{
'code': instance.code,
};
SendSOSArguments _$SendSOSArgumentsFromJson(Map<String, dynamic> json) =>
SendSOSArguments(
orderId: json['orderId'] as String,
location: json['location'] == null
? null
: PointInput.fromJson(json['location'] as Map<String, dynamic>),
);
Map<String, dynamic> _$SendSOSArgumentsToJson(SendSOSArguments instance) {
final val = <String, dynamic>{
'orderId': instance.orderId,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('location', instance.location?.toJson());
return val;
}
LoginArguments _$LoginArgumentsFromJson(Map<String, dynamic> json) =>
LoginArguments(
firebaseToken: json['firebaseToken'] as String,
);
Map<String, dynamic> _$LoginArgumentsToJson(LoginArguments instance) =>
<String, dynamic>{
'firebaseToken': instance.firebaseToken,
};
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib/graphql | mirrored_repositories/RideFlutter/rider-app/lib/graphql/generated/graphql_api.graphql.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
import 'package:artemis/artemis.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:equatable/equatable.dart';
import 'package:gql/ast.dart';
import '../scalars/timestamp.dart';
import '../scalars/connection_cursor.dart';
part 'graphql_api.graphql.g.dart';
mixin ChatRiderMixin {
late String id;
String? firstName;
String? lastName;
late String mobileNumber;
ChatRiderMixin$Media? media;
}
mixin ChatDriverMixin {
late String id;
String? firstName;
String? lastName;
late String mobileNumber;
ChatDriverMixin$Media? media;
}
mixin ChatMessageMixin {
late String id;
late String content;
late bool sentByDriver;
}
mixin HistoryOrderItemMixin {
late List<HistoryOrderItemMixin$OrderEdge> edges;
late HistoryOrderItemMixin$PageInfo pageInfo;
}
mixin PointMixin {
late double lat;
late double lng;
}
mixin CurrentOrderMixin {
late String id;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
late List<CurrentOrderMixin$Point> points;
CurrentOrderMixin$Driver? driver;
late CurrentOrderMixin$Service service;
List<CurrentOrderMixin$Point>? directions;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? etaPickup;
late double paidAmount;
late double costAfterCoupon;
late double costBest;
late String currency;
late List<String> addresses;
late int waitMinutes;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? startTimestamp;
late int durationBest;
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Order$Rider extends JsonSerializable
with EquatableMixin, ChatRiderMixin {
GetMessages$Query$Order$Rider();
factory GetMessages$Query$Order$Rider.fromJson(Map<String, dynamic> json) =>
_$GetMessages$Query$Order$RiderFromJson(json);
@override
List<Object?> get props => [id, firstName, lastName, mobileNumber, media];
@override
Map<String, dynamic> toJson() => _$GetMessages$Query$Order$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Order$Driver extends JsonSerializable
with EquatableMixin, ChatDriverMixin {
GetMessages$Query$Order$Driver();
factory GetMessages$Query$Order$Driver.fromJson(Map<String, dynamic> json) =>
_$GetMessages$Query$Order$DriverFromJson(json);
@override
List<Object?> get props => [id, firstName, lastName, mobileNumber, media];
@override
Map<String, dynamic> toJson() => _$GetMessages$Query$Order$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Order$OrderMessage extends JsonSerializable
with EquatableMixin, ChatMessageMixin {
GetMessages$Query$Order$OrderMessage();
factory GetMessages$Query$Order$OrderMessage.fromJson(
Map<String, dynamic> json) =>
_$GetMessages$Query$Order$OrderMessageFromJson(json);
@override
List<Object?> get props => [id, content, sentByDriver];
@override
Map<String, dynamic> toJson() =>
_$GetMessages$Query$Order$OrderMessageToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Order extends JsonSerializable with EquatableMixin {
GetMessages$Query$Order();
factory GetMessages$Query$Order.fromJson(Map<String, dynamic> json) =>
_$GetMessages$Query$OrderFromJson(json);
late String id;
late GetMessages$Query$Order$Rider rider;
GetMessages$Query$Order$Driver? driver;
late List<GetMessages$Query$Order$OrderMessage> conversations;
@override
List<Object?> get props => [id, rider, driver, conversations];
@override
Map<String, dynamic> toJson() => _$GetMessages$Query$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query extends JsonSerializable with EquatableMixin {
GetMessages$Query();
factory GetMessages$Query.fromJson(Map<String, dynamic> json) =>
_$GetMessages$QueryFromJson(json);
late GetMessages$Query$Order currentOrder;
@override
List<Object?> get props => [currentOrder];
@override
Map<String, dynamic> toJson() => _$GetMessages$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ChatRiderMixin$Media extends JsonSerializable with EquatableMixin {
ChatRiderMixin$Media();
factory ChatRiderMixin$Media.fromJson(Map<String, dynamic> json) =>
_$ChatRiderMixin$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$ChatRiderMixin$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ChatDriverMixin$Media extends JsonSerializable with EquatableMixin {
ChatDriverMixin$Media();
factory ChatDriverMixin$Media.fromJson(Map<String, dynamic> json) =>
_$ChatDriverMixin$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$ChatDriverMixin$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SendMessage$Mutation$OrderMessage extends JsonSerializable
with EquatableMixin, ChatMessageMixin {
SendMessage$Mutation$OrderMessage();
factory SendMessage$Mutation$OrderMessage.fromJson(
Map<String, dynamic> json) =>
_$SendMessage$Mutation$OrderMessageFromJson(json);
@override
List<Object?> get props => [id, content, sentByDriver];
@override
Map<String, dynamic> toJson() =>
_$SendMessage$Mutation$OrderMessageToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SendMessage$Mutation extends JsonSerializable with EquatableMixin {
SendMessage$Mutation();
factory SendMessage$Mutation.fromJson(Map<String, dynamic> json) =>
_$SendMessage$MutationFromJson(json);
late SendMessage$Mutation$OrderMessage createOneOrderMessage;
@override
List<Object?> get props => [createOneOrderMessage];
@override
Map<String, dynamic> toJson() => _$SendMessage$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class NewMessageReceived$Subscription$OrderMessage extends JsonSerializable
with EquatableMixin, ChatMessageMixin {
NewMessageReceived$Subscription$OrderMessage();
factory NewMessageReceived$Subscription$OrderMessage.fromJson(
Map<String, dynamic> json) =>
_$NewMessageReceived$Subscription$OrderMessageFromJson(json);
@override
List<Object?> get props => [id, content, sentByDriver];
@override
Map<String, dynamic> toJson() =>
_$NewMessageReceived$Subscription$OrderMessageToJson(this);
}
@JsonSerializable(explicitToJson: true)
class NewMessageReceived$Subscription extends JsonSerializable
with EquatableMixin {
NewMessageReceived$Subscription();
factory NewMessageReceived$Subscription.fromJson(Map<String, dynamic> json) =>
_$NewMessageReceived$SubscriptionFromJson(json);
late NewMessageReceived$Subscription$OrderMessage newMessageReceived;
@override
List<Object?> get props => [newMessageReceived];
@override
Map<String, dynamic> toJson() =>
_$NewMessageReceived$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Reservations$Query$OrderConnection$OrderEdge$Order
extends JsonSerializable with EquatableMixin {
Reservations$Query$OrderConnection$OrderEdge$Order();
factory Reservations$Query$OrderConnection$OrderEdge$Order.fromJson(
Map<String, dynamic> json) =>
_$Reservations$Query$OrderConnection$OrderEdge$OrderFromJson(json);
late String id;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime expectedTimestamp;
late List<String> addresses;
@override
List<Object?> get props => [id, expectedTimestamp, addresses];
@override
Map<String, dynamic> toJson() =>
_$Reservations$Query$OrderConnection$OrderEdge$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Reservations$Query$OrderConnection$OrderEdge extends JsonSerializable
with EquatableMixin {
Reservations$Query$OrderConnection$OrderEdge();
factory Reservations$Query$OrderConnection$OrderEdge.fromJson(
Map<String, dynamic> json) =>
_$Reservations$Query$OrderConnection$OrderEdgeFromJson(json);
late Reservations$Query$OrderConnection$OrderEdge$Order node;
@override
List<Object?> get props => [node];
@override
Map<String, dynamic> toJson() =>
_$Reservations$Query$OrderConnection$OrderEdgeToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Reservations$Query$OrderConnection extends JsonSerializable
with EquatableMixin {
Reservations$Query$OrderConnection();
factory Reservations$Query$OrderConnection.fromJson(
Map<String, dynamic> json) =>
_$Reservations$Query$OrderConnectionFromJson(json);
late List<Reservations$Query$OrderConnection$OrderEdge> edges;
@override
List<Object?> get props => [edges];
@override
Map<String, dynamic> toJson() =>
_$Reservations$Query$OrderConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Reservations$Query extends JsonSerializable with EquatableMixin {
Reservations$Query();
factory Reservations$Query.fromJson(Map<String, dynamic> json) =>
_$Reservations$QueryFromJson(json);
late Reservations$Query$OrderConnection orders;
@override
List<Object?> get props => [orders];
@override
Map<String, dynamic> toJson() => _$Reservations$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement
extends JsonSerializable with EquatableMixin {
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement();
factory GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement.fromJson(
Map<String, dynamic> json) =>
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$AnnouncementFromJson(
json);
late String id;
late String title;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime startAt;
late String description;
String? url;
@override
List<Object?> get props => [id, title, startAt, description, url];
@override
Map<String, dynamic> toJson() =>
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$AnnouncementToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge
extends JsonSerializable with EquatableMixin {
GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge();
factory GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge.fromJson(
Map<String, dynamic> json) =>
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdgeFromJson(
json);
late GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge$Announcement
node;
@override
List<Object?> get props => [node];
@override
Map<String, dynamic> toJson() =>
_$GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdgeToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetAnnouncements$Query$AnnouncementConnection extends JsonSerializable
with EquatableMixin {
GetAnnouncements$Query$AnnouncementConnection();
factory GetAnnouncements$Query$AnnouncementConnection.fromJson(
Map<String, dynamic> json) =>
_$GetAnnouncements$Query$AnnouncementConnectionFromJson(json);
late List<GetAnnouncements$Query$AnnouncementConnection$AnnouncementEdge>
edges;
@override
List<Object?> get props => [edges];
@override
Map<String, dynamic> toJson() =>
_$GetAnnouncements$Query$AnnouncementConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetAnnouncements$Query extends JsonSerializable with EquatableMixin {
GetAnnouncements$Query();
factory GetAnnouncements$Query.fromJson(Map<String, dynamic> json) =>
_$GetAnnouncements$QueryFromJson(json);
late GetAnnouncements$Query$AnnouncementConnection announcements;
@override
List<Object?> get props => [announcements];
@override
Map<String, dynamic> toJson() => _$GetAnnouncements$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetRider$Query$Rider$Media extends JsonSerializable with EquatableMixin {
GetRider$Query$Rider$Media();
factory GetRider$Query$Rider$Media.fromJson(Map<String, dynamic> json) =>
_$GetRider$Query$Rider$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$GetRider$Query$Rider$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetRider$Query$Rider extends JsonSerializable with EquatableMixin {
GetRider$Query$Rider();
factory GetRider$Query$Rider.fromJson(Map<String, dynamic> json) =>
_$GetRider$Query$RiderFromJson(json);
late String id;
late String mobileNumber;
String? firstName;
String? lastName;
@JsonKey(unknownEnumValue: Gender.artemisUnknown)
Gender? gender;
String? email;
GetRider$Query$Rider$Media? media;
@override
List<Object?> get props =>
[id, mobileNumber, firstName, lastName, gender, email, media];
@override
Map<String, dynamic> toJson() => _$GetRider$Query$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetRider$Query extends JsonSerializable with EquatableMixin {
GetRider$Query();
factory GetRider$Query.fromJson(Map<String, dynamic> json) =>
_$GetRider$QueryFromJson(json);
GetRider$Query$Rider? rider;
@override
List<Object?> get props => [rider];
@override
Map<String, dynamic> toJson() => _$GetRider$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateProfile$Mutation$Rider extends JsonSerializable
with EquatableMixin {
UpdateProfile$Mutation$Rider();
factory UpdateProfile$Mutation$Rider.fromJson(Map<String, dynamic> json) =>
_$UpdateProfile$Mutation$RiderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$UpdateProfile$Mutation$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateProfile$Mutation extends JsonSerializable with EquatableMixin {
UpdateProfile$Mutation();
factory UpdateProfile$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateProfile$MutationFromJson(json);
late UpdateProfile$Mutation$Rider updateOneRider;
@override
List<Object?> get props => [updateOneRider];
@override
Map<String, dynamic> toJson() => _$UpdateProfile$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DeleteUser$Mutation$Rider extends JsonSerializable with EquatableMixin {
DeleteUser$Mutation$Rider();
factory DeleteUser$Mutation$Rider.fromJson(Map<String, dynamic> json) =>
_$DeleteUser$Mutation$RiderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$DeleteUser$Mutation$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DeleteUser$Mutation extends JsonSerializable with EquatableMixin {
DeleteUser$Mutation();
factory DeleteUser$Mutation.fromJson(Map<String, dynamic> json) =>
_$DeleteUser$MutationFromJson(json);
late DeleteUser$Mutation$Rider deleteUser;
@override
List<Object?> get props => [deleteUser];
@override
Map<String, dynamic> toJson() => _$DeleteUser$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetAddresses$Query$RiderAddress$Point extends JsonSerializable
with EquatableMixin {
GetAddresses$Query$RiderAddress$Point();
factory GetAddresses$Query$RiderAddress$Point.fromJson(
Map<String, dynamic> json) =>
_$GetAddresses$Query$RiderAddress$PointFromJson(json);
late double lat;
late double lng;
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() =>
_$GetAddresses$Query$RiderAddress$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetAddresses$Query$RiderAddress extends JsonSerializable
with EquatableMixin {
GetAddresses$Query$RiderAddress();
factory GetAddresses$Query$RiderAddress.fromJson(Map<String, dynamic> json) =>
_$GetAddresses$Query$RiderAddressFromJson(json);
late String id;
late String title;
@JsonKey(unknownEnumValue: RiderAddressType.artemisUnknown)
late RiderAddressType type;
late String details;
late GetAddresses$Query$RiderAddress$Point location;
@override
List<Object?> get props => [id, title, type, details, location];
@override
Map<String, dynamic> toJson() =>
_$GetAddresses$Query$RiderAddressToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetAddresses$Query extends JsonSerializable with EquatableMixin {
GetAddresses$Query();
factory GetAddresses$Query.fromJson(Map<String, dynamic> json) =>
_$GetAddresses$QueryFromJson(json);
late List<GetAddresses$Query$RiderAddress> riderAddresses;
@override
List<Object?> get props => [riderAddresses];
@override
Map<String, dynamic> toJson() => _$GetAddresses$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateAddress$Mutation$RiderAddress extends JsonSerializable
with EquatableMixin {
CreateAddress$Mutation$RiderAddress();
factory CreateAddress$Mutation$RiderAddress.fromJson(
Map<String, dynamic> json) =>
_$CreateAddress$Mutation$RiderAddressFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$CreateAddress$Mutation$RiderAddressToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateAddress$Mutation extends JsonSerializable with EquatableMixin {
CreateAddress$Mutation();
factory CreateAddress$Mutation.fromJson(Map<String, dynamic> json) =>
_$CreateAddress$MutationFromJson(json);
late CreateAddress$Mutation$RiderAddress createOneRiderAddress;
@override
List<Object?> get props => [createOneRiderAddress];
@override
Map<String, dynamic> toJson() => _$CreateAddress$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateRiderAddressInput extends JsonSerializable with EquatableMixin {
CreateRiderAddressInput({
required this.title,
required this.details,
required this.location,
this.type,
});
factory CreateRiderAddressInput.fromJson(Map<String, dynamic> json) =>
_$CreateRiderAddressInputFromJson(json);
late String title;
late String details;
late PointInput location;
@JsonKey(unknownEnumValue: RiderAddressType.artemisUnknown)
RiderAddressType? type;
@override
List<Object?> get props => [title, details, location, type];
@override
Map<String, dynamic> toJson() => _$CreateRiderAddressInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PointInput extends JsonSerializable with EquatableMixin {
PointInput({
required this.lat,
required this.lng,
});
factory PointInput.fromJson(Map<String, dynamic> json) =>
_$PointInputFromJson(json);
late double lat;
late double lng;
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$PointInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateAddress$Mutation$RiderAddress extends JsonSerializable
with EquatableMixin {
UpdateAddress$Mutation$RiderAddress();
factory UpdateAddress$Mutation$RiderAddress.fromJson(
Map<String, dynamic> json) =>
_$UpdateAddress$Mutation$RiderAddressFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$UpdateAddress$Mutation$RiderAddressToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateAddress$Mutation extends JsonSerializable with EquatableMixin {
UpdateAddress$Mutation();
factory UpdateAddress$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateAddress$MutationFromJson(json);
late UpdateAddress$Mutation$RiderAddress updateOneRiderAddress;
@override
List<Object?> get props => [updateOneRiderAddress];
@override
Map<String, dynamic> toJson() => _$UpdateAddress$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DeleteAddress$Mutation$RiderAddressDeleteResponse extends JsonSerializable
with EquatableMixin {
DeleteAddress$Mutation$RiderAddressDeleteResponse();
factory DeleteAddress$Mutation$RiderAddressDeleteResponse.fromJson(
Map<String, dynamic> json) =>
_$DeleteAddress$Mutation$RiderAddressDeleteResponseFromJson(json);
String? id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$DeleteAddress$Mutation$RiderAddressDeleteResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DeleteAddress$Mutation extends JsonSerializable with EquatableMixin {
DeleteAddress$Mutation();
factory DeleteAddress$Mutation.fromJson(Map<String, dynamic> json) =>
_$DeleteAddress$MutationFromJson(json);
late DeleteAddress$Mutation$RiderAddressDeleteResponse deleteOneRiderAddress;
@override
List<Object?> get props => [deleteOneRiderAddress];
@override
Map<String, dynamic> toJson() => _$DeleteAddress$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetHistory$Query$OrderConnection extends JsonSerializable
with EquatableMixin, HistoryOrderItemMixin {
GetHistory$Query$OrderConnection();
factory GetHistory$Query$OrderConnection.fromJson(
Map<String, dynamic> json) =>
_$GetHistory$Query$OrderConnectionFromJson(json);
@override
List<Object?> get props => [edges, pageInfo];
@override
Map<String, dynamic> toJson() =>
_$GetHistory$Query$OrderConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetHistory$Query extends JsonSerializable with EquatableMixin {
GetHistory$Query();
factory GetHistory$Query.fromJson(Map<String, dynamic> json) =>
_$GetHistory$QueryFromJson(json);
late GetHistory$Query$OrderConnection orders;
@override
List<Object?> get props => [orders];
@override
Map<String, dynamic> toJson() => _$GetHistory$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge$Order$Service$Media
extends JsonSerializable with EquatableMixin {
HistoryOrderItemMixin$OrderEdge$Order$Service$Media();
factory HistoryOrderItemMixin$OrderEdge$Order$Service$Media.fromJson(
Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdge$Order$Service$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdge$Order$Service$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge$Order$Service extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$OrderEdge$Order$Service();
factory HistoryOrderItemMixin$OrderEdge$Order$Service.fromJson(
Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdge$Order$ServiceFromJson(json);
late HistoryOrderItemMixin$OrderEdge$Order$Service$Media media;
late String name;
@override
List<Object?> get props => [media, name];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdge$Order$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge$Order extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$OrderEdge$Order();
factory HistoryOrderItemMixin$OrderEdge$Order.fromJson(
Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdge$OrderFromJson(json);
late String id;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime createdOn;
late List<String> addresses;
late String currency;
late double costAfterCoupon;
late HistoryOrderItemMixin$OrderEdge$Order$Service service;
@override
List<Object?> get props =>
[id, status, createdOn, addresses, currency, costAfterCoupon, service];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdge$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$OrderEdge();
factory HistoryOrderItemMixin$OrderEdge.fromJson(Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdgeFromJson(json);
late HistoryOrderItemMixin$OrderEdge$Order node;
@override
List<Object?> get props => [node];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdgeToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$PageInfo extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$PageInfo();
factory HistoryOrderItemMixin$PageInfo.fromJson(Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$PageInfoFromJson(json);
bool? hasNextPage;
@JsonKey(
fromJson: fromGraphQLConnectionCursorNullableToDartStringNullable,
toJson: fromDartStringNullableToGraphQLConnectionCursorNullable)
String? endCursor;
@JsonKey(
fromJson: fromGraphQLConnectionCursorNullableToDartStringNullable,
toJson: fromDartStringNullableToGraphQLConnectionCursorNullable)
String? startCursor;
bool? hasPreviousPage;
@override
List<Object?> get props =>
[hasNextPage, endCursor, startCursor, hasPreviousPage];
@override
Map<String, dynamic> toJson() => _$HistoryOrderItemMixin$PageInfoToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Point extends JsonSerializable
with EquatableMixin, PointMixin {
GetOrderDetails$Query$Order$Point();
factory GetOrderDetails$Query$Order$Point.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Driver$Media extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$Driver$Media();
factory GetOrderDetails$Query$Order$Driver$Media.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$Driver$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$Driver$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Driver$CarModel extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$Driver$CarModel();
factory GetOrderDetails$Query$Order$Driver$CarModel.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$Driver$CarModelFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$Driver$CarModelToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Driver extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$Driver();
factory GetOrderDetails$Query$Order$Driver.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$DriverFromJson(json);
String? firstName;
String? lastName;
int? rating;
String? carPlate;
GetOrderDetails$Query$Order$Driver$Media? media;
GetOrderDetails$Query$Order$Driver$CarModel? car;
@override
List<Object?> get props =>
[firstName, lastName, rating, carPlate, media, car];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Service$Media extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$Service$Media();
factory GetOrderDetails$Query$Order$Service$Media.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$Service$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$Service$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Service extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$Service();
factory GetOrderDetails$Query$Order$Service.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$ServiceFromJson(json);
late String name;
late GetOrderDetails$Query$Order$Service$Media media;
@override
List<Object?> get props => [name, media];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$PaymentGateway$Media extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$PaymentGateway$Media();
factory GetOrderDetails$Query$Order$PaymentGateway$Media.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$PaymentGateway$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$PaymentGateway$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$PaymentGateway extends JsonSerializable
with EquatableMixin {
GetOrderDetails$Query$Order$PaymentGateway();
factory GetOrderDetails$Query$Order$PaymentGateway.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$PaymentGatewayFromJson(json);
late String title;
GetOrderDetails$Query$Order$PaymentGateway$Media? media;
@override
List<Object?> get props => [title, media];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$PaymentGatewayToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order extends JsonSerializable with EquatableMixin {
GetOrderDetails$Query$Order();
factory GetOrderDetails$Query$Order.fromJson(Map<String, dynamic> json) =>
_$GetOrderDetails$Query$OrderFromJson(json);
late List<GetOrderDetails$Query$Order$Point> points;
late List<String> addresses;
late double costAfterCoupon;
late String currency;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? startTimestamp;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? finishTimestamp;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime expectedTimestamp;
GetOrderDetails$Query$Order$Driver? driver;
late GetOrderDetails$Query$Order$Service service;
GetOrderDetails$Query$Order$PaymentGateway? paymentGateway;
@override
List<Object?> get props => [
points,
addresses,
costAfterCoupon,
currency,
startTimestamp,
finishTimestamp,
expectedTimestamp,
driver,
service,
paymentGateway
];
@override
Map<String, dynamic> toJson() => _$GetOrderDetails$Query$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query extends JsonSerializable with EquatableMixin {
GetOrderDetails$Query();
factory GetOrderDetails$Query.fromJson(Map<String, dynamic> json) =>
_$GetOrderDetails$QueryFromJson(json);
GetOrderDetails$Query$Order? order;
@override
List<Object?> get props => [order];
@override
Map<String, dynamic> toJson() => _$GetOrderDetails$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CancelBooking$Mutation$Order extends JsonSerializable
with EquatableMixin {
CancelBooking$Mutation$Order();
factory CancelBooking$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$CancelBooking$Mutation$OrderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$CancelBooking$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CancelBooking$Mutation extends JsonSerializable with EquatableMixin {
CancelBooking$Mutation();
factory CancelBooking$Mutation.fromJson(Map<String, dynamic> json) =>
_$CancelBooking$MutationFromJson(json);
late CancelBooking$Mutation$Order cancelBooking;
@override
List<Object?> get props => [cancelBooking];
@override
Map<String, dynamic> toJson() => _$CancelBooking$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SubmitComplaint$Mutation$Complaint extends JsonSerializable
with EquatableMixin {
SubmitComplaint$Mutation$Complaint();
factory SubmitComplaint$Mutation$Complaint.fromJson(
Map<String, dynamic> json) =>
_$SubmitComplaint$Mutation$ComplaintFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$SubmitComplaint$Mutation$ComplaintToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SubmitComplaint$Mutation extends JsonSerializable with EquatableMixin {
SubmitComplaint$Mutation();
factory SubmitComplaint$Mutation.fromJson(Map<String, dynamic> json) =>
_$SubmitComplaint$MutationFromJson(json);
late SubmitComplaint$Mutation$Complaint createOneComplaint;
@override
List<Object?> get props => [createOneComplaint];
@override
Map<String, dynamic> toJson() => _$SubmitComplaint$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$RiderWallet extends JsonSerializable with EquatableMixin {
Wallet$Query$RiderWallet();
factory Wallet$Query$RiderWallet.fromJson(Map<String, dynamic> json) =>
_$Wallet$Query$RiderWalletFromJson(json);
late String id;
late double balance;
late String currency;
@override
List<Object?> get props => [id, balance, currency];
@override
Map<String, dynamic> toJson() => _$Wallet$Query$RiderWalletToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion
extends JsonSerializable with EquatableMixin {
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion();
factory Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion.fromJson(
Map<String, dynamic> json) =>
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacionFromJson(
json);
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime createdAt;
late double amount;
late String currency;
String? refrenceNumber;
@JsonKey(unknownEnumValue: RiderDeductTransactionType.artemisUnknown)
RiderDeductTransactionType? deductType;
@JsonKey(unknownEnumValue: TransactionAction.artemisUnknown)
late TransactionAction action;
@JsonKey(unknownEnumValue: RiderRechargeTransactionType.artemisUnknown)
RiderRechargeTransactionType? rechargeType;
@override
List<Object?> get props => [
createdAt,
amount,
currency,
refrenceNumber,
deductType,
action,
rechargeType
];
@override
Map<String, dynamic> toJson() =>
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacionToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$RiderTransacionConnection$RiderTransacionEdge
extends JsonSerializable with EquatableMixin {
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge();
factory Wallet$Query$RiderTransacionConnection$RiderTransacionEdge.fromJson(
Map<String, dynamic> json) =>
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdgeFromJson(
json);
late Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion
node;
@override
List<Object?> get props => [node];
@override
Map<String, dynamic> toJson() =>
_$Wallet$Query$RiderTransacionConnection$RiderTransacionEdgeToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$RiderTransacionConnection extends JsonSerializable
with EquatableMixin {
Wallet$Query$RiderTransacionConnection();
factory Wallet$Query$RiderTransacionConnection.fromJson(
Map<String, dynamic> json) =>
_$Wallet$Query$RiderTransacionConnectionFromJson(json);
late List<Wallet$Query$RiderTransacionConnection$RiderTransacionEdge> edges;
@override
List<Object?> get props => [edges];
@override
Map<String, dynamic> toJson() =>
_$Wallet$Query$RiderTransacionConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query extends JsonSerializable with EquatableMixin {
Wallet$Query();
factory Wallet$Query.fromJson(Map<String, dynamic> json) =>
_$Wallet$QueryFromJson(json);
late List<Wallet$Query$RiderWallet> riderWallets;
late Wallet$Query$RiderTransacionConnection riderTransacions;
@override
List<Object?> get props => [riderWallets, riderTransacions];
@override
Map<String, dynamic> toJson() => _$Wallet$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PaymentGateways$Query$PaymentGateway$Media extends JsonSerializable
with EquatableMixin {
PaymentGateways$Query$PaymentGateway$Media();
factory PaymentGateways$Query$PaymentGateway$Media.fromJson(
Map<String, dynamic> json) =>
_$PaymentGateways$Query$PaymentGateway$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$PaymentGateways$Query$PaymentGateway$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PaymentGateways$Query$PaymentGateway extends JsonSerializable
with EquatableMixin {
PaymentGateways$Query$PaymentGateway();
factory PaymentGateways$Query$PaymentGateway.fromJson(
Map<String, dynamic> json) =>
_$PaymentGateways$Query$PaymentGatewayFromJson(json);
late String id;
late String title;
@JsonKey(unknownEnumValue: PaymentGatewayType.artemisUnknown)
late PaymentGatewayType type;
String? publicKey;
PaymentGateways$Query$PaymentGateway$Media? media;
@override
List<Object?> get props => [id, title, type, publicKey, media];
@override
Map<String, dynamic> toJson() =>
_$PaymentGateways$Query$PaymentGatewayToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PaymentGateways$Query extends JsonSerializable with EquatableMixin {
PaymentGateways$Query();
factory PaymentGateways$Query.fromJson(Map<String, dynamic> json) =>
_$PaymentGateways$QueryFromJson(json);
late List<PaymentGateways$Query$PaymentGateway> paymentGateways;
@override
List<Object?> get props => [paymentGateways];
@override
Map<String, dynamic> toJson() => _$PaymentGateways$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayForRide$Query$PaymentGateway$Media extends JsonSerializable
with EquatableMixin {
PayForRide$Query$PaymentGateway$Media();
factory PayForRide$Query$PaymentGateway$Media.fromJson(
Map<String, dynamic> json) =>
_$PayForRide$Query$PaymentGateway$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$PayForRide$Query$PaymentGateway$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayForRide$Query$PaymentGateway extends JsonSerializable
with EquatableMixin {
PayForRide$Query$PaymentGateway();
factory PayForRide$Query$PaymentGateway.fromJson(Map<String, dynamic> json) =>
_$PayForRide$Query$PaymentGatewayFromJson(json);
late String id;
late String title;
@JsonKey(unknownEnumValue: PaymentGatewayType.artemisUnknown)
late PaymentGatewayType type;
String? publicKey;
PayForRide$Query$PaymentGateway$Media? media;
@override
List<Object?> get props => [id, title, type, publicKey, media];
@override
Map<String, dynamic> toJson() =>
_$PayForRide$Query$PaymentGatewayToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayForRide$Query$RiderWallet extends JsonSerializable
with EquatableMixin {
PayForRide$Query$RiderWallet();
factory PayForRide$Query$RiderWallet.fromJson(Map<String, dynamic> json) =>
_$PayForRide$Query$RiderWalletFromJson(json);
late String id;
late double balance;
late String currency;
@override
List<Object?> get props => [id, balance, currency];
@override
Map<String, dynamic> toJson() => _$PayForRide$Query$RiderWalletToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayForRide$Query extends JsonSerializable with EquatableMixin {
PayForRide$Query();
factory PayForRide$Query.fromJson(Map<String, dynamic> json) =>
_$PayForRide$QueryFromJson(json);
late List<PayForRide$Query$PaymentGateway> paymentGateways;
late List<PayForRide$Query$RiderWallet> riderWallets;
@override
List<Object?> get props => [paymentGateways, riderWallets];
@override
Map<String, dynamic> toJson() => _$PayForRide$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayRide$Mutation$TopUpWalletResponse extends JsonSerializable
with EquatableMixin {
PayRide$Mutation$TopUpWalletResponse();
factory PayRide$Mutation$TopUpWalletResponse.fromJson(
Map<String, dynamic> json) =>
_$PayRide$Mutation$TopUpWalletResponseFromJson(json);
@JsonKey(unknownEnumValue: TopUpWalletStatus.artemisUnknown)
late TopUpWalletStatus status;
late String url;
@override
List<Object?> get props => [status, url];
@override
Map<String, dynamic> toJson() =>
_$PayRide$Mutation$TopUpWalletResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayRide$Mutation$Order extends JsonSerializable with EquatableMixin {
PayRide$Mutation$Order();
factory PayRide$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$PayRide$Mutation$OrderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$PayRide$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PayRide$Mutation extends JsonSerializable with EquatableMixin {
PayRide$Mutation();
factory PayRide$Mutation.fromJson(Map<String, dynamic> json) =>
_$PayRide$MutationFromJson(json);
late PayRide$Mutation$TopUpWalletResponse topUpWallet;
late PayRide$Mutation$Order updateOneOrder;
@override
List<Object?> get props => [topUpWallet, updateOneOrder];
@override
Map<String, dynamic> toJson() => _$PayRide$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TopUpWalletInput extends JsonSerializable with EquatableMixin {
TopUpWalletInput({
required this.gatewayId,
required this.amount,
required this.currency,
this.token,
this.pin,
this.otp,
this.transactionId,
this.orderNumber,
});
factory TopUpWalletInput.fromJson(Map<String, dynamic> json) =>
_$TopUpWalletInputFromJson(json);
late String gatewayId;
late double amount;
late String currency;
String? token;
double? pin;
double? otp;
String? transactionId;
String? orderNumber;
@override
List<Object?> get props => [
gatewayId,
amount,
currency,
token,
pin,
otp,
transactionId,
orderNumber
];
@override
Map<String, dynamic> toJson() => _$TopUpWalletInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TopUpWallet$Mutation$TopUpWalletResponse extends JsonSerializable
with EquatableMixin {
TopUpWallet$Mutation$TopUpWalletResponse();
factory TopUpWallet$Mutation$TopUpWalletResponse.fromJson(
Map<String, dynamic> json) =>
_$TopUpWallet$Mutation$TopUpWalletResponseFromJson(json);
@JsonKey(unknownEnumValue: TopUpWalletStatus.artemisUnknown)
late TopUpWalletStatus status;
late String url;
@override
List<Object?> get props => [status, url];
@override
Map<String, dynamic> toJson() =>
_$TopUpWallet$Mutation$TopUpWalletResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TopUpWallet$Mutation extends JsonSerializable with EquatableMixin {
TopUpWallet$Mutation();
factory TopUpWallet$Mutation.fromJson(Map<String, dynamic> json) =>
_$TopUpWallet$MutationFromJson(json);
late TopUpWallet$Mutation$TopUpWalletResponse topUpWallet;
@override
List<Object?> get props => [topUpWallet];
@override
Map<String, dynamic> toJson() => _$TopUpWallet$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query$Rider$Media extends JsonSerializable
with EquatableMixin {
GetCurrentOrder$Query$Rider$Media();
factory GetCurrentOrder$Query$Rider$Media.fromJson(
Map<String, dynamic> json) =>
_$GetCurrentOrder$Query$Rider$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$GetCurrentOrder$Query$Rider$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query$Rider$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
GetCurrentOrder$Query$Rider$Order();
factory GetCurrentOrder$Query$Rider$Order.fromJson(
Map<String, dynamic> json) =>
_$GetCurrentOrder$Query$Rider$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
points,
driver,
service,
directions,
etaPickup,
paidAmount,
costAfterCoupon,
costBest,
currency,
addresses,
waitMinutes,
startTimestamp,
durationBest
];
@override
Map<String, dynamic> toJson() =>
_$GetCurrentOrder$Query$Rider$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate
extends JsonSerializable with EquatableMixin {
GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate();
factory GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate.fromJson(
Map<String, dynamic> json) =>
_$GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregateFromJson(
json);
int? id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregateToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query$Rider$BookedOrders extends JsonSerializable
with EquatableMixin {
GetCurrentOrder$Query$Rider$BookedOrders();
factory GetCurrentOrder$Query$Rider$BookedOrders.fromJson(
Map<String, dynamic> json) =>
_$GetCurrentOrder$Query$Rider$BookedOrdersFromJson(json);
GetCurrentOrder$Query$Rider$BookedOrders$RiderOrdersCountAggregate? count;
@override
List<Object?> get props => [count];
@override
Map<String, dynamic> toJson() =>
_$GetCurrentOrder$Query$Rider$BookedOrdersToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query$Rider extends JsonSerializable with EquatableMixin {
GetCurrentOrder$Query$Rider();
factory GetCurrentOrder$Query$Rider.fromJson(Map<String, dynamic> json) =>
_$GetCurrentOrder$Query$RiderFromJson(json);
late String id;
late String mobileNumber;
String? firstName;
String? lastName;
@JsonKey(unknownEnumValue: Gender.artemisUnknown)
Gender? gender;
String? email;
GetCurrentOrder$Query$Rider$Media? media;
late List<GetCurrentOrder$Query$Rider$Order> orders;
late List<GetCurrentOrder$Query$Rider$BookedOrders> bookedOrders;
@override
List<Object?> get props => [
id,
mobileNumber,
firstName,
lastName,
gender,
email,
media,
orders,
bookedOrders
];
@override
Map<String, dynamic> toJson() => _$GetCurrentOrder$Query$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query$Point extends JsonSerializable
with EquatableMixin, PointMixin {
GetCurrentOrder$Query$Point();
factory GetCurrentOrder$Query$Point.fromJson(Map<String, dynamic> json) =>
_$GetCurrentOrder$Query$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$GetCurrentOrder$Query$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrder$Query extends JsonSerializable with EquatableMixin {
GetCurrentOrder$Query();
factory GetCurrentOrder$Query.fromJson(Map<String, dynamic> json) =>
_$GetCurrentOrder$QueryFromJson(json);
GetCurrentOrder$Query$Rider? rider;
@JsonKey(unknownEnumValue: VersionStatus.artemisUnknown)
late VersionStatus requireUpdate;
GetCurrentOrder$Query$Point? getCurrentOrderDriverLocation;
@override
List<Object?> get props =>
[rider, requireUpdate, getCurrentOrderDriverLocation];
@override
Map<String, dynamic> toJson() => _$GetCurrentOrder$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Point extends JsonSerializable
with EquatableMixin, PointMixin {
CurrentOrderMixin$Point();
factory CurrentOrderMixin$Point.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Driver$Media extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$Driver$Media();
factory CurrentOrderMixin$Driver$Media.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$Driver$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$Driver$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Driver$CarModel extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$Driver$CarModel();
factory CurrentOrderMixin$Driver$CarModel.fromJson(
Map<String, dynamic> json) =>
_$CurrentOrderMixin$Driver$CarModelFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$CurrentOrderMixin$Driver$CarModelToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Driver$CarColor extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$Driver$CarColor();
factory CurrentOrderMixin$Driver$CarColor.fromJson(
Map<String, dynamic> json) =>
_$CurrentOrderMixin$Driver$CarColorFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$CurrentOrderMixin$Driver$CarColorToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Driver extends JsonSerializable with EquatableMixin {
CurrentOrderMixin$Driver();
factory CurrentOrderMixin$Driver.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$DriverFromJson(json);
String? firstName;
String? lastName;
CurrentOrderMixin$Driver$Media? media;
late String mobileNumber;
String? carPlate;
CurrentOrderMixin$Driver$CarModel? car;
CurrentOrderMixin$Driver$CarColor? carColor;
int? rating;
@override
List<Object?> get props => [
firstName,
lastName,
media,
mobileNumber,
carPlate,
car,
carColor,
rating
];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Service$Media extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$Service$Media();
factory CurrentOrderMixin$Service$Media.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$Service$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$CurrentOrderMixin$Service$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Service extends JsonSerializable with EquatableMixin {
CurrentOrderMixin$Service();
factory CurrentOrderMixin$Service.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$ServiceFromJson(json);
late CurrentOrderMixin$Service$Media media;
late String name;
late int prepayPercent;
late double cancellationTotalFee;
@override
List<Object?> get props => [media, name, prepayPercent, cancellationTotalFee];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateOrder$Mutation$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
CreateOrder$Mutation$Order();
factory CreateOrder$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$CreateOrder$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
points,
driver,
service,
directions,
etaPickup,
paidAmount,
costAfterCoupon,
costBest,
currency,
addresses,
waitMinutes,
startTimestamp,
durationBest
];
@override
Map<String, dynamic> toJson() => _$CreateOrder$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateOrder$Mutation$Rider extends JsonSerializable with EquatableMixin {
CreateOrder$Mutation$Rider();
factory CreateOrder$Mutation$Rider.fromJson(Map<String, dynamic> json) =>
_$CreateOrder$Mutation$RiderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$CreateOrder$Mutation$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateOrder$Mutation extends JsonSerializable with EquatableMixin {
CreateOrder$Mutation();
factory CreateOrder$Mutation.fromJson(Map<String, dynamic> json) =>
_$CreateOrder$MutationFromJson(json);
late CreateOrder$Mutation$Order createOrder;
late CreateOrder$Mutation$Rider updateOneRider;
@override
List<Object?> get props => [createOrder, updateOneRider];
@override
Map<String, dynamic> toJson() => _$CreateOrder$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CreateOrderInput extends JsonSerializable with EquatableMixin {
CreateOrderInput({
required this.serviceId,
required this.intervalMinutes,
required this.points,
required this.addresses,
this.twoWay,
this.optionIds,
this.couponCode,
});
factory CreateOrderInput.fromJson(Map<String, dynamic> json) =>
_$CreateOrderInputFromJson(json);
late int serviceId;
late int intervalMinutes;
late List<PointInput> points;
late List<String> addresses;
bool? twoWay;
List<String>? optionIds;
String? couponCode;
@override
List<Object?> get props => [
serviceId,
intervalMinutes,
points,
addresses,
twoWay,
optionIds,
couponCode
];
@override
Map<String, dynamic> toJson() => _$CreateOrderInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CancelOrder$Mutation$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
CancelOrder$Mutation$Order();
factory CancelOrder$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$CancelOrder$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
points,
driver,
service,
directions,
etaPickup,
paidAmount,
costAfterCoupon,
costBest,
currency,
addresses,
waitMinutes,
startTimestamp,
durationBest
];
@override
Map<String, dynamic> toJson() => _$CancelOrder$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CancelOrder$Mutation extends JsonSerializable with EquatableMixin {
CancelOrder$Mutation();
factory CancelOrder$Mutation.fromJson(Map<String, dynamic> json) =>
_$CancelOrder$MutationFromJson(json);
late CancelOrder$Mutation$Order cancelOrder;
@override
List<Object?> get props => [cancelOrder];
@override
Map<String, dynamic> toJson() => _$CancelOrder$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrder$Mutation$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
UpdateOrder$Mutation$Order();
factory UpdateOrder$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$UpdateOrder$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
points,
driver,
service,
directions,
etaPickup,
paidAmount,
costAfterCoupon,
costBest,
currency,
addresses,
waitMinutes,
startTimestamp,
durationBest
];
@override
Map<String, dynamic> toJson() => _$UpdateOrder$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrder$Mutation extends JsonSerializable with EquatableMixin {
UpdateOrder$Mutation();
factory UpdateOrder$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateOrder$MutationFromJson(json);
late UpdateOrder$Mutation$Order updateOneOrder;
@override
List<Object?> get props => [updateOneOrder];
@override
Map<String, dynamic> toJson() => _$UpdateOrder$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrderInput extends JsonSerializable with EquatableMixin {
UpdateOrderInput({
this.waitMinutes,
this.status,
this.tipAmount,
this.couponCode,
});
factory UpdateOrderInput.fromJson(Map<String, dynamic> json) =>
_$UpdateOrderInputFromJson(json);
int? waitMinutes;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
OrderStatus? status;
double? tipAmount;
String? couponCode;
@override
List<Object?> get props => [waitMinutes, status, tipAmount, couponCode];
@override
Map<String, dynamic> toJson() => _$UpdateOrderInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Point extends JsonSerializable
with EquatableMixin, PointMixin {
UpdatedOrder$Subscription$Order$Point();
factory UpdatedOrder$Subscription$Order$Point.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Driver$Media extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order$Driver$Media();
factory UpdatedOrder$Subscription$Order$Driver$Media.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$Driver$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$Driver$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Driver$CarModel extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order$Driver$CarModel();
factory UpdatedOrder$Subscription$Order$Driver$CarModel.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$Driver$CarModelFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$Driver$CarModelToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Driver$CarColor extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order$Driver$CarColor();
factory UpdatedOrder$Subscription$Order$Driver$CarColor.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$Driver$CarColorFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$Driver$CarColorToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Driver extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order$Driver();
factory UpdatedOrder$Subscription$Order$Driver.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$DriverFromJson(json);
String? firstName;
String? lastName;
UpdatedOrder$Subscription$Order$Driver$Media? media;
late String mobileNumber;
String? carPlate;
UpdatedOrder$Subscription$Order$Driver$CarModel? car;
UpdatedOrder$Subscription$Order$Driver$CarColor? carColor;
int? rating;
@override
List<Object?> get props => [
firstName,
lastName,
media,
mobileNumber,
carPlate,
car,
carColor,
rating
];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Service$Media extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order$Service$Media();
factory UpdatedOrder$Subscription$Order$Service$Media.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$Service$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$Service$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order$Service extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order$Service();
factory UpdatedOrder$Subscription$Order$Service.fromJson(
Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$Order$ServiceFromJson(json);
late UpdatedOrder$Subscription$Order$Service$Media media;
late String name;
late int prepayPercent;
late double cancellationTotalFee;
@override
List<Object?> get props => [media, name, prepayPercent, cancellationTotalFee];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$Order$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription$Order extends JsonSerializable
with EquatableMixin {
UpdatedOrder$Subscription$Order();
factory UpdatedOrder$Subscription$Order.fromJson(Map<String, dynamic> json) =>
_$UpdatedOrder$Subscription$OrderFromJson(json);
late String id;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
late List<UpdatedOrder$Subscription$Order$Point> points;
UpdatedOrder$Subscription$Order$Driver? driver;
List<UpdatedOrder$Subscription$Order$Point>? directions;
late UpdatedOrder$Subscription$Order$Service service;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? etaPickup;
late double paidAmount;
late double costAfterCoupon;
late int durationBest;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? startTimestamp;
late double costBest;
late String currency;
late List<String> addresses;
late int waitMinutes;
@override
List<Object?> get props => [
id,
status,
points,
driver,
directions,
service,
etaPickup,
paidAmount,
costAfterCoupon,
durationBest,
startTimestamp,
costBest,
currency,
addresses,
waitMinutes
];
@override
Map<String, dynamic> toJson() =>
_$UpdatedOrder$Subscription$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdatedOrder$Subscription extends JsonSerializable with EquatableMixin {
UpdatedOrder$Subscription();
factory UpdatedOrder$Subscription.fromJson(Map<String, dynamic> json) =>
_$UpdatedOrder$SubscriptionFromJson(json);
late UpdatedOrder$Subscription$Order orderUpdated;
@override
List<Object?> get props => [orderUpdated];
@override
Map<String, dynamic> toJson() => _$UpdatedOrder$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DriverLocationUpdated$Subscription$Point extends JsonSerializable
with EquatableMixin, PointMixin {
DriverLocationUpdated$Subscription$Point();
factory DriverLocationUpdated$Subscription$Point.fromJson(
Map<String, dynamic> json) =>
_$DriverLocationUpdated$Subscription$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() =>
_$DriverLocationUpdated$Subscription$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DriverLocationUpdated$Subscription extends JsonSerializable
with EquatableMixin {
DriverLocationUpdated$Subscription();
factory DriverLocationUpdated$Subscription.fromJson(
Map<String, dynamic> json) =>
_$DriverLocationUpdated$SubscriptionFromJson(json);
late DriverLocationUpdated$Subscription$Point driverLocationUpdated;
@override
List<Object?> get props => [driverLocationUpdated];
@override
Map<String, dynamic> toJson() =>
_$DriverLocationUpdated$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SubmitFeedback$Mutation$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
SubmitFeedback$Mutation$Order();
factory SubmitFeedback$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$SubmitFeedback$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
points,
driver,
service,
directions,
etaPickup,
paidAmount,
costAfterCoupon,
costBest,
currency,
addresses,
waitMinutes,
startTimestamp,
durationBest
];
@override
Map<String, dynamic> toJson() => _$SubmitFeedback$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SubmitFeedback$Mutation extends JsonSerializable with EquatableMixin {
SubmitFeedback$Mutation();
factory SubmitFeedback$Mutation.fromJson(Map<String, dynamic> json) =>
_$SubmitFeedback$MutationFromJson(json);
late SubmitFeedback$Mutation$Order submitReview;
@override
List<Object?> get props => [submitReview];
@override
Map<String, dynamic> toJson() => _$SubmitFeedback$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriversLocation$Query$Point extends JsonSerializable
with EquatableMixin, PointMixin {
GetDriversLocation$Query$Point();
factory GetDriversLocation$Query$Point.fromJson(Map<String, dynamic> json) =>
_$GetDriversLocation$Query$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$GetDriversLocation$Query$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriversLocation$Query extends JsonSerializable with EquatableMixin {
GetDriversLocation$Query();
factory GetDriversLocation$Query.fromJson(Map<String, dynamic> json) =>
_$GetDriversLocation$QueryFromJson(json);
late List<GetDriversLocation$Query$Point> getDriversLocation;
@override
List<Object?> get props => [getDriversLocation];
@override
Map<String, dynamic> toJson() => _$GetDriversLocation$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetReviewParameters$Query$FeedbackParameter extends JsonSerializable
with EquatableMixin {
GetReviewParameters$Query$FeedbackParameter();
factory GetReviewParameters$Query$FeedbackParameter.fromJson(
Map<String, dynamic> json) =>
_$GetReviewParameters$Query$FeedbackParameterFromJson(json);
late String id;
late String title;
late bool isGood;
@override
List<Object?> get props => [id, title, isGood];
@override
Map<String, dynamic> toJson() =>
_$GetReviewParameters$Query$FeedbackParameterToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetReviewParameters$Query extends JsonSerializable with EquatableMixin {
GetReviewParameters$Query();
factory GetReviewParameters$Query.fromJson(Map<String, dynamic> json) =>
_$GetReviewParameters$QueryFromJson(json);
late List<GetReviewParameters$Query$FeedbackParameter> feedbackParameters;
@override
List<Object?> get props => [feedbackParameters];
@override
Map<String, dynamic> toJson() => _$GetReviewParameters$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query$CalculateFareDTO$Point extends JsonSerializable
with EquatableMixin {
GetFare$Query$CalculateFareDTO$Point();
factory GetFare$Query$CalculateFareDTO$Point.fromJson(
Map<String, dynamic> json) =>
_$GetFare$Query$CalculateFareDTO$PointFromJson(json);
late double lat;
late double lng;
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() =>
_$GetFare$Query$CalculateFareDTO$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media
extends JsonSerializable with EquatableMixin {
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media();
factory GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media.fromJson(
Map<String, dynamic> json) =>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$MediaFromJson(
json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$MediaToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption
extends JsonSerializable with EquatableMixin {
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption();
factory GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption.fromJson(
Map<String, dynamic> json) =>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOptionFromJson(
json);
late String id;
late String name;
@JsonKey(unknownEnumValue: ServiceOptionType.artemisUnknown)
late ServiceOptionType type;
double? additionalFee;
@JsonKey(unknownEnumValue: ServiceOptionIcon.artemisUnknown)
late ServiceOptionIcon icon;
@override
List<Object?> get props => [id, name, type, additionalFee, icon];
@override
Map<String, dynamic> toJson() =>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOptionToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query$CalculateFareDTO$ServiceCategory$Service
extends JsonSerializable with EquatableMixin {
GetFare$Query$CalculateFareDTO$ServiceCategory$Service();
factory GetFare$Query$CalculateFareDTO$ServiceCategory$Service.fromJson(
Map<String, dynamic> json) =>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$ServiceFromJson(json);
late String id;
late String name;
String? description;
int? personCapacity;
late int prepayPercent;
late bool twoWayAvailable;
late GetFare$Query$CalculateFareDTO$ServiceCategory$Service$Media media;
late List<
GetFare$Query$CalculateFareDTO$ServiceCategory$Service$ServiceOption>
options;
late double cost;
double? costAfterCoupon;
@override
List<Object?> get props => [
id,
name,
description,
personCapacity,
prepayPercent,
twoWayAvailable,
media,
options,
cost,
costAfterCoupon
];
@override
Map<String, dynamic> toJson() =>
_$GetFare$Query$CalculateFareDTO$ServiceCategory$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query$CalculateFareDTO$ServiceCategory extends JsonSerializable
with EquatableMixin {
GetFare$Query$CalculateFareDTO$ServiceCategory();
factory GetFare$Query$CalculateFareDTO$ServiceCategory.fromJson(
Map<String, dynamic> json) =>
_$GetFare$Query$CalculateFareDTO$ServiceCategoryFromJson(json);
late String id;
late String name;
late List<GetFare$Query$CalculateFareDTO$ServiceCategory$Service> services;
@override
List<Object?> get props => [id, name, services];
@override
Map<String, dynamic> toJson() =>
_$GetFare$Query$CalculateFareDTO$ServiceCategoryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query$CalculateFareDTO extends JsonSerializable
with EquatableMixin {
GetFare$Query$CalculateFareDTO();
factory GetFare$Query$CalculateFareDTO.fromJson(Map<String, dynamic> json) =>
_$GetFare$Query$CalculateFareDTOFromJson(json);
late double distance;
late double duration;
late String currency;
late List<GetFare$Query$CalculateFareDTO$Point> directions;
late List<GetFare$Query$CalculateFareDTO$ServiceCategory> services;
@JsonKey(unknownEnumValue: CalculateFareError.artemisUnknown)
CalculateFareError? error;
@override
List<Object?> get props =>
[distance, duration, currency, directions, services, error];
@override
Map<String, dynamic> toJson() => _$GetFare$Query$CalculateFareDTOToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetFare$Query extends JsonSerializable with EquatableMixin {
GetFare$Query();
factory GetFare$Query.fromJson(Map<String, dynamic> json) =>
_$GetFare$QueryFromJson(json);
late GetFare$Query$CalculateFareDTO getFare;
@override
List<Object?> get props => [getFare];
@override
Map<String, dynamic> toJson() => _$GetFare$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ApplyCoupon$Mutation$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
ApplyCoupon$Mutation$Order();
factory ApplyCoupon$Mutation$Order.fromJson(Map<String, dynamic> json) =>
_$ApplyCoupon$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
points,
driver,
service,
directions,
etaPickup,
paidAmount,
costAfterCoupon,
costBest,
currency,
addresses,
waitMinutes,
startTimestamp,
durationBest
];
@override
Map<String, dynamic> toJson() => _$ApplyCoupon$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ApplyCoupon$Mutation extends JsonSerializable with EquatableMixin {
ApplyCoupon$Mutation();
factory ApplyCoupon$Mutation.fromJson(Map<String, dynamic> json) =>
_$ApplyCoupon$MutationFromJson(json);
late ApplyCoupon$Mutation$Order applyCoupon;
@override
List<Object?> get props => [applyCoupon];
@override
Map<String, dynamic> toJson() => _$ApplyCoupon$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SendSOS$Mutation$Sos extends JsonSerializable with EquatableMixin {
SendSOS$Mutation$Sos();
factory SendSOS$Mutation$Sos.fromJson(Map<String, dynamic> json) =>
_$SendSOS$Mutation$SosFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$SendSOS$Mutation$SosToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SendSOS$Mutation extends JsonSerializable with EquatableMixin {
SendSOS$Mutation();
factory SendSOS$Mutation.fromJson(Map<String, dynamic> json) =>
_$SendSOS$MutationFromJson(json);
late SendSOS$Mutation$Sos sosSignal;
@override
List<Object?> get props => [sosSignal];
@override
Map<String, dynamic> toJson() => _$SendSOS$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Login$Mutation$Login extends JsonSerializable with EquatableMixin {
Login$Mutation$Login();
factory Login$Mutation$Login.fromJson(Map<String, dynamic> json) =>
_$Login$Mutation$LoginFromJson(json);
late String jwtToken;
@override
List<Object?> get props => [jwtToken];
@override
Map<String, dynamic> toJson() => _$Login$Mutation$LoginToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Login$Mutation extends JsonSerializable with EquatableMixin {
Login$Mutation();
factory Login$Mutation.fromJson(Map<String, dynamic> json) =>
_$Login$MutationFromJson(json);
late Login$Mutation$Login login;
@override
List<Object?> get props => [login];
@override
Map<String, dynamic> toJson() => _$Login$MutationToJson(this);
}
enum Gender {
@JsonValue('Male')
male,
@JsonValue('Female')
female,
@JsonValue('Unknown')
unknown,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum RiderAddressType {
@JsonValue('Home')
home,
@JsonValue('Work')
work,
@JsonValue('Partner')
partner,
@JsonValue('Gym')
gym,
@JsonValue('Parent')
parent,
@JsonValue('Cafe')
cafe,
@JsonValue('Park')
park,
@JsonValue('Other')
other,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum OrderStatus {
@JsonValue('Requested')
requested,
@JsonValue('NotFound')
notFound,
@JsonValue('NoCloseFound')
noCloseFound,
@JsonValue('Found')
found,
@JsonValue('DriverAccepted')
driverAccepted,
@JsonValue('Arrived')
arrived,
@JsonValue('WaitingForPrePay')
waitingForPrePay,
@JsonValue('DriverCanceled')
driverCanceled,
@JsonValue('RiderCanceled')
riderCanceled,
@JsonValue('Started')
started,
@JsonValue('WaitingForPostPay')
waitingForPostPay,
@JsonValue('WaitingForReview')
waitingForReview,
@JsonValue('Finished')
finished,
@JsonValue('Booked')
booked,
@JsonValue('Expired')
expired,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum RiderDeductTransactionType {
@JsonValue('OrderFee')
orderFee,
@JsonValue('Withdraw')
withdraw,
@JsonValue('Correction')
correction,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum TransactionAction {
@JsonValue('Recharge')
recharge,
@JsonValue('Deduct')
deduct,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum RiderRechargeTransactionType {
@JsonValue('BankTransfer')
bankTransfer,
@JsonValue('Gift')
gift,
@JsonValue('Correction')
correction,
@JsonValue('InAppPayment')
inAppPayment,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum PaymentGatewayType {
@JsonValue('Stripe')
stripe,
@JsonValue('BrainTree')
brainTree,
@JsonValue('PayPal')
payPal,
@JsonValue('Paytm')
paytm,
@JsonValue('Razorpay')
razorpay,
@JsonValue('Paystack')
paystack,
@JsonValue('PayU')
payU,
@JsonValue('Instamojo')
instamojo,
@JsonValue('Flutterwave')
flutterwave,
@JsonValue('PayGate')
payGate,
@JsonValue('MIPS')
mips,
@JsonValue('MercadoPago')
mercadoPago,
@JsonValue('AmazonPaymentServices')
amazonPaymentServices,
@JsonValue('MyTMoney')
myTMoney,
@JsonValue('WayForPay')
wayForPay,
@JsonValue('MyFatoorah')
myFatoorah,
@JsonValue('SberBank')
sberBank,
@JsonValue('CustomLink')
customLink,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum TopUpWalletStatus {
@JsonValue('OK')
ok,
@JsonValue('Redirect')
redirect,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum VersionStatus {
@JsonValue('Latest')
latest,
@JsonValue('MandatoryUpdate')
mandatoryUpdate,
@JsonValue('OptionalUpdate')
optionalUpdate,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum ServiceOptionType {
@JsonValue('Free')
free,
@JsonValue('Paid')
paid,
@JsonValue('TwoWay')
twoWay,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum ServiceOptionIcon {
@JsonValue('Pet')
pet,
@JsonValue('TwoWay')
twoWay,
@JsonValue('Luggage')
luggage,
@JsonValue('PackageDelivery')
packageDelivery,
@JsonValue('Shopping')
shopping,
@JsonValue('Custom1')
custom1,
@JsonValue('Custom2')
custom2,
@JsonValue('Custom3')
custom3,
@JsonValue('Custom4')
custom4,
@JsonValue('Custom5')
custom5,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum CalculateFareError {
@JsonValue('RegionUnsupported')
regionUnsupported,
@JsonValue('NoServiceInRegion')
noServiceInRegion,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
final GET_MESSAGES_QUERY_DOCUMENT_OPERATION_NAME = 'GetMessages';
final GET_MESSAGES_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetMessages'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currentOrder'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatRider'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatDriver'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'conversations'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'sorting'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'field'),
value: EnumValueNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'direction'),
value: EnumValueNode(name: NameNode(value: 'DESC')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatMessage'),
directives: [],
)
]),
),
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatRider'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Rider'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatDriver'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Driver'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatMessage'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderMessage'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'content'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'sentByDriver'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class GetMessagesQuery
extends GraphQLQuery<GetMessages$Query, JsonSerializable> {
GetMessagesQuery();
@override
final DocumentNode document = GET_MESSAGES_QUERY_DOCUMENT;
@override
final String operationName = GET_MESSAGES_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetMessages$Query parse(Map<String, dynamic> json) =>
GetMessages$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SendMessageArguments extends JsonSerializable with EquatableMixin {
SendMessageArguments({
required this.requestId,
required this.content,
});
@override
factory SendMessageArguments.fromJson(Map<String, dynamic> json) =>
_$SendMessageArgumentsFromJson(json);
late String requestId;
late String content;
@override
List<Object?> get props => [requestId, content];
@override
Map<String, dynamic> toJson() => _$SendMessageArgumentsToJson(this);
}
final SEND_MESSAGE_MUTATION_DOCUMENT_OPERATION_NAME = 'SendMessage';
final SEND_MESSAGE_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SendMessage'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'requestId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'content')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createOneOrderMessage'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'orderMessage'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'requestId'),
value: VariableNode(name: NameNode(value: 'requestId')),
),
ObjectFieldNode(
name: NameNode(value: 'content'),
value: VariableNode(name: NameNode(value: 'content')),
),
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatMessage'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatMessage'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderMessage'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'content'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'sentByDriver'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class SendMessageMutation
extends GraphQLQuery<SendMessage$Mutation, SendMessageArguments> {
SendMessageMutation({required this.variables});
@override
final DocumentNode document = SEND_MESSAGE_MUTATION_DOCUMENT;
@override
final String operationName = SEND_MESSAGE_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SendMessageArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SendMessage$Mutation parse(Map<String, dynamic> json) =>
SendMessage$Mutation.fromJson(json);
}
final NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME =
'NewMessageReceived';
final NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'NewMessageReceived'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'newMessageReceived'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatMessage'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatMessage'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderMessage'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'content'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'sentByDriver'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class NewMessageReceivedSubscription
extends GraphQLQuery<NewMessageReceived$Subscription, JsonSerializable> {
NewMessageReceivedSubscription();
@override
final DocumentNode document = NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
NewMessageReceived$Subscription parse(Map<String, dynamic> json) =>
NewMessageReceived$Subscription.fromJson(json);
}
final RESERVATIONS_QUERY_DOCUMENT_OPERATION_NAME = 'Reservations';
final RESERVATIONS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'Reservations'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orders'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'filter'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'eq'),
value: EnumValueNode(name: NameNode(value: 'Booked')),
)
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]),
)
]),
)
]);
class ReservationsQuery
extends GraphQLQuery<Reservations$Query, JsonSerializable> {
ReservationsQuery();
@override
final DocumentNode document = RESERVATIONS_QUERY_DOCUMENT;
@override
final String operationName = RESERVATIONS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
Reservations$Query parse(Map<String, dynamic> json) =>
Reservations$Query.fromJson(json);
}
final GET_ANNOUNCEMENTS_QUERY_DOCUMENT_OPERATION_NAME = 'GetAnnouncements';
final GET_ANNOUNCEMENTS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetAnnouncements'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'announcements'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'paging'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'first'),
value: IntValueNode(value: '50'),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startAt'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'description'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'url'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]),
)
]),
)
]);
class GetAnnouncementsQuery
extends GraphQLQuery<GetAnnouncements$Query, JsonSerializable> {
GetAnnouncementsQuery();
@override
final DocumentNode document = GET_ANNOUNCEMENTS_QUERY_DOCUMENT;
@override
final String operationName = GET_ANNOUNCEMENTS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetAnnouncements$Query parse(Map<String, dynamic> json) =>
GetAnnouncements$Query.fromJson(json);
}
final GET_RIDER_QUERY_DOCUMENT_OPERATION_NAME = 'GetRider';
final GET_RIDER_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetRider'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: IntValueNode(value: '1'),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'gender'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'email'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
)
]),
)
]);
class GetRiderQuery extends GraphQLQuery<GetRider$Query, JsonSerializable> {
GetRiderQuery();
@override
final DocumentNode document = GET_RIDER_QUERY_DOCUMENT;
@override
final String operationName = GET_RIDER_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetRider$Query parse(Map<String, dynamic> json) =>
GetRider$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateProfileArguments extends JsonSerializable with EquatableMixin {
UpdateProfileArguments({
required this.firstName,
required this.lastName,
this.gender,
this.email,
});
@override
factory UpdateProfileArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateProfileArgumentsFromJson(json);
late String firstName;
late String lastName;
@JsonKey(unknownEnumValue: Gender.artemisUnknown)
final Gender? gender;
final String? email;
@override
List<Object?> get props => [firstName, lastName, gender, email];
@override
Map<String, dynamic> toJson() => _$UpdateProfileArgumentsToJson(this);
}
final UPDATE_PROFILE_MUTATION_DOCUMENT_OPERATION_NAME = 'UpdateProfile';
final UPDATE_PROFILE_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateProfile'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'firstName')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'lastName')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'gender')),
type: NamedTypeNode(
name: NameNode(value: 'Gender'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'email')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneRider'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'firstName'),
value: VariableNode(name: NameNode(value: 'firstName')),
),
ObjectFieldNode(
name: NameNode(value: 'lastName'),
value: VariableNode(name: NameNode(value: 'lastName')),
),
ObjectFieldNode(
name: NameNode(value: 'gender'),
value: VariableNode(name: NameNode(value: 'gender')),
),
ObjectFieldNode(
name: NameNode(value: 'email'),
value: VariableNode(name: NameNode(value: 'email')),
),
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class UpdateProfileMutation
extends GraphQLQuery<UpdateProfile$Mutation, UpdateProfileArguments> {
UpdateProfileMutation({required this.variables});
@override
final DocumentNode document = UPDATE_PROFILE_MUTATION_DOCUMENT;
@override
final String operationName = UPDATE_PROFILE_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateProfileArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateProfile$Mutation parse(Map<String, dynamic> json) =>
UpdateProfile$Mutation.fromJson(json);
}
final DELETE_USER_MUTATION_DOCUMENT_OPERATION_NAME = 'DeleteUser';
final DELETE_USER_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'DeleteUser'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'deleteUser'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class DeleteUserMutation
extends GraphQLQuery<DeleteUser$Mutation, JsonSerializable> {
DeleteUserMutation();
@override
final DocumentNode document = DELETE_USER_MUTATION_DOCUMENT;
@override
final String operationName = DELETE_USER_MUTATION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
DeleteUser$Mutation parse(Map<String, dynamic> json) =>
DeleteUser$Mutation.fromJson(json);
}
final GET_ADDRESSES_QUERY_DOCUMENT_OPERATION_NAME = 'GetAddresses';
final GET_ADDRESSES_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetAddresses'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'riderAddresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'type'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'details'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'location'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
)
]),
)
]);
class GetAddressesQuery
extends GraphQLQuery<GetAddresses$Query, JsonSerializable> {
GetAddressesQuery();
@override
final DocumentNode document = GET_ADDRESSES_QUERY_DOCUMENT;
@override
final String operationName = GET_ADDRESSES_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetAddresses$Query parse(Map<String, dynamic> json) =>
GetAddresses$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class CreateAddressArguments extends JsonSerializable with EquatableMixin {
CreateAddressArguments({required this.input});
@override
factory CreateAddressArguments.fromJson(Map<String, dynamic> json) =>
_$CreateAddressArgumentsFromJson(json);
late CreateRiderAddressInput input;
@override
List<Object?> get props => [input];
@override
Map<String, dynamic> toJson() => _$CreateAddressArgumentsToJson(this);
}
final CREATE_ADDRESS_MUTATION_DOCUMENT_OPERATION_NAME = 'CreateAddress';
final CREATE_ADDRESS_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'CreateAddress'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'input')),
type: NamedTypeNode(
name: NameNode(value: 'CreateRiderAddressInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createOneRiderAddress'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'riderAddress'),
value: VariableNode(name: NameNode(value: 'input')),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class CreateAddressMutation
extends GraphQLQuery<CreateAddress$Mutation, CreateAddressArguments> {
CreateAddressMutation({required this.variables});
@override
final DocumentNode document = CREATE_ADDRESS_MUTATION_DOCUMENT;
@override
final String operationName = CREATE_ADDRESS_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final CreateAddressArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
CreateAddress$Mutation parse(Map<String, dynamic> json) =>
CreateAddress$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateAddressArguments extends JsonSerializable with EquatableMixin {
UpdateAddressArguments({
required this.id,
required this.update,
});
@override
factory UpdateAddressArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateAddressArgumentsFromJson(json);
late String id;
late CreateRiderAddressInput update;
@override
List<Object?> get props => [id, update];
@override
Map<String, dynamic> toJson() => _$UpdateAddressArgumentsToJson(this);
}
final UPDATE_ADDRESS_MUTATION_DOCUMENT_OPERATION_NAME = 'UpdateAddress';
final UPDATE_ADDRESS_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateAddress'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'update')),
type: NamedTypeNode(
name: NameNode(value: 'CreateRiderAddressInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneRiderAddress'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: VariableNode(name: NameNode(value: 'update')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class UpdateAddressMutation
extends GraphQLQuery<UpdateAddress$Mutation, UpdateAddressArguments> {
UpdateAddressMutation({required this.variables});
@override
final DocumentNode document = UPDATE_ADDRESS_MUTATION_DOCUMENT;
@override
final String operationName = UPDATE_ADDRESS_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateAddressArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateAddress$Mutation parse(Map<String, dynamic> json) =>
UpdateAddress$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class DeleteAddressArguments extends JsonSerializable with EquatableMixin {
DeleteAddressArguments({required this.id});
@override
factory DeleteAddressArguments.fromJson(Map<String, dynamic> json) =>
_$DeleteAddressArgumentsFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$DeleteAddressArgumentsToJson(this);
}
final DELETE_ADDRESS_MUTATION_DOCUMENT_OPERATION_NAME = 'DeleteAddress';
final DELETE_ADDRESS_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'DeleteAddress'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'deleteOneRiderAddress'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'id')),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class DeleteAddressMutation
extends GraphQLQuery<DeleteAddress$Mutation, DeleteAddressArguments> {
DeleteAddressMutation({required this.variables});
@override
final DocumentNode document = DELETE_ADDRESS_MUTATION_DOCUMENT;
@override
final String operationName = DELETE_ADDRESS_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final DeleteAddressArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
DeleteAddress$Mutation parse(Map<String, dynamic> json) =>
DeleteAddress$Mutation.fromJson(json);
}
final GET_HISTORY_QUERY_DOCUMENT_OPERATION_NAME = 'GetHistory';
final GET_HISTORY_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetHistory'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orders'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'sorting'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'field'),
value: EnumValueNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'direction'),
value: EnumValueNode(name: NameNode(value: 'DESC')),
),
]),
),
ArgumentNode(
name: NameNode(value: 'paging'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'first'),
value: IntValueNode(value: '20'),
)
]),
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'historyOrderItem'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'historyOrderItem'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderConnection'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
)
]),
),
FieldNode(
name: NameNode(value: 'pageInfo'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'hasNextPage'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'endCursor'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startCursor'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'hasPreviousPage'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]);
class GetHistoryQuery extends GraphQLQuery<GetHistory$Query, JsonSerializable> {
GetHistoryQuery();
@override
final DocumentNode document = GET_HISTORY_QUERY_DOCUMENT;
@override
final String operationName = GET_HISTORY_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetHistory$Query parse(Map<String, dynamic> json) =>
GetHistory$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetailsArguments extends JsonSerializable with EquatableMixin {
GetOrderDetailsArguments({required this.id});
@override
factory GetOrderDetailsArguments.fromJson(Map<String, dynamic> json) =>
_$GetOrderDetailsArgumentsFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$GetOrderDetailsArgumentsToJson(this);
}
final GET_ORDER_DETAILS_QUERY_DOCUMENT_OPERATION_NAME = 'GetOrderDetails';
final GET_ORDER_DETAILS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetOrderDetails'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'order'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'id')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'finishTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FieldNode(
name: NameNode(value: 'paymentGateway'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class GetOrderDetailsQuery
extends GraphQLQuery<GetOrderDetails$Query, GetOrderDetailsArguments> {
GetOrderDetailsQuery({required this.variables});
@override
final DocumentNode document = GET_ORDER_DETAILS_QUERY_DOCUMENT;
@override
final String operationName = GET_ORDER_DETAILS_QUERY_DOCUMENT_OPERATION_NAME;
@override
final GetOrderDetailsArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
GetOrderDetails$Query parse(Map<String, dynamic> json) =>
GetOrderDetails$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class CancelBookingArguments extends JsonSerializable with EquatableMixin {
CancelBookingArguments({required this.id});
@override
factory CancelBookingArguments.fromJson(Map<String, dynamic> json) =>
_$CancelBookingArgumentsFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$CancelBookingArgumentsToJson(this);
}
final CANCEL_BOOKING_MUTATION_DOCUMENT_OPERATION_NAME = 'CancelBooking';
final CANCEL_BOOKING_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'CancelBooking'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'cancelBooking'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'id')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class CancelBookingMutation
extends GraphQLQuery<CancelBooking$Mutation, CancelBookingArguments> {
CancelBookingMutation({required this.variables});
@override
final DocumentNode document = CANCEL_BOOKING_MUTATION_DOCUMENT;
@override
final String operationName = CANCEL_BOOKING_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final CancelBookingArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
CancelBooking$Mutation parse(Map<String, dynamic> json) =>
CancelBooking$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SubmitComplaintArguments extends JsonSerializable with EquatableMixin {
SubmitComplaintArguments({
required this.id,
required this.subject,
required this.content,
});
@override
factory SubmitComplaintArguments.fromJson(Map<String, dynamic> json) =>
_$SubmitComplaintArgumentsFromJson(json);
late String id;
late String subject;
late String content;
@override
List<Object?> get props => [id, subject, content];
@override
Map<String, dynamic> toJson() => _$SubmitComplaintArgumentsToJson(this);
}
final SUBMIT_COMPLAINT_MUTATION_DOCUMENT_OPERATION_NAME = 'SubmitComplaint';
final SUBMIT_COMPLAINT_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SubmitComplaint'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'subject')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'content')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createOneComplaint'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'complaint'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'requestId'),
value: VariableNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'requestedByDriver'),
value: BooleanValueNode(value: false),
),
ObjectFieldNode(
name: NameNode(value: 'subject'),
value: VariableNode(name: NameNode(value: 'subject')),
),
ObjectFieldNode(
name: NameNode(value: 'content'),
value: VariableNode(name: NameNode(value: 'content')),
),
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class SubmitComplaintMutation
extends GraphQLQuery<SubmitComplaint$Mutation, SubmitComplaintArguments> {
SubmitComplaintMutation({required this.variables});
@override
final DocumentNode document = SUBMIT_COMPLAINT_MUTATION_DOCUMENT;
@override
final String operationName =
SUBMIT_COMPLAINT_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SubmitComplaintArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SubmitComplaint$Mutation parse(Map<String, dynamic> json) =>
SubmitComplaint$Mutation.fromJson(json);
}
final WALLET_QUERY_DOCUMENT_OPERATION_NAME = 'Wallet';
final WALLET_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'Wallet'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'riderWallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'riderTransacions'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'sorting'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'field'),
value: EnumValueNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'direction'),
value: EnumValueNode(name: NameNode(value: 'DESC')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createdAt'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'amount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'refrenceNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'deductType'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'action'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rechargeType'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]),
),
]),
)
]);
class WalletQuery extends GraphQLQuery<Wallet$Query, JsonSerializable> {
WalletQuery();
@override
final DocumentNode document = WALLET_QUERY_DOCUMENT;
@override
final String operationName = WALLET_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
Wallet$Query parse(Map<String, dynamic> json) => Wallet$Query.fromJson(json);
}
final PAYMENT_GATEWAYS_QUERY_DOCUMENT_OPERATION_NAME = 'PaymentGateways';
final PAYMENT_GATEWAYS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'PaymentGateways'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'paymentGateways'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'type'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'publicKey'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
)
]),
)
]);
class PaymentGatewaysQuery
extends GraphQLQuery<PaymentGateways$Query, JsonSerializable> {
PaymentGatewaysQuery();
@override
final DocumentNode document = PAYMENT_GATEWAYS_QUERY_DOCUMENT;
@override
final String operationName = PAYMENT_GATEWAYS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
PaymentGateways$Query parse(Map<String, dynamic> json) =>
PaymentGateways$Query.fromJson(json);
}
final PAY_FOR_RIDE_QUERY_DOCUMENT_OPERATION_NAME = 'PayForRide';
final PAY_FOR_RIDE_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'PayForRide'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'paymentGateways'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'type'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'publicKey'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FieldNode(
name: NameNode(value: 'riderWallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
)
]);
class PayForRideQuery extends GraphQLQuery<PayForRide$Query, JsonSerializable> {
PayForRideQuery();
@override
final DocumentNode document = PAY_FOR_RIDE_QUERY_DOCUMENT;
@override
final String operationName = PAY_FOR_RIDE_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
PayForRide$Query parse(Map<String, dynamic> json) =>
PayForRide$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class PayRideArguments extends JsonSerializable with EquatableMixin {
PayRideArguments({
required this.input,
required this.orderId,
this.tipAmount,
required this.shouldPreauth,
});
@override
factory PayRideArguments.fromJson(Map<String, dynamic> json) =>
_$PayRideArgumentsFromJson(json);
late TopUpWalletInput input;
late String orderId;
final double? tipAmount;
late bool shouldPreauth;
@override
List<Object?> get props => [input, orderId, tipAmount, shouldPreauth];
@override
Map<String, dynamic> toJson() => _$PayRideArgumentsToJson(this);
}
final PAY_RIDE_MUTATION_DOCUMENT_OPERATION_NAME = 'PayRide';
final PAY_RIDE_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'PayRide'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'input')),
type: NamedTypeNode(
name: NameNode(value: 'TopUpWalletInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'orderId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'tipAmount')),
type: NamedTypeNode(
name: NameNode(value: 'Float'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'shouldPreauth')),
type: NamedTypeNode(
name: NameNode(value: 'Boolean'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'topUpWallet'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: VariableNode(name: NameNode(value: 'input')),
),
ArgumentNode(
name: NameNode(value: 'shouldPreauth'),
value: VariableNode(name: NameNode(value: 'shouldPreauth')),
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'url'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'updateOneOrder'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'orderId')),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'tipAmount'),
value: VariableNode(name: NameNode(value: 'tipAmount')),
)
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
)
]);
class PayRideMutation extends GraphQLQuery<PayRide$Mutation, PayRideArguments> {
PayRideMutation({required this.variables});
@override
final DocumentNode document = PAY_RIDE_MUTATION_DOCUMENT;
@override
final String operationName = PAY_RIDE_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final PayRideArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
PayRide$Mutation parse(Map<String, dynamic> json) =>
PayRide$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class TopUpWalletArguments extends JsonSerializable with EquatableMixin {
TopUpWalletArguments({required this.input});
@override
factory TopUpWalletArguments.fromJson(Map<String, dynamic> json) =>
_$TopUpWalletArgumentsFromJson(json);
late TopUpWalletInput input;
@override
List<Object?> get props => [input];
@override
Map<String, dynamic> toJson() => _$TopUpWalletArgumentsToJson(this);
}
final TOP_UP_WALLET_MUTATION_DOCUMENT_OPERATION_NAME = 'TopUpWallet';
final TOP_UP_WALLET_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'TopUpWallet'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'input')),
type: NamedTypeNode(
name: NameNode(value: 'TopUpWalletInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'topUpWallet'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: VariableNode(name: NameNode(value: 'input')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'url'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]);
class TopUpWalletMutation
extends GraphQLQuery<TopUpWallet$Mutation, TopUpWalletArguments> {
TopUpWalletMutation({required this.variables});
@override
final DocumentNode document = TOP_UP_WALLET_MUTATION_DOCUMENT;
@override
final String operationName = TOP_UP_WALLET_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final TopUpWalletArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
TopUpWallet$Mutation parse(Map<String, dynamic> json) =>
TopUpWallet$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class GetCurrentOrderArguments extends JsonSerializable with EquatableMixin {
GetCurrentOrderArguments({required this.versionCode});
@override
factory GetCurrentOrderArguments.fromJson(Map<String, dynamic> json) =>
_$GetCurrentOrderArgumentsFromJson(json);
late int versionCode;
@override
List<Object?> get props => [versionCode];
@override
Map<String, dynamic> toJson() => _$GetCurrentOrderArgumentsToJson(this);
}
final GET_CURRENT_ORDER_QUERY_DOCUMENT_OPERATION_NAME = 'GetCurrentOrder';
final GET_CURRENT_ORDER_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetCurrentOrder'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'versionCode')),
type: NamedTypeNode(
name: NameNode(value: 'Int'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'gender'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'email'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'orders'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'filter'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'in'),
value: ListValueNode(values: [
EnumValueNode(name: NameNode(value: 'Requested')),
EnumValueNode(name: NameNode(value: 'Found')),
EnumValueNode(name: NameNode(value: 'NotFound')),
EnumValueNode(name: NameNode(value: 'NoCloseFound')),
EnumValueNode(
name: NameNode(value: 'DriverAccepted')),
EnumValueNode(name: NameNode(value: 'Arrived')),
EnumValueNode(name: NameNode(value: 'Started')),
EnumValueNode(
name: NameNode(value: 'WaitingForReview')),
EnumValueNode(
name: NameNode(value: 'WaitingForPostPay')),
EnumValueNode(
name: NameNode(value: 'WaitingForPrePay')),
]),
)
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'ordersAggregate'),
alias: NameNode(value: 'bookedOrders'),
arguments: [
ArgumentNode(
name: NameNode(value: 'filter'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'eq'),
value: EnumValueNode(name: NameNode(value: 'Booked')),
)
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'count'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
),
]),
),
FieldNode(
name: NameNode(value: 'requireUpdate'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'versionCode'),
value: VariableNode(name: NameNode(value: 'versionCode')),
)
],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'getCurrentOrderDriverLocation'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class GetCurrentOrderQuery
extends GraphQLQuery<GetCurrentOrder$Query, GetCurrentOrderArguments> {
GetCurrentOrderQuery({required this.variables});
@override
final DocumentNode document = GET_CURRENT_ORDER_QUERY_DOCUMENT;
@override
final String operationName = GET_CURRENT_ORDER_QUERY_DOCUMENT_OPERATION_NAME;
@override
final GetCurrentOrderArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
GetCurrentOrder$Query parse(Map<String, dynamic> json) =>
GetCurrentOrder$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class CreateOrderArguments extends JsonSerializable with EquatableMixin {
CreateOrderArguments({
required this.input,
required this.notificationPlayerId,
});
@override
factory CreateOrderArguments.fromJson(Map<String, dynamic> json) =>
_$CreateOrderArgumentsFromJson(json);
late CreateOrderInput input;
late String notificationPlayerId;
@override
List<Object?> get props => [input, notificationPlayerId];
@override
Map<String, dynamic> toJson() => _$CreateOrderArgumentsToJson(this);
}
final CREATE_ORDER_MUTATION_DOCUMENT_OPERATION_NAME = 'CreateOrder';
final CREATE_ORDER_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'CreateOrder'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'input')),
type: NamedTypeNode(
name: NameNode(value: 'CreateOrderInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'notificationPlayerId')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createOrder'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: VariableNode(name: NameNode(value: 'input')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'updateOneRider'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'notificationPlayerId'),
value: VariableNode(
name: NameNode(value: 'notificationPlayerId')),
)
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class CreateOrderMutation
extends GraphQLQuery<CreateOrder$Mutation, CreateOrderArguments> {
CreateOrderMutation({required this.variables});
@override
final DocumentNode document = CREATE_ORDER_MUTATION_DOCUMENT;
@override
final String operationName = CREATE_ORDER_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final CreateOrderArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
CreateOrder$Mutation parse(Map<String, dynamic> json) =>
CreateOrder$Mutation.fromJson(json);
}
final CANCEL_ORDER_MUTATION_DOCUMENT_OPERATION_NAME = 'CancelOrder';
final CANCEL_ORDER_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'CancelOrder'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'cancelOrder'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class CancelOrderMutation
extends GraphQLQuery<CancelOrder$Mutation, JsonSerializable> {
CancelOrderMutation();
@override
final DocumentNode document = CANCEL_ORDER_MUTATION_DOCUMENT;
@override
final String operationName = CANCEL_ORDER_MUTATION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
CancelOrder$Mutation parse(Map<String, dynamic> json) =>
CancelOrder$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrderArguments extends JsonSerializable with EquatableMixin {
UpdateOrderArguments({
required this.id,
required this.update,
});
@override
factory UpdateOrderArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateOrderArgumentsFromJson(json);
late String id;
late UpdateOrderInput update;
@override
List<Object?> get props => [id, update];
@override
Map<String, dynamic> toJson() => _$UpdateOrderArgumentsToJson(this);
}
final UPDATE_ORDER_MUTATION_DOCUMENT_OPERATION_NAME = 'updateOrder';
final UPDATE_ORDER_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'updateOrder'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'update')),
type: NamedTypeNode(
name: NameNode(value: 'UpdateOrderInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneOrder'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: VariableNode(name: NameNode(value: 'update')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class UpdateOrderMutation
extends GraphQLQuery<UpdateOrder$Mutation, UpdateOrderArguments> {
UpdateOrderMutation({required this.variables});
@override
final DocumentNode document = UPDATE_ORDER_MUTATION_DOCUMENT;
@override
final String operationName = UPDATE_ORDER_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateOrderArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateOrder$Mutation parse(Map<String, dynamic> json) =>
UpdateOrder$Mutation.fromJson(json);
}
final UPDATED_ORDER_SUBSCRIPTION_DOCUMENT_OPERATION_NAME = 'UpdatedOrder';
final UPDATED_ORDER_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'UpdatedOrder'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orderUpdated'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class UpdatedOrderSubscription
extends GraphQLQuery<UpdatedOrder$Subscription, JsonSerializable> {
UpdatedOrderSubscription();
@override
final DocumentNode document = UPDATED_ORDER_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
UPDATED_ORDER_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
UpdatedOrder$Subscription parse(Map<String, dynamic> json) =>
UpdatedOrder$Subscription.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class DriverLocationUpdatedArguments extends JsonSerializable
with EquatableMixin {
DriverLocationUpdatedArguments({required this.driverId});
@override
factory DriverLocationUpdatedArguments.fromJson(Map<String, dynamic> json) =>
_$DriverLocationUpdatedArgumentsFromJson(json);
late String driverId;
@override
List<Object?> get props => [driverId];
@override
Map<String, dynamic> toJson() => _$DriverLocationUpdatedArgumentsToJson(this);
}
final DRIVER_LOCATION_UPDATED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME =
'DriverLocationUpdated';
final DRIVER_LOCATION_UPDATED_SUBSCRIPTION_DOCUMENT =
DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'DriverLocationUpdated'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'driverId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'driverLocationUpdated'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'driverId'),
value: VariableNode(name: NameNode(value: 'driverId')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class DriverLocationUpdatedSubscription extends GraphQLQuery<
DriverLocationUpdated$Subscription, DriverLocationUpdatedArguments> {
DriverLocationUpdatedSubscription({required this.variables});
@override
final DocumentNode document = DRIVER_LOCATION_UPDATED_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
DRIVER_LOCATION_UPDATED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
final DriverLocationUpdatedArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
DriverLocationUpdated$Subscription parse(Map<String, dynamic> json) =>
DriverLocationUpdated$Subscription.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SubmitFeedbackArguments extends JsonSerializable with EquatableMixin {
SubmitFeedbackArguments({
required this.score,
required this.description,
required this.orderId,
required this.parameterIds,
});
@override
factory SubmitFeedbackArguments.fromJson(Map<String, dynamic> json) =>
_$SubmitFeedbackArgumentsFromJson(json);
late int score;
late String description;
late String orderId;
late List<String> parameterIds;
@override
List<Object?> get props => [score, description, orderId, parameterIds];
@override
Map<String, dynamic> toJson() => _$SubmitFeedbackArgumentsToJson(this);
}
final SUBMIT_FEEDBACK_MUTATION_DOCUMENT_OPERATION_NAME = 'SubmitFeedback';
final SUBMIT_FEEDBACK_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SubmitFeedback'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'score')),
type: NamedTypeNode(
name: NameNode(value: 'Int'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'description')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'orderId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'parameterIds')),
type: ListTypeNode(
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'submitReview'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'review'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'score'),
value: VariableNode(name: NameNode(value: 'score')),
),
ObjectFieldNode(
name: NameNode(value: 'description'),
value: VariableNode(name: NameNode(value: 'description')),
),
ObjectFieldNode(
name: NameNode(value: 'requestId'),
value: VariableNode(name: NameNode(value: 'orderId')),
),
ObjectFieldNode(
name: NameNode(value: 'parameterIds'),
value: VariableNode(name: NameNode(value: 'parameterIds')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class SubmitFeedbackMutation
extends GraphQLQuery<SubmitFeedback$Mutation, SubmitFeedbackArguments> {
SubmitFeedbackMutation({required this.variables});
@override
final DocumentNode document = SUBMIT_FEEDBACK_MUTATION_DOCUMENT;
@override
final String operationName = SUBMIT_FEEDBACK_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SubmitFeedbackArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SubmitFeedback$Mutation parse(Map<String, dynamic> json) =>
SubmitFeedback$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class GetDriversLocationArguments extends JsonSerializable with EquatableMixin {
GetDriversLocationArguments({this.point});
@override
factory GetDriversLocationArguments.fromJson(Map<String, dynamic> json) =>
_$GetDriversLocationArgumentsFromJson(json);
final PointInput? point;
@override
List<Object?> get props => [point];
@override
Map<String, dynamic> toJson() => _$GetDriversLocationArgumentsToJson(this);
}
final GET_DRIVERS_LOCATION_QUERY_DOCUMENT_OPERATION_NAME = 'GetDriversLocation';
final GET_DRIVERS_LOCATION_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetDriversLocation'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'point')),
type: NamedTypeNode(
name: NameNode(value: 'PointInput'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'getDriversLocation'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'center'),
value: VariableNode(name: NameNode(value: 'point')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class GetDriversLocationQuery extends GraphQLQuery<GetDriversLocation$Query,
GetDriversLocationArguments> {
GetDriversLocationQuery({required this.variables});
@override
final DocumentNode document = GET_DRIVERS_LOCATION_QUERY_DOCUMENT;
@override
final String operationName =
GET_DRIVERS_LOCATION_QUERY_DOCUMENT_OPERATION_NAME;
@override
final GetDriversLocationArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
GetDriversLocation$Query parse(Map<String, dynamic> json) =>
GetDriversLocation$Query.fromJson(json);
}
final GET_REVIEW_PARAMETERS_QUERY_DOCUMENT_OPERATION_NAME =
'GetReviewParameters';
final GET_REVIEW_PARAMETERS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetReviewParameters'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'feedbackParameters'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'isGood'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]);
class GetReviewParametersQuery
extends GraphQLQuery<GetReviewParameters$Query, JsonSerializable> {
GetReviewParametersQuery();
@override
final DocumentNode document = GET_REVIEW_PARAMETERS_QUERY_DOCUMENT;
@override
final String operationName =
GET_REVIEW_PARAMETERS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetReviewParameters$Query parse(Map<String, dynamic> json) =>
GetReviewParameters$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class GetFareArguments extends JsonSerializable with EquatableMixin {
GetFareArguments({
required this.points,
this.couponCode,
this.selectedOptionIds,
});
@override
factory GetFareArguments.fromJson(Map<String, dynamic> json) =>
_$GetFareArgumentsFromJson(json);
late List<PointInput> points;
final String? couponCode;
final List<String>? selectedOptionIds;
@override
List<Object?> get props => [points, couponCode, selectedOptionIds];
@override
Map<String, dynamic> toJson() => _$GetFareArgumentsToJson(this);
}
final GET_FARE_QUERY_DOCUMENT_OPERATION_NAME = 'GetFare';
final GET_FARE_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetFare'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'points')),
type: ListTypeNode(
type: NamedTypeNode(
name: NameNode(value: 'PointInput'),
isNonNull: true,
),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'couponCode')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'selectedOptionIds')),
type: ListTypeNode(
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'getFare'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'points'),
value: VariableNode(name: NameNode(value: 'points')),
),
ObjectFieldNode(
name: NameNode(value: 'couponCode'),
value: VariableNode(name: NameNode(value: 'couponCode')),
),
ObjectFieldNode(
name: NameNode(value: 'selectedOptionIds'),
value: VariableNode(name: NameNode(value: 'selectedOptionIds')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'distance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'duration'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'services'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'services'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'description'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'personCapacity'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'twoWayAvailable'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'type'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'additionalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'cost'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
FieldNode(
name: NameNode(value: 'error'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]);
class GetFareQuery extends GraphQLQuery<GetFare$Query, GetFareArguments> {
GetFareQuery({required this.variables});
@override
final DocumentNode document = GET_FARE_QUERY_DOCUMENT;
@override
final String operationName = GET_FARE_QUERY_DOCUMENT_OPERATION_NAME;
@override
final GetFareArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
GetFare$Query parse(Map<String, dynamic> json) =>
GetFare$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class ApplyCouponArguments extends JsonSerializable with EquatableMixin {
ApplyCouponArguments({required this.code});
@override
factory ApplyCouponArguments.fromJson(Map<String, dynamic> json) =>
_$ApplyCouponArgumentsFromJson(json);
late String code;
@override
List<Object?> get props => [code];
@override
Map<String, dynamic> toJson() => _$ApplyCouponArgumentsToJson(this);
}
final APPLY_COUPON_MUTATION_DOCUMENT_OPERATION_NAME = 'ApplyCoupon';
final APPLY_COUPON_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'ApplyCoupon'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'code')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'applyCoupon'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'code'),
value: VariableNode(name: NameNode(value: 'code')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'prepayPercent'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'cancellationTotalFee'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'waitMinutes'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class ApplyCouponMutation
extends GraphQLQuery<ApplyCoupon$Mutation, ApplyCouponArguments> {
ApplyCouponMutation({required this.variables});
@override
final DocumentNode document = APPLY_COUPON_MUTATION_DOCUMENT;
@override
final String operationName = APPLY_COUPON_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final ApplyCouponArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
ApplyCoupon$Mutation parse(Map<String, dynamic> json) =>
ApplyCoupon$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SendSOSArguments extends JsonSerializable with EquatableMixin {
SendSOSArguments({
required this.orderId,
this.location,
});
@override
factory SendSOSArguments.fromJson(Map<String, dynamic> json) =>
_$SendSOSArgumentsFromJson(json);
late String orderId;
final PointInput? location;
@override
List<Object?> get props => [orderId, location];
@override
Map<String, dynamic> toJson() => _$SendSOSArgumentsToJson(this);
}
final SEND_S_O_S_MUTATION_DOCUMENT_OPERATION_NAME = 'SendSOS';
final SEND_S_O_S_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SendSOS'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'orderId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'location')),
type: NamedTypeNode(
name: NameNode(value: 'PointInput'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'sosSignal'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'orderId'),
value: VariableNode(name: NameNode(value: 'orderId')),
),
ArgumentNode(
name: NameNode(value: 'location'),
value: VariableNode(name: NameNode(value: 'location')),
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class SendSOSMutation extends GraphQLQuery<SendSOS$Mutation, SendSOSArguments> {
SendSOSMutation({required this.variables});
@override
final DocumentNode document = SEND_S_O_S_MUTATION_DOCUMENT;
@override
final String operationName = SEND_S_O_S_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SendSOSArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SendSOS$Mutation parse(Map<String, dynamic> json) =>
SendSOS$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class LoginArguments extends JsonSerializable with EquatableMixin {
LoginArguments({required this.firebaseToken});
@override
factory LoginArguments.fromJson(Map<String, dynamic> json) =>
_$LoginArgumentsFromJson(json);
late String firebaseToken;
@override
List<Object?> get props => [firebaseToken];
@override
Map<String, dynamic> toJson() => _$LoginArgumentsToJson(this);
}
final LOGIN_MUTATION_DOCUMENT_OPERATION_NAME = 'Login';
final LOGIN_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'Login'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'firebaseToken')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'login'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'firebaseToken'),
value: VariableNode(name: NameNode(value: 'firebaseToken')),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'jwtToken'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class LoginMutation extends GraphQLQuery<Login$Mutation, LoginArguments> {
LoginMutation({required this.variables});
@override
final DocumentNode document = LOGIN_MUTATION_DOCUMENT;
@override
final String operationName = LOGIN_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final LoginArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
Login$Mutation parse(Map<String, dynamic> json) =>
Login$Mutation.fromJson(json);
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/wallet/wallet_view.dart | import 'package:client_shared/config.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/wallet/wallet_card_view.dart';
import 'package:client_shared/wallet/wallet_activity_item_view.dart';
import 'package:lifecycle/lifecycle.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/wallet/add_credit_sheet_view.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../query_result_view.dart';
class WalletView extends StatefulWidget {
const WalletView({Key? key}) : super(key: key);
@override
State<WalletView> createState() => _WalletViewState();
}
class _WalletViewState extends State<WalletView> {
int? selectedWalletIndex;
Refetch? refetch;
@override
Widget build(BuildContext context) {
return Scaffold(
body: LifecycleWrapper(
onLifecycleEvent: (event) {
if (event == LifecycleEvent.visible && refetch != null) {
refetch!();
}
},
child: Query(
options: QueryOptions(document: WALLET_QUERY_DOCUMENT),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
this.refetch = refetch;
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
final query = Wallet$Query.fromJson(result.data!);
final wallet = query.riderWallets;
final transactions = query.riderTransacions.edges;
if (wallet.isNotEmpty && selectedWalletIndex == null) {
selectedWalletIndex = 0;
}
final currentWallet =
wallet.isEmpty ? null : wallet[selectedWalletIndex ?? 0];
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
RidyBackButton(text: S.of(context).action_back),
WalletCardView(
title: S.of(context).wallet_card_title(appName),
actionAddCreditText:
S.of(context).add_credit_dialog_title,
actionRedeemGiftCardText:
S.of(context).action_redeem_gift_card,
currency: currentWallet?.currency ?? defaultCurrency,
credit: currentWallet?.balance ?? 0,
onAdddCredit: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 600),
builder: (context) {
return AddCreditSheetView(
currency:
currentWallet?.currency ?? defaultCurrency,
);
});
},
),
const SizedBox(height: 32),
Text(S.of(context).wallet_activities_heading,
style: Theme.of(context).textTheme.headlineMedium),
const SizedBox(height: 12),
if (transactions.isNotEmpty)
Expanded(
child: ListView.builder(
itemCount: transactions.length,
itemBuilder: (context, index) {
final item = transactions[index].node;
return WalletActivityItemView(
title: item.action == TransactionAction.recharge
? getRechargeText(item.rechargeType!)
: getDeductText(context, item.deductType!),
dateTime: item.createdAt,
amount: item.amount,
currency: item.currency,
icon: getTransactionIcon(item),
);
}),
),
if (transactions.isEmpty)
Expanded(
child: Center(
child: Text(
S.of(context).wallet_empty_state_message))),
],
),
);
}),
),
);
}
String getDeductText(
BuildContext context, RiderDeductTransactionType deductType) {
switch (deductType) {
case RiderDeductTransactionType.orderFee:
return S.of(context).enum_rider_transaction_deduct_order_fee;
case RiderDeductTransactionType.withdraw:
return S.of(context).enum_rider_transaction_deduct_withdraw;
case RiderDeductTransactionType.correction:
return S.of(context).enum_rider_transaction_deduct_correction;
default:
return S.of(context).enum_unknown;
}
}
String getRechargeText(RiderRechargeTransactionType type) {
switch (type) {
case RiderRechargeTransactionType.bankTransfer:
return S.of(context).enum_rider_transaction_recharge_bank_transfer;
case RiderRechargeTransactionType.correction:
return S.of(context).enum_rider_transaction_recharge_correction;
case RiderRechargeTransactionType.gift:
return S.of(context).enum_rider_transaction_recharge_gift;
case RiderRechargeTransactionType.inAppPayment:
return S.of(context).enum_rider_transaction_recharge_in_app_payment;
default:
return S.of(context).enum_unknown;
}
}
IconData getTransactionIcon(
Wallet$Query$RiderTransacionConnection$RiderTransacionEdge$RiderTransacion
transacion) {
if (transacion.action == TransactionAction.recharge) {
switch (transacion.rechargeType) {
case RiderRechargeTransactionType.bankTransfer:
return Ionicons.business;
case RiderRechargeTransactionType.gift:
return Ionicons.gift;
case RiderRechargeTransactionType.correction:
return Ionicons.refresh;
case RiderRechargeTransactionType.inAppPayment:
return Ionicons.receipt;
default:
return Ionicons.help;
}
} else {
switch (transacion.deductType) {
case RiderDeductTransactionType.orderFee:
return Ionicons.car;
default:
return Ionicons.help;
}
}
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/wallet/add_credit_sheet_view.dart | import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:ridy/query_result_view.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:client_shared/wallet/payment_method_item.dart';
import 'package:client_shared/wallet/money_presets_group.dart';
import '../config.dart';
class AddCreditSheetView extends StatefulWidget {
final String currency;
const AddCreditSheetView({required this.currency, Key? key})
: super(key: key);
@override
State<AddCreditSheetView> createState() => _AddCreditSheetViewState();
}
class _AddCreditSheetViewState extends State<AddCreditSheetView> {
String? selectedGatewayId;
double? amount;
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
top: 16,
left: 16,
right: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(title: S.of(context).add_credit_dialog_title),
Text(
S.of(context).add_credit_select_payment_method,
style: Theme.of(context).textTheme.headlineMedium,
).pOnly(bottom: 8),
Query(
options: QueryOptions(document: PAYMENT_GATEWAYS_QUERY_DOCUMENT),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
final gateways = PaymentGateways$Query.fromJson(result.data!)
.paymentGateways;
return Column(
children: gateways
.map((gateway) => PaymentMethodItem(
id: gateway.id,
title: gateway.title,
selectedValue: selectedGatewayId,
imageAddress: gateway.media != null
? serverUrl + gateway.media!.address
: null,
onSelected: (value) {
setState(() => selectedGatewayId = gateway.id);
}))
.toList());
}),
const SizedBox(height: 16),
Text(
S.of(context).add_credit_chose_amount,
style: Theme.of(context).textTheme.headlineMedium,
),
const SizedBox(height: 16),
MoneyPresetsGroup(
onAmountChanged: (value) => setState(() => amount = value)),
const SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: Mutation(
options: MutationOptions(
document: TOP_UP_WALLET_MUTATION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (RunMutation runMutation, QueryResult? result) {
return ElevatedButton(
onPressed: ((result?.isLoading ?? false) ||
amount == null ||
selectedGatewayId == null)
? null
: () async {
Navigator.pop(context);
final mutationResult = await runMutation(
TopUpWalletArguments(
input: TopUpWalletInput(
gatewayId: selectedGatewayId!,
amount: amount!,
currency: widget.currency))
.toJson())
.networkResult;
final resultParsed = TopUpWallet$Mutation.fromJson(
mutationResult!.data!);
launchUrl(Uri.parse(resultParsed.topUpWallet.url),
mode: LaunchMode.externalApplication);
},
child: Text(S.of(context).top_up_sheet_pay_button),
);
}),
)
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/address/address_location_selection_view.dart | import 'dart:async';
import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:osm_nominatim/osm_nominatim.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
import 'package:client_shared/components/marker_new.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class AddressLocationSelectionView extends StatefulWidget {
final FullLocation? defaultLocation;
const AddressLocationSelectionView(this.defaultLocation, {Key? key})
: super(key: key);
@override
State<AddressLocationSelectionView> createState() =>
_AddressLocationSelectionViewState();
}
class _AddressLocationSelectionViewState
extends State<AddressLocationSelectionView> {
final MapController mapController = MapController();
String? address;
late StreamSubscription<MapEvent> subscription;
@override
void initState() {
address ??= widget.defaultLocation?.address;
super.initState();
}
@override
Widget build(BuildContext context) {
return FlutterMap(
mapController: mapController,
options: MapOptions(
onMapReady: () {
subscription =
mapController.mapEventStream.listen((MapEvent mapEvent) async {
if (mapEvent is MapEventMoveStart) {
setState(() {
address = null;
});
} else if (mapEvent is MapEventMoveEnd) {
final reverseSearchResult = await Nominatim.reverseSearch(
lat: mapController.center.latitude,
lon: mapController.center.longitude,
nameDetails: true);
final fullLocation =
reverseSearchResult.convertToFullLocation();
setState(() {
address = fullLocation.address;
});
}
});
},
maxZoom: 20,
zoom: 16,
center: widget.defaultLocation?.latlng,
interactiveFlags: InteractiveFlag.drag |
InteractiveFlag.pinchMove |
InteractiveFlag.pinchZoom |
InteractiveFlag.doubleTapZoom),
children: [
if (mapProvider == MapProvider.openStreetMap ||
(mapProvider == MapProvider.googleMap &&
mapBoxAccessToken.isEmptyOrNull))
openStreetTileLayer,
if (mapProvider == MapProvider.mapBox ||
(mapProvider == MapProvider.googleMap &&
!mapBoxAccessToken.isEmptyOrNull))
mapBoxTileLayer,
CurrentLocationLayer(
followOnLocationUpdate: widget.defaultLocation == null
? FollowOnLocationUpdate.once
: FollowOnLocationUpdate.never,
),
MarkerNew(address: address).centered(),
SafeArea(
top: false,
minimum: const EdgeInsets.all(16),
child: Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: address == null
? null
: () {
Navigator.of(context).pop(FullLocation(
latlng: mapController.center,
address: address!,
title: widget.defaultLocation?.title ?? ""));
},
child: Text(S.of(context).action_confirm_location)),
),
],
).objectBottomCenter(),
)
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/address/address_list_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/address/address_details_view.dart';
import 'package:ridy/address/address_item_view.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:ridy/main/bloc/current_location_cubit.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../query_result_view.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class AddressListView extends StatefulWidget {
const AddressListView({Key? key}) : super(key: key);
@override
State<AddressListView> createState() => _AddressListViewState();
}
class _AddressListViewState extends State<AddressListView> {
List<GetAddresses$Query$RiderAddress> allAddresses = [];
Refetch? refetch;
List<RiderAddressType> defaultTypes = [
RiderAddressType.home,
RiderAddressType.work,
];
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Query(
options: QueryOptions(
document: GET_ADDRESSES_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
this.refetch = refetch;
allAddresses =
GetAddresses$Query.fromJson(result.data!).riderAddresses;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Text(
S.of(context).favorite_locations_list_title,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 4),
Text(
S.of(context).favorite_locations_list_body,
style: Theme.of(context).textTheme.bodySmall,
),
const SizedBox(height: 12),
...defaultTypes.map(
(e) {
final ind =
allAddresses.indexWhere((element) => element.type == e);
if (ind < 0) {
return AddressItemView(
onAction: (address, type) =>
showAddressDetailsView(context, address, type),
type: e,
address: null,
);
} else {
return const SizedBox();
}
},
),
...allAddresses.map((e) {
return AddressItemView(
onAction: (address, type) =>
showAddressDetailsView(context, address, type),
type: e.type,
address: e,
);
}),
const Divider(),
AddressListAddLocationButton(
onTap: () => showAddressDetailsView(context, null, null)),
],
);
},
),
),
);
}
void showAddressDetailsView(BuildContext context,
GetAddresses$Query$RiderAddress? address, RiderAddressType? type) async {
final currentLocation = context.read<CurrentLocationCubit>().state;
await showBarModalBottomSheet(
context: context,
builder: (_) {
return BlocProvider.value(
value: BlocProvider.of<CurrentLocationCubit>(context),
child: AddressDetailsView(
address: address,
defaultType: type,
currentLocation: currentLocation));
});
refetch!();
}
}
class AddressListAddLocationButton extends StatelessWidget {
final Function() onTap;
const AddressListAddLocationButton({required this.onTap, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return CupertinoButton(
padding: const EdgeInsets.symmetric(vertical: 8),
onPressed: onTap,
child: Row(children: [
const AddressListIcon(Icons.add),
const SizedBox(width: 8),
Text(
S.of(context).action_add_favorite_location,
style: Theme.of(context).textTheme.titleMedium,
)
]));
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/address/address_details_view.dart | import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/address/address_item_view.dart';
import 'package:ridy/address/address_location_selection_view.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/location_selection/welcome_card/place_search_sheet_view.dart';
import 'package:client_shared/components/marker_new.dart';
import 'package:client_shared/theme/theme.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:latlong2/latlong.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
class AddressDetailsView extends StatefulWidget {
final GetAddresses$Query$RiderAddress? address;
final RiderAddressType? defaultType;
final FullLocation? currentLocation;
const AddressDetailsView(
{this.currentLocation, this.address, this.defaultType, Key? key})
: super(key: key);
@override
State<AddressDetailsView> createState() => _AddressDetailsViewState();
}
class _AddressDetailsViewState extends State<AddressDetailsView> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
late MapController mapController;
String title = "";
String? details;
RiderAddressType? type;
@override
void initState() {
mapController = MapController();
if (widget.address != null) {
title = widget.address!.title;
details = widget.address!.details;
type = widget.address!.type;
} else {
type = widget.defaultType;
}
super.initState();
}
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: [
RidyBackButton(text: S.of(context).action_back),
const Spacer(),
if (widget.address != null)
Mutation(
options: MutationOptions(
document: DELETE_ADDRESS_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return CupertinoButton(
onPressed: () async {
final args =
DeleteAddressArguments(id: widget.address!.id)
.toJson();
await runMutation(args).networkResult;
if (!mounted) return;
Navigator.pop(context);
},
minSize: 0,
padding: const EdgeInsets.all(0),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
Ionicons.trash,
color: CustomTheme.neutralColors.shade600,
),
Padding(
padding: const EdgeInsets.only(left: 4, top: 4),
child: Text(
S.of(context).action_delete,
style: TextStyle(
color:
CustomTheme.neutralColors.shade600),
),
)
]),
);
})
],
),
const SizedBox(height: 16),
Text(
S.of(context).favorite_location_details_title,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 16),
Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
initialValue: title,
onChanged: (value) => title = value,
decoration: InputDecoration(
prefixIcon: const Icon(
Ionicons.ellipse,
color: CustomTheme.neutralColors,
size: 12,
),
isDense: true,
hintStyle: Theme.of(context).textTheme.labelLarge,
hintText: S.of(context).create_address_title_textfield_hint,
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).create_address_name_empty_error;
}
return null;
},
),
const SizedBox(height: 8),
DropdownButtonFormField<RiderAddressType>(
value: type,
icon: const Icon(
Ionicons.chevron_down,
color: CustomTheme.neutralColors,
),
validator: (RiderAddressType? type) => (type != null
? null
: S.of(context).textbox_error_select_type_address),
decoration: InputDecoration(
hintText: S.of(context).placeholder_type,
hintStyle: Theme.of(context).textTheme.labelLarge,
isDense: true,
prefixIcon: const Icon(
Ionicons.ellipse,
color: CustomTheme.neutralColors,
size: 12,
),
),
items: <DropdownMenuItem<RiderAddressType>>[
createAddressType(RiderAddressType.home),
createAddressType(RiderAddressType.work),
createAddressType(RiderAddressType.gym),
createAddressType(RiderAddressType.cafe),
createAddressType(RiderAddressType.park),
createAddressType(RiderAddressType.parent),
createAddressType(RiderAddressType.partner),
createAddressType(RiderAddressType.other),
],
onChanged: (RiderAddressType? value) => type = value,
),
],
),
),
const Spacer(),
CupertinoButton(
minSize: 0,
padding: EdgeInsets.zero,
onPressed: () {},
child: Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
boxShadow: [
BoxShadow(
color: CustomTheme.neutralColors.shade200,
blurRadius: 5,
spreadRadius: 1)
]),
constraints: const BoxConstraints(minHeight: 100, maxHeight: 350),
child: FlutterMap(
mapController: mapController,
options: MapOptions(
onMapReady: () {
if (widget.address != null) {
mapController.move(
widget.address!.location.toLatLng(), 16);
}
},
center: widget.address?.location.toLatLng() ??
widget.currentLocation?.latlng,
onTap: (position, latlng) async {
final location =
await showBarModalBottomSheet<FullLocation>(
context: context,
builder: (context) {
return AddressLocationSelectionView(
details != null
? FullLocation(
latlng: mapController.center,
address: details!,
title: title)
: widget.currentLocation);
});
if (location == null) return;
mapController.move(location.latlng, 15);
setState(() {
details = location.address;
});
},
zoom: 15.0,
interactiveFlags: InteractiveFlag.none),
children: [
if (mapProvider == MapProvider.openStreetMap ||
(mapProvider == MapProvider.googleMap &&
mapBoxAccessToken.isEmptyOrNull))
openStreetTileLayer,
if (mapProvider == MapProvider.mapBox ||
(mapProvider == MapProvider.googleMap &&
!mapBoxAccessToken.isEmptyOrNull))
mapBoxTileLayer,
CurrentLocationLayer(
followOnLocationUpdate: FollowOnLocationUpdate.never,
),
MarkerNew(address: details).centered(),
],
),
),
),
const Spacer(),
if (widget.address == null)
Mutation(
options:
MutationOptions(document: CREATE_ADDRESS_MUTATION_DOCUMENT),
builder: (
RunMutation runMutation,
QueryResult? result,
) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: (details == null || title.isEmpty)
? null
: () async {
if (_formKey.currentState!.validate()) {
final args = CreateAddressArguments(
input: CreateRiderAddressInput(
title: title,
details: details!,
type: type,
location: PointInput(
lat: mapController
.center.latitude,
lng: mapController
.center.longitude)))
.toJson();
await runMutation(args).networkResult;
if (!mounted) return;
Navigator.pop(context);
}
},
child: Text(S.of(context).action_save)),
);
}),
if (widget.address != null)
Mutation(
options:
MutationOptions(document: UPDATE_ADDRESS_MUTATION_DOCUMENT),
builder: (
RunMutation runMutation,
QueryResult? result,
) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: (details == null || title.isEmpty)
? null
: () async {
if (_formKey.currentState!.validate()) {
final args = UpdateAddressArguments(
id: widget.address!.id,
update: CreateRiderAddressInput(
title: title,
details: details!,
type: type,
location: PointInput(
lat: mapController
.center.latitude,
lng: mapController
.center.longitude)))
.toJson();
await runMutation(args).networkResult;
if (!mounted) return;
Navigator.pop(context);
}
},
child: Text(S.of(context).action_save)),
);
})
],
),
);
}
DropdownMenuItem<RiderAddressType> createAddressType(RiderAddressType type) {
return DropdownMenuItem(
value: type,
child: Row(children: [
Icon(
getAddressTypeIcon(type),
color: Colors.grey,
),
const SizedBox(width: 8),
Text(getAddressTypeName(context, type)),
]));
}
}
extension AddressLocation on GetAddresses$Query$RiderAddress$Point {
LatLng toLatLng() {
return LatLng(lat, lng);
}
}
| 0 |
mirrored_repositories/RideFlutter/rider-app/lib | mirrored_repositories/RideFlutter/rider-app/lib/address/address_item_view.dart | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:client_shared/theme/theme.dart';
class AddressItemView extends StatelessWidget {
final RiderAddressType type;
final GetAddresses$Query$RiderAddress? address;
final Function(
GetAddresses$Query$RiderAddress? address, RiderAddressType? type)
onAction;
const AddressItemView(
{required this.onAction, required this.type, this.address, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(vertical: 8),
child: Row(
children: [
AddressListIcon(getAddressTypeIcon(type)),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
getAddressTypeName(context, type),
style: Theme.of(context).textTheme.titleMedium,
),
if (address != null)
Text(
address!.details,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.labelMedium,
),
if (address == null)
CupertinoButton(
padding: const EdgeInsets.only(left: 0, top: 2),
minSize: 0,
child: Text(S.of(context).action_set_location,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(color: CustomTheme.primaryColors)),
onPressed: () => onAction(null, type))
],
),
),
const Spacer(),
if (address != null)
CupertinoButton(
child: Text(
S.of(context).action_edit,
style: Theme.of(context).textTheme.labelMedium,
),
onPressed: () => onAction(address, null))
],
),
);
}
}
class AddressListIcon extends StatelessWidget {
final IconData iconData;
const AddressListIcon(
this.iconData, {
Key? key,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(10)),
child: Icon(
iconData,
size: 28,
color: CustomTheme.neutralColors.shade600,
),
);
}
}
IconData getAddressTypeIcon(RiderAddressType type) {
switch (type) {
case RiderAddressType.home:
return Ionicons.home;
case RiderAddressType.work:
return Ionicons.business;
case RiderAddressType.partner:
return Ionicons.heart;
case RiderAddressType.other:
return Ionicons.location;
case RiderAddressType.artemisUnknown:
return Ionicons.location;
case RiderAddressType.gym:
return Ionicons.barbell;
case RiderAddressType.parent:
return Ionicons.people;
case RiderAddressType.cafe:
return Ionicons.cafe;
case RiderAddressType.park:
return Ionicons.leaf;
}
}
String getAddressTypeName(BuildContext context, RiderAddressType type) {
switch (type) {
case RiderAddressType.home:
return S.of(context).enum_address_type_home;
case RiderAddressType.work:
return S.of(context).enum_address_type_work;
case RiderAddressType.partner:
return S.of(context).enum_address_type_partner;
case RiderAddressType.other:
return S.of(context).enum_address_type_other;
case RiderAddressType.artemisUnknown:
return S.of(context).enum_address_type_other;
case RiderAddressType.gym:
return S.of(context).enum_address_type_gym;
case RiderAddressType.parent:
return S.of(context).enum_address_type_parent_house;
case RiderAddressType.cafe:
return S.of(context).enum_address_type_cafe;
case RiderAddressType.park:
return S.of(context).enum_address_type_park;
}
}
| 0 |
mirrored_repositories/RideFlutter | mirrored_repositories/RideFlutter/driver-app/unused_i10n.dart | // ignore_for_file: depend_on_referenced_packages, avoid_print
import 'dart:convert';
import 'dart:io';
import 'package:args/args.dart';
import 'package:glob/glob.dart';
import 'package:glob/list_local_fs.dart';
const lineNumber = 'line-number';
void main(List<String> arguments) {
exitCode = 0; // presume success
final parser = ArgParser()
..addFlag(
'path',
negatable: false,
abbr: 'p',
help: 'Path to the Flutter/Dart project',
);
ArgResults argResults = parser.parse(arguments);
final paths = argResults.rest;
final terms = getTranslationTerms(paths.first);
final dartFiles = getDartFiles(paths.first);
final notUsed = findNotUsedArbTerms(terms, dartFiles);
for (final t in notUsed) {
print(t);
}
}
Set<String> getTranslationTerms(String path) {
final arbFile = Glob("$path/**.arb");
final arbFiles = <FileSystemEntity>[];
for (var entity in arbFile.listSync(followLinks: false)) {
arbFiles.add(entity);
}
final arbTerms = <String>{};
for (final file in arbFiles) {
final content = File(file.path).readAsStringSync();
final map = jsonDecode(content) as Map<String, dynamic>;
for (final entry in map.entries) {
if (!entry.key.startsWith('@')) {
arbTerms.add(entry.key);
}
}
}
return arbTerms;
}
List<FileSystemEntity> getDartFiles(String path) {
final dartFile = Glob("$path/lib/**.dart");
final dartFiles = <FileSystemEntity>[];
for (var entity in dartFile.listSync(followLinks: false)) {
if (!entity.path.contains('generated')) {
dartFiles.add(entity);
}
}
return dartFiles;
}
Set<String> findNotUsedArbTerms(
Set<String> arbTerms,
List<FileSystemEntity> files,
) {
final unused = arbTerms.toSet();
for (final file in files) {
final content = File(file.path).readAsStringSync();
for (final arb in arbTerms) {
if (content.contains(arb)) {
unused.remove(arb);
}
}
}
return unused;
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/drawer_view.dart | import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:client_shared/config.dart';
import 'package:ridy/config.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class DrawerView extends StatelessWidget {
final BasicProfileMixin? driver;
const DrawerView({required this.driver, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(children: [
const SizedBox(
height: 48,
),
Row(
children: [
UserAvatarView(
urlPrefix: serverUrl,
url: driver?.media?.address,
cornerRadius: 10,
size: 50,
backgroundColor: CustomTheme.primaryColors.shade300,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text(
driver?.firstName != null || driver?.lastName != null
? "${driver?.firstName ?? " "} ${driver?.lastName ?? " "}"
: "-",
style: Theme.of(context).textTheme.titleLarge,
),
),
],
),
const SizedBox(
height: 32,
),
if (driver?.isWalletHidden == false)
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.bar_chart),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_earnings,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'earnings');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.person),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_profile,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'profile');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.notifications),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_announcements,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'announcements');
},
),
if (driver?.isWalletHidden == false)
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.wallet),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_wallet,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'wallet');
},
),
if (driver?.isWalletHidden == false)
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.time),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_trip_history,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () {
Navigator.pushNamed(context, 'trip-history');
},
),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.information),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_about,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
showAboutDialog(
context: context,
applicationIcon: Image.asset(
'images/logo.png',
width: 100,
height: 100,
),
applicationVersion:
"${packageInfo.version} (Build ${packageInfo.buildNumber})",
applicationName: packageInfo.appName,
applicationLegalese:
// ignore: use_build_context_synchronously
S.of(context).copyright_notice(companyName));
},
),
const Spacer(),
ListTile(
iconColor: CustomTheme.primaryColors.shade800,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
leading: const Icon(Ionicons.log_out),
minLeadingWidth: 20.0,
title: Text(
S.of(context).menu_logout,
style: Theme.of(context).textTheme.titleMedium,
),
onTap: () async {
final logoutDialogResult = await showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(S.of(context).title_logout),
content: Text(S.of(context).logout_dialog_body),
actions: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 8),
child: TextButton(
onPressed: () {
Navigator.pop(context, 2);
},
child: Text(
S.of(context).action_delete_account,
style: const TextStyle(
color: Color(0xffb20d0e))))),
const Spacer(),
TextButton(
onPressed: () {
Navigator.pop(context, 0);
},
child: Text(S.of(context).action_cancel)),
TextButton(
onPressed: () async {
Navigator.pop(context, 1);
await Hive.box('user').delete('jwt');
},
child: Text(S.of(context).action_ok))
],
)
],
));
if (logoutDialogResult != 2) return;
showDialog(
context: context,
builder: (BuildContext ncontext) {
return AlertDialog(
title: Text(S.of(context).dialog_account_deletion_title),
content: Text(S.of(context).dialog_account_deletion_body),
actions: [
Row(
children: [
Padding(
padding: const EdgeInsets.only(left: 8),
child: Mutation(
options: MutationOptions(
document: DELETE_USER_MUTATION_DOCUMENT),
builder: (RunMutation runMutation,
QueryResult? result) {
return TextButton(
onPressed: () async {
Navigator.pop(context);
await runMutation({}).networkResult;
await Hive.box('user').delete('jwt');
},
child: Text(
S.of(context).action_delete_account,
textAlign: TextAlign.end,
style: const TextStyle(
color: Color(0xffb20d0e)),
));
}),
),
const Spacer(),
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(
S.of(context).action_cancel,
textAlign: TextAlign.end,
))
],
),
],
);
});
//exit(1);
},
)
]),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/main_bloc.dart | import 'graphql/generated/graphql_api.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:latlong2/latlong.dart';
abstract class MainEvent {}
class DriverUpdated extends MainEvent {
BasicProfileMixin driver;
DriverUpdated(this.driver);
}
class VersionStatusEvent extends MainEvent {
VersionStatus status;
VersionStatusEvent(this.status);
}
class AvailableOrdersUpdated extends MainEvent {
List<dynamic> orders;
AvailableOrdersUpdated(this.orders);
}
class AvailabledOrderAdded extends MainEvent {
Map<String, dynamic> order;
AvailabledOrderAdded(this.order);
}
class AvailableOrderRemoved extends MainEvent {
Map<String, dynamic> order;
AvailableOrderRemoved(this.order);
}
class SelectedOrderChanged extends MainEvent {
int index;
SelectedOrderChanged(this.index);
}
class CurrentOrderUpdated extends MainEvent {
Map<String, dynamic> order;
CurrentOrderUpdated(this.order);
}
abstract class MainState {
BasicProfileMixin? driver;
List<MarkerData> markers;
MainState(this.driver, this.markers);
}
class StatusUnregistered extends MainState {
StatusUnregistered(driver) : super(driver, []);
}
class StatusOffline extends MainState {
StatusOffline(BasicProfileMixin? driver) : super(driver, []);
}
class RequireUpdateState extends MainState {
RequireUpdateState() : super(null, []);
}
class StatusOnline extends MainState {
List<AvailableOrderMixin> orders;
AvailableOrderMixin? selectedOrder;
StatusOnline({driver, required this.orders, this.selectedOrder})
: super(
driver,
selectedOrder != null
? selectedOrder.points
.asMap()
.entries
.map((e) => MarkerData(
id: e.value.lat.toString(),
position: LatLng(e.value.lat, e.value.lng),
address: selectedOrder.addresses[e.key]))
.toList()
: []);
}
class StatusInService extends MainState {
LatLng? currentLocation;
StatusInService(driver, {this.currentLocation}) : super(driver, []) {
if (this.driver?.currentOrders.isNotEmpty ?? false) {
final order = this.driver?.currentOrders.first;
if (order!.status == OrderStatus.driverAccepted ||
order.status == OrderStatus.arrived) {
markers = [
MarkerData(
id: order.points[0].lat.toString(),
position: LatLng(order.points[0].lat, order.points[0].lng),
address: order.addresses[0])
];
}
if (order.status == OrderStatus.started) {
markers = order.points
.skip(1)
.toList()
.asMap()
.entries
.map<MarkerData>((e) => MarkerData(
id: order.points[e.key].lat.toString(),
position:
LatLng(order.points[e.key].lat, order.points[e.key].lng),
address: order.addresses[e.key]))
.toList();
}
}
}
}
class MainBloc extends Bloc<MainEvent, MainState> {
MainBloc() : super(StatusOffline(null)) {
on<VersionStatusEvent>(((event, emit) => emit(RequireUpdateState())));
on<DriverUpdated>((event, emit) {
switch (event.driver.status) {
case DriverStatus.online:
emit(StatusOnline(driver: event.driver, orders: []));
break;
case DriverStatus.inService:
emit(StatusInService(event.driver));
break;
case DriverStatus.offline:
emit(StatusOffline(event.driver));
break;
case DriverStatus.blocked:
case DriverStatus.waitingDocuments:
case DriverStatus.pendingApproval:
case DriverStatus.softReject:
case DriverStatus.hardReject:
case DriverStatus.artemisUnknown:
emit(StatusUnregistered(event.driver));
}
});
on<AvailableOrdersUpdated>((event, emit) {
if (state is! StatusOnline) {
return;
}
// if ((listEquals((state as StatusOnline).orders.map((e) => e.id).toList(),
// event.orders.map((e) => e.id).toList())) &&
// event.location?.latitude ==
// (state as StatusOnline).currentLocation?.latitude) {
// return;
// }
List<AvailableOrderMixin> orders = event.orders
.map<AvailableOrders$Query$Order>(
(orderObj) => AvailableOrders$Query$Order.fromJson(orderObj))
.toList();
final sumOldIds = (state as StatusOnline).orders.fold<int>(
0, (previousValue, element) => previousValue + int.parse(element.id));
final sumNewIds = orders.fold<int>(
0, (value, element) => value + int.parse(element.id));
if (sumNewIds != sumOldIds) {
emit(StatusOnline(
driver: state.driver,
orders: orders,
selectedOrder: orders.isNotEmpty ? orders.first : null));
}
});
on<AvailabledOrderAdded>((event, emit) {
if (state is StatusOnline) {
if ((state as StatusOnline).orders.indexWhere(
(element) => element.id == event.order['orderCreated']['id']) ==
-1) {
final AvailableOrderMixin created =
AvailableOrders$Query$Order.fromJson(
event.order['orderCreated'] as Map<String, dynamic>);
(state as StatusOnline).orders.add(created);
emit(StatusOnline(
driver: state.driver,
orders: (state as StatusOnline).orders,
selectedOrder: (state as StatusOnline).orders.length == 1
? (state as StatusOnline).orders.first
: (state as StatusOnline).selectedOrder));
}
}
});
on<AvailableOrderRemoved>((event, emit) {
if (state is StatusOnline) {
final updated =
OrderRemoved$Subscription.fromJson(event.order).orderRemoved;
if ((state as StatusOnline)
.orders
.indexWhere((element) => element.id == updated.id) >
-1) {
(state as StatusOnline)
.orders
.removeWhere((element) => element.id == updated.id);
emit(StatusOnline(
driver: state.driver,
orders: (state as StatusOnline).orders,
selectedOrder: (state as StatusOnline).selectedOrder));
}
}
});
on<SelectedOrderChanged>((event, emit) {
if (state is StatusOnline) {
emit(StatusOnline(
driver: state.driver,
orders: (state as StatusOnline).orders,
selectedOrder: (state as StatusOnline).orders[event.index]));
}
});
on<CurrentOrderUpdated>((event, emit) {
final endedStatuses = [
OrderStatus.riderCanceled,
OrderStatus.driverCanceled,
OrderStatus.finished,
OrderStatus.waitingForReview
];
final order = BasicProfileMixin$Order.fromJson(event.order);
if (endedStatuses.contains(order.status)) {
state.driver!.status = DriverStatus.online;
state.driver!.currentOrders = [];
emit(StatusOnline(driver: state.driver, orders: []));
} else {
if (state.driver!.currentOrders.isEmpty) {
state.driver!.currentOrders.add(order);
} else {
state.driver!.currentOrders = [order];
}
emit(StatusInService(state.driver));
}
});
}
}
class MarkerData {
String id;
LatLng position;
String address;
MarkerData({required this.id, required this.position, required this.address});
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/driver_distance_select_view.dart | import 'package:client_shared/theme/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/current_location_cubit.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class DriverDistanceSelect extends StatelessWidget {
const DriverDistanceSelect({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Mutation(
options: MutationOptions(
document: UPDATE_DRIVER_SEARCH_DISTANCE_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return BlocBuilder<CurrentLocationCubit, CurrentLocationState>(
builder: (context, state) {
return Row(
children: [
const Spacer(),
CupertinoButton(
minSize: 0,
padding: EdgeInsets.zero,
onPressed: (result?.isLoading ??
false || state.radius == null)
? null
: () async {
if ((state.radius ?? 0) > 1000) {
final newDistance = (state.radius ?? 0) - 1000;
await runMutation(
UpdateDriverSearchDistanceArguments(
distance: newDistance)
.toJson())
.networkResult;
// ignore: use_build_context_synchronously
context
.read<CurrentLocationCubit>()
.setRadius(newDistance);
}
},
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: CustomTheme.secondaryColors.shade400,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10))),
child: const Icon(
Icons.remove,
size: 32,
color: Colors.white,
)),
),
Container(
padding: const EdgeInsets.all(11),
color: CustomTheme.primaryColors.shade50,
child: Text(S
.of(context)
.distance_format((state.radius ?? 0) / 1000))),
CupertinoButton(
minSize: 0,
padding: EdgeInsets.zero,
onPressed: (result?.isLoading ??
false || state.radius == null)
? null
: () async {
if ((state.radius ?? 0) < 10000) {
final newDistance = (state.radius ?? 0) + 1000;
await runMutation(
UpdateDriverSearchDistanceArguments(
distance: newDistance)
.toJson())
.networkResult;
// ignore: use_build_context_synchronously
context
.read<CurrentLocationCubit>()
.setRadius(newDistance);
}
},
child: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: CustomTheme.secondaryColors.shade400,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(10),
bottomRight: Radius.circular(10))),
child: const Icon(
Icons.add,
size: 32,
color: Colors.white,
)),
),
const Spacer(),
],
);
},
);
});
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/current_location_cubit.dart | import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:latlong2/latlong.dart';
class CurrentLocationCubit extends Cubit<CurrentLocationState> {
CurrentLocationCubit() : super(CurrentLocationState());
setRadius(int? radius) {
emit(CurrentLocationState(location: state.location, radius: radius));
}
setCurrentLocation(LatLng location) {
if (location.latitude != state.location?.latitude ||
location.longitude != state.location?.longitude) {
emit(CurrentLocationState(location: location, radius: state.radius));
}
}
}
class CurrentLocationState {
LatLng? location;
int? radius;
CurrentLocationState({this.location, this.radius});
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/config.dart | import 'package:client_shared/config.dart';
String serverUrl = "http://$serverIP:4002/";
String wsUrl = serverUrl.replaceFirst("http", "ws");
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/unregistered_driver_messages_view.dart | import 'package:client_shared/theme/theme.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'graphql/generated/graphql_api.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
class UnregisteredDriverMessagesView extends StatelessWidget {
final BasicProfileMixin? driver;
final Refetch? refetch;
const UnregisteredDriverMessagesView(
{required this.driver, required this.refetch, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, packageInfo) => Flex(
direction: Axis.vertical,
children: [
Flexible(
flex: 2,
child: Container(
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade200,
borderRadius: const BorderRadius.only(
bottomRight: Radius.circular(70))),
child: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Row(
children: [
const Spacer(),
ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Image.asset(
"images/logo.png",
width: 32,
height: 32,
),
),
const SizedBox(width: 8),
Text(
packageInfo.data?.appName ?? "",
style: Theme.of(context).textTheme.headlineMedium,
),
const Spacer(),
],
),
const Spacer(),
Image.asset(
'images/registration-illustration.png',
width: 300,
height: 300,
),
const Spacer()
],
),
),
)),
Flexible(
child: Stack(
children: [
Positioned(
left: -70,
right: -70,
top: 30,
child: Image.asset(
'images/dotted-lines-1.png',
),
),
if (driver == null)
Center(
child: NotLoggedInUnregisteredView(refetch: refetch),
),
if (driver?.status == DriverStatus.waitingDocuments)
Center(
child: WaitingToCompleteSubmissionUnregisteredView(
refetch: refetch),
),
if (driver?.status == DriverStatus.pendingApproval)
Center(
child: RegistrationSubmittedUnregisteredView(
refetch: refetch)),
if (driver?.status == DriverStatus.softReject)
Center(
child: SoftRejectUnregisteredView(
rejectionNote: driver?.softRejectionNote),
),
if (driver?.status == DriverStatus.hardReject)
const Center(
child: HardRejectUnregisteredView(),
)
],
))
],
),
);
}
}
class NotLoggedInUnregisteredView extends StatelessWidget {
final Refetch? refetch;
const NotLoggedInUnregisteredView({Key? key, required this.refetch})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
const SizedBox(height: 24),
Text(
S.of(context).onboarding_welcome,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 24),
SizedBox(
width: 300,
child: ElevatedButton(
onPressed: () {
Navigator.pushNamed(context, 'register');
},
child: Text(S.of(context).action_login_signup)),
)
],
);
}
}
class WaitingToCompleteSubmissionUnregisteredView extends StatelessWidget {
final Refetch? refetch;
const WaitingToCompleteSubmissionUnregisteredView(
{Key? key, required this.refetch})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
Text(
S.of(context).onboarding_welcome,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 8),
Text(
S.of(context).incomplete_registration_description,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: CustomTheme.neutralColors.shade600),
)
],
),
),
const SizedBox(height: 24),
SizedBox(
width: 300,
child: OutlinedButton(
onPressed: () {
Navigator.pushNamed(context, 'register');
},
child: Text(S.of(context).action_complete_registration)),
)
],
);
}
}
class RegistrationSubmittedUnregisteredView extends StatelessWidget {
final Refetch? refetch;
const RegistrationSubmittedUnregisteredView({Key? key, required this.refetch})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
Text(
S.of(context).onboarding_welcome,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 8),
Text(
S.of(context).pending_review_registration_description,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: CustomTheme.neutralColors.shade600),
)
],
),
),
const SizedBox(height: 24),
SizedBox(
width: 300,
child: OutlinedButton(
onPressed: () async {
await Navigator.pushNamed(context, 'register');
},
child: Text(S.of(context).action_edit_submission)),
)
],
);
}
}
class HardRejectUnregisteredView extends StatelessWidget {
const HardRejectUnregisteredView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
Text(
S.of(context).onboarding_welcome,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 8),
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(
Ionicons.close_circle,
color: Color(0xffb20d0e),
size: 18,
),
const SizedBox(width: 8),
Text(
S.of(context).hard_reject_registration,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: const Color(0xffb20d0e)),
),
],
)
],
),
),
],
);
}
}
class SoftRejectUnregisteredView extends StatelessWidget {
final String? rejectionNote;
const SoftRejectUnregisteredView({required this.rejectionNote, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(horizontal: 30, vertical: 10),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(12)),
child: Column(
children: [
Text(
S.of(context).onboarding_welcome,
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 8),
Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(
Ionicons.close_circle,
color: Color(0xffb20d0e),
size: 18,
),
const SizedBox(width: 8),
Text(
S.of(context).soft_rejection_description,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: const Color(0xffb20d0e)),
),
],
),
if (!rejectionNote.isEmptyOrNull)
Text(
rejectionNote ?? "",
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.bodySmall
?.copyWith(color: const Color(0xffb20d0e)),
)
],
),
),
const SizedBox(height: 24),
SizedBox(
width: 300,
child: OutlinedButton(
onPressed: () {
Navigator.pushNamed(context, 'register');
},
child: Text(
S.of(context).action_edit_submission,
style: const TextStyle(color: Color(0xffb20d0e)),
)),
)
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/order_item_view.dart | import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:ridy/config.dart';
import 'package:ridy/current_location_cubit.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:geolocator/geolocator.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'graphql/generated/graphql_api.dart';
import 'package:intl/intl.dart';
class OrderItemView extends StatelessWidget {
final AvailableOrderMixin order;
final OrderAcceptedCallback onAcceptCallback;
final bool isActionActive;
const OrderItemView(
{Key? key,
required this.order,
required this.onAcceptCallback,
required this.isActionActive})
: super(key: key);
@override
Widget build(BuildContext context) {
return BlocBuilder<CurrentLocationCubit, CurrentLocationState>(
builder: (context, state) {
final driverDistance = state.location == null
? order.distanceBest
: (Geolocator.distanceBetween(
state.location!.latitude,
state.location!.longitude,
order.points.first.lat,
order.points.first.lng) /
1000);
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: RidySheetView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
UserAvatarView(
urlPrefix: serverUrl,
url: null,
cornerRadius: 60,
size: 30),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
order.service.name,
style: Theme.of(context).textTheme.titleMedium,
),
Text(
S.of(context).request_card_distance(
(driverDistance / 1000).round()),
style: Theme.of(context).textTheme.labelMedium,
)
],
),
const Spacer(),
Container(
padding:
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade200,
borderRadius: BorderRadius.circular(12)),
child: Text(
NumberFormat.simpleCurrency(name: order.currency)
.format(order.costBest),
style: Theme.of(context).textTheme.headlineMedium,
),
)
],
),
const Divider(),
...order.addresses.mapIndexed((e, index) {
if (order.addresses.length > 2 &&
index > 0 &&
index != order.addresses.length - 1) {
return const SizedBox(
width: 1,
height: 1,
);
}
return Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 4),
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(6),
child: Icon(
getIconByIndex(index, order.addresses.length),
color: CustomTheme.neutralColors.shade500,
),
),
Expanded(
child: Text(e,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.bodySmall),
),
if (index == order.addresses.length - 1)
Text(
order.durationBest == 0
? ""
: durationToString(
Duration(seconds: order.durationBest)),
style: Theme.of(context).textTheme.bodySmall)
],
),
),
if (index < order.addresses.length - 1)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: DottedLine(
direction: Axis.vertical,
lineLength: 20,
lineThickness: 3,
dashLength: 3,
dashColor: CustomTheme.neutralColors.shade500),
)
],
);
}).toList(),
const Spacer(),
Row(
children: order.options
.map((e) => OrderPreferenceTagView(
icon: e.icon,
name: e.name,
))
.toList()),
ElevatedButton(
onPressed: !isActionActive
? null
: () => onAcceptCallback(order.id),
child: Row(
children: [
const Spacer(),
Text(S.of(context).available_order_action_accept),
const Spacer()
],
).p4())
.p4()
],
),
),
);
});
}
IconData getIconByIndex(int index, int length) {
if (index == 0) {
return Ionicons.navigate;
} else if (index == length - 1) {
return Ionicons.location;
} else {}
return Ionicons.flag;
}
}
typedef OrderAcceptedCallback = void Function(String orderId);
String durationToString(Duration duration) =>
("in ${duration.inMinutes.toStringAsFixed(0)} mins");
class OrderPreferenceTagView extends StatelessWidget {
final ServiceOptionIcon icon;
final String name;
const OrderPreferenceTagView(
{required this.icon, required this.name, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(4),
child: Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade100,
borderRadius: BorderRadius.circular(16)),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: CustomTheme.primaryColors,
borderRadius: BorderRadius.circular(16)),
child: Icon(
getOptionIcon(),
size: 14,
color: Colors.white,
),
),
const SizedBox(width: 4),
Text(
name,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(width: 4),
],
),
),
);
}
IconData getOptionIcon() {
switch (icon) {
case ServiceOptionIcon.pet:
return Ionicons.paw;
case ServiceOptionIcon.twoWay:
return Ionicons.repeat;
case ServiceOptionIcon.luggage:
return Ionicons.briefcase;
case ServiceOptionIcon.packageDelivery:
return Ionicons.cube;
case ServiceOptionIcon.shopping:
return Ionicons.cart;
case ServiceOptionIcon.custom1:
return Ionicons.help;
case ServiceOptionIcon.custom2:
return Ionicons.help;
case ServiceOptionIcon.custom3:
return Ionicons.help;
case ServiceOptionIcon.custom4:
return Ionicons.help;
case ServiceOptionIcon.custom5:
return Ionicons.help;
case ServiceOptionIcon.artemisUnknown:
return Ionicons.help;
}
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/order_status_card_view.dart | import 'package:client_shared/components/light_colored_button.dart';
import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:client_shared/components/rounded_button.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:ridy/order_invoice_view.dart';
import 'package:ridy/ride_options_sheet_view.dart';
import 'package:ridy/rider_preferences_sheet_view.dart';
import 'package:timeago_flutter/timeago_flutter.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:collection/collection.dart';
import 'config.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'main_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:velocity_x/velocity_x.dart';
import 'graphql/generated/graphql_api.dart';
import 'package:map_launcher/map_launcher.dart';
import 'package:flutter_svg/flutter_svg.dart';
class OrderStatusCardView extends StatelessWidget {
final CurrentOrderMixin order;
const OrderStatusCardView({required this.order, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final bloc = context.read<MainBloc>();
final now = DateTime.now();
final canPay = (order.paidAmount +
(order.rider.wallets
.firstWhereOrNull(
(element) => element.currency == order.currency)
?.balance ??
0)) >=
order.costAfterCoupon;
return Mutation(
options:
MutationOptions(document: UPDATE_ORDER_STATUS_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
if (order.status == OrderStatus.waitingForPostPay) {
return OrderInvoiceView(
order: order,
onCashPaymentReceived: () {
updateCurrentOrderStatus(
bloc, runMutation, OrderStatus.finished,
cashPayment: (order.costAfterCoupon +
order.tipAmount -
order.paidAmount));
});
}
return Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
children: [
const Spacer(),
FloatingActionButton.extended(
heroTag: 'navigateFab',
onPressed: () => openMapsSheet(context, order),
elevation: 0,
label: Text(
S.of(context).order_status_action_navigate,
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(color: Colors.white),
),
icon: const Icon(Ionicons.navigate)),
],
).pSymmetric(v: 12, h: 16),
RidySheetView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: getTitleForStatus(context, order.status)),
Row(
children: [
UserAvatarView(
urlPrefix: serverUrl,
url: order.rider.media?.address,
cornerRadius: 40,
size: 35),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${order.rider.firstName ?? "-"} ${order.rider.lastName ?? "-"}",
style:
Theme.of(context).textTheme.titleMedium,
),
if (order.status == OrderStatus.driverAccepted)
Timeago(
builder: (context, text) {
return Text(
(order.etaPickup?.isBefore(now) ??
false)
? S
.of(context)
.rider_expected_time_past(
order.etaPickup
?.difference(now)
.inMinutes
.abs() ??
0)
: S
.of(context)
.rider_expected_time_future(
order
.etaPickup
?.difference(
DateTime
.now())
.inMinutes ??
0),
style: Theme.of(context)
.textTheme
.labelSmall,
);
},
date: order.etaPickup ?? DateTime.now()),
if (order.status == OrderStatus.started ||
order.status == OrderStatus.arrived)
Row(
children: [
Icon(
!canPay
? Ionicons.close_circle
: Ionicons.checkmark_circle,
size: 14,
color: !canPay
? const Color(0xffb20d0e)
: const Color(0xff108910),
),
const SizedBox(width: 2),
Text(
canPay
? S
.of(context)
.order_payment_status_paid
: S
.of(context)
.order_payment_status_unpaid,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(
color: !canPay
? const Color(0xffb20d0e)
: const Color(0xff108910)),
)
],
),
],
),
),
),
if (order.status == OrderStatus.driverAccepted ||
order.status == OrderStatus.arrived)
RoundedButton(
icon: Ionicons.call,
onPressed: () {
_launchUrl(context,
"tel://+${order.rider.mobileNumber}");
}),
const SizedBox(width: 8),
if (order.status == OrderStatus.driverAccepted ||
order.status == OrderStatus.arrived)
RoundedButton(
icon: Ionicons.mail,
onPressed: () {
Navigator.pushNamed(context, 'chat');
}),
],
),
const SizedBox(height: 8),
const Divider(),
Row(
children: [
LightColoredButton(
icon: Ionicons.list,
text: S.of(context).action_ride_options,
onPressed: () async {
final result =
await showModalBottomSheet<RideOptionsResult>(
context: context,
builder: (context) {
return const RideOptionsSheetView();
});
switch (result) {
case RideOptionsResult.cancel:
updateCurrentOrderStatus(bloc, runMutation,
OrderStatus.driverCanceled);
break;
case RideOptionsResult.none:
case null:
break;
}
}),
const Spacer(),
if (order.options.isNotEmpty)
LightColoredButton(
icon: Ionicons.options,
text: S.of(context).action_ride_preferences,
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) {
return RiderPreferencesSheetView(
options: order.options,
);
});
}),
],
),
const SizedBox(height: 12),
if (order.status == OrderStatus.driverAccepted)
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: (result?.isLoading ?? false)
? null
: () => updateCurrentOrderStatus(
bloc, runMutation, OrderStatus.arrived),
child: Text(
S.of(context).order_status_action_arrived)),
),
if (order.status == OrderStatus.arrived)
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: (result?.isLoading ?? false)
? null
: () => updateCurrentOrderStatus(
bloc, runMutation, OrderStatus.started),
child:
Text(S.of(context).order_status_action_start)),
),
if (order.status == OrderStatus.started)
SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: (result?.isLoading ?? false)
? null
: () => updateCurrentOrderStatus(
bloc, runMutation, OrderStatus.finished),
child: Text(
S.of(context).order_status_action_finished)),
)
],
).px4(),
),
],
);
});
}
openMapsSheet(context, CurrentOrderMixin order) async {
final availableMaps = await MapLauncher.installedMaps;
String title = S.of(context).navigation_dialog_title_pickup_point;
Coords coords = Coords(order.points.first.lat, order.points.first.lng);
if (order.status != OrderStatus.driverAccepted &&
order.status != OrderStatus.arrived) {
title = S.of(context).navigation_title_destination_point;
coords = Coords(order.points.last.lat, order.points.last.lng);
}
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
children: [
SheetTitleView(
title: S.of(context).navigation_dialog_title,
closeAction: () {
Navigator.pop(context);
},
),
SingleChildScrollView(
child: Wrap(
children: <Widget>[
for (var map in availableMaps)
ListTile(
onTap: () => map.showMarker(
coords: coords,
title: title,
),
title: Text(map.mapName),
leading: SvgPicture.asset(
map.icon,
height: 30.0,
width: 30.0,
),
),
],
),
),
],
),
);
},
);
}
String getTitleForStatus(BuildContext context, OrderStatus status) {
switch (status) {
case OrderStatus.driverAccepted:
return S.of(context).order_status_card_title_driver_accepted;
case OrderStatus.arrived:
return S.of(context).order_status_card_title_arrived;
case OrderStatus.started:
return S.of(context).order_status_card_title_started;
default:
return "";
}
}
_launchUrl(BuildContext context, String url) async {
final canLaunch = await canLaunchUrl(Uri.parse(url));
if (!canLaunch) {
final snackBar =
// ignore: use_build_context_synchronously
SnackBar(content: Text(S.of(context).message_cant_open_url));
// ignore: use_build_context_synchronously
ScaffoldMessenger.of(context).showSnackBar(snackBar);
}
launchUrl(Uri.parse(url));
}
Future<void> updateCurrentOrderStatus(
MainBloc bloc, RunMutation runMutation, OrderStatus orderStatus,
{double? cashPayment}) async {
final result = await runMutation(UpdateOrderStatusArguments(
orderId: order.id,
status: orderStatus,
cashPayment: cashPayment ?? 0)
.toJson())
.networkResult;
bloc.add(CurrentOrderUpdated(result!.data!['updateOneOrder']));
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/rider_preferences_sheet_view.dart | import 'package:client_shared/components/sheet_title_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'graphql/generated/graphql_api.graphql.dart';
class RiderPreferencesSheetView extends StatelessWidget {
final List<CurrentOrderMixin$ServiceOption> options;
const RiderPreferencesSheetView({required this.options, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).ride_preferences_title,
closeAction: () => Navigator.pop(context)),
...options.map((e) => RidePreferenceItem(
name: e.name, icon: e.icon, isSelected: false)),
const SizedBox(height: 16),
Row(
children: [
Expanded(
child: ElevatedButton(
onPressed: () => Navigator.pop(context),
child: Text(S.of(context).action_confirm_and_continue),
))
],
)
],
));
}
}
class RidePreferenceItem extends StatelessWidget {
final String name;
final ServiceOptionIcon icon;
final bool isSelected;
const RidePreferenceItem(
{required this.name,
required this.icon,
required this.isSelected,
Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
child: Row(
children: [
AnimatedContainer(
duration: const Duration(milliseconds: 250),
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
border: Border.all(
width: 1,
color: isSelected
? CustomTheme.primaryColors
: Colors.transparent,
),
color: isSelected
? CustomTheme.primaryColors.shade200
: CustomTheme.neutralColors.shade200),
child: Icon(
getOptionIcon(),
size: 32,
color: isSelected
? CustomTheme.primaryColors
: CustomTheme.neutralColors.shade400,
),
),
const SizedBox(width: 12),
Text(
name,
style: Theme.of(context).textTheme.titleMedium,
)
],
),
);
}
IconData getOptionIcon() {
switch (icon) {
case ServiceOptionIcon.pet:
return Ionicons.paw;
case ServiceOptionIcon.twoWay:
return Ionicons.repeat;
case ServiceOptionIcon.luggage:
return Ionicons.briefcase;
case ServiceOptionIcon.packageDelivery:
return Ionicons.cube;
case ServiceOptionIcon.shopping:
return Ionicons.cart;
case ServiceOptionIcon.custom1:
return Ionicons.help;
case ServiceOptionIcon.custom2:
return Ionicons.help;
case ServiceOptionIcon.custom3:
return Ionicons.help;
case ServiceOptionIcon.custom4:
return Ionicons.help;
case ServiceOptionIcon.custom5:
return Ionicons.help;
case ServiceOptionIcon.artemisUnknown:
return Ionicons.help;
}
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/order_invoice_view.dart | import 'package:client_shared/components/ridy_sheet_view.dart';
import 'package:client_shared/components/sheet_title_view.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:ridy/config.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class OrderInvoiceView extends StatelessWidget {
final CurrentOrderMixin order;
final Function() onCashPaymentReceived;
const OrderInvoiceView(
{required this.order, required this.onCashPaymentReceived, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return RidySheetView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SheetTitleView(title: S.of(context).invoice_dialog_title),
Text(S.of(context).invoice_dialog_heading,
style: Theme.of(context).textTheme.headlineMedium),
const SizedBox(height: 4),
Text(
S.of(context).invoice_dialog_body,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 8),
Center(
child: UserAvatarView(
urlPrefix: serverUrl,
url: order.rider.media?.address,
cornerRadius: 12,
size: 60),
),
const SizedBox(height: 8),
Center(
child: Text(
"${order.rider.firstName ?? ""} ${order.rider.lastName ?? ""}",
style: Theme.of(context).textTheme.titleMedium)),
const SizedBox(height: 8),
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade100,
borderRadius: BorderRadius.circular(8)),
child: Column(
children: [
Row(
children: [
Text(order.service.name,
style: Theme.of(context).textTheme.bodySmall),
const Spacer(),
Text(
NumberFormat.simpleCurrency(name: order.currency)
.format(order.costAfterCoupon),
style: Theme.of(context).textTheme.bodySmall)
],
),
// TODO: Show coupon discount
// if (order.costAfterCoupon != order.costBest) const Divider(),
// if (order.costAfterCoupon != order.costBest)
// Row(children: [
// Text("Coupon discount",
// style: Theme.of(context).textTheme.bodySmall),
// const Spacer(),
// Text(
// NumberFormat.simpleCurrency(name: order.currency)
// .format(order.costAfterCoupon - order.costBest),
// style: Theme.of(context).textTheme.bodySmall)
// ]),
const Divider(),
Row(
children: [
Text(S.of(context).invoice_item_tip,
style: Theme.of(context).textTheme.bodySmall),
const Spacer(),
Text(
"+${NumberFormat.simpleCurrency(name: order.currency).format(order.tipAmount)}",
style: Theme.of(context).textTheme.bodySmall)
],
),
const Divider(
thickness: 1.5,
),
Row(
children: [
Text(S.of(context).invoice_item_subtotal,
style: Theme.of(context).textTheme.headlineMedium),
const Spacer(),
Text(
NumberFormat.simpleCurrency(name: order.currency)
.format(order.costAfterCoupon + order.tipAmount),
style: Theme.of(context).textTheme.headlineMedium)
],
)
],
),
),
const SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: OutlinedButton(
onPressed: onCashPaymentReceived,
child: Text(
S.of(context).order_status_action_received_cash,
style: Theme.of(context).textTheme.titleMedium,
)).px4(),
)
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/main.dart | import 'dart:async';
import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:country_codes/country_codes.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/services.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:lifecycle/lifecycle.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:ridy/chat/chat_view.dart';
import 'package:ridy/current_location_cubit.dart';
import 'package:ridy/earnings/earnings_view.dart';
import 'package:ridy/map_providers/google_map_provider.dart';
import 'package:ridy/notice_bar.dart';
import 'package:ridy/profile/profile_view.dart';
import 'package:ridy/register/register_view.dart';
import 'package:ridy/unregistered_driver_messages_view.dart';
import 'announcements/announcements_view.dart';
import 'config.dart';
import 'drawer_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'main_bloc.dart';
import 'map_providers/open_street_map_provider.dart';
import 'order_status_card_view.dart';
import 'orders_carousel_view.dart';
import 'query_result_view.dart';
import 'trip-history/trip_history_list_view.dart';
import 'wallet/wallet_view.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:intl/intl.dart';
import 'graphql/generated/graphql_api.dart';
import 'graphql_provider.dart';
import 'package:geolocator/geolocator.dart';
// ignore: avoid_void_async
void main() async {
await initHiveForFlutter();
WidgetsFlutterBinding.ensureInitialized();
await Geolocator.requestPermission();
await Firebase.initializeApp();
FlutterError.onError = FirebaseCrashlytics.instance.recordFlutterFatalError;
await Hive.openBox('user');
await CountryCodes.init();
final locale = CountryCodes.detailsForLocale();
if (locale.dialCode != null) {
defaultCountryCode = locale.dialCode!;
}
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<Box>(
valueListenable: Hive.box('user').listenable(),
builder: (context, Box box, widget) {
return MultiBlocProvider(
providers: [
BlocProvider<MainBloc>(
lazy: false, create: (context) => MainBloc()),
BlocProvider<CurrentLocationCubit>(
lazy: false, create: (context) => CurrentLocationCubit())
],
child: MyGraphqlProvider(
uri: "${serverUrl}graphql",
subscriptionUri: "${wsUrl}graphql",
jwt: box.get('jwt').toString(),
child: MaterialApp(
title: 'Ridy',
navigatorObservers: [defaultLifecycleObserver],
debugShowCheckedModeBanner: false,
localizationsDelegates: S.localizationsDelegates,
supportedLocales: S.supportedLocales,
routes: {
'register': (context) => const RegisterView(),
'profile': (context) => const ProfileView(),
'trip-history': (context) => const TripHistoryListView(),
'announcements': (context) => const AnnouncementsView(),
'earnings': (context) => const EarningsView(),
'chat': (context) => const ChatView(),
'wallet': (context) => const WalletView(),
},
theme: CustomTheme.theme1,
home: MyHomePage()),
),
);
},
);
}
}
// ignore: must_be_immutable
class MyHomePage extends StatelessWidget with WidgetsBindingObserver {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();
Refetch? refetch;
MyHomePage({Key? key}) : super(key: key) {
WidgetsBinding.instance.addObserver(this);
}
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
final mainBloc = context.read<MainBloc>();
final locationCubit = context.read<CurrentLocationCubit>();
return Scaffold(
key: scaffoldKey,
drawer: ClipRRect(
borderRadius: BorderRadius.circular(10),
child: Drawer(
backgroundColor: CustomTheme.primaryColors.shade100,
child: BlocBuilder<MainBloc, MainState>(
builder: (context, state) {
return DrawerView(
driver: state.driver,
);
},
),
),
),
body: ValueListenableBuilder(
valueListenable: Hive.box('user').listenable(),
builder: (context, Box box, widget) {
if (box.get('jwt') == null) {
return UnregisteredDriverMessagesView(
driver: null,
refetch: refetch,
);
}
return LifecycleWrapper(
onLifecycleEvent: (event) {
if (event == LifecycleEvent.active && refetch != null) {
refetch!();
updateNotificationId(context);
}
},
child: FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
return Query(
options: QueryOptions(
document: ME_QUERY_DOCUMENT,
variables: MeArguments(
versionCode: int.parse(
snapshot.data?.buildNumber ??
"999999"))
.toJson(),
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
this.refetch = refetch;
final mquery = Me$Query.fromJson(result.data!);
if (mquery.requireUpdate ==
VersionStatus.mandatoryUpdate) {
mainBloc.add(
VersionStatusEvent(mquery.requireUpdate));
} else {
mainBloc.add(DriverUpdated(mquery.driver!));
locationCubit
.setRadius(mquery.driver!.searchDistance);
}
return BlocConsumer<MainBloc, MainState>(
listenWhen:
(MainState previous, MainState next) {
if (previous is StatusUnregistered &&
next is StatusUnregistered &&
previous.driver?.status ==
next.driver?.status) {
return false;
}
if ((previous is StatusOnline) &&
next is StatusOnline) {
return false;
}
return true;
}, listener: (context, state) {
if (state is StatusOnline) {
refetch!();
}
}, builder: (context, state) {
if (state is StatusUnregistered) {
return UnregisteredDriverMessagesView(
driver: state.driver, refetch: refetch);
}
return Stack(children: [
if (mapProvider ==
MapProvider.openStreetMap ||
mapProvider == MapProvider.mapBox)
OpenStreetMapProvider(),
if (mapProvider == MapProvider.googleMap)
GoogleMapProvider(),
SafeArea(
minimum: const EdgeInsets.all(16),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
_getMenuButton(),
const Spacer(),
_getWalletButton(context, state),
if (state is! StatusInService)
const Spacer(),
_getOnlineOfflineButton(context, state)
],
),
),
if (state is StatusOffline ||
(state is StatusOnline &&
state.orders.isEmpty))
Positioned(
bottom: 0,
left: 0,
right: 0,
child: NoticeBar(
title: state is StatusOffline
? S
.of(context)
.status_offline_description
: S
.of(context)
.status_online_description),
),
if (state is StatusOnline)
Positioned(
bottom: 0,
child: SizedBox(
width:
MediaQuery.of(context).size.width,
height: 350,
child: OrdersCarouselView()),
),
if (state is StatusInService &&
state.driver!.currentOrders.isNotEmpty)
Positioned(
bottom: 0,
child: Subscription(
options: SubscriptionOptions(
document:
ORDER_UPDATED_SUBSCRIPTION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result) {
if (result.data != null) {
WidgetsBinding.instance
.addPostFrameCallback((_) {
refetch!();
});
}
return SizedBox(
width: MediaQuery.of(context)
.size
.width,
child: OrderStatusCardView(
order: state.driver!
.currentOrders.first));
}),
),
]);
});
});
}));
}));
}
Widget _getOnlineOfflineButton(BuildContext context, MainState state) {
final mainBloc = context.read<MainBloc>();
return Mutation(
options:
MutationOptions(document: UPDATE_DRIVER_STATUS_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return Container(
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
color: Color(0x14000000),
offset: Offset(0, 3),
blurRadius: 15)
]),
child: AnimatedSwitcher(
duration: const Duration(milliseconds: 200),
child: (state is StatusOffline)
? FloatingActionButton.extended(
key: const Key('offline'),
heroTag: 'fabOffline',
extendedPadding:
const EdgeInsets.symmetric(horizontal: 36),
elevation: 0,
backgroundColor: CustomTheme.primaryColors,
foregroundColor: Colors.white,
onPressed: (result?.isLoading ?? false)
? null
: () async {
final fcmId = await getFcmId(context);
final res = await runMutation(
UpdateDriverStatusArguments(
status: DriverStatus.online,
fcmId: fcmId)
.toJson())
.networkResult;
final driver =
UpdateDriverStatus$Mutation.fromJson(
res!.data!);
mainBloc
.add(DriverUpdated(driver.updateOneDriver));
},
label: Text(S.of(context).statusOffline,
style: Theme.of(context).textTheme.headlineSmall),
icon: const Icon(Ionicons.car_sport),
)
: ((state is StatusOnline)
? FloatingActionButton.extended(
key: const Key('online'),
heroTag: 'fabOnline',
elevation: 0,
onPressed: (result?.isLoading ?? false)
? null
: () async {
final res = await runMutation(
UpdateDriverStatusArguments(
status:
DriverStatus.offline)
.toJson())
.networkResult;
final driver =
UpdateDriverStatus$Mutation.fromJson(
res!.data!);
mainBloc.add(
DriverUpdated(driver.updateOneDriver));
},
label: Text(S.of(context).statusOnline,
style: Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(
color: CustomTheme
.primaryColors.shade600)),
backgroundColor: CustomTheme.primaryColors.shade200,
foregroundColor: CustomTheme.primaryColors.shade600,
icon: const Icon(Ionicons.power),
)
: const SizedBox())),
);
});
}
Widget _getMenuButton() {
return Container(
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
color: Color(0x14000000), offset: Offset(3, 3), blurRadius: 25)
]),
child: FloatingActionButton(
heroTag: 'fabMenu',
elevation: 0,
mini: true,
shape:
RoundedRectangleBorder(borderRadius: BorderRadius.circular(30)),
onPressed: () => scaffoldKey.currentState?.openDrawer(),
backgroundColor: CustomTheme.primaryColors.shade50,
child: const Icon(
Icons.menu,
color: Colors.black,
)),
);
}
Widget _getWalletButton(BuildContext context, MainState state) {
return Container(
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
color: Color(0x14000000), offset: Offset(0, 3), blurRadius: 15)
]),
child: FloatingActionButton.extended(
heroTag: 'fabIncome',
onPressed: () => Navigator.pushNamed(context, 'earnings'),
backgroundColor: CustomTheme.primaryColors.shade50,
foregroundColor: CustomTheme.primaryColors,
icon: const Icon(Ionicons.wallet),
elevation: 0,
label: Text(
(state.driver?.wallets.length ?? 0) > 0
? NumberFormat.simpleCurrency(
name: state.driver!.wallets.first.currency)
.format(state.driver!.wallets.first.balance)
: "-",
style: Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(color: CustomTheme.primaryColors))),
);
}
Future<String?> getFcmId(BuildContext context) async {
FirebaseMessaging messaging = FirebaseMessaging.instance;
NotificationSettings settings = await messaging.requestPermission(
alert: true,
announcement: true,
badge: true,
carPlay: true,
criticalAlert: false,
provisional: true,
sound: true,
);
if (settings.authorizationStatus == AuthorizationStatus.denied) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title:
Text(S.of(context).message_notification_permission_title),
content: Text(S
.of(context)
.message_notification_permission_denined_message),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child: Text(S.of(context).action_ok),
)
],
));
return null;
} else {
messaging.onTokenRefresh.listen((event) {
updateNotificationId(context);
});
return messaging.getToken(
vapidKey: "",
);
}
}
void updateNotificationId(BuildContext context) async {
final httpLink = HttpLink(
"${serverUrl}graphql",
);
final authLink = AuthLink(
getToken: () async => 'Bearer ${Hive.box('user').get('jwt')}',
);
Link link = authLink.concat(httpLink);
final GraphQLClient client = GraphQLClient(
cache: GraphQLCache(),
link: link,
);
final fcmId = await getFcmId(context);
await client.mutate(MutationOptions(
document: UPDATE_DRIVER_F_C_M_ID_MUTATION_DOCUMENT,
variables: {"fcmId": fcmId},
fetchPolicy: FetchPolicy.noCache));
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/notice_bar.dart | import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
class NoticeBar extends StatelessWidget {
final String title;
const NoticeBar({required this.title, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade50,
borderRadius: BorderRadius.circular(16),
boxShadow: const [
BoxShadow(
color: Color(0x14000000), offset: Offset(0, -3), blurRadius: 25)
]),
child: SafeArea(
top: false,
minimum: const EdgeInsets.all(16),
child: Text(
title,
style: Theme.of(context).textTheme.bodyMedium,
textAlign: TextAlign.center,
)),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/query_result_view.dart | import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class QueryResultView extends StatelessWidget {
final QueryResult queryResult;
const QueryResultView(this.queryResult, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
if (queryResult.isLoading) {
return const QueryResultLoadingView();
}
if (queryResult.hasException) {
return Center(
child: Text(queryResult.exception.toString()),
);
}
return Container();
}
}
class QueryResultLoadingView extends StatelessWidget {
const QueryResultLoadingView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const CircularProgressIndicator.adaptive(),
const SizedBox(height: 8),
Text(
S.of(context).loading,
style: Theme.of(context).textTheme.caption,
)
],
));
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/graphql_provider.dart | import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter/material.dart';
/*String get host {
if (Platform.isAndroid) {
return '10.0.2.2';
} else {
return 'localhost';
}
}
final client = getClient(
uri: "http://localhost:3002/graphql",
subscriptionUri: "ws:localhost:3002/graphql",
);
final cache = GraphQLCache(store: InMemoryStore());
GraphQLClient getClient({
required String uri,
String? subscriptionUri,
}) {
Link link = HttpLink(uri);
if (subscriptionUri != null) {
final WebSocketLink websocketLink = WebSocketLink(
subscriptionUri,
config: SocketClientConfig(
autoReconnect: true,
inactivityTimeout: Duration(seconds: 30),
),
);
// link = link.concat(websocketLink);
link = Link.split((request) => request.isSubscription, websocketLink, link);
}
return GraphQLClient(
cache: cache,
link: link,
);
}*/
ValueNotifier<GraphQLClient> clientFor(
{required String uri, required String subscriptionUri, String? jwtToken}) {
final WebSocketLink websocketLink = jwtToken != null
? WebSocketLink(subscriptionUri,
config: SocketClientConfig(initialPayload: {"authToken": jwtToken}))
: WebSocketLink(subscriptionUri);
final HttpLink httpLink = jwtToken != null
? HttpLink(uri, defaultHeaders: {"Authorization": "Bearer $jwtToken"})
: HttpLink(uri);
final Link link =
Link.split((request) => request.isSubscription, websocketLink, httpLink);
final GraphQLCache cache = GraphQLCache(store: HiveStore());
return ValueNotifier<GraphQLClient>(
GraphQLClient(
cache: cache,
link: link,
defaultPolicies: DefaultPolicies(
query: Policies(fetch: FetchPolicy.noCache),
mutate: Policies(fetch: FetchPolicy.noCache),
subscribe: Policies(fetch: FetchPolicy.noCache))),
);
}
/// Wraps the root application with the `graphql_flutter` client.
/// We use the cache for all state management.
class MyGraphqlProvider extends StatelessWidget {
MyGraphqlProvider(
{Key? key,
required this.child,
required String uri,
required String subscriptionUri,
String? jwt})
: client = clientFor(
uri: uri, subscriptionUri: subscriptionUri, jwtToken: jwt),
super(key: key);
final Widget child;
final ValueNotifier<GraphQLClient> client;
@override
Widget build(BuildContext context) {
return GraphQLProvider(
client: client,
child: child,
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/ride_options_sheet_view.dart | import 'package:client_shared/components/sheet_title_view.dart';
import 'package:client_shared/components/ride_option_item.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class RideOptionsSheetView extends StatelessWidget {
const RideOptionsSheetView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SheetTitleView(
title: S.of(context).rider_options_dialog_title,
closeAction: () => Navigator.pop(context),
),
RideOptionItem(
icon: Ionicons.close,
text: S.of(context).action_cancel_ride,
onPressed: () =>
Navigator.pop(context, RideOptionsResult.cancel)),
],
));
}
}
enum RideOptionsResult { none, cancel }
| 0 |
mirrored_repositories/RideFlutter/driver-app | mirrored_repositories/RideFlutter/driver-app/lib/orders_carousel_view.dart | import 'package:flutter_gen/gen_l10n/messages.dart';
import 'driver_distance_select_view.dart';
import 'main_bloc.dart';
import 'query_result_view.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'graphql/generated/graphql_api.dart';
import 'order_item_view.dart';
class OrdersCarouselView extends StatelessWidget {
final PageController carouselController = PageController();
OrdersCarouselView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
return SafeArea(
top: false,
minimum: const EdgeInsets.all(16),
child: Query(
options: QueryOptions(
document: AVAILABLE_ORDERS_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
// if ((mainBloc.state as StatusOnline).orders.length !=
// result.data!['availableOrders'].length) {
// mainBloc
// .add(AvailableOrdersUpdated(result.data!['availableOrders']));
// }
return Subscription(
options: SubscriptionOptions(
document: ORDER_CREATED_SUBSCRIPTION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult? created) {
if (created?.data != null) {
mainBloc.add(AvailabledOrderAdded(created!.data!));
}
return Subscription(
options: SubscriptionOptions(
document: ORDER_REMOVED_SUBSCRIPTION_DOCUMENT),
builder: (QueryResult? updated) {
if (updated?.data != null) {
mainBloc.add(AvailableOrderRemoved(updated!.data!));
}
return Mutation(
options: MutationOptions(
document:
UPDATE_ORDER_STATUS_MUTATION_DOCUMENT),
builder: (RunMutation runMutation,
QueryResult? result) =>
BlocBuilder<MainBloc, MainState>(
builder: (context, state) {
if ((state as StatusOnline).orders.isEmpty) {
return const DriverDistanceSelect();
}
return PageView.builder(
controller:
PageController(viewportFraction: 0.9),
itemCount: state.orders.length,
onPageChanged: (index) => mainBloc
.add(SelectedOrderChanged(index)),
itemBuilder: (context, index) =>
OrderItemView(
order: state.orders[index],
isActionActive:
((result?.isLoading ?? false) ==
false),
onAcceptCallback:
(String orderId) async {
final result = await runMutation(
UpdateOrderStatusArguments(
orderId: orderId,
status: OrderStatus
.driverAccepted)
.toJson())
.networkResult;
if (result?.hasException ??
true) {
final snackBar = SnackBar(
content: Text(result
?.exception
?.graphqlErrors
.map((e) =>
e.message)
.join(',') ??
// ignore: use_build_context_synchronously
S
.of(context)
.message_unknown_error));
// ignore: use_build_context_synchronously
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
return;
}
mainBloc.add(CurrentOrderUpdated(
result!.data![
'updateOneOrder']));
},
));
}));
});
});
}),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/announcements/announcements_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/components/empty_state_card_view.dart';
import 'package:client_shared/components/list_shimmer_skeleton.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:shimmer/shimmer.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../graphql/generated/graphql_api.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:intl/intl.dart';
class AnnouncementsView extends StatelessWidget {
const AnnouncementsView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.dark);
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Query(
options: QueryOptions(document: ANNOUNCEMENTS_QUERY_DOCUMENT),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading) {
return Shimmer.fromColors(
baseColor: CustomTheme.neutralColors.shade300,
highlightColor: CustomTheme.neutralColors.shade100,
enabled: true,
child: const ListShimmerSkeleton(),
);
}
final announcements =
Announcements$Query.fromJson(result.data!).announcements;
if (announcements.isEmpty) {
return EmptyStateCard(
title: S.of(context).announcements_empty_state_title,
description:
S.of(context).announcements_empty_state_body,
icon: Ionicons.notifications_off_circle);
}
return Expanded(
child: ListView.builder(
itemCount: announcements.length,
itemBuilder: (context, index) {
return CupertinoButton(
padding: const EdgeInsets.all(0),
onPressed: announcements[index].url.isEmptyOrNull
? null
: () {
launchUrl(
Uri.parse(announcements[index].url!),
mode: LaunchMode.externalApplication);
},
child: Card(
child: ListTile(
title: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
DateFormat("yyyy-MM-dd")
.format(announcements[index].startAt),
style:
Theme.of(context).textTheme.caption,
),
Text(announcements[index].title),
],
),
subtitle: Text(announcements[index].description)
.pOnly(top: 6),
).pOnly(bottom: 10, top: 8),
),
);
}),
);
}),
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/map_providers/google_map_provider.dart | import 'dart:async';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:ridy/current_location_cubit.dart';
import '../main_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:geolocator/geolocator.dart' as geo;
import '../graphql/generated/graphql_api.dart';
import 'open_street_map_provider.dart';
// ignore: must_be_immutable
class GoogleMapProvider extends StatelessWidget {
final Completer<GoogleMapController> _controller = Completer();
static const CameraPosition _kGooglePlex = CameraPosition(
target: LatLng(37.42796133580664, -122.085749655962),
zoom: 14.4746,
);
late BitmapDescriptor iconPickup;
final Stream<geo.Position> streamServerLocation =
geo.Geolocator.getPositionStream(
locationSettings: const geo.LocationSettings(distanceFilter: 50));
GoogleMapProvider({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
return Mutation(
options:
MutationOptions(document: UPDATE_DRIVER_LOCATION_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
BitmapDescriptor.fromAssetImage(
const ImageConfiguration(size: Size(48, 48)),
'images/marker.png')
.then((onValue) {
iconPickup = onValue;
});
return BlocConsumer<MainBloc, MainState>(
listenWhen: (previous, next) =>
next is StatusOnline || next is StatusInService,
listener: (context, state) async {
geo.Geolocator.checkPermission().then((value) {
if (value == geo.LocationPermission.denied) {
geo.Geolocator.requestPermission();
}
});
final currentLocation =
context.read<CurrentLocationCubit>().state.location;
if (state.markers.isNotEmpty) {
final points = state.markers
.map((e) =>
LatLng(e.position.latitude, e.position.longitude))
.followedBy(currentLocation != null
? [
LatLng(currentLocation.latitude,
currentLocation.longitude)
]
: [])
.toList();
(await _controller.future).animateCamera(
CameraUpdate.newLatLngBounds(
boundsFromLatLngList(points), 100));
}
if (state is StatusOnline &&
state.orders.isEmpty &&
currentLocation != null) {
(await _controller.future).animateCamera(
CameraUpdate.newLatLngZoom(
LatLng(currentLocation.latitude,
currentLocation.longitude),
16));
}
if ((state is StatusOnline && currentLocation == null) ||
(state is StatusInService &&
state.currentLocation == null)) {
geo.Geolocator.getCurrentPosition().then(
(value) => onLocationUpdated(value, mainBloc, context));
}
},
builder: (context, state) => Stack(
children: [
GoogleMap(
initialCameraPosition: _kGooglePlex,
padding: const EdgeInsets.only(bottom: 50),
myLocationEnabled: true,
myLocationButtonEnabled: state is StatusOffline ||
(state is StatusOnline && state.orders.isEmpty),
onMapCreated: (GoogleMapController controller) {
_controller.complete(controller);
},
markers: state.markers
.map((e) => Marker(
markerId: MarkerId(e.id),
icon: iconPickup,
position: LatLng(
e.position.latitude, e.position.longitude)))
.toSet(),
),
if (state is! StatusOffline)
StreamBuilder<geo.Position>(
stream: streamServerLocation,
builder: (context, snapshot) {
if (snapshot.hasData) {
onLocationUpdated(
snapshot.data!, mainBloc, context);
}
return Container();
})
],
));
});
}
}
LatLngBounds boundsFromLatLngList(List<LatLng> list) {
double? x0, x1, y0, y1;
for (LatLng latLng in list) {
if (x0 == null) {
x0 = x1 = latLng.latitude;
y0 = y1 = latLng.longitude;
} else {
if (latLng.latitude > (x1 ?? 0)) x1 = latLng.latitude;
if (latLng.latitude < x0) x0 = latLng.latitude;
if (latLng.longitude > (y1 ?? 0)) y1 = latLng.longitude;
if (latLng.longitude < (y0 ?? 0)) y0 = latLng.longitude;
}
}
return LatLngBounds(northeast: LatLng(x1!, y1!), southwest: LatLng(x0!, y0!));
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/map_providers/open_street_map_provider.dart | import 'package:client_shared/components/marker_new.dart';
import 'package:client_shared/map_providers.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:ridy/config.dart';
import 'package:ridy/current_location_cubit.dart';
import 'package:client_shared/config.dart';
import '../main_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:flutter_map_location_marker/flutter_map_location_marker.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:geolocator/geolocator.dart' as geo;
import 'package:hive/hive.dart';
import 'package:latlong2/latlong.dart';
import '../graphql/generated/graphql_api.dart';
// ignore: must_be_immutable
class OpenStreetMapProvider extends StatelessWidget {
MapController? mapController;
final Stream<geo.Position> streamServerLocation =
geo.Geolocator.getPositionStream(
locationSettings: const geo.LocationSettings(distanceFilter: 50));
OpenStreetMapProvider({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
final mainBloc = context.read<MainBloc>();
final locationCubit = context.read<CurrentLocationCubit>();
return FlutterMap(
mapController: mapController,
options: MapOptions(
maxZoom: 20,
zoom: 12,
interactiveFlags: InteractiveFlag.drag |
InteractiveFlag.pinchMove |
InteractiveFlag.pinchZoom |
InteractiveFlag.doubleTapZoom),
children: [
if (mapProvider == MapProvider.openStreetMap) openStreetTileLayer,
if (mapProvider == MapProvider.mapBox) mapBoxTileLayer,
CurrentLocationLayer(
followOnLocationUpdate: FollowOnLocationUpdate.once,
),
BlocBuilder<MainBloc, MainState>(
builder: (context, mainBlocState) =>
mainBlocState is StatusOnline && mainBlocState.orders.isEmpty
? BlocBuilder<CurrentLocationCubit, CurrentLocationState>(
builder: (context, state) {
if (state.location != null &&
state.radius != null) {
return CircleLayer(circles: <CircleMarker>[
CircleMarker(
point: state.location!,
color: Colors.blue.withOpacity(0.3),
borderStrokeWidth: 2,
borderColor:
CustomTheme.secondaryColors.shade200,
useRadiusInMeter: true,
radius: state.radius!.toDouble()),
]);
} else {
return Container();
}
},
)
: Container()),
BlocBuilder<MainBloc, MainState>(
builder: (context, state) {
if (state is StatusOnline &&
state.orders.isNotEmpty &&
state.selectedOrder != null) {
return PolylineLayer(saveLayers: false, polylines: [
Polyline(
points: state.selectedOrder?.directions
?.map((e) => LatLng(e.lat, e.lng))
.toList() ??
[],
strokeWidth: 5,
color: CustomTheme.primaryColors)
]);
}
return const SizedBox();
},
),
BlocBuilder<MainBloc, MainState>(
builder: (context, state) => MarkerLayer(
markers: state.markers
.map((e) => Marker(
point: e.position,
width: 240,
height: 63,
builder: (context) => MarkerNew(address: e.address)))
.toList())),
BlocConsumer<MainBloc, MainState>(
listenWhen: (previous, next) {
if (previous is StatusOnline &&
next is StatusOnline &&
previous.selectedOrder?.id == next.selectedOrder?.id) {
return false;
}
return next is StatusOnline || next is StatusInService;
},
listener: (context, state) {
geo.Geolocator.checkPermission().then((value) {
if (value == geo.LocationPermission.denied) {
geo.Geolocator.requestPermission();
}
});
final currentLocation = locationCubit.state.location;
if (state.markers.isNotEmpty) {
final points = state.markers
.map((e) => e.position)
.followedBy(
currentLocation != null ? [currentLocation] : [])
.toList();
mapController?.fitBounds(LatLngBounds.fromPoints(points),
options: const FitBoundsOptions(
padding: EdgeInsets.only(
top: 130, left: 130, right: 130, bottom: 500)));
}
if (currentLocation == null &&
(state is StatusOnline || state is StatusInService)) {
geo.Geolocator.getCurrentPosition().then(
(value) => onLocationUpdated(value, mainBloc, context));
}
},
builder: (context, state) {
if (state is StatusOffline) {
return const SizedBox();
}
return Stack(
children: [
if (state is StatusOnline)
Align(
alignment: Alignment.bottomRight,
child: SafeArea(
minimum: EdgeInsets.only(
bottom: state.orders.isEmpty ? 96.0 : 350,
right: 16.0),
child: FloatingActionButton(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30)),
mini: true,
elevation: 0,
backgroundColor:
CustomTheme.primaryColors.shade50,
onPressed: () {
final currentLocation = context
.read<CurrentLocationCubit>()
.state
.location;
if (currentLocation == null) return;
mapController?.move(currentLocation, 16);
},
child: Icon(
Icons.location_searching,
color: CustomTheme.neutralColors.shade500,
))),
),
StreamBuilder<geo.Position>(
stream: streamServerLocation,
builder: (context, snapshot) {
if (snapshot.hasData) {
onLocationUpdated(snapshot.data!, mainBloc, context);
}
return const SizedBox();
}),
],
);
},
),
]);
}
}
void onLocationUpdated(
geo.Position position, MainBloc bloc, BuildContext context) async {
final httpLink = HttpLink(
"${serverUrl}graphql",
);
final authLink = AuthLink(
getToken: () async => 'Bearer ${Hive.box('user').get('jwt')}',
);
Link link = authLink.concat(httpLink);
final GraphQLClient client = GraphQLClient(
cache: GraphQLCache(),
link: link,
);
final newLocation = LatLng(position.latitude, position.longitude);
context.read<CurrentLocationCubit>().setCurrentLocation(newLocation);
final res = await client.mutate(MutationOptions(
document: UPDATE_DRIVER_LOCATION_MUTATION_DOCUMENT,
variables: UpdateDriverLocationArguments(
point:
PointInput(lat: position.latitude, lng: position.longitude))
.toJson(),
fetchPolicy: FetchPolicy.noCache));
bloc.add(AvailableOrdersUpdated(res.data!['updateDriversLocationNew']));
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/profile/profile_info_card.dart | import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
class ProfileInfoCard extends StatelessWidget {
final String title;
final Widget subtitle;
const ProfileInfoCard({Key? key, required this.title, required this.subtitle})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
margin: const EdgeInsets.symmetric(horizontal: 8),
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade50,
borderRadius: BorderRadius.circular(8),
boxShadow: const [
BoxShadow(
color: Color(0x2e4a5569),
offset: Offset(0, 3),
blurRadius: 10,
)
]),
child: Column(
children: [
Text(title, style: Theme.of(context).textTheme.labelSmall),
const SizedBox(height: 4),
subtitle
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/profile/profile_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/components/list_shimmer_skeleton.dart';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/config.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:ridy/profile/profile_info_card.dart';
import 'package:shimmer/shimmer.dart';
class ProfileView extends StatefulWidget {
const ProfileView({Key? key}) : super(key: key);
@override
State<ProfileView> createState() => _ProfileViewState();
}
class _ProfileViewState extends State<ProfileView> {
final List<bool> _isOpen = [false, false];
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 4),
Text(S.of(context).menu_profile,
style: Theme.of(context).textTheme.headlineLarge),
const SizedBox(height: 12),
Query(
options: QueryOptions(document: GET_PROFILE_QUERY_DOCUMENT),
builder: (result, {fetchMore, refetch}) {
if (result.isLoading) {
return Shimmer.fromColors(
baseColor: CustomTheme.neutralColors.shade300,
highlightColor: CustomTheme.neutralColors.shade100,
enabled: true,
child: const ListShimmerSkeleton(),
);
}
final driver =
GetProfile$Query.fromJson(result.data!).driver!;
return Expanded(
child: SingleChildScrollView(
child: Column(children: [
Center(
child: UserAvatarView(
urlPrefix: serverUrl,
url: driver.media?.address,
cornerRadius: 12,
size: 82),
),
const SizedBox(height: 4),
Text("${driver.firstName} ${driver.lastName}",
style: Theme.of(context).textTheme.headlineLarge),
Text(
"+${driver.mobileNumber}",
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 12),
Row(mainAxisSize: MainAxisSize.min, children: [
ProfileInfoCard(
title: S.of(context).profile_distance_traveled,
subtitle: Text(
driver.historyOrdersAggregate.first.sum
?.distanceBest ==
null
? "0"
: driver.historyOrdersAggregate.first.sum!
.distanceBest
.toString(),
style:
Theme.of(context).textTheme.titleMedium,
)),
ProfileInfoCard(
title: S.of(context).profile_total_trips,
subtitle: Text(
driver.historyOrdersAggregate.first.count?.id
.toString() ??
"0",
style:
Theme.of(context).textTheme.titleMedium,
)),
ProfileInfoCard(
title: S.of(context).profile_rating,
subtitle: Row(children: [
const SizedBox(width: 12),
const Icon(
Ionicons.star,
color: Color(0xFFEFC868),
size: 16,
),
const SizedBox(width: 4),
Text(
driver.rating?.toString() ?? "-",
style:
Theme.of(context).textTheme.titleMedium,
),
const SizedBox(width: 12)
]))
]),
const SizedBox(height: 24),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 12, vertical: 16),
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: BorderRadius.circular(10)),
child: Row(
children: [
Text(
S.of(context).profile_services_title,
style:
Theme.of(context).textTheme.titleMedium,
),
const SizedBox(width: 4),
Expanded(
child: SingleChildScrollView(
child: Row(
children: driver.enabledServices
.map((e) => Container(
padding:
const EdgeInsets.symmetric(
horizontal: 4),
child: Text(
"• ${e.name}",
style: Theme.of(context)
.textTheme
.labelMedium,
),
))
.toList()),
))
],
),
),
const SizedBox(height: 12),
Container(
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: BorderRadius.circular(12)),
child: ExpansionPanelList(
elevation: 0,
children: [
ExpansionPanel(
backgroundColor: Colors.transparent,
isExpanded: _isOpen[0],
canTapOnHeader: true,
headerBuilder: (context, isExpanded) {
return Container(
padding: const EdgeInsets.all(12),
child: Text(
S
.of(context)
.profile_bank_information_title,
style: Theme.of(context)
.textTheme
.titleMedium,
),
);
},
body: BankInformationTableView(
driver: driver,
))
],
expansionCallback: (panelIndex, isExpanded) {
setState(() {
_isOpen[0] = !isExpanded;
});
}),
),
const SizedBox(height: 12),
Container(
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade100,
borderRadius: BorderRadius.circular(12)),
child: ExpansionPanelList(
elevation: 0,
children: [
ExpansionPanel(
backgroundColor: Colors.transparent,
isExpanded: _isOpen[1],
canTapOnHeader: true,
headerBuilder: (context, isExpanded) {
return Container(
padding: const EdgeInsets.all(12),
child: Text(
S
.of(context)
.profile_vehicle_information_title,
style: Theme.of(context)
.textTheme
.titleMedium,
),
);
},
body: VehicleInformationTableView(
driver: driver))
],
expansionCallback: (panelIndex, isExpanded) {
setState(() {
_isOpen[1] = !isExpanded;
});
}),
),
if (driver.documents.isNotEmpty)
Align(
alignment: Alignment.centerLeft,
child: Container(
padding:
const EdgeInsets.only(left: 4, top: 12),
child: Text(
S
.of(context)
.profile_uploaded_documents_title,
textAlign: TextAlign.start,
style: Theme.of(context)
.textTheme
.titleMedium),
),
),
const SizedBox(height: 4),
Row(
children: [
Expanded(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: driver.documents
.map(
(e) => Container(
padding:
const EdgeInsets.only(left: 8),
child: ClipRRect(
borderRadius:
BorderRadius.circular(8),
child: Image.network(
serverUrl + e.address,
width: 105,
height: 105,
fit: BoxFit.cover,
),
),
),
)
.toList(),
),
),
)
],
),
const SizedBox(height: 50),
]),
),
);
}),
],
)),
);
}
}
class BankInformationTableView extends StatelessWidget {
final GetProfile$Query$Driver driver;
const BankInformationTableView({Key? key, required this.driver})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(12),
child: Column(
children: [
ProfileInformationRow(
title: S.of(context).account_number,
content: driver.accountNumber ?? "-"),
const Divider(),
ProfileInformationRow(
title: S.of(context).bank_name, content: driver.bankName ?? "-"),
const Divider(),
ProfileInformationRow(
title: S.of(context).address, content: driver.address ?? "-"),
],
),
);
}
}
class VehicleInformationTableView extends StatelessWidget {
final GetProfile$Query$Driver driver;
const VehicleInformationTableView({Key? key, required this.driver})
: super(key: key);
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.all(12),
child: Column(
children: [
ProfileInformationRow(
title: S.of(context).car_model, content: driver.car?.name ?? "-"),
const Divider(),
ProfileInformationRow(
title: S.of(context).car_color,
content: driver.carColor?.name ?? "-"),
const Divider(),
ProfileInformationRow(
title: S.of(context).plate_number,
content: driver.carPlate ?? "-"),
],
),
);
}
}
class ProfileInformationRow extends StatelessWidget {
final String title;
final String content;
const ProfileInformationRow(
{required this.title, required this.content, Key? key})
: super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
Text(
title,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(color: CustomTheme.neutralColors.shade700),
),
const Spacer(),
Expanded(
child: Text(
content,
textAlign: TextAlign.end,
style: Theme.of(context).textTheme.labelMedium,
))
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/chat/chat_cubit.dart | import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
class ChatCubit extends Cubit<List<types.TextMessage>> {
ChatCubit() : super([]);
void setMessages(List<types.TextMessage> messages) => emit(messages);
void addMessage(types.TextMessage message) =>
emit([message].followedBy(state).toList());
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/chat/chat_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_chat_ui/flutter_chat_ui.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/chat/chat_cubit.dart';
import 'package:ridy/config.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:ridy/query_result_view.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types;
import 'package:url_launcher/url_launcher.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class ChatView extends StatelessWidget {
const ChatView({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => ChatCubit(),
lazy: false,
child: Builder(builder: (context) {
return Scaffold(
body: Query(
options: QueryOptions(
document: GET_MESSAGES_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
var cubit = context.read<ChatCubit>();
var order = GetMessages$Query.fromJson(result.data!)
.driver!
.currentOrders
.first;
var messages = order.conversations
.map((e) => e.toTextMessage(order.rider, order.driver))
.toList();
cubit.setMessages(messages);
return Subscription(
options: SubscriptionOptions(
document: NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult subscriptionResult) {
if (subscriptionResult.data != null) {
var message = NewMessageReceived$Subscription.fromJson(
subscriptionResult.data!)
.newMessageReceived
.toTextMessage(order.rider, order.driver);
cubit.addMessage(message);
}
return Mutation(
options: MutationOptions(
document: SEND_MESSAGE_MUTATION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (RunMutation runMutation,
QueryResult? mutationResult) {
return BlocBuilder<ChatCubit,
List<types.TextMessage>>(
builder: (context, state) {
return Column(
children: [
SafeArea(
minimum: const EdgeInsets.all(16),
child: Row(
children: [
RidyBackButton(
text:
S.of(context).action_back),
const Spacer(),
CupertinoButton(
child: Container(
padding:
const EdgeInsets.all(8),
decoration: BoxDecoration(
color: CustomTheme
.neutralColors
.shade200,
borderRadius:
BorderRadius.circular(
20)),
child: Icon(
Ionicons.call,
color: CustomTheme
.neutralColors.shade600,
),
),
onPressed: () {
launchUrl(Uri.parse(
"tel://+${order.rider.mobileNumber}"));
})
],
)),
Expanded(
child: Chat(
messages: state,
theme: DefaultChatTheme(
primaryColor:
CustomTheme.primaryColors,
backgroundColor: CustomTheme
.primaryColors.shade50,
inputBackgroundColor: CustomTheme
.neutralColors.shade200,
inputTextColor: Colors.black),
onSendPressed: (text) async {
var args = SendMessageArguments(
content: text.text,
requestId: order.id)
.toJson();
var result = await runMutation(args)
.networkResult;
var message =
SendMessage$Mutation.fromJson(
result!.data!);
cubit.addMessage(message
.createOneOrderMessage
.toTextMessage(
order.rider, order.driver));
},
user: order.driver.toUser()),
),
],
);
},
);
});
});
}),
);
}),
);
}
}
extension ChatDriverExtension on ChatDriverMixin {
types.User toUser() => types.User(
id: 'd$id',
firstName: firstName,
lastName: lastName,
imageUrl: media == null ? null : serverUrl + media!.address);
}
extension ChatRiderExtension on ChatRiderMixin {
types.User toUser() => types.User(
id: 'r$id',
firstName: firstName,
lastName: lastName,
imageUrl: media == null ? null : serverUrl + media!.address);
}
extension ChatMeessageExtension on ChatMessageMixin {
types.TextMessage toTextMessage(
ChatRiderMixin rider, ChatDriverMixin driver) =>
types.TextMessage(
id: id,
text: content,
author: sentByDriver ? driver.toUser() : rider.toUser());
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/trip-history/submit_complaint_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class SubmitComplaintView extends StatefulWidget {
final String orderId;
const SubmitComplaintView({Key? key, required this.orderId})
: super(key: key);
@override
State<SubmitComplaintView> createState() => _SubmitComplaintViewState();
}
class _SubmitComplaintViewState extends State<SubmitComplaintView> {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
String? subject;
String? content;
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: EdgeInsets.only(
top: 16,
right: 16,
left: 16,
bottom: MediaQuery.of(context).viewInsets.bottom + 16),
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Text(S.of(context).issue_submit_title,
style: Theme.of(context).textTheme.headlineLarge),
const SizedBox(height: 8),
Text(S.of(context).issue_submit_body,
style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 16),
Form(
key: _formKey,
child: Column(
children: <Widget>[
TextFormField(
initialValue: subject,
onChanged: (value) => setState(() {
subject = value;
}),
decoration: InputDecoration(
prefixIcon: const Icon(
Ionicons.ellipse,
color: CustomTheme.neutralColors,
size: 12,
),
isDense: true,
hintStyle: Theme.of(context).textTheme.labelLarge,
hintText: S.of(context).issue_subject_placeholder,
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).error_field_cant_be_empty;
}
return null;
},
),
const SizedBox(height: 12),
TextFormField(
initialValue: content,
onChanged: (value) => setState(() {
content = value;
}),
minLines: 3,
maxLines: 5,
decoration: InputDecoration(
isDense: true,
hintStyle: Theme.of(context).textTheme.labelLarge,
hintText: S.of(context).issue_description_placeholder,
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).error_field_cant_be_empty;
}
return null;
},
),
],
),
),
const Spacer(),
Mutation(
options:
MutationOptions(document: SUBMIT_COMPLAINT_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: content.isEmptyOrNull || subject.isEmptyOrNull
? null
: () async {
await runMutation(SubmitComplaintArguments(
id: widget.orderId,
subject: subject!,
content: content!)
.toJson())
.networkResult;
if (!mounted) return;
Navigator.pop(context);
showDialog(
context: context,
builder: (context) {
return AlertDialog(
content: Text(S
.of(context)
.complaint_submit_success_message),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
},
child:
Text(S.of(context).action_ok))
]);
});
},
child: Text(S.of(context).button_report_issue)),
);
})
]),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/trip-history/trip_history_details_view.dart | import 'package:client_shared/config.dart';
import 'package:client_shared/map_providers.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/plugin_api.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:intl/intl.dart';
import 'package:latlong2/latlong.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:client_shared/components/marker_new.dart';
import 'package:ridy/query_result_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:ridy/trip-history/submit_complaint_view.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class TripHistoryDetailsView extends StatelessWidget {
final String orderId;
final MapController mapController = MapController();
TripHistoryDetailsView({required this.orderId, Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
Expanded(
child: Query(
options: QueryOptions(
document: GET_ORDER_DETAILS_QUERY_DOCUMENT,
variables:
GetOrderDetailsArguments(id: orderId).toJson()),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
final order =
GetOrderDetails$Query.fromJson(result.data!).order!;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(height: 16),
Text(
DateFormat('MMM.dd.yyyy')
.format(order.expectedTimestamp),
style: Theme.of(context).textTheme.headlineLarge,
),
const SizedBox(height: 16),
Container(
decoration: const BoxDecoration(boxShadow: [
BoxShadow(
color: Color(0x10000000),
offset: Offset(1, 2),
blurRadius: 20)
]),
child: SizedBox(
height: 300,
child: ClipRRect(
borderRadius: BorderRadius.circular(18),
child: FlutterMap(
mapController: mapController,
options: MapOptions(
interactiveFlags: InteractiveFlag.none,
onMapReady: () {
Future.delayed(
const Duration(milliseconds: 500),
() {
mapController.fitBounds(
LatLngBounds.fromPoints(order.points
.map((e) => e.toLatLng())
.toList()),
options: const FitBoundsOptions(
padding: EdgeInsets.symmetric(
horizontal: 130,
vertical: 65)));
});
}),
children: [
if (mapProvider ==
MapProvider.openStreetMap ||
(mapProvider == MapProvider.googleMap &&
mapBoxAccessToken.isEmptyOrNull))
openStreetTileLayer,
if (mapProvider == MapProvider.mapBox ||
(mapProvider == MapProvider.googleMap &&
!mapBoxAccessToken.isEmptyOrNull))
mapBoxTileLayer,
MarkerLayer(
markers: order.points
.asMap()
.entries
.map((e) => Marker(
width: 240,
height: 63,
point: e.value.toLatLng(),
builder: (context) => MarkerNew(
address:
order.addresses[e.key])))
.toList())
],
),
),
),
),
Container(
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
color: CustomTheme.primaryColors.shade100),
child: Row(children: [
Text(
S.of(context).order_details_payment_method_title,
style: Theme.of(context).textTheme.titleMedium,
),
const Spacer(),
Icon(
order.paymentGatewayId == null
? Ionicons.cash
: Ionicons.globe,
color: CustomTheme.neutralColors,
),
const SizedBox(width: 8),
Text(
order.paymentGatewayId == null
? S.of(context).order_payment_method_cash
: S.of(context).order_payment_method_online,
style: Theme.of(context).textTheme.bodySmall,
)
]),
),
Container(
margin: const EdgeInsets.only(top: 16),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18),
color: CustomTheme.primaryColors.shade100),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
S
.of(context)
.order_details_trip_information_title,
style:
Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 8),
Row(
children: [
Icon(
Ionicons.navigate,
color: CustomTheme.neutralColors.shade500,
),
const SizedBox(width: 6),
Expanded(
child: Text(
order.addresses.first,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(
overflow:
TextOverflow.ellipsis),
),
),
const SizedBox(width: 6),
Text(
order.startTimestamp != null
? DateFormat('HH:mm a')
.format(order.startTimestamp!)
: "-",
style: Theme.of(context)
.textTheme
.labelSmall)
],
),
const Padding(
padding: EdgeInsets.only(
left: 12, top: 4, bottom: 4, right: 12),
child: DottedLine(
direction: Axis.vertical,
dashColor: CustomTheme.neutralColors,
lineLength: 20,
lineThickness: 2.0,
),
),
Row(
children: [
Icon(
Ionicons.location,
color: CustomTheme.neutralColors.shade500,
),
const SizedBox(width: 6),
Expanded(
child: Text(
order.addresses.last,
style: Theme.of(context)
.textTheme
.labelMedium
?.copyWith(
overflow:
TextOverflow.ellipsis),
),
),
const SizedBox(width: 6),
Text(
order.finishTimestamp != null
? DateFormat('HH:mm a')
.format(order.finishTimestamp!)
: "-",
style: Theme.of(context)
.textTheme
.labelSmall)
],
)
]),
)
],
);
}),
),
SizedBox(
width: double.infinity,
child: OutlinedButton(
onPressed: () async {
showBarModalBottomSheet(
context: context,
builder: (context) {
return SubmitComplaintView(orderId: orderId);
});
},
style: OutlinedButton.styleFrom(
backgroundColor: Colors.transparent,
side: const BorderSide(width: 1.5, color: Color(0xffed4346)),
),
child: Text(
S.of(context).button_report_issue,
style: Theme.of(context)
.textTheme
.titleMedium
?.copyWith(color: const Color(0xffb20d0e)),
),
),
)
],
));
}
}
extension PointMixinHeper on PointMixin {
LatLng toLatLng() {
return LatLng(lat, lng);
}
}
LatLng computeCentroid(List<LatLng> points) {
double latitude = 0;
double longitude = 0;
int n = points.length;
for (LatLng point in points) {
latitude += point.latitude;
longitude += point.longitude;
}
return LatLng(latitude / n, longitude / n);
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/trip-history/trip_history_list_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/components/empty_state_card_view.dart';
import 'package:client_shared/components/trip_history_item_view.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/trip-history/trip_history_details_view.dart';
import '../graphql/generated/graphql_api.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:modal_bottom_sheet/modal_bottom_sheet.dart';
import '../query_result_view.dart';
class TripHistoryListView extends StatefulWidget {
const TripHistoryListView({Key? key}) : super(key: key);
@override
State<TripHistoryListView> createState() => _TripHistoryListViewState();
}
class _TripHistoryListViewState extends State<TripHistoryListView> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
const SizedBox(height: 16),
Query(
options: QueryOptions(
document: HISTORY_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
if (result.hasException || result.isLoading) {
return QueryResultView(result);
}
final query = History$Query.fromJson(result.data!);
final orders = query.orders.edges;
if (orders.isEmpty) {
return EmptyStateCard(
title: S.of(context).empty_state_title_no_record,
description: S.of(context).trip_history_empty_state,
icon: Ionicons.cloud_offline,
);
}
return Expanded(
child: ListView.builder(
shrinkWrap: true,
itemCount: orders.length,
itemBuilder: (context, index) {
final item = orders[index].node;
return TripHistoryItemView(
id: item.id,
canceledText: S.of(context).order_status_canceled,
title: item.service.name,
dateTime: item.createdOn,
currency: item.currency,
price: item.costAfterCoupon - item.providerShare,
isCanceled:
item.status == OrderStatus.riderCanceled ||
item.status == OrderStatus.driverCanceled,
onPressed: (id) {
showBarModalBottomSheet(
context: context,
builder: (context) {
return TripHistoryDetailsView(
orderId: id,
);
});
});
}),
);
},
),
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/register/register_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:ridy/register/pages/register_contact_details_view.dart';
import 'package:ridy/register/pages/register_payout_details_view.dart';
import 'package:ridy/register/pages/register_phone_number_view.dart';
import 'package:ridy/register/pages/register_ride_details_view.dart';
import 'package:ridy/register/pages/register_upload_documents_view.dart';
import 'package:ridy/register/pages/register_verification_code_view.dart';
import '../query_result_view.dart';
class RegisterView extends StatefulWidget {
static const allowedStatuses = [
DriverStatus.waitingDocuments,
DriverStatus.pendingApproval,
DriverStatus.softReject
];
const RegisterView({Key? key}) : super(key: key);
@override
State<RegisterView> createState() => _RegisterViewState();
}
class _RegisterViewState extends State<RegisterView> {
int activePageId = 0;
PageController pageController = PageController(initialPage: 0);
String? verificationId;
String? phoneNumber;
bool isLoading = false;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Stack(
children: [
Column(
children: [
Stack(
children: [
const RidyBackButton(text: ""),
Center(child: Text(S.of(context).driver_register_title))
],
),
const SizedBox(height: 12),
Container(
constraints: const BoxConstraints(maxWidth: 800),
padding: const EdgeInsets.all(12),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 26),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
RegistrationStepOrb(
id: 0, activePageId: activePageId),
RegistrationStepDottedLine(
id: 0, activePageId: activePageId),
RegistrationStepOrb(
id: 1, activePageId: activePageId),
RegistrationStepDottedLine(
id: 1, activePageId: activePageId),
RegistrationStepOrb(
id: 2, activePageId: activePageId),
RegistrationStepDottedLine(
id: 2, activePageId: activePageId),
RegistrationStepOrb(
id: 3, activePageId: activePageId),
RegistrationStepDottedLine(
id: 3, activePageId: activePageId),
RegistrationStepOrb(
id: 4, activePageId: activePageId),
RegistrationStepDottedLine(
id: 4, activePageId: activePageId),
RegistrationStepOrb(
id: 5, activePageId: activePageId)
],
),
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
RegistrationStepTitle(
id: 0,
title: S.of(context).register_step_phone_number,
activePageId: activePageId),
RegistrationStepTitle(
id: 1,
title:
S.of(context).register_step_verify_number,
activePageId: activePageId),
RegistrationStepTitle(
id: 2,
title:
S.of(context).register_step_contact_details,
activePageId: activePageId),
RegistrationStepTitle(
id: 3,
title: S.of(context).register_step_ride_details,
activePageId: activePageId),
RegistrationStepTitle(
id: 4,
title:
S.of(context).register_step_payout_details,
activePageId: activePageId),
RegistrationStepTitle(
id: 5,
title: S
.of(context)
.register_step_upload_documents,
activePageId: activePageId),
],
)
],
),
),
const SizedBox(height: 8),
Query(
options: QueryOptions(
document: GET_DRIVER_QUERY_DOCUMENT,
fetchPolicy: FetchPolicy.networkOnly),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
GetDriver$Query$Driver? driver;
if (result.isLoading) {
return Expanded(child: QueryResultView(result));
}
List<GetDriver$Query$CarModel> models = [];
List<GetDriver$Query$CarColor> colors = [];
GetDriver$Query query = GetDriver$Query();
if (result.data != null) {
query = GetDriver$Query.fromJson(result.data!);
models = query.carModels;
colors = query.carColors;
if (query.driver?.mobileNumber != null) {
if (!RegisterView.allowedStatuses
.contains(query.driver?.status)) {
WidgetsBinding.instance.addPostFrameCallback((_) {
Navigator.pop(context);
});
return Container();
}
}
driver = query.driver;
models = query.carModels;
colors = query.carColors;
if (driver != null && activePageId < 2) {
WidgetsBinding.instance.addPostFrameCallback((_) {
pageController.jumpToPage(2);
setState(() {
activePageId = 2;
});
});
}
if (pageController.initialPage != activePageId) {
WidgetsBinding.instance.addPostFrameCallback((_) {
pageController.jumpToPage(activePageId);
});
}
}
return Expanded(
child: PageView.builder(
controller: pageController,
itemCount: 6,
physics: const NeverScrollableScrollPhysics(),
onPageChanged: (value) =>
setState(() => activePageId = value),
itemBuilder: ((context, index) {
switch (index) {
case 0:
return RegisterPhoneNumberView(
driver: driver,
onCodeSent:
(verificationId, phoneNumber) {
this.verificationId = verificationId;
this.phoneNumber = phoneNumber;
pageController.jumpToPage(1);
},
onLoggedIn: () {
pageController.jumpToPage(2);
refetch!();
},
onLoadingStateUpdated: (loading) =>
setState(() => isLoading = loading),
);
case 1:
return RegisterVerificationCodeView(
verificationCodeId: verificationId!,
phoneNumber: phoneNumber!,
onLoggedIn: () {
pageController.jumpToPage(2);
refetch!();
},
onLoadingStateUpdated: (loading) =>
setState(() => isLoading = loading),
);
case 2:
return RegisterContactDetailsView(
driver: driver!,
onContinue: () =>
pageController.jumpToPage(3),
onLoadingStateUpdated: (loading) =>
setState(() => isLoading = loading),
);
case 3:
return RegisterRideDetailsView(
driver: driver!,
models: models,
colors: colors,
onContinue: () =>
pageController.jumpToPage(4),
onLoadingStateUpdated: (loading) =>
setState(() => isLoading = loading),
);
case 4:
return RegisterPayoutDetailsView(
driver: driver!,
onContinue: () =>
pageController.jumpToPage(5),
onLoadingStateUpdated: (loading) =>
setState(() => isLoading = loading),
);
case 5:
return RegisterUploadDocumentsView(
driver: driver!,
onUploaded: () => refetch!(),
onLoadingStateUpdated: (loading) =>
setState(() => isLoading = loading),
);
default:
return const Text("Unsupported state");
}
})),
);
})
],
),
if (isLoading)
Positioned.fill(
child: Container(
color: Colors.white60,
child: const QueryResultLoadingView(),
))
],
)),
);
}
}
class RegistrationStepOrb extends StatelessWidget {
final int activePageId;
final int id;
const RegistrationStepOrb(
{Key? key, required this.activePageId, required this.id})
: super(key: key);
@override
Widget build(BuildContext context) {
return SizedBox(
width: 27,
child: Column(
children: [
Row(
children: [
AnimatedContainer(
width: 27,
height: 27,
duration: const Duration(milliseconds: 250),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50),
color: activePageId >= id
? CustomTheme.primaryColors
: CustomTheme.neutralColors.shade200),
child: Center(
child: Text("${id + 1}",
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: activePageId >= id
? CustomTheme.primaryColors.shade50
: CustomTheme.neutralColors.shade800)),
),
),
],
),
const SizedBox(height: 6)
],
),
);
}
}
class RegistrationStepTitle extends StatelessWidget {
final int activePageId;
final int id;
final String title;
const RegistrationStepTitle(
{Key? key,
required this.activePageId,
required this.id,
required this.title})
: super(key: key);
@override
Widget build(BuildContext context) {
return Visibility(
visible: activePageId == id,
child: Center(
child: Text(title, style: Theme.of(context).textTheme.labelSmall)));
}
}
class RegistrationStepDottedLine extends StatelessWidget {
final int activePageId;
final int id;
const RegistrationStepDottedLine(
{Key? key, required this.activePageId, required this.id})
: super(key: key);
@override
Widget build(BuildContext context) {
return Expanded(
child: Padding(
padding: const EdgeInsets.only(top: 13),
child: DottedLine(
dashColor: (id >= activePageId
? CustomTheme.neutralColors.shade200
: CustomTheme.primaryColors)),
));
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/register | mirrored_repositories/RideFlutter/driver-app/lib/register/pages/register_ride_details_view.dart | import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
class RegisterRideDetailsView extends StatelessWidget {
final Function() onContinue;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GetDriver$Query$Driver driver;
final List<GetDriver$Query$CarModel> models;
final List<GetDriver$Query$CarColor> colors;
final Function(bool loading) onLoadingStateUpdated;
RegisterRideDetailsView(
{Key? key,
required this.driver,
required this.models,
required this.colors,
required this.onContinue,
required this.onLoadingStateUpdated})
: super(key: key);
@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).register_ride_details_title,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 24),
Row(
children: [
Flexible(
child: TextFormField(
initialValue: driver.carPlate,
onChanged: (value) => driver.carPlate = value,
decoration: InputDecoration(
isDense: true,
labelText: S.of(context).plate_number),
),
),
const SizedBox(width: 8),
Flexible(
child: TextFormField(
keyboardType: TextInputType.number,
initialValue:
driver.carProductionYear?.toString() ?? "",
onChanged: (value) {
driver.carProductionYear = int.tryParse(value);
},
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isDense: true,
labelText: S.of(context).car_production_year),
),
)
],
),
const SizedBox(height: 8),
DropdownButtonFormField<String>(
value: driver.carId,
decoration: InputDecoration(
isDense: true, labelText: S.of(context).car_model),
items: models
.map((e) => DropdownMenuItem(
value: e.id, child: Text(e.name)))
.toList(),
onChanged: (String? id) => driver.carId = id,
),
const SizedBox(height: 8),
DropdownButtonFormField<String>(
value: driver.carId,
decoration: InputDecoration(
isDense: true, labelText: S.of(context).car_color),
items: colors
.map((e) => DropdownMenuItem(
value: e.id, child: Text(e.name)))
.toList(),
onChanged: (String? id) => driver.carColorId = id,
)
]),
),
),
Mutation(
options:
MutationOptions(document: UPDATE_PROFILE_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
bool? isValid = _formKey.currentState?.validate();
if (isValid != true) return;
onLoadingStateUpdated(true);
final result = await runMutation({
"input": {
"carProductionYear": driver.carProductionYear,
"carPlate": driver.carPlate,
"carColorId": driver.carColorId,
"carId": driver.carId
}
}).networkResult;
onLoadingStateUpdated(false);
if (result?.hasException ?? false) {
final snackBar = SnackBar(
content: Text(result?.exception?.graphqlErrors
.map((e) => e.message)
.join(',') ??
// ignore: use_build_context_synchronously
S.of(context).message_unknown_error));
// ignore: use_build_context_synchronously
ScaffoldMessenger.of(context).showSnackBar(snackBar);
} else {
onContinue();
}
},
child: Text(S.of(context).action_continue),
),
);
})
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/register | mirrored_repositories/RideFlutter/driver-app/lib/register/pages/register_upload_documents_view.dart | import 'dart:convert';
import 'package:client_shared/components/user_avatar_view.dart';
import 'package:client_shared/config.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:http/http.dart' as http;
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../../config.dart';
class RegisterUploadDocumentsView extends StatefulWidget {
final Function() onUploaded;
final GetDriver$Query$Driver driver;
final Function(bool loading) onLoadingStateUpdated;
const RegisterUploadDocumentsView(
{Key? key,
required this.driver,
required this.onUploaded,
required this.onLoadingStateUpdated})
: super(key: key);
@override
State<RegisterUploadDocumentsView> createState() =>
_RegisterUploadDocumentsViewState();
}
class _RegisterUploadDocumentsViewState
extends State<RegisterUploadDocumentsView> {
GetDriver$Query$Driver$Media? profilePicture;
List<GetDriver$Query$Driver$Media> documents = [];
@override
void initState() {
documents = widget.driver.documents;
profilePicture = widget.driver.media;
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(S.of(context).register_profile_photo_title,
style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: 8),
Text(
S.of(context).register_profile_photo_subtitle,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 8),
Stack(
children: [
Padding(
padding: const EdgeInsets.all(8),
child: UserAvatarView(
urlPrefix: serverUrl,
url: profilePicture?.address,
cornerRadius: 10,
size: 50,
),
),
Positioned(
right: 0,
bottom: 0,
child: Container(
decoration: BoxDecoration(
color: CustomTheme.primaryColors.shade300,
borderRadius: BorderRadius.circular(10)),
child: Icon(
Icons.add,
color: CustomTheme.neutralColors.shade500,
),
))
],
),
CupertinoButton(
minSize: 0,
padding:
const EdgeInsets.symmetric(vertical: 4, horizontal: 6),
child: Text(S.of(context).action_add_photo),
onPressed: () async {
FilePickerResult? result = await FilePicker.platform
.pickFiles(type: FileType.image);
if (result != null && result.files.single.path != null) {
final profilePic = await uploadFile(
result.files.single.path!, UploadMedia.profile);
setState(() {
profilePicture = profilePic;
});
}
}),
const SizedBox(height: 12),
Text(S.of(context).register_upload_documents_title,
style: Theme.of(context).textTheme.titleLarge),
const SizedBox(height: 8),
Text(
S.of(context).register_upload_documents_subtitle,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 16),
Row(children: [
ElevatedButton(
onPressed: () async {
FilePickerResult? result = await FilePicker.platform
.pickFiles(type: FileType.image);
if (result != null &&
result.files.single.path != null) {
final file = await uploadFile(
result.files.single.path!, UploadMedia.document);
setState(() {
documents = documents.followedBy([file]).toList();
});
}
},
child: SizedBox(
width: 75,
height: 75,
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Ionicons.cloud_upload),
const SizedBox(height: 4),
Text(
S.of(context).action_upload_document,
textAlign: TextAlign.center,
style: Theme.of(context)
.textTheme
.headlineSmall
?.copyWith(fontSize: 14),
),
],
),
),
)),
Expanded(
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: documents
.map(
(e) => Container(
padding: const EdgeInsets.only(left: 8),
child: ClipRRect(
borderRadius: BorderRadius.circular(8),
child: Image.network(
serverUrl + e.address,
width: 105,
height: 105,
fit: BoxFit.cover,
),
),
),
)
.toList(),
),
),
)
]),
],
),
),
),
Mutation(
options: MutationOptions(
document: SET_DOCUMENTS_ON_DRIVER_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
widget.onLoadingStateUpdated(true);
final inp = SetDocumentsOnDriverArguments(
driverId: widget.driver.id,
relationIds: documents.map((e) => e.id).toList());
await runMutation(inp.toJson()).networkResult;
widget.onLoadingStateUpdated(false);
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(demoMode
? S.of(context).title_important
: S.of(context).title_success),
content: Text(demoMode
? S
.of(context)
.driver_registration_approved_demo_mode
: S
.of(context)
.driver_register_profile_submitted_message),
actions: [
TextButton(
onPressed: () {
int count = 0;
Navigator.popUntil(context, (route) {
return count++ == 2;
});
},
child: Text(S.of(context).action_ok),
)
],
));
},
child: Text(S.of(context).action_confirm_and_continue),
),
);
})
],
);
}
Future<GetDriver$Query$Driver$Media> uploadFile(
String path, UploadMedia media) async {
var postUri = Uri.parse(
"$serverUrl${media == UploadMedia.profile ? "upload_profile" : "upload_document"}");
var request = http.MultipartRequest("POST", postUri);
request.headers['Authorization'] =
'Bearer ${Hive.box('user').get('jwt').toString()}';
request.files.add(await http.MultipartFile.fromPath('file', path));
final streamedResponse = await request.send();
widget.onUploaded();
var response = await http.Response.fromStream(streamedResponse);
var json = jsonDecode(response.body);
return GetDriver$Query$Driver$Media.fromJson(json);
}
}
enum UploadMedia { profile, document }
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/register | mirrored_repositories/RideFlutter/driver-app/lib/register/pages/register_phone_number_view.dart | import 'package:client_shared/config.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:country_code_picker/country_code_picker.dart';
import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/graphql/generated/graphql_api.graphql.dart';
import 'package:url_launcher/url_launcher.dart';
class RegisterPhoneNumberView extends StatefulWidget {
final GetDriver$Query$Driver? driver;
final Function(String verificationId, String phoneNumber) onCodeSent;
final Function() onLoggedIn;
final Function(bool loading) onLoadingStateUpdated;
const RegisterPhoneNumberView(
{Key? key,
this.driver,
required this.onCodeSent,
required this.onLoggedIn,
required this.onLoadingStateUpdated})
: super(key: key);
@override
State<RegisterPhoneNumberView> createState() =>
_RegisterPhoneNumberViewState();
}
class _RegisterPhoneNumberViewState extends State<RegisterPhoneNumberView> {
bool agreedToTerms = false;
String countryCode = defaultCountryCode;
String phoneNumber = "";
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).register_number_title,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 8),
Text(
S.of(context).register_number_subtitle,
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 24),
Row(children: [
Container(
decoration: BoxDecoration(
color: CustomTheme.neutralColors.shade200,
borderRadius: BorderRadius.circular(10)),
child: CountryCodePicker(
boxDecoration: BoxDecoration(
color: CustomTheme.neutralColors.shade100,
borderRadius: BorderRadius.circular(10)),
initialSelection: countryCode,
onChanged: (value) => countryCode = value.dialCode ?? countryCode,
),
),
const SizedBox(width: 5),
Flexible(
child: TextFormField(
initialValue: phoneNumber,
onChanged: (value) => phoneNumber = value,
keyboardType: TextInputType.phone,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.digitsOnly
],
decoration: InputDecoration(
isDense: true,
labelText: S.of(context).cell_number,
),
validator: (String? value) {
if (value == null || value.isEmpty) {
return S.of(context).phone_number_empty;
} else {
return null;
}
},
),
),
]),
if (loginTermsAndConditionsUrl.isNotEmpty)
RegistrationPhoneNumberTermsCheckbox(
agreedToTerms: agreedToTerms,
onAgreedChanged: (value) => setState(() => agreedToTerms = value),
),
const Spacer(),
SizedBox(
width: double.infinity,
child: Mutation(
options: MutationOptions(document: LOGIN_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) =>
ElevatedButton(
onPressed: () async {
if (loginTermsAndConditionsUrl.isNotEmpty &&
!agreedToTerms) {
return;
}
if (phoneNumber.isEmpty) {
return;
}
widget.onLoadingStateUpdated(true);
if (kIsWeb) {
final authResult = await FirebaseAuth.instance
.signInWithPhoneNumber(phoneNumber);
widget.onCodeSent(authResult.verificationId,
countryCode + phoneNumber);
} else {
FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: countryCode + phoneNumber,
verificationCompleted: (PhoneAuthCredential
phoneAuthCredential) async {
final UserCredential cr = await FirebaseAuth
.instance
.signInWithCredential(phoneAuthCredential);
final String firebaseToken =
await cr.user!.getIdToken();
final args =
LoginArguments(firebaseToken: firebaseToken)
.toJson();
final netResult =
await runMutation(args).networkResult;
final loginRes =
Login$Mutation.fromJson(netResult!.data!);
final jwt = loginRes.login.jwtToken;
Hive.box('user').put('jwt', jwt);
widget.onLoadingStateUpdated(false);
widget.onLoggedIn();
},
verificationFailed:
(FirebaseAuthException error) {
widget.onLoadingStateUpdated(false);
final snackBar = SnackBar(
content: Text(error.message ??
S.of(context).message_unknown_error));
ScaffoldMessenger.of(context)
.showSnackBar(snackBar);
},
codeSent: (String verificationId,
int? forceResendingToken) {
widget.onLoadingStateUpdated(false);
widget.onCodeSent(
verificationId, countryCode + phoneNumber);
},
codeAutoRetrievalTimeout:
(String verificationId) {});
}
},
child: Text(S.of(context).action_continue)),
))
],
);
}
}
class RegistrationPhoneNumberTermsCheckbox extends StatelessWidget {
final bool agreedToTerms;
final Function(bool value) onAgreedChanged;
const RegistrationPhoneNumberTermsCheckbox(
{Key? key, required this.agreedToTerms, required this.onAgreedChanged})
: super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
Checkbox(
value: agreedToTerms,
onChanged: (value) => onAgreedChanged(value ?? false)),
Flexible(
child: RichText(
text: TextSpan(children: [
TextSpan(
style: const TextStyle(color: Colors.black),
text: S.of(context).terms_and_condition_first_part),
TextSpan(
style: const TextStyle(color: Colors.blue),
text: S.of(context).terms_and_conditions_clickable_part,
recognizer: TapGestureRecognizer()
..onTap = () {
launchUrl(Uri.parse(loginTermsAndConditionsUrl));
})
])),
),
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/register | mirrored_repositories/RideFlutter/driver-app/lib/register/pages/register_payout_details_view.dart | import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../../graphql/generated/graphql_api.dart';
class RegisterPayoutDetailsView extends StatelessWidget {
final Function() onContinue;
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GetDriver$Query$Driver driver;
final Function(bool loading) onLoadingStateUpdated;
RegisterPayoutDetailsView(
{Key? key,
required this.driver,
required this.onContinue,
required this.onLoadingStateUpdated})
: super(key: key);
@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).register_payout_details_title,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 24),
TextFormField(
initialValue: driver.bankName,
decoration: InputDecoration(
isDense: true, labelText: S.of(context).bank_name),
onChanged: (value) => driver.bankName = value,
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.accountNumber,
decoration: InputDecoration(
isDense: true,
labelText: S.of(context).account_number),
onChanged: (value) => driver.accountNumber = value,
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.accountNumber,
decoration: InputDecoration(
isDense: true, labelText: S.of(context).bank_swift),
onChanged: (value) => driver.bankSwift = value,
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.bankRoutingNumber,
decoration: InputDecoration(
isDense: true,
labelText: S.of(context).bankRoutingNumber),
onChanged: (value) => driver.bankRoutingNumber = value,
),
]),
),
),
Mutation(
options: MutationOptions(
document: UPDATE_PROFILE_MUTATION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (RunMutation runMutation, QueryResult? result) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
bool? isValid = _formKey.currentState?.validate();
if (isValid != true) return;
onLoadingStateUpdated(true);
await runMutation({
"input": {
"bankName": driver.bankName,
"bankSwift": driver.bankSwift,
"bankRoutingNumber": driver.bankRoutingNumber,
"accountNumber": driver.accountNumber
}
}).networkResult;
onLoadingStateUpdated(false);
onContinue();
},
child: Text(S.of(context).action_continue),
),
);
})
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/register | mirrored_repositories/RideFlutter/driver-app/lib/register/pages/register_contact_details_view.dart | import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import '../../graphql/generated/graphql_api.graphql.dart';
class RegisterContactDetailsView extends StatelessWidget {
final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
final GetDriver$Query$Driver driver;
final Function() onContinue;
final Function(bool loading) onLoadingStateUpdated;
RegisterContactDetailsView(
{Key? key,
required this.driver,
required this.onContinue,
required this.onLoadingStateUpdated})
: super(key: key);
@override
Widget build(BuildContext context) {
return Form(
key: _formKey,
child: Column(
children: [
Expanded(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).register_contact_details_title,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 24),
Container(
constraints: const BoxConstraints(maxWidth: 200),
child: DropdownButtonFormField<Gender>(
value: driver.gender,
decoration: InputDecoration(
isDense: true, labelText: S.of(context).gender),
items: <DropdownMenuItem<Gender>>[
DropdownMenuItem(
value: Gender.male,
child: Text(S.of(context).gender_male),
),
DropdownMenuItem(
value: Gender.female,
child: Text(S.of(context).gender_female))
],
onChanged: (Gender? value) {
driver.gender = value;
},
),
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.firstName,
onChanged: (value) => driver.firstName = value,
validator: (value) {
if (value.isEmptyOrNull) {
return S.of(context).form_required_field_error;
} else {
return null;
}
},
decoration: InputDecoration(
isDense: true, labelText: S.of(context).firstname),
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.lastName,
onChanged: (value) => driver.lastName = value,
validator: (value) {
if (value.isEmptyOrNull) {
return S.of(context).form_required_field_error;
} else {
return null;
}
},
decoration: InputDecoration(
isDense: true, labelText: S.of(context).lastname),
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.certificateNumber,
onChanged: (value) => driver.certificateNumber = value,
decoration: InputDecoration(
isDense: true,
labelText: S.of(context).certificate_number),
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.email,
onChanged: (value) => driver.email = value,
decoration: InputDecoration(
isDense: true, labelText: S.of(context).email),
),
const SizedBox(height: 8),
TextFormField(
initialValue: driver.address,
onChanged: (value) {
driver.address = value;
},
decoration: InputDecoration(
isDense: true, labelText: S.of(context).address),
),
]),
),
),
Mutation(
options: MutationOptions(
document: UPDATE_PROFILE_MUTATION_DOCUMENT,
fetchPolicy: FetchPolicy.noCache),
builder: (RunMutation runMutation, QueryResult? result) {
return SizedBox(
width: double.infinity,
child: ElevatedButton(
onPressed: () async {
bool? isValid = _formKey.currentState?.validate();
if (isValid != true) return;
final input =
UpdateDriverInput(gender: driver.gender).toJson();
onLoadingStateUpdated(true);
await runMutation({
"input": {
"firstName": driver.firstName,
"lastName": driver.lastName,
"email": driver.email,
"certificateNumber": driver.certificateNumber,
"gender": input["gender"],
"address": driver.address
}
}).networkResult;
onLoadingStateUpdated(false);
onContinue();
},
child: Text(S.of(context).action_continue),
),
);
})
],
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/register | mirrored_repositories/RideFlutter/driver-app/lib/register/pages/register_verification_code_view.dart | import 'package:firebase_auth/firebase_auth.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:hive/hive.dart';
import 'package:pinput/pinput.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class RegisterVerificationCodeView extends StatefulWidget {
final String verificationCodeId;
final String phoneNumber;
final Function() onLoggedIn;
final Function(bool loading) onLoadingStateUpdated;
const RegisterVerificationCodeView(
{Key? key,
required this.verificationCodeId,
required this.phoneNumber,
required this.onLoggedIn,
required this.onLoadingStateUpdated})
: super(key: key);
@override
State<RegisterVerificationCodeView> createState() =>
_RegisterVerificationCodeViewState();
}
class _RegisterVerificationCodeViewState
extends State<RegisterVerificationCodeView> {
final FocusNode focusNode = FocusNode();
@override
void initState() {
focusNode.requestFocus();
super.initState();
}
@override
Widget build(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
S.of(context).register_verify_code_title,
style: Theme.of(context).textTheme.titleLarge,
),
const SizedBox(height: 8),
Text(
S.of(context).register_verify_code_subtitle(widget.phoneNumber),
style: Theme.of(context).textTheme.labelMedium,
),
const SizedBox(height: 24),
Mutation(
options: MutationOptions(document: LOGIN_MUTATION_DOCUMENT),
builder: (RunMutation runMutation, QueryResult? result) {
return Pinput(
focusNode: focusNode,
length: 6,
onCompleted: (value) async {
widget.onLoadingStateUpdated(true);
final PhoneAuthCredential credential =
PhoneAuthProvider.credential(
verificationId: widget.verificationCodeId,
smsCode: value);
final UserCredential cr = await FirebaseAuth.instance
.signInWithCredential(credential);
final String firebaseToken = await cr.user!.getIdToken();
final args =
LoginArguments(firebaseToken: firebaseToken).toJson();
final netResult = await runMutation(args).networkResult;
final loginRes = Login$Mutation.fromJson(netResult!.data!);
final jwt = loginRes.login.jwtToken;
Hive.box('user').put('jwt', jwt);
widget.onLoadingStateUpdated(false);
widget.onLoggedIn();
},
);
}),
const Spacer(),
],
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/graphql | mirrored_repositories/RideFlutter/driver-app/lib/graphql/scalars/datetime.dart | DateTime fromGraphQLDateTimeToDartDateTime(int data) =>
DateTime.fromMillisecondsSinceEpoch(data);
int fromDartDateTimeToGraphQLDateTime(DateTime data) =>
data.millisecondsSinceEpoch;
int? fromDartDateTimeNullableToGraphQLDateTimeNullable(DateTime? datetime) =>
datetime?.millisecondsSinceEpoch;
DateTime? fromGraphQLDateTimeNullableToDartDateTimeNullable(
int? milSinceEpoch) =>
milSinceEpoch != null
? DateTime.fromMillisecondsSinceEpoch(milSinceEpoch)
: null;
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/graphql | mirrored_repositories/RideFlutter/driver-app/lib/graphql/scalars/timestamp.dart | DateTime fromGraphQLTimestampToDartDateTime(int data) =>
DateTime.fromMillisecondsSinceEpoch(data);
int fromDartDateTimeToGraphQLTimestamp(DateTime data) =>
data.millisecondsSinceEpoch;
int? fromDartDateTimeNullableToGraphQLTimestampNullable(DateTime? datetime) =>
datetime?.millisecondsSinceEpoch;
DateTime? fromGraphQLTimestampNullableToDartDateTimeNullable(
int? milSinceEpoch) =>
milSinceEpoch != null
? DateTime.fromMillisecondsSinceEpoch(milSinceEpoch)
: null;
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/graphql | mirrored_repositories/RideFlutter/driver-app/lib/graphql/scalars/connection_cursor.dart | String fromGraphQLConnectionCursorToDartString(String data) => data;
String fromDartStringToGraphQLConnectionCursor(String data) => data;
String? fromGraphQLConnectionCursorToDartStringNullable(String? data) => data;
String? fromDartStringToGraphQLConnectionCursorNullable(String? data) => data;
String? fromGraphQLConnectionCursorNullableToDartStringNullable(String? data) =>
data;
String? fromDartStringNullableToGraphQLConnectionCursorNullable(String? data) =>
data;
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/graphql | mirrored_repositories/RideFlutter/driver-app/lib/graphql/generated/graphql_api.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
export 'graphql_api.graphql.dart';
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/graphql | mirrored_repositories/RideFlutter/driver-app/lib/graphql/generated/graphql_api.graphql.g.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
// @dart=2.12
part of 'graphql_api.graphql.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
GetMessages$Query$Driver$Order$Rider
_$GetMessages$Query$Driver$Order$RiderFromJson(Map<String, dynamic> json) =>
GetMessages$Query$Driver$Order$Rider()
..id = json['id'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..media = json['media'] == null
? null
: ChatRiderMixin$Media.fromJson(
json['media'] as Map<String, dynamic>)
..mobileNumber = json['mobileNumber'] as String;
Map<String, dynamic> _$GetMessages$Query$Driver$Order$RiderToJson(
GetMessages$Query$Driver$Order$Rider instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('media', instance.media?.toJson());
val['mobileNumber'] = instance.mobileNumber;
return val;
}
GetMessages$Query$Driver$Order$Driver
_$GetMessages$Query$Driver$Order$DriverFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Driver$Order$Driver()
..id = json['id'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..media = json['media'] == null
? null
: ChatDriverMixin$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$GetMessages$Query$Driver$Order$DriverToJson(
GetMessages$Query$Driver$Order$Driver instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('media', instance.media?.toJson());
return val;
}
GetMessages$Query$Driver$Order$OrderMessage
_$GetMessages$Query$Driver$Order$OrderMessageFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Driver$Order$OrderMessage()
..id = json['id'] as String
..content = json['content'] as String
..sentByDriver = json['sentByDriver'] as bool;
Map<String, dynamic> _$GetMessages$Query$Driver$Order$OrderMessageToJson(
GetMessages$Query$Driver$Order$OrderMessage instance) =>
<String, dynamic>{
'id': instance.id,
'content': instance.content,
'sentByDriver': instance.sentByDriver,
};
GetMessages$Query$Driver$Order _$GetMessages$Query$Driver$OrderFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Driver$Order()
..id = json['id'] as String
..rider = GetMessages$Query$Driver$Order$Rider.fromJson(
json['rider'] as Map<String, dynamic>)
..driver = GetMessages$Query$Driver$Order$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..conversations = (json['conversations'] as List<dynamic>)
.map((e) => GetMessages$Query$Driver$Order$OrderMessage.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetMessages$Query$Driver$OrderToJson(
GetMessages$Query$Driver$Order instance) =>
<String, dynamic>{
'id': instance.id,
'rider': instance.rider.toJson(),
'driver': instance.driver.toJson(),
'conversations': instance.conversations.map((e) => e.toJson()).toList(),
};
GetMessages$Query$Driver _$GetMessages$Query$DriverFromJson(
Map<String, dynamic> json) =>
GetMessages$Query$Driver()
..currentOrders = (json['currentOrders'] as List<dynamic>)
.map((e) => GetMessages$Query$Driver$Order.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetMessages$Query$DriverToJson(
GetMessages$Query$Driver instance) =>
<String, dynamic>{
'currentOrders': instance.currentOrders.map((e) => e.toJson()).toList(),
};
GetMessages$Query _$GetMessages$QueryFromJson(Map<String, dynamic> json) =>
GetMessages$Query()
..driver = json['driver'] == null
? null
: GetMessages$Query$Driver.fromJson(
json['driver'] as Map<String, dynamic>);
Map<String, dynamic> _$GetMessages$QueryToJson(GetMessages$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
return val;
}
ChatRiderMixin$Media _$ChatRiderMixin$MediaFromJson(
Map<String, dynamic> json) =>
ChatRiderMixin$Media()..address = json['address'] as String;
Map<String, dynamic> _$ChatRiderMixin$MediaToJson(
ChatRiderMixin$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
ChatDriverMixin$Media _$ChatDriverMixin$MediaFromJson(
Map<String, dynamic> json) =>
ChatDriverMixin$Media()..address = json['address'] as String;
Map<String, dynamic> _$ChatDriverMixin$MediaToJson(
ChatDriverMixin$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
SendMessage$Mutation$OrderMessage _$SendMessage$Mutation$OrderMessageFromJson(
Map<String, dynamic> json) =>
SendMessage$Mutation$OrderMessage()
..id = json['id'] as String
..content = json['content'] as String
..sentByDriver = json['sentByDriver'] as bool;
Map<String, dynamic> _$SendMessage$Mutation$OrderMessageToJson(
SendMessage$Mutation$OrderMessage instance) =>
<String, dynamic>{
'id': instance.id,
'content': instance.content,
'sentByDriver': instance.sentByDriver,
};
SendMessage$Mutation _$SendMessage$MutationFromJson(
Map<String, dynamic> json) =>
SendMessage$Mutation()
..createOneOrderMessage = SendMessage$Mutation$OrderMessage.fromJson(
json['createOneOrderMessage'] as Map<String, dynamic>);
Map<String, dynamic> _$SendMessage$MutationToJson(
SendMessage$Mutation instance) =>
<String, dynamic>{
'createOneOrderMessage': instance.createOneOrderMessage.toJson(),
};
NewMessageReceived$Subscription$OrderMessage
_$NewMessageReceived$Subscription$OrderMessageFromJson(
Map<String, dynamic> json) =>
NewMessageReceived$Subscription$OrderMessage()
..id = json['id'] as String
..content = json['content'] as String
..sentByDriver = json['sentByDriver'] as bool;
Map<String, dynamic> _$NewMessageReceived$Subscription$OrderMessageToJson(
NewMessageReceived$Subscription$OrderMessage instance) =>
<String, dynamic>{
'id': instance.id,
'content': instance.content,
'sentByDriver': instance.sentByDriver,
};
NewMessageReceived$Subscription _$NewMessageReceived$SubscriptionFromJson(
Map<String, dynamic> json) =>
NewMessageReceived$Subscription()
..newMessageReceived =
NewMessageReceived$Subscription$OrderMessage.fromJson(
json['newMessageReceived'] as Map<String, dynamic>);
Map<String, dynamic> _$NewMessageReceived$SubscriptionToJson(
NewMessageReceived$Subscription instance) =>
<String, dynamic>{
'newMessageReceived': instance.newMessageReceived.toJson(),
};
History$Query$OrderConnection _$History$Query$OrderConnectionFromJson(
Map<String, dynamic> json) =>
History$Query$OrderConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) => HistoryOrderItemMixin$OrderEdge.fromJson(
e as Map<String, dynamic>))
.toList()
..pageInfo = HistoryOrderItemMixin$PageInfo.fromJson(
json['pageInfo'] as Map<String, dynamic>);
Map<String, dynamic> _$History$Query$OrderConnectionToJson(
History$Query$OrderConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
'pageInfo': instance.pageInfo.toJson(),
};
History$Query _$History$QueryFromJson(Map<String, dynamic> json) =>
History$Query()
..orders = History$Query$OrderConnection.fromJson(
json['orders'] as Map<String, dynamic>);
Map<String, dynamic> _$History$QueryToJson(History$Query instance) =>
<String, dynamic>{
'orders': instance.orders.toJson(),
};
HistoryOrderItemMixin$OrderEdge$Order$Service
_$HistoryOrderItemMixin$OrderEdge$Order$ServiceFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge$Order$Service()
..name = json['name'] as String;
Map<String, dynamic> _$HistoryOrderItemMixin$OrderEdge$Order$ServiceToJson(
HistoryOrderItemMixin$OrderEdge$Order$Service instance) =>
<String, dynamic>{
'name': instance.name,
};
HistoryOrderItemMixin$OrderEdge$Order
_$HistoryOrderItemMixin$OrderEdge$OrderFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..createdOn =
fromGraphQLTimestampToDartDateTime(json['createdOn'] as int)
..currency = json['currency'] as String
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..providerShare = (json['providerShare'] as num).toDouble()
..service = HistoryOrderItemMixin$OrderEdge$Order$Service.fromJson(
json['service'] as Map<String, dynamic>);
Map<String, dynamic> _$HistoryOrderItemMixin$OrderEdge$OrderToJson(
HistoryOrderItemMixin$OrderEdge$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'createdOn', fromDartDateTimeToGraphQLTimestamp(instance.createdOn));
val['currency'] = instance.currency;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['providerShare'] = instance.providerShare;
val['service'] = instance.service.toJson();
return val;
}
const _$OrderStatusEnumMap = {
OrderStatus.requested: 'Requested',
OrderStatus.notFound: 'NotFound',
OrderStatus.noCloseFound: 'NoCloseFound',
OrderStatus.found: 'Found',
OrderStatus.driverAccepted: 'DriverAccepted',
OrderStatus.arrived: 'Arrived',
OrderStatus.waitingForPrePay: 'WaitingForPrePay',
OrderStatus.driverCanceled: 'DriverCanceled',
OrderStatus.riderCanceled: 'RiderCanceled',
OrderStatus.started: 'Started',
OrderStatus.waitingForPostPay: 'WaitingForPostPay',
OrderStatus.waitingForReview: 'WaitingForReview',
OrderStatus.finished: 'Finished',
OrderStatus.booked: 'Booked',
OrderStatus.expired: 'Expired',
OrderStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
HistoryOrderItemMixin$OrderEdge _$HistoryOrderItemMixin$OrderEdgeFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$OrderEdge()
..node = HistoryOrderItemMixin$OrderEdge$Order.fromJson(
json['node'] as Map<String, dynamic>);
Map<String, dynamic> _$HistoryOrderItemMixin$OrderEdgeToJson(
HistoryOrderItemMixin$OrderEdge instance) =>
<String, dynamic>{
'node': instance.node.toJson(),
};
HistoryOrderItemMixin$PageInfo _$HistoryOrderItemMixin$PageInfoFromJson(
Map<String, dynamic> json) =>
HistoryOrderItemMixin$PageInfo()
..hasNextPage = json['hasNextPage'] as bool?
..endCursor = fromGraphQLConnectionCursorNullableToDartStringNullable(
json['endCursor'] as String?)
..startCursor = fromGraphQLConnectionCursorNullableToDartStringNullable(
json['startCursor'] as String?)
..hasPreviousPage = json['hasPreviousPage'] as bool?;
Map<String, dynamic> _$HistoryOrderItemMixin$PageInfoToJson(
HistoryOrderItemMixin$PageInfo instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('hasNextPage', instance.hasNextPage);
writeNotNull(
'endCursor',
fromDartStringNullableToGraphQLConnectionCursorNullable(
instance.endCursor));
writeNotNull(
'startCursor',
fromDartStringNullableToGraphQLConnectionCursorNullable(
instance.startCursor));
writeNotNull('hasPreviousPage', instance.hasPreviousPage);
return val;
}
GetOrderDetails$Query$Order$Point _$GetOrderDetails$Query$Order$PointFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$GetOrderDetails$Query$Order$PointToJson(
GetOrderDetails$Query$Order$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
GetOrderDetails$Query$Order _$GetOrderDetails$Query$OrderFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query$Order()
..points = (json['points'] as List<dynamic>)
.map((e) => GetOrderDetails$Query$Order$Point.fromJson(
e as Map<String, dynamic>))
.toList()
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..costBest = (json['costBest'] as num).toDouble()
..currency = json['currency'] as String
..startTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['startTimestamp'] as int?)
..finishTimestamp = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['finishTimestamp'] as int?)
..distanceBest = json['distanceBest'] as int
..durationBest = json['durationBest'] as int
..paymentGatewayId = (json['paymentGatewayId'] as num?)?.toDouble()
..expectedTimestamp =
fromGraphQLTimestampToDartDateTime(json['expectedTimestamp'] as int);
Map<String, dynamic> _$GetOrderDetails$Query$OrderToJson(
GetOrderDetails$Query$Order instance) {
final val = <String, dynamic>{
'points': instance.points.map((e) => e.toJson()).toList(),
'addresses': instance.addresses,
'costBest': instance.costBest,
'currency': instance.currency,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'startTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.startTimestamp));
writeNotNull(
'finishTimestamp',
fromDartDateTimeNullableToGraphQLTimestampNullable(
instance.finishTimestamp));
val['distanceBest'] = instance.distanceBest;
val['durationBest'] = instance.durationBest;
writeNotNull('paymentGatewayId', instance.paymentGatewayId);
writeNotNull('expectedTimestamp',
fromDartDateTimeToGraphQLTimestamp(instance.expectedTimestamp));
return val;
}
GetOrderDetails$Query _$GetOrderDetails$QueryFromJson(
Map<String, dynamic> json) =>
GetOrderDetails$Query()
..order = json['order'] == null
? null
: GetOrderDetails$Query$Order.fromJson(
json['order'] as Map<String, dynamic>);
Map<String, dynamic> _$GetOrderDetails$QueryToJson(
GetOrderDetails$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('order', instance.order?.toJson());
return val;
}
SubmitComplaint$Mutation$Complaint _$SubmitComplaint$Mutation$ComplaintFromJson(
Map<String, dynamic> json) =>
SubmitComplaint$Mutation$Complaint()..id = json['id'] as String;
Map<String, dynamic> _$SubmitComplaint$Mutation$ComplaintToJson(
SubmitComplaint$Mutation$Complaint instance) =>
<String, dynamic>{
'id': instance.id,
};
SubmitComplaint$Mutation _$SubmitComplaint$MutationFromJson(
Map<String, dynamic> json) =>
SubmitComplaint$Mutation()
..createOneComplaint = SubmitComplaint$Mutation$Complaint.fromJson(
json['createOneComplaint'] as Map<String, dynamic>);
Map<String, dynamic> _$SubmitComplaint$MutationToJson(
SubmitComplaint$Mutation instance) =>
<String, dynamic>{
'createOneComplaint': instance.createOneComplaint.toJson(),
};
Announcements$Query$Announcement _$Announcements$Query$AnnouncementFromJson(
Map<String, dynamic> json) =>
Announcements$Query$Announcement()
..title = json['title'] as String
..description = json['description'] as String
..startAt = fromGraphQLTimestampToDartDateTime(json['startAt'] as int)
..url = json['url'] as String?;
Map<String, dynamic> _$Announcements$Query$AnnouncementToJson(
Announcements$Query$Announcement instance) {
final val = <String, dynamic>{
'title': instance.title,
'description': instance.description,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('startAt', fromDartDateTimeToGraphQLTimestamp(instance.startAt));
writeNotNull('url', instance.url);
return val;
}
Announcements$Query _$Announcements$QueryFromJson(Map<String, dynamic> json) =>
Announcements$Query()
..announcements = (json['announcements'] as List<dynamic>)
.map((e) => Announcements$Query$Announcement.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$Announcements$QueryToJson(
Announcements$Query instance) =>
<String, dynamic>{
'announcements': instance.announcements.map((e) => e.toJson()).toList(),
};
UpdateProfile$Mutation$Driver _$UpdateProfile$Mutation$DriverFromJson(
Map<String, dynamic> json) =>
UpdateProfile$Mutation$Driver()..id = json['id'] as String;
Map<String, dynamic> _$UpdateProfile$Mutation$DriverToJson(
UpdateProfile$Mutation$Driver instance) =>
<String, dynamic>{
'id': instance.id,
};
UpdateProfile$Mutation _$UpdateProfile$MutationFromJson(
Map<String, dynamic> json) =>
UpdateProfile$Mutation()
..updateOneDriver = UpdateProfile$Mutation$Driver.fromJson(
json['updateOneDriver'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateProfile$MutationToJson(
UpdateProfile$Mutation instance) =>
<String, dynamic>{
'updateOneDriver': instance.updateOneDriver.toJson(),
};
UpdateDriverInput _$UpdateDriverInputFromJson(Map<String, dynamic> json) =>
UpdateDriverInput(
carProductionYear: json['carProductionYear'] as int?,
carModelId: json['carModelId'] as String?,
carId: json['carId'] as String?,
carColorId: json['carColorId'] as String?,
searchDistance: json['searchDistance'] as int?,
firstName: json['firstName'] as String?,
lastName: json['lastName'] as String?,
status: $enumDecodeNullable(_$DriverStatusEnumMap, json['status'],
unknownValue: DriverStatus.artemisUnknown),
certificateNumber: json['certificateNumber'] as String?,
email: json['email'] as String?,
carPlate: json['carPlate'] as String?,
mediaId: (json['mediaId'] as num?)?.toDouble(),
gender: $enumDecodeNullable(_$GenderEnumMap, json['gender'],
unknownValue: Gender.artemisUnknown),
accountNumber: json['accountNumber'] as String?,
bankName: json['bankName'] as String?,
bankRoutingNumber: json['bankRoutingNumber'] as String?,
bankSwift: json['bankSwift'] as String?,
address: json['address'] as String?,
notificationPlayerId: json['notificationPlayerId'] as String?,
);
Map<String, dynamic> _$UpdateDriverInputToJson(UpdateDriverInput instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('carProductionYear', instance.carProductionYear);
writeNotNull('carModelId', instance.carModelId);
writeNotNull('carId', instance.carId);
writeNotNull('carColorId', instance.carColorId);
writeNotNull('searchDistance', instance.searchDistance);
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('status', _$DriverStatusEnumMap[instance.status]);
writeNotNull('certificateNumber', instance.certificateNumber);
writeNotNull('email', instance.email);
writeNotNull('carPlate', instance.carPlate);
writeNotNull('mediaId', instance.mediaId);
writeNotNull('gender', _$GenderEnumMap[instance.gender]);
writeNotNull('accountNumber', instance.accountNumber);
writeNotNull('bankName', instance.bankName);
writeNotNull('bankRoutingNumber', instance.bankRoutingNumber);
writeNotNull('bankSwift', instance.bankSwift);
writeNotNull('address', instance.address);
writeNotNull('notificationPlayerId', instance.notificationPlayerId);
return val;
}
const _$DriverStatusEnumMap = {
DriverStatus.online: 'Online',
DriverStatus.offline: 'Offline',
DriverStatus.blocked: 'Blocked',
DriverStatus.inService: 'InService',
DriverStatus.waitingDocuments: 'WaitingDocuments',
DriverStatus.pendingApproval: 'PendingApproval',
DriverStatus.softReject: 'SoftReject',
DriverStatus.hardReject: 'HardReject',
DriverStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
const _$GenderEnumMap = {
Gender.male: 'Male',
Gender.female: 'Female',
Gender.unknown: 'Unknown',
Gender.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
GetDriver$Query$Driver$Media _$GetDriver$Query$Driver$MediaFromJson(
Map<String, dynamic> json) =>
GetDriver$Query$Driver$Media()
..id = json['id'] as String
..address = json['address'] as String;
Map<String, dynamic> _$GetDriver$Query$Driver$MediaToJson(
GetDriver$Query$Driver$Media instance) =>
<String, dynamic>{
'id': instance.id,
'address': instance.address,
};
GetDriver$Query$Driver _$GetDriver$Query$DriverFromJson(
Map<String, dynamic> json) =>
GetDriver$Query$Driver()
..id = json['id'] as String
..status = $enumDecode(_$DriverStatusEnumMap, json['status'],
unknownValue: DriverStatus.artemisUnknown)
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..gender = $enumDecodeNullable(_$GenderEnumMap, json['gender'],
unknownValue: Gender.artemisUnknown)
..email = json['email'] as String?
..mobileNumber = json['mobileNumber'] as String
..accountNumber = json['accountNumber'] as String?
..bankName = json['bankName'] as String?
..bankRoutingNumber = json['bankRoutingNumber'] as String?
..address = json['address'] as String?
..documents = (json['documents'] as List<dynamic>)
.map((e) =>
GetDriver$Query$Driver$Media.fromJson(e as Map<String, dynamic>))
.toList()
..bankSwift = json['bankSwift'] as String?
..media = json['media'] == null
? null
: GetDriver$Query$Driver$Media.fromJson(
json['media'] as Map<String, dynamic>)
..carPlate = json['carPlate'] as String?
..carProductionYear = json['carProductionYear'] as int?
..certificateNumber = json['certificateNumber'] as String?
..carColorId = json['carColorId'] as String?
..carId = json['carId'] as String?;
Map<String, dynamic> _$GetDriver$Query$DriverToJson(
GetDriver$Query$Driver instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$DriverStatusEnumMap[instance.status]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('gender', _$GenderEnumMap[instance.gender]);
writeNotNull('email', instance.email);
val['mobileNumber'] = instance.mobileNumber;
writeNotNull('accountNumber', instance.accountNumber);
writeNotNull('bankName', instance.bankName);
writeNotNull('bankRoutingNumber', instance.bankRoutingNumber);
writeNotNull('address', instance.address);
val['documents'] = instance.documents.map((e) => e.toJson()).toList();
writeNotNull('bankSwift', instance.bankSwift);
writeNotNull('media', instance.media?.toJson());
writeNotNull('carPlate', instance.carPlate);
writeNotNull('carProductionYear', instance.carProductionYear);
writeNotNull('certificateNumber', instance.certificateNumber);
writeNotNull('carColorId', instance.carColorId);
writeNotNull('carId', instance.carId);
return val;
}
GetDriver$Query$CarModel _$GetDriver$Query$CarModelFromJson(
Map<String, dynamic> json) =>
GetDriver$Query$CarModel()
..id = json['id'] as String
..name = json['name'] as String;
Map<String, dynamic> _$GetDriver$Query$CarModelToJson(
GetDriver$Query$CarModel instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
};
GetDriver$Query$CarColor _$GetDriver$Query$CarColorFromJson(
Map<String, dynamic> json) =>
GetDriver$Query$CarColor()
..id = json['id'] as String
..name = json['name'] as String;
Map<String, dynamic> _$GetDriver$Query$CarColorToJson(
GetDriver$Query$CarColor instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
};
GetDriver$Query _$GetDriver$QueryFromJson(Map<String, dynamic> json) =>
GetDriver$Query()
..driver = json['driver'] == null
? null
: GetDriver$Query$Driver.fromJson(
json['driver'] as Map<String, dynamic>)
..carModels = (json['carModels'] as List<dynamic>)
.map((e) =>
GetDriver$Query$CarModel.fromJson(e as Map<String, dynamic>))
.toList()
..carColors = (json['carColors'] as List<dynamic>)
.map((e) =>
GetDriver$Query$CarColor.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetDriver$QueryToJson(GetDriver$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['carModels'] = instance.carModels.map((e) => e.toJson()).toList();
val['carColors'] = instance.carColors.map((e) => e.toJson()).toList();
return val;
}
Login$Mutation$Login _$Login$Mutation$LoginFromJson(
Map<String, dynamic> json) =>
Login$Mutation$Login()..jwtToken = json['jwtToken'] as String;
Map<String, dynamic> _$Login$Mutation$LoginToJson(
Login$Mutation$Login instance) =>
<String, dynamic>{
'jwtToken': instance.jwtToken,
};
Login$Mutation _$Login$MutationFromJson(Map<String, dynamic> json) =>
Login$Mutation()
..login =
Login$Mutation$Login.fromJson(json['login'] as Map<String, dynamic>);
Map<String, dynamic> _$Login$MutationToJson(Login$Mutation instance) =>
<String, dynamic>{
'login': instance.login.toJson(),
};
SetDocumentsOnDriver$Mutation$Driver
_$SetDocumentsOnDriver$Mutation$DriverFromJson(Map<String, dynamic> json) =>
SetDocumentsOnDriver$Mutation$Driver()
..mobileNumber = json['mobileNumber'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..searchDistance = json['searchDistance'] as int?
..media = json['media'] == null
? null
: BasicProfileMixin$Media.fromJson(
json['media'] as Map<String, dynamic>)
..softRejectionNote = json['softRejectionNote'] as String?
..status = $enumDecode(_$DriverStatusEnumMap, json['status'],
unknownValue: DriverStatus.artemisUnknown)
..currentOrders = (json['currentOrders'] as List<dynamic>)
.map((e) =>
BasicProfileMixin$Order.fromJson(e as Map<String, dynamic>))
.toList()
..wallets = (json['wallets'] as List<dynamic>)
.map((e) => BasicProfileMixin$DriverWallet.fromJson(
e as Map<String, dynamic>))
.toList()
..isWalletHidden = json['isWalletHidden'] as bool;
Map<String, dynamic> _$SetDocumentsOnDriver$Mutation$DriverToJson(
SetDocumentsOnDriver$Mutation$Driver instance) {
final val = <String, dynamic>{
'mobileNumber': instance.mobileNumber,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('searchDistance', instance.searchDistance);
writeNotNull('media', instance.media?.toJson());
writeNotNull('softRejectionNote', instance.softRejectionNote);
val['status'] = _$DriverStatusEnumMap[instance.status]!;
val['currentOrders'] = instance.currentOrders.map((e) => e.toJson()).toList();
val['wallets'] = instance.wallets.map((e) => e.toJson()).toList();
val['isWalletHidden'] = instance.isWalletHidden;
return val;
}
SetDocumentsOnDriver$Mutation _$SetDocumentsOnDriver$MutationFromJson(
Map<String, dynamic> json) =>
SetDocumentsOnDriver$Mutation()
..updateOneDriver = SetDocumentsOnDriver$Mutation$Driver.fromJson(
json['updateOneDriver'] as Map<String, dynamic>)
..setDocumentsOnDriver = SetDocumentsOnDriver$Mutation$Driver.fromJson(
json['setDocumentsOnDriver'] as Map<String, dynamic>);
Map<String, dynamic> _$SetDocumentsOnDriver$MutationToJson(
SetDocumentsOnDriver$Mutation instance) =>
<String, dynamic>{
'updateOneDriver': instance.updateOneDriver.toJson(),
'setDocumentsOnDriver': instance.setDocumentsOnDriver.toJson(),
};
BasicProfileMixin$Media _$BasicProfileMixin$MediaFromJson(
Map<String, dynamic> json) =>
BasicProfileMixin$Media()..address = json['address'] as String;
Map<String, dynamic> _$BasicProfileMixin$MediaToJson(
BasicProfileMixin$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
BasicProfileMixin$Order _$BasicProfileMixin$OrderFromJson(
Map<String, dynamic> json) =>
BasicProfileMixin$Order()
..id = json['id'] as String
..createdOn = fromGraphQLTimestampToDartDateTime(json['createdOn'] as int)
..expectedTimestamp =
fromGraphQLTimestampToDartDateTime(json['expectedTimestamp'] as int)
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..currency = json['currency'] as String
..costBest = (json['costBest'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..paidAmount = (json['paidAmount'] as num).toDouble()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..tipAmount = (json['tipAmount'] as num).toDouble()
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..options = (json['options'] as List<dynamic>)
.map((e) => CurrentOrderMixin$ServiceOption.fromJson(
e as Map<String, dynamic>))
.toList()
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..rider = CurrentOrderMixin$Rider.fromJson(
json['rider'] as Map<String, dynamic>);
Map<String, dynamic> _$BasicProfileMixin$OrderToJson(
BasicProfileMixin$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'createdOn', fromDartDateTimeToGraphQLTimestamp(instance.createdOn));
writeNotNull('expectedTimestamp',
fromDartDateTimeToGraphQLTimestamp(instance.expectedTimestamp));
val['status'] = _$OrderStatusEnumMap[instance.status]!;
val['currency'] = instance.currency;
val['costBest'] = instance.costBest;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['paidAmount'] = instance.paidAmount;
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['tipAmount'] = instance.tipAmount;
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
val['points'] = instance.points.map((e) => e.toJson()).toList();
val['service'] = instance.service.toJson();
val['options'] = instance.options.map((e) => e.toJson()).toList();
val['addresses'] = instance.addresses;
val['rider'] = instance.rider.toJson();
return val;
}
BasicProfileMixin$DriverWallet _$BasicProfileMixin$DriverWalletFromJson(
Map<String, dynamic> json) =>
BasicProfileMixin$DriverWallet()
..balance = (json['balance'] as num).toDouble()
..currency = json['currency'] as String;
Map<String, dynamic> _$BasicProfileMixin$DriverWalletToJson(
BasicProfileMixin$DriverWallet instance) =>
<String, dynamic>{
'balance': instance.balance,
'currency': instance.currency,
};
CurrentOrderMixin$Point _$CurrentOrderMixin$PointFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$CurrentOrderMixin$PointToJson(
CurrentOrderMixin$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
CurrentOrderMixin$Service _$CurrentOrderMixin$ServiceFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Service()..name = json['name'] as String;
Map<String, dynamic> _$CurrentOrderMixin$ServiceToJson(
CurrentOrderMixin$Service instance) =>
<String, dynamic>{
'name': instance.name,
};
CurrentOrderMixin$ServiceOption _$CurrentOrderMixin$ServiceOptionFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$ServiceOption()
..id = json['id'] as String
..name = json['name'] as String
..icon = $enumDecode(_$ServiceOptionIconEnumMap, json['icon'],
unknownValue: ServiceOptionIcon.artemisUnknown);
Map<String, dynamic> _$CurrentOrderMixin$ServiceOptionToJson(
CurrentOrderMixin$ServiceOption instance) =>
<String, dynamic>{
'id': instance.id,
'name': instance.name,
'icon': _$ServiceOptionIconEnumMap[instance.icon]!,
};
const _$ServiceOptionIconEnumMap = {
ServiceOptionIcon.pet: 'Pet',
ServiceOptionIcon.twoWay: 'TwoWay',
ServiceOptionIcon.luggage: 'Luggage',
ServiceOptionIcon.packageDelivery: 'PackageDelivery',
ServiceOptionIcon.shopping: 'Shopping',
ServiceOptionIcon.custom1: 'Custom1',
ServiceOptionIcon.custom2: 'Custom2',
ServiceOptionIcon.custom3: 'Custom3',
ServiceOptionIcon.custom4: 'Custom4',
ServiceOptionIcon.custom5: 'Custom5',
ServiceOptionIcon.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
CurrentOrderMixin$Rider$Media _$CurrentOrderMixin$Rider$MediaFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Rider$Media()..address = json['address'] as String;
Map<String, dynamic> _$CurrentOrderMixin$Rider$MediaToJson(
CurrentOrderMixin$Rider$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
CurrentOrderMixin$Rider$RiderWallet
_$CurrentOrderMixin$Rider$RiderWalletFromJson(Map<String, dynamic> json) =>
CurrentOrderMixin$Rider$RiderWallet()
..currency = json['currency'] as String
..balance = (json['balance'] as num).toDouble();
Map<String, dynamic> _$CurrentOrderMixin$Rider$RiderWalletToJson(
CurrentOrderMixin$Rider$RiderWallet instance) =>
<String, dynamic>{
'currency': instance.currency,
'balance': instance.balance,
};
CurrentOrderMixin$Rider _$CurrentOrderMixin$RiderFromJson(
Map<String, dynamic> json) =>
CurrentOrderMixin$Rider()
..mobileNumber = json['mobileNumber'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..media = json['media'] == null
? null
: CurrentOrderMixin$Rider$Media.fromJson(
json['media'] as Map<String, dynamic>)
..wallets = (json['wallets'] as List<dynamic>)
.map((e) => CurrentOrderMixin$Rider$RiderWallet.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$CurrentOrderMixin$RiderToJson(
CurrentOrderMixin$Rider instance) {
final val = <String, dynamic>{
'mobileNumber': instance.mobileNumber,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('media', instance.media?.toJson());
val['wallets'] = instance.wallets.map((e) => e.toJson()).toList();
return val;
}
DeleteUser$Mutation$Driver _$DeleteUser$Mutation$DriverFromJson(
Map<String, dynamic> json) =>
DeleteUser$Mutation$Driver()..id = json['id'] as String;
Map<String, dynamic> _$DeleteUser$Mutation$DriverToJson(
DeleteUser$Mutation$Driver instance) =>
<String, dynamic>{
'id': instance.id,
};
DeleteUser$Mutation _$DeleteUser$MutationFromJson(Map<String, dynamic> json) =>
DeleteUser$Mutation()
..deleteUser = DeleteUser$Mutation$Driver.fromJson(
json['deleteUser'] as Map<String, dynamic>);
Map<String, dynamic> _$DeleteUser$MutationToJson(
DeleteUser$Mutation instance) =>
<String, dynamic>{
'deleteUser': instance.deleteUser.toJson(),
};
GetProfile$Query$Driver$Media _$GetProfile$Query$Driver$MediaFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$Media()
..id = json['id'] as String
..address = json['address'] as String;
Map<String, dynamic> _$GetProfile$Query$Driver$MediaToJson(
GetProfile$Query$Driver$Media instance) =>
<String, dynamic>{
'id': instance.id,
'address': instance.address,
};
GetProfile$Query$Driver$Service _$GetProfile$Query$Driver$ServiceFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$Service()..name = json['name'] as String;
Map<String, dynamic> _$GetProfile$Query$Driver$ServiceToJson(
GetProfile$Query$Driver$Service instance) =>
<String, dynamic>{
'name': instance.name,
};
GetProfile$Query$Driver$CarColor _$GetProfile$Query$Driver$CarColorFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$CarColor()..name = json['name'] as String;
Map<String, dynamic> _$GetProfile$Query$Driver$CarColorToJson(
GetProfile$Query$Driver$CarColor instance) =>
<String, dynamic>{
'name': instance.name,
};
GetProfile$Query$Driver$CarModel _$GetProfile$Query$Driver$CarModelFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$CarModel()..name = json['name'] as String;
Map<String, dynamic> _$GetProfile$Query$Driver$CarModelToJson(
GetProfile$Query$Driver$CarModel instance) =>
<String, dynamic>{
'name': instance.name,
};
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregateFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate()
..distanceBest = (json['distanceBest'] as num?)?.toDouble();
Map<String, dynamic>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregateToJson(
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate
instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('distanceBest', instance.distanceBest);
return val;
}
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregateFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate()
..id = json['id'] as int?;
Map<String, dynamic>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregateToJson(
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate
instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('id', instance.id);
return val;
}
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponseFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse()
..sum = json['sum'] == null
? null
: GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate
.fromJson(json['sum'] as Map<String, dynamic>)
..count = json['count'] == null
? null
: GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate
.fromJson(json['count'] as Map<String, dynamic>);
Map<String, dynamic>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponseToJson(
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('sum', instance.sum?.toJson());
writeNotNull('count', instance.count?.toJson());
return val;
}
GetProfile$Query$Driver _$GetProfile$Query$DriverFromJson(
Map<String, dynamic> json) =>
GetProfile$Query$Driver()
..id = json['id'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..mobileNumber = json['mobileNumber'] as String
..accountNumber = json['accountNumber'] as String?
..bankName = json['bankName'] as String?
..address = json['address'] as String?
..rating = (json['rating'] as num?)?.toDouble()
..documents = (json['documents'] as List<dynamic>)
.map((e) =>
GetProfile$Query$Driver$Media.fromJson(e as Map<String, dynamic>))
.toList()
..bankSwift = json['bankSwift'] as String?
..media = json['media'] == null
? null
: GetProfile$Query$Driver$Media.fromJson(
json['media'] as Map<String, dynamic>)
..carPlate = json['carPlate'] as String?
..enabledServices = (json['enabledServices'] as List<dynamic>)
.map((e) => GetProfile$Query$Driver$Service.fromJson(
e as Map<String, dynamic>))
.toList()
..carColor = json['carColor'] == null
? null
: GetProfile$Query$Driver$CarColor.fromJson(
json['carColor'] as Map<String, dynamic>)
..car = json['car'] == null
? null
: GetProfile$Query$Driver$CarModel.fromJson(
json['car'] as Map<String, dynamic>)
..historyOrdersAggregate =
(json['historyOrdersAggregate'] as List<dynamic>)
.map((e) =>
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse
.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetProfile$Query$DriverToJson(
GetProfile$Query$Driver instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
val['mobileNumber'] = instance.mobileNumber;
writeNotNull('accountNumber', instance.accountNumber);
writeNotNull('bankName', instance.bankName);
writeNotNull('address', instance.address);
writeNotNull('rating', instance.rating);
val['documents'] = instance.documents.map((e) => e.toJson()).toList();
writeNotNull('bankSwift', instance.bankSwift);
writeNotNull('media', instance.media?.toJson());
writeNotNull('carPlate', instance.carPlate);
val['enabledServices'] =
instance.enabledServices.map((e) => e.toJson()).toList();
writeNotNull('carColor', instance.carColor?.toJson());
writeNotNull('car', instance.car?.toJson());
val['historyOrdersAggregate'] =
instance.historyOrdersAggregate.map((e) => e.toJson()).toList();
return val;
}
GetProfile$Query _$GetProfile$QueryFromJson(Map<String, dynamic> json) =>
GetProfile$Query()
..driver = json['driver'] == null
? null
: GetProfile$Query$Driver.fromJson(
json['driver'] as Map<String, dynamic>);
Map<String, dynamic> _$GetProfile$QueryToJson(GetProfile$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
return val;
}
GetStats$Query$StatisticsResult$Datapoint
_$GetStats$Query$StatisticsResult$DatapointFromJson(
Map<String, dynamic> json) =>
GetStats$Query$StatisticsResult$Datapoint()
..count = (json['count'] as num).toDouble()
..current = json['current'] as String
..distance = (json['distance'] as num).toDouble()
..earning = (json['earning'] as num).toDouble()
..name = json['name'] as String
..time = (json['time'] as num).toDouble();
Map<String, dynamic> _$GetStats$Query$StatisticsResult$DatapointToJson(
GetStats$Query$StatisticsResult$Datapoint instance) =>
<String, dynamic>{
'count': instance.count,
'current': instance.current,
'distance': instance.distance,
'earning': instance.earning,
'name': instance.name,
'time': instance.time,
};
GetStats$Query$StatisticsResult _$GetStats$Query$StatisticsResultFromJson(
Map<String, dynamic> json) =>
GetStats$Query$StatisticsResult()
..currency = json['currency'] as String
..dataset = (json['dataset'] as List<dynamic>)
.map((e) => GetStats$Query$StatisticsResult$Datapoint.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetStats$Query$StatisticsResultToJson(
GetStats$Query$StatisticsResult instance) =>
<String, dynamic>{
'currency': instance.currency,
'dataset': instance.dataset.map((e) => e.toJson()).toList(),
};
GetStats$Query$OrderConnection _$GetStats$Query$OrderConnectionFromJson(
Map<String, dynamic> json) =>
GetStats$Query$OrderConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) => HistoryOrderItemMixin$OrderEdge.fromJson(
e as Map<String, dynamic>))
.toList()
..pageInfo = HistoryOrderItemMixin$PageInfo.fromJson(
json['pageInfo'] as Map<String, dynamic>);
Map<String, dynamic> _$GetStats$Query$OrderConnectionToJson(
GetStats$Query$OrderConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
'pageInfo': instance.pageInfo.toJson(),
};
GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy
_$GetStats$Query$OrderAggregateResponse$OrderAggregateGroupByFromJson(
Map<String, dynamic> json) =>
GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy()
..createdOn = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['createdOn'] as int?);
Map<String, dynamic>
_$GetStats$Query$OrderAggregateResponse$OrderAggregateGroupByToJson(
GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('createdOn',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.createdOn));
return val;
}
GetStats$Query$OrderAggregateResponse$OrderCountAggregate
_$GetStats$Query$OrderAggregateResponse$OrderCountAggregateFromJson(
Map<String, dynamic> json) =>
GetStats$Query$OrderAggregateResponse$OrderCountAggregate()
..id = json['id'] as int?;
Map<String, dynamic>
_$GetStats$Query$OrderAggregateResponse$OrderCountAggregateToJson(
GetStats$Query$OrderAggregateResponse$OrderCountAggregate instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('id', instance.id);
return val;
}
GetStats$Query$OrderAggregateResponse$OrderSumAggregate
_$GetStats$Query$OrderAggregateResponse$OrderSumAggregateFromJson(
Map<String, dynamic> json) =>
GetStats$Query$OrderAggregateResponse$OrderSumAggregate()
..costBest = (json['costBest'] as num?)?.toDouble();
Map<String, dynamic>
_$GetStats$Query$OrderAggregateResponse$OrderSumAggregateToJson(
GetStats$Query$OrderAggregateResponse$OrderSumAggregate instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('costBest', instance.costBest);
return val;
}
GetStats$Query$OrderAggregateResponse
_$GetStats$Query$OrderAggregateResponseFromJson(
Map<String, dynamic> json) =>
GetStats$Query$OrderAggregateResponse()
..groupBy = json['groupBy'] == null
? null
: GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy
.fromJson(json['groupBy'] as Map<String, dynamic>)
..count = json['count'] == null
? null
: GetStats$Query$OrderAggregateResponse$OrderCountAggregate
.fromJson(json['count'] as Map<String, dynamic>)
..sum = json['sum'] == null
? null
: GetStats$Query$OrderAggregateResponse$OrderSumAggregate
.fromJson(json['sum'] as Map<String, dynamic>);
Map<String, dynamic> _$GetStats$Query$OrderAggregateResponseToJson(
GetStats$Query$OrderAggregateResponse instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('groupBy', instance.groupBy?.toJson());
writeNotNull('count', instance.count?.toJson());
writeNotNull('sum', instance.sum?.toJson());
return val;
}
GetStats$Query _$GetStats$QueryFromJson(Map<String, dynamic> json) =>
GetStats$Query()
..getStatsNew = GetStats$Query$StatisticsResult.fromJson(
json['getStatsNew'] as Map<String, dynamic>)
..orders = GetStats$Query$OrderConnection.fromJson(
json['orders'] as Map<String, dynamic>)
..orderAggregate = (json['orderAggregate'] as List<dynamic>)
.map((e) => GetStats$Query$OrderAggregateResponse.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$GetStats$QueryToJson(GetStats$Query instance) =>
<String, dynamic>{
'getStatsNew': instance.getStatsNew.toJson(),
'orders': instance.orders.toJson(),
'orderAggregate': instance.orderAggregate.map((e) => e.toJson()).toList(),
};
Wallet$Query$DriverWallet _$Wallet$Query$DriverWalletFromJson(
Map<String, dynamic> json) =>
Wallet$Query$DriverWallet()
..id = json['id'] as String
..balance = (json['balance'] as num).toDouble()
..currency = json['currency'] as String;
Map<String, dynamic> _$Wallet$Query$DriverWalletToJson(
Wallet$Query$DriverWallet instance) =>
<String, dynamic>{
'id': instance.id,
'balance': instance.balance,
'currency': instance.currency,
};
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacionFromJson(
Map<String, dynamic> json) =>
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion()
..createdAt =
fromGraphQLTimestampToDartDateTime(json['createdAt'] as int)
..amount = (json['amount'] as num).toDouble()
..currency = json['currency'] as String
..refrenceNumber = json['refrenceNumber'] as String?
..deductType = $enumDecodeNullable(
_$DriverDeductTransactionTypeEnumMap, json['deductType'],
unknownValue: DriverDeductTransactionType.artemisUnknown)
..action = $enumDecode(_$TransactionActionEnumMap, json['action'],
unknownValue: TransactionAction.artemisUnknown)
..rechargeType = $enumDecodeNullable(
_$DriverRechargeTransactionTypeEnumMap, json['rechargeType'],
unknownValue: DriverRechargeTransactionType.artemisUnknown);
Map<String, dynamic>
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacionToJson(
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion
instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'createdAt', fromDartDateTimeToGraphQLTimestamp(instance.createdAt));
val['amount'] = instance.amount;
val['currency'] = instance.currency;
writeNotNull('refrenceNumber', instance.refrenceNumber);
writeNotNull(
'deductType', _$DriverDeductTransactionTypeEnumMap[instance.deductType]);
val['action'] = _$TransactionActionEnumMap[instance.action]!;
writeNotNull('rechargeType',
_$DriverRechargeTransactionTypeEnumMap[instance.rechargeType]);
return val;
}
const _$DriverDeductTransactionTypeEnumMap = {
DriverDeductTransactionType.withdraw: 'Withdraw',
DriverDeductTransactionType.commission: 'Commission',
DriverDeductTransactionType.correction: 'Correction',
DriverDeductTransactionType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
const _$TransactionActionEnumMap = {
TransactionAction.recharge: 'Recharge',
TransactionAction.deduct: 'Deduct',
TransactionAction.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
const _$DriverRechargeTransactionTypeEnumMap = {
DriverRechargeTransactionType.orderFee: 'OrderFee',
DriverRechargeTransactionType.bankTransfer: 'BankTransfer',
DriverRechargeTransactionType.inAppPayment: 'InAppPayment',
DriverRechargeTransactionType.gift: 'Gift',
DriverRechargeTransactionType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdgeFromJson(
Map<String, dynamic> json) =>
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge()
..node =
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion
.fromJson(json['node'] as Map<String, dynamic>);
Map<String, dynamic>
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdgeToJson(
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge
instance) =>
<String, dynamic>{
'node': instance.node.toJson(),
};
Wallet$Query$DriverTransacionConnection
_$Wallet$Query$DriverTransacionConnectionFromJson(
Map<String, dynamic> json) =>
Wallet$Query$DriverTransacionConnection()
..edges = (json['edges'] as List<dynamic>)
.map((e) =>
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge
.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$Wallet$Query$DriverTransacionConnectionToJson(
Wallet$Query$DriverTransacionConnection instance) =>
<String, dynamic>{
'edges': instance.edges.map((e) => e.toJson()).toList(),
};
Wallet$Query _$Wallet$QueryFromJson(Map<String, dynamic> json) => Wallet$Query()
..driverWallets = (json['driverWallets'] as List<dynamic>)
.map((e) => Wallet$Query$DriverWallet.fromJson(e as Map<String, dynamic>))
.toList()
..driverTransacions = Wallet$Query$DriverTransacionConnection.fromJson(
json['driverTransacions'] as Map<String, dynamic>);
Map<String, dynamic> _$Wallet$QueryToJson(Wallet$Query instance) =>
<String, dynamic>{
'driverWallets': instance.driverWallets.map((e) => e.toJson()).toList(),
'driverTransacions': instance.driverTransacions.toJson(),
};
PaymentGateways$Query$PaymentGateway$Media
_$PaymentGateways$Query$PaymentGateway$MediaFromJson(
Map<String, dynamic> json) =>
PaymentGateways$Query$PaymentGateway$Media()
..address = json['address'] as String;
Map<String, dynamic> _$PaymentGateways$Query$PaymentGateway$MediaToJson(
PaymentGateways$Query$PaymentGateway$Media instance) =>
<String, dynamic>{
'address': instance.address,
};
PaymentGateways$Query$PaymentGateway
_$PaymentGateways$Query$PaymentGatewayFromJson(Map<String, dynamic> json) =>
PaymentGateways$Query$PaymentGateway()
..id = json['id'] as String
..title = json['title'] as String
..type = $enumDecode(_$PaymentGatewayTypeEnumMap, json['type'],
unknownValue: PaymentGatewayType.artemisUnknown)
..publicKey = json['publicKey'] as String?
..media = json['media'] == null
? null
: PaymentGateways$Query$PaymentGateway$Media.fromJson(
json['media'] as Map<String, dynamic>);
Map<String, dynamic> _$PaymentGateways$Query$PaymentGatewayToJson(
PaymentGateways$Query$PaymentGateway instance) {
final val = <String, dynamic>{
'id': instance.id,
'title': instance.title,
'type': _$PaymentGatewayTypeEnumMap[instance.type]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('publicKey', instance.publicKey);
writeNotNull('media', instance.media?.toJson());
return val;
}
const _$PaymentGatewayTypeEnumMap = {
PaymentGatewayType.stripe: 'Stripe',
PaymentGatewayType.brainTree: 'BrainTree',
PaymentGatewayType.payPal: 'PayPal',
PaymentGatewayType.paytm: 'Paytm',
PaymentGatewayType.razorpay: 'Razorpay',
PaymentGatewayType.paystack: 'Paystack',
PaymentGatewayType.payU: 'PayU',
PaymentGatewayType.instamojo: 'Instamojo',
PaymentGatewayType.flutterwave: 'Flutterwave',
PaymentGatewayType.payGate: 'PayGate',
PaymentGatewayType.mips: 'MIPS',
PaymentGatewayType.mercadoPago: 'MercadoPago',
PaymentGatewayType.amazonPaymentServices: 'AmazonPaymentServices',
PaymentGatewayType.myTMoney: 'MyTMoney',
PaymentGatewayType.wayForPay: 'WayForPay',
PaymentGatewayType.myFatoorah: 'MyFatoorah',
PaymentGatewayType.sberBank: 'SberBank',
PaymentGatewayType.customLink: 'CustomLink',
PaymentGatewayType.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
PaymentGateways$Query _$PaymentGateways$QueryFromJson(
Map<String, dynamic> json) =>
PaymentGateways$Query()
..paymentGateways = (json['paymentGateways'] as List<dynamic>)
.map((e) => PaymentGateways$Query$PaymentGateway.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$PaymentGateways$QueryToJson(
PaymentGateways$Query instance) =>
<String, dynamic>{
'paymentGateways':
instance.paymentGateways.map((e) => e.toJson()).toList(),
};
TopUpWallet$Mutation$TopUpWalletResponse
_$TopUpWallet$Mutation$TopUpWalletResponseFromJson(
Map<String, dynamic> json) =>
TopUpWallet$Mutation$TopUpWalletResponse()
..status = $enumDecode(_$TopUpWalletStatusEnumMap, json['status'],
unknownValue: TopUpWalletStatus.artemisUnknown)
..url = json['url'] as String;
Map<String, dynamic> _$TopUpWallet$Mutation$TopUpWalletResponseToJson(
TopUpWallet$Mutation$TopUpWalletResponse instance) =>
<String, dynamic>{
'status': _$TopUpWalletStatusEnumMap[instance.status]!,
'url': instance.url,
};
const _$TopUpWalletStatusEnumMap = {
TopUpWalletStatus.ok: 'OK',
TopUpWalletStatus.redirect: 'Redirect',
TopUpWalletStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
TopUpWallet$Mutation _$TopUpWallet$MutationFromJson(
Map<String, dynamic> json) =>
TopUpWallet$Mutation()
..topUpWallet = TopUpWallet$Mutation$TopUpWalletResponse.fromJson(
json['topUpWallet'] as Map<String, dynamic>);
Map<String, dynamic> _$TopUpWallet$MutationToJson(
TopUpWallet$Mutation instance) =>
<String, dynamic>{
'topUpWallet': instance.topUpWallet.toJson(),
};
TopUpWalletInput _$TopUpWalletInputFromJson(Map<String, dynamic> json) =>
TopUpWalletInput(
gatewayId: json['gatewayId'] as String,
amount: (json['amount'] as num).toDouble(),
currency: json['currency'] as String,
token: json['token'] as String?,
pin: (json['pin'] as num?)?.toDouble(),
otp: (json['otp'] as num?)?.toDouble(),
transactionId: json['transactionId'] as String?,
);
Map<String, dynamic> _$TopUpWalletInputToJson(TopUpWalletInput instance) {
final val = <String, dynamic>{
'gatewayId': instance.gatewayId,
'amount': instance.amount,
'currency': instance.currency,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('token', instance.token);
writeNotNull('pin', instance.pin);
writeNotNull('otp', instance.otp);
writeNotNull('transactionId', instance.transactionId);
return val;
}
Me$Query$Driver _$Me$Query$DriverFromJson(Map<String, dynamic> json) =>
Me$Query$Driver()
..mobileNumber = json['mobileNumber'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..searchDistance = json['searchDistance'] as int?
..media = json['media'] == null
? null
: BasicProfileMixin$Media.fromJson(
json['media'] as Map<String, dynamic>)
..softRejectionNote = json['softRejectionNote'] as String?
..status = $enumDecode(_$DriverStatusEnumMap, json['status'],
unknownValue: DriverStatus.artemisUnknown)
..currentOrders = (json['currentOrders'] as List<dynamic>)
.map((e) =>
BasicProfileMixin$Order.fromJson(e as Map<String, dynamic>))
.toList()
..wallets = (json['wallets'] as List<dynamic>)
.map((e) => BasicProfileMixin$DriverWallet.fromJson(
e as Map<String, dynamic>))
.toList()
..isWalletHidden = json['isWalletHidden'] as bool;
Map<String, dynamic> _$Me$Query$DriverToJson(Me$Query$Driver instance) {
final val = <String, dynamic>{
'mobileNumber': instance.mobileNumber,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('searchDistance', instance.searchDistance);
writeNotNull('media', instance.media?.toJson());
writeNotNull('softRejectionNote', instance.softRejectionNote);
val['status'] = _$DriverStatusEnumMap[instance.status]!;
val['currentOrders'] = instance.currentOrders.map((e) => e.toJson()).toList();
val['wallets'] = instance.wallets.map((e) => e.toJson()).toList();
val['isWalletHidden'] = instance.isWalletHidden;
return val;
}
Me$Query _$Me$QueryFromJson(Map<String, dynamic> json) => Me$Query()
..driver = json['driver'] == null
? null
: Me$Query$Driver.fromJson(json['driver'] as Map<String, dynamic>)
..requireUpdate = $enumDecode(_$VersionStatusEnumMap, json['requireUpdate'],
unknownValue: VersionStatus.artemisUnknown);
Map<String, dynamic> _$Me$QueryToJson(Me$Query instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('driver', instance.driver?.toJson());
val['requireUpdate'] = _$VersionStatusEnumMap[instance.requireUpdate]!;
return val;
}
const _$VersionStatusEnumMap = {
VersionStatus.latest: 'Latest',
VersionStatus.mandatoryUpdate: 'MandatoryUpdate',
VersionStatus.optionalUpdate: 'OptionalUpdate',
VersionStatus.artemisUnknown: 'ARTEMIS_UNKNOWN',
};
AvailableOrders$Query$Order _$AvailableOrders$Query$OrderFromJson(
Map<String, dynamic> json) =>
AvailableOrders$Query$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..currency = json['currency'] as String
..costBest = (json['costBest'] as num).toDouble()
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..distanceBest = json['distanceBest'] as int
..durationBest = json['durationBest'] as int
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
AvailableOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..options = (json['options'] as List<dynamic>)
.map((e) => AvailableOrderMixin$ServiceOption.fromJson(
e as Map<String, dynamic>))
.toList()
..service = AvailableOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..points = (json['points'] as List<dynamic>)
.map((e) =>
AvailableOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$AvailableOrders$Query$OrderToJson(
AvailableOrders$Query$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'currency': instance.currency,
'costBest': instance.costBest,
'addresses': instance.addresses,
'distanceBest': instance.distanceBest,
'durationBest': instance.durationBest,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
val['options'] = instance.options.map((e) => e.toJson()).toList();
val['service'] = instance.service.toJson();
val['points'] = instance.points.map((e) => e.toJson()).toList();
return val;
}
AvailableOrders$Query _$AvailableOrders$QueryFromJson(
Map<String, dynamic> json) =>
AvailableOrders$Query()
..availableOrders = (json['availableOrders'] as List<dynamic>)
.map((e) =>
AvailableOrders$Query$Order.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$AvailableOrders$QueryToJson(
AvailableOrders$Query instance) =>
<String, dynamic>{
'availableOrders':
instance.availableOrders.map((e) => e.toJson()).toList(),
};
AvailableOrderMixin$Point _$AvailableOrderMixin$PointFromJson(
Map<String, dynamic> json) =>
AvailableOrderMixin$Point()
..lat = (json['lat'] as num).toDouble()
..lng = (json['lng'] as num).toDouble();
Map<String, dynamic> _$AvailableOrderMixin$PointToJson(
AvailableOrderMixin$Point instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
AvailableOrderMixin$ServiceOption _$AvailableOrderMixin$ServiceOptionFromJson(
Map<String, dynamic> json) =>
AvailableOrderMixin$ServiceOption()
..name = json['name'] as String
..icon = $enumDecode(_$ServiceOptionIconEnumMap, json['icon'],
unknownValue: ServiceOptionIcon.artemisUnknown);
Map<String, dynamic> _$AvailableOrderMixin$ServiceOptionToJson(
AvailableOrderMixin$ServiceOption instance) =>
<String, dynamic>{
'name': instance.name,
'icon': _$ServiceOptionIconEnumMap[instance.icon]!,
};
AvailableOrderMixin$Service _$AvailableOrderMixin$ServiceFromJson(
Map<String, dynamic> json) =>
AvailableOrderMixin$Service()..name = json['name'] as String;
Map<String, dynamic> _$AvailableOrderMixin$ServiceToJson(
AvailableOrderMixin$Service instance) =>
<String, dynamic>{
'name': instance.name,
};
OrderCreated$Subscription$Order _$OrderCreated$Subscription$OrderFromJson(
Map<String, dynamic> json) =>
OrderCreated$Subscription$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..currency = json['currency'] as String
..costBest = (json['costBest'] as num).toDouble()
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..distanceBest = json['distanceBest'] as int
..durationBest = json['durationBest'] as int
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
AvailableOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..options = (json['options'] as List<dynamic>)
.map((e) => AvailableOrderMixin$ServiceOption.fromJson(
e as Map<String, dynamic>))
.toList()
..service = AvailableOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..points = (json['points'] as List<dynamic>)
.map((e) =>
AvailableOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$OrderCreated$Subscription$OrderToJson(
OrderCreated$Subscription$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'currency': instance.currency,
'costBest': instance.costBest,
'addresses': instance.addresses,
'distanceBest': instance.distanceBest,
'durationBest': instance.durationBest,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
val['options'] = instance.options.map((e) => e.toJson()).toList();
val['service'] = instance.service.toJson();
val['points'] = instance.points.map((e) => e.toJson()).toList();
return val;
}
OrderCreated$Subscription _$OrderCreated$SubscriptionFromJson(
Map<String, dynamic> json) =>
OrderCreated$Subscription()
..orderCreated = OrderCreated$Subscription$Order.fromJson(
json['orderCreated'] as Map<String, dynamic>);
Map<String, dynamic> _$OrderCreated$SubscriptionToJson(
OrderCreated$Subscription instance) =>
<String, dynamic>{
'orderCreated': instance.orderCreated.toJson(),
};
OrderRemoved$Subscription$Order _$OrderRemoved$Subscription$OrderFromJson(
Map<String, dynamic> json) =>
OrderRemoved$Subscription$Order()..id = json['id'] as String;
Map<String, dynamic> _$OrderRemoved$Subscription$OrderToJson(
OrderRemoved$Subscription$Order instance) =>
<String, dynamic>{
'id': instance.id,
};
OrderRemoved$Subscription _$OrderRemoved$SubscriptionFromJson(
Map<String, dynamic> json) =>
OrderRemoved$Subscription()
..orderRemoved = OrderRemoved$Subscription$Order.fromJson(
json['orderRemoved'] as Map<String, dynamic>);
Map<String, dynamic> _$OrderRemoved$SubscriptionToJson(
OrderRemoved$Subscription instance) =>
<String, dynamic>{
'orderRemoved': instance.orderRemoved.toJson(),
};
OrderUpdated$Subscription$Order _$OrderUpdated$Subscription$OrderFromJson(
Map<String, dynamic> json) =>
OrderUpdated$Subscription$Order()..id = json['id'] as String;
Map<String, dynamic> _$OrderUpdated$Subscription$OrderToJson(
OrderUpdated$Subscription$Order instance) =>
<String, dynamic>{
'id': instance.id,
};
OrderUpdated$Subscription _$OrderUpdated$SubscriptionFromJson(
Map<String, dynamic> json) =>
OrderUpdated$Subscription()
..orderUpdated = OrderUpdated$Subscription$Order.fromJson(
json['orderUpdated'] as Map<String, dynamic>);
Map<String, dynamic> _$OrderUpdated$SubscriptionToJson(
OrderUpdated$Subscription instance) =>
<String, dynamic>{
'orderUpdated': instance.orderUpdated.toJson(),
};
UpdateDriverLocation$Mutation$Order
_$UpdateDriverLocation$Mutation$OrderFromJson(Map<String, dynamic> json) =>
UpdateDriverLocation$Mutation$Order()
..id = json['id'] as String
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..currency = json['currency'] as String
..costBest = (json['costBest'] as num).toDouble()
..addresses = (json['addresses'] as List<dynamic>)
.map((e) => e as String)
.toList()
..distanceBest = json['distanceBest'] as int
..durationBest = json['durationBest'] as int
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
AvailableOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..options = (json['options'] as List<dynamic>)
.map((e) => AvailableOrderMixin$ServiceOption.fromJson(
e as Map<String, dynamic>))
.toList()
..service = AvailableOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..points = (json['points'] as List<dynamic>)
.map((e) =>
AvailableOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$UpdateDriverLocation$Mutation$OrderToJson(
UpdateDriverLocation$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
'status': _$OrderStatusEnumMap[instance.status]!,
'currency': instance.currency,
'costBest': instance.costBest,
'addresses': instance.addresses,
'distanceBest': instance.distanceBest,
'durationBest': instance.durationBest,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
val['options'] = instance.options.map((e) => e.toJson()).toList();
val['service'] = instance.service.toJson();
val['points'] = instance.points.map((e) => e.toJson()).toList();
return val;
}
UpdateDriverLocation$Mutation _$UpdateDriverLocation$MutationFromJson(
Map<String, dynamic> json) =>
UpdateDriverLocation$Mutation()
..updateDriversLocationNew =
(json['updateDriversLocationNew'] as List<dynamic>)
.map((e) => UpdateDriverLocation$Mutation$Order.fromJson(
e as Map<String, dynamic>))
.toList();
Map<String, dynamic> _$UpdateDriverLocation$MutationToJson(
UpdateDriverLocation$Mutation instance) =>
<String, dynamic>{
'updateDriversLocationNew':
instance.updateDriversLocationNew.map((e) => e.toJson()).toList(),
};
PointInput _$PointInputFromJson(Map<String, dynamic> json) => PointInput(
lat: (json['lat'] as num).toDouble(),
lng: (json['lng'] as num).toDouble(),
);
Map<String, dynamic> _$PointInputToJson(PointInput instance) =>
<String, dynamic>{
'lat': instance.lat,
'lng': instance.lng,
};
UpdateOrderStatus$Mutation$Order _$UpdateOrderStatus$Mutation$OrderFromJson(
Map<String, dynamic> json) =>
UpdateOrderStatus$Mutation$Order()
..id = json['id'] as String
..createdOn = fromGraphQLTimestampToDartDateTime(json['createdOn'] as int)
..expectedTimestamp =
fromGraphQLTimestampToDartDateTime(json['expectedTimestamp'] as int)
..status = $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown)
..currency = json['currency'] as String
..costBest = (json['costBest'] as num).toDouble()
..costAfterCoupon = (json['costAfterCoupon'] as num).toDouble()
..paidAmount = (json['paidAmount'] as num).toDouble()
..etaPickup = fromGraphQLTimestampNullableToDartDateTimeNullable(
json['etaPickup'] as int?)
..tipAmount = (json['tipAmount'] as num).toDouble()
..directions = (json['directions'] as List<dynamic>?)
?.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..points = (json['points'] as List<dynamic>)
.map((e) =>
CurrentOrderMixin$Point.fromJson(e as Map<String, dynamic>))
.toList()
..service = CurrentOrderMixin$Service.fromJson(
json['service'] as Map<String, dynamic>)
..options = (json['options'] as List<dynamic>)
.map((e) => CurrentOrderMixin$ServiceOption.fromJson(
e as Map<String, dynamic>))
.toList()
..addresses =
(json['addresses'] as List<dynamic>).map((e) => e as String).toList()
..rider = CurrentOrderMixin$Rider.fromJson(
json['rider'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateOrderStatus$Mutation$OrderToJson(
UpdateOrderStatus$Mutation$Order instance) {
final val = <String, dynamic>{
'id': instance.id,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'createdOn', fromDartDateTimeToGraphQLTimestamp(instance.createdOn));
writeNotNull('expectedTimestamp',
fromDartDateTimeToGraphQLTimestamp(instance.expectedTimestamp));
val['status'] = _$OrderStatusEnumMap[instance.status]!;
val['currency'] = instance.currency;
val['costBest'] = instance.costBest;
val['costAfterCoupon'] = instance.costAfterCoupon;
val['paidAmount'] = instance.paidAmount;
writeNotNull('etaPickup',
fromDartDateTimeNullableToGraphQLTimestampNullable(instance.etaPickup));
val['tipAmount'] = instance.tipAmount;
writeNotNull(
'directions', instance.directions?.map((e) => e.toJson()).toList());
val['points'] = instance.points.map((e) => e.toJson()).toList();
val['service'] = instance.service.toJson();
val['options'] = instance.options.map((e) => e.toJson()).toList();
val['addresses'] = instance.addresses;
val['rider'] = instance.rider.toJson();
return val;
}
UpdateOrderStatus$Mutation _$UpdateOrderStatus$MutationFromJson(
Map<String, dynamic> json) =>
UpdateOrderStatus$Mutation()
..updateOneOrder = UpdateOrderStatus$Mutation$Order.fromJson(
json['updateOneOrder'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateOrderStatus$MutationToJson(
UpdateOrderStatus$Mutation instance) =>
<String, dynamic>{
'updateOneOrder': instance.updateOneOrder.toJson(),
};
UpdateDriverStatus$Mutation$Driver _$UpdateDriverStatus$Mutation$DriverFromJson(
Map<String, dynamic> json) =>
UpdateDriverStatus$Mutation$Driver()
..mobileNumber = json['mobileNumber'] as String
..firstName = json['firstName'] as String?
..lastName = json['lastName'] as String?
..searchDistance = json['searchDistance'] as int?
..media = json['media'] == null
? null
: BasicProfileMixin$Media.fromJson(
json['media'] as Map<String, dynamic>)
..softRejectionNote = json['softRejectionNote'] as String?
..status = $enumDecode(_$DriverStatusEnumMap, json['status'],
unknownValue: DriverStatus.artemisUnknown)
..currentOrders = (json['currentOrders'] as List<dynamic>)
.map((e) =>
BasicProfileMixin$Order.fromJson(e as Map<String, dynamic>))
.toList()
..wallets = (json['wallets'] as List<dynamic>)
.map((e) => BasicProfileMixin$DriverWallet.fromJson(
e as Map<String, dynamic>))
.toList()
..isWalletHidden = json['isWalletHidden'] as bool;
Map<String, dynamic> _$UpdateDriverStatus$Mutation$DriverToJson(
UpdateDriverStatus$Mutation$Driver instance) {
final val = <String, dynamic>{
'mobileNumber': instance.mobileNumber,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('firstName', instance.firstName);
writeNotNull('lastName', instance.lastName);
writeNotNull('searchDistance', instance.searchDistance);
writeNotNull('media', instance.media?.toJson());
writeNotNull('softRejectionNote', instance.softRejectionNote);
val['status'] = _$DriverStatusEnumMap[instance.status]!;
val['currentOrders'] = instance.currentOrders.map((e) => e.toJson()).toList();
val['wallets'] = instance.wallets.map((e) => e.toJson()).toList();
val['isWalletHidden'] = instance.isWalletHidden;
return val;
}
UpdateDriverStatus$Mutation _$UpdateDriverStatus$MutationFromJson(
Map<String, dynamic> json) =>
UpdateDriverStatus$Mutation()
..updateOneDriver = UpdateDriverStatus$Mutation$Driver.fromJson(
json['updateOneDriver'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateDriverStatus$MutationToJson(
UpdateDriverStatus$Mutation instance) =>
<String, dynamic>{
'updateOneDriver': instance.updateOneDriver.toJson(),
};
UpdateDriverFCMId$Mutation$Driver _$UpdateDriverFCMId$Mutation$DriverFromJson(
Map<String, dynamic> json) =>
UpdateDriverFCMId$Mutation$Driver()..id = json['id'] as String;
Map<String, dynamic> _$UpdateDriverFCMId$Mutation$DriverToJson(
UpdateDriverFCMId$Mutation$Driver instance) =>
<String, dynamic>{
'id': instance.id,
};
UpdateDriverFCMId$Mutation _$UpdateDriverFCMId$MutationFromJson(
Map<String, dynamic> json) =>
UpdateDriverFCMId$Mutation()
..updateOneDriver = UpdateDriverFCMId$Mutation$Driver.fromJson(
json['updateOneDriver'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateDriverFCMId$MutationToJson(
UpdateDriverFCMId$Mutation instance) =>
<String, dynamic>{
'updateOneDriver': instance.updateOneDriver.toJson(),
};
UpdateDriverSearchDistance$Mutation$Driver
_$UpdateDriverSearchDistance$Mutation$DriverFromJson(
Map<String, dynamic> json) =>
UpdateDriverSearchDistance$Mutation$Driver()..id = json['id'] as String;
Map<String, dynamic> _$UpdateDriverSearchDistance$Mutation$DriverToJson(
UpdateDriverSearchDistance$Mutation$Driver instance) =>
<String, dynamic>{
'id': instance.id,
};
UpdateDriverSearchDistance$Mutation
_$UpdateDriverSearchDistance$MutationFromJson(Map<String, dynamic> json) =>
UpdateDriverSearchDistance$Mutation()
..updateOneDriver =
UpdateDriverSearchDistance$Mutation$Driver.fromJson(
json['updateOneDriver'] as Map<String, dynamic>);
Map<String, dynamic> _$UpdateDriverSearchDistance$MutationToJson(
UpdateDriverSearchDistance$Mutation instance) =>
<String, dynamic>{
'updateOneDriver': instance.updateOneDriver.toJson(),
};
SendMessageArguments _$SendMessageArgumentsFromJson(
Map<String, dynamic> json) =>
SendMessageArguments(
requestId: json['requestId'] as String,
content: json['content'] as String,
);
Map<String, dynamic> _$SendMessageArgumentsToJson(
SendMessageArguments instance) =>
<String, dynamic>{
'requestId': instance.requestId,
'content': instance.content,
};
GetOrderDetailsArguments _$GetOrderDetailsArgumentsFromJson(
Map<String, dynamic> json) =>
GetOrderDetailsArguments(
id: json['id'] as String,
);
Map<String, dynamic> _$GetOrderDetailsArgumentsToJson(
GetOrderDetailsArguments instance) =>
<String, dynamic>{
'id': instance.id,
};
SubmitComplaintArguments _$SubmitComplaintArgumentsFromJson(
Map<String, dynamic> json) =>
SubmitComplaintArguments(
id: json['id'] as String,
subject: json['subject'] as String,
content: json['content'] as String,
);
Map<String, dynamic> _$SubmitComplaintArgumentsToJson(
SubmitComplaintArguments instance) =>
<String, dynamic>{
'id': instance.id,
'subject': instance.subject,
'content': instance.content,
};
UpdateProfileArguments _$UpdateProfileArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateProfileArguments(
input: UpdateDriverInput.fromJson(json['input'] as Map<String, dynamic>),
);
Map<String, dynamic> _$UpdateProfileArgumentsToJson(
UpdateProfileArguments instance) =>
<String, dynamic>{
'input': instance.input.toJson(),
};
LoginArguments _$LoginArgumentsFromJson(Map<String, dynamic> json) =>
LoginArguments(
firebaseToken: json['firebaseToken'] as String,
);
Map<String, dynamic> _$LoginArgumentsToJson(LoginArguments instance) =>
<String, dynamic>{
'firebaseToken': instance.firebaseToken,
};
SetDocumentsOnDriverArguments _$SetDocumentsOnDriverArgumentsFromJson(
Map<String, dynamic> json) =>
SetDocumentsOnDriverArguments(
driverId: json['driverId'] as String,
relationIds: (json['relationIds'] as List<dynamic>)
.map((e) => e as String)
.toList(),
);
Map<String, dynamic> _$SetDocumentsOnDriverArgumentsToJson(
SetDocumentsOnDriverArguments instance) =>
<String, dynamic>{
'driverId': instance.driverId,
'relationIds': instance.relationIds,
};
GetStatsArguments _$GetStatsArgumentsFromJson(Map<String, dynamic> json) =>
GetStatsArguments(
startDate: fromGraphQLDateTimeToDartDateTime(json['startDate'] as int),
endDate: fromGraphQLDateTimeToDartDateTime(json['endDate'] as int),
);
Map<String, dynamic> _$GetStatsArgumentsToJson(GetStatsArguments instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull(
'startDate', fromDartDateTimeToGraphQLDateTime(instance.startDate));
writeNotNull('endDate', fromDartDateTimeToGraphQLDateTime(instance.endDate));
return val;
}
TopUpWalletArguments _$TopUpWalletArgumentsFromJson(
Map<String, dynamic> json) =>
TopUpWalletArguments(
input: TopUpWalletInput.fromJson(json['input'] as Map<String, dynamic>),
);
Map<String, dynamic> _$TopUpWalletArgumentsToJson(
TopUpWalletArguments instance) =>
<String, dynamic>{
'input': instance.input.toJson(),
};
MeArguments _$MeArgumentsFromJson(Map<String, dynamic> json) => MeArguments(
versionCode: json['versionCode'] as int,
);
Map<String, dynamic> _$MeArgumentsToJson(MeArguments instance) =>
<String, dynamic>{
'versionCode': instance.versionCode,
};
UpdateDriverLocationArguments _$UpdateDriverLocationArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateDriverLocationArguments(
point: PointInput.fromJson(json['point'] as Map<String, dynamic>),
);
Map<String, dynamic> _$UpdateDriverLocationArgumentsToJson(
UpdateDriverLocationArguments instance) =>
<String, dynamic>{
'point': instance.point.toJson(),
};
UpdateOrderStatusArguments _$UpdateOrderStatusArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateOrderStatusArguments(
orderId: json['orderId'] as String,
status: $enumDecode(_$OrderStatusEnumMap, json['status'],
unknownValue: OrderStatus.artemisUnknown),
cashPayment: (json['cashPayment'] as num?)?.toDouble(),
);
Map<String, dynamic> _$UpdateOrderStatusArgumentsToJson(
UpdateOrderStatusArguments instance) {
final val = <String, dynamic>{
'orderId': instance.orderId,
'status': _$OrderStatusEnumMap[instance.status]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('cashPayment', instance.cashPayment);
return val;
}
UpdateDriverStatusArguments _$UpdateDriverStatusArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateDriverStatusArguments(
status: $enumDecode(_$DriverStatusEnumMap, json['status'],
unknownValue: DriverStatus.artemisUnknown),
fcmId: json['fcmId'] as String?,
);
Map<String, dynamic> _$UpdateDriverStatusArgumentsToJson(
UpdateDriverStatusArguments instance) {
final val = <String, dynamic>{
'status': _$DriverStatusEnumMap[instance.status]!,
};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('fcmId', instance.fcmId);
return val;
}
UpdateDriverFCMIdArguments _$UpdateDriverFCMIdArgumentsFromJson(
Map<String, dynamic> json) =>
UpdateDriverFCMIdArguments(
fcmId: json['fcmId'] as String?,
);
Map<String, dynamic> _$UpdateDriverFCMIdArgumentsToJson(
UpdateDriverFCMIdArguments instance) {
final val = <String, dynamic>{};
void writeNotNull(String key, dynamic value) {
if (value != null) {
val[key] = value;
}
}
writeNotNull('fcmId', instance.fcmId);
return val;
}
UpdateDriverSearchDistanceArguments
_$UpdateDriverSearchDistanceArgumentsFromJson(Map<String, dynamic> json) =>
UpdateDriverSearchDistanceArguments(
distance: json['distance'] as int,
);
Map<String, dynamic> _$UpdateDriverSearchDistanceArgumentsToJson(
UpdateDriverSearchDistanceArguments instance) =>
<String, dynamic>{
'distance': instance.distance,
};
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib/graphql | mirrored_repositories/RideFlutter/driver-app/lib/graphql/generated/graphql_api.graphql.dart | // GENERATED CODE - DO NOT MODIFY BY HAND
// @dart = 2.12
import 'package:artemis/artemis.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:equatable/equatable.dart';
import 'package:gql/ast.dart';
import '../scalars/timestamp.dart';
import '../scalars/datetime.dart';
import '../scalars/connection_cursor.dart';
part 'graphql_api.graphql.g.dart';
mixin ChatRiderMixin {
late String id;
String? firstName;
String? lastName;
ChatRiderMixin$Media? media;
}
mixin ChatDriverMixin {
late String id;
String? firstName;
String? lastName;
ChatDriverMixin$Media? media;
}
mixin ChatMessageMixin {
late String id;
late String content;
late bool sentByDriver;
}
mixin HistoryOrderItemMixin {
late List<HistoryOrderItemMixin$OrderEdge> edges;
late HistoryOrderItemMixin$PageInfo pageInfo;
}
mixin PointMixin {
late double lat;
late double lng;
}
mixin BasicProfileMixin {
late String mobileNumber;
String? firstName;
String? lastName;
int? searchDistance;
BasicProfileMixin$Media? media;
String? softRejectionNote;
@JsonKey(unknownEnumValue: DriverStatus.artemisUnknown)
late DriverStatus status;
late List<BasicProfileMixin$Order> currentOrders;
late List<BasicProfileMixin$DriverWallet> wallets;
late bool isWalletHidden;
}
mixin CurrentOrderMixin {
late String id;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime createdOn;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime expectedTimestamp;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
late String currency;
late double costBest;
late double costAfterCoupon;
late double paidAmount;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? etaPickup;
late double tipAmount;
List<CurrentOrderMixin$Point>? directions;
late List<CurrentOrderMixin$Point> points;
late CurrentOrderMixin$Service service;
late List<CurrentOrderMixin$ServiceOption> options;
late List<String> addresses;
late CurrentOrderMixin$Rider rider;
}
mixin AvailableOrderMixin {
late String id;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
late String currency;
late double costBest;
late List<String> addresses;
late int distanceBest;
late int durationBest;
List<AvailableOrderMixin$Point>? directions;
late List<AvailableOrderMixin$ServiceOption> options;
late AvailableOrderMixin$Service service;
late List<AvailableOrderMixin$Point> points;
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Driver$Order$Rider extends JsonSerializable
with EquatableMixin, ChatRiderMixin {
GetMessages$Query$Driver$Order$Rider();
factory GetMessages$Query$Driver$Order$Rider.fromJson(
Map<String, dynamic> json) =>
_$GetMessages$Query$Driver$Order$RiderFromJson(json);
late String mobileNumber;
@override
List<Object?> get props => [id, firstName, lastName, media, mobileNumber];
@override
Map<String, dynamic> toJson() =>
_$GetMessages$Query$Driver$Order$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Driver$Order$Driver extends JsonSerializable
with EquatableMixin, ChatDriverMixin {
GetMessages$Query$Driver$Order$Driver();
factory GetMessages$Query$Driver$Order$Driver.fromJson(
Map<String, dynamic> json) =>
_$GetMessages$Query$Driver$Order$DriverFromJson(json);
@override
List<Object?> get props => [id, firstName, lastName, media];
@override
Map<String, dynamic> toJson() =>
_$GetMessages$Query$Driver$Order$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Driver$Order$OrderMessage extends JsonSerializable
with EquatableMixin, ChatMessageMixin {
GetMessages$Query$Driver$Order$OrderMessage();
factory GetMessages$Query$Driver$Order$OrderMessage.fromJson(
Map<String, dynamic> json) =>
_$GetMessages$Query$Driver$Order$OrderMessageFromJson(json);
@override
List<Object?> get props => [id, content, sentByDriver];
@override
Map<String, dynamic> toJson() =>
_$GetMessages$Query$Driver$Order$OrderMessageToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Driver$Order extends JsonSerializable
with EquatableMixin {
GetMessages$Query$Driver$Order();
factory GetMessages$Query$Driver$Order.fromJson(Map<String, dynamic> json) =>
_$GetMessages$Query$Driver$OrderFromJson(json);
late String id;
late GetMessages$Query$Driver$Order$Rider rider;
late GetMessages$Query$Driver$Order$Driver driver;
late List<GetMessages$Query$Driver$Order$OrderMessage> conversations;
@override
List<Object?> get props => [id, rider, driver, conversations];
@override
Map<String, dynamic> toJson() => _$GetMessages$Query$Driver$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query$Driver extends JsonSerializable with EquatableMixin {
GetMessages$Query$Driver();
factory GetMessages$Query$Driver.fromJson(Map<String, dynamic> json) =>
_$GetMessages$Query$DriverFromJson(json);
late List<GetMessages$Query$Driver$Order> currentOrders;
@override
List<Object?> get props => [currentOrders];
@override
Map<String, dynamic> toJson() => _$GetMessages$Query$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetMessages$Query extends JsonSerializable with EquatableMixin {
GetMessages$Query();
factory GetMessages$Query.fromJson(Map<String, dynamic> json) =>
_$GetMessages$QueryFromJson(json);
GetMessages$Query$Driver? driver;
@override
List<Object?> get props => [driver];
@override
Map<String, dynamic> toJson() => _$GetMessages$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ChatRiderMixin$Media extends JsonSerializable with EquatableMixin {
ChatRiderMixin$Media();
factory ChatRiderMixin$Media.fromJson(Map<String, dynamic> json) =>
_$ChatRiderMixin$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$ChatRiderMixin$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class ChatDriverMixin$Media extends JsonSerializable with EquatableMixin {
ChatDriverMixin$Media();
factory ChatDriverMixin$Media.fromJson(Map<String, dynamic> json) =>
_$ChatDriverMixin$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$ChatDriverMixin$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SendMessage$Mutation$OrderMessage extends JsonSerializable
with EquatableMixin, ChatMessageMixin {
SendMessage$Mutation$OrderMessage();
factory SendMessage$Mutation$OrderMessage.fromJson(
Map<String, dynamic> json) =>
_$SendMessage$Mutation$OrderMessageFromJson(json);
@override
List<Object?> get props => [id, content, sentByDriver];
@override
Map<String, dynamic> toJson() =>
_$SendMessage$Mutation$OrderMessageToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SendMessage$Mutation extends JsonSerializable with EquatableMixin {
SendMessage$Mutation();
factory SendMessage$Mutation.fromJson(Map<String, dynamic> json) =>
_$SendMessage$MutationFromJson(json);
late SendMessage$Mutation$OrderMessage createOneOrderMessage;
@override
List<Object?> get props => [createOneOrderMessage];
@override
Map<String, dynamic> toJson() => _$SendMessage$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class NewMessageReceived$Subscription$OrderMessage extends JsonSerializable
with EquatableMixin, ChatMessageMixin {
NewMessageReceived$Subscription$OrderMessage();
factory NewMessageReceived$Subscription$OrderMessage.fromJson(
Map<String, dynamic> json) =>
_$NewMessageReceived$Subscription$OrderMessageFromJson(json);
@override
List<Object?> get props => [id, content, sentByDriver];
@override
Map<String, dynamic> toJson() =>
_$NewMessageReceived$Subscription$OrderMessageToJson(this);
}
@JsonSerializable(explicitToJson: true)
class NewMessageReceived$Subscription extends JsonSerializable
with EquatableMixin {
NewMessageReceived$Subscription();
factory NewMessageReceived$Subscription.fromJson(Map<String, dynamic> json) =>
_$NewMessageReceived$SubscriptionFromJson(json);
late NewMessageReceived$Subscription$OrderMessage newMessageReceived;
@override
List<Object?> get props => [newMessageReceived];
@override
Map<String, dynamic> toJson() =>
_$NewMessageReceived$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class History$Query$OrderConnection extends JsonSerializable
with EquatableMixin, HistoryOrderItemMixin {
History$Query$OrderConnection();
factory History$Query$OrderConnection.fromJson(Map<String, dynamic> json) =>
_$History$Query$OrderConnectionFromJson(json);
@override
List<Object?> get props => [edges, pageInfo];
@override
Map<String, dynamic> toJson() => _$History$Query$OrderConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class History$Query extends JsonSerializable with EquatableMixin {
History$Query();
factory History$Query.fromJson(Map<String, dynamic> json) =>
_$History$QueryFromJson(json);
late History$Query$OrderConnection orders;
@override
List<Object?> get props => [orders];
@override
Map<String, dynamic> toJson() => _$History$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge$Order$Service extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$OrderEdge$Order$Service();
factory HistoryOrderItemMixin$OrderEdge$Order$Service.fromJson(
Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdge$Order$ServiceFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdge$Order$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge$Order extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$OrderEdge$Order();
factory HistoryOrderItemMixin$OrderEdge$Order.fromJson(
Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdge$OrderFromJson(json);
late String id;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime createdOn;
late String currency;
late double costAfterCoupon;
late double providerShare;
late HistoryOrderItemMixin$OrderEdge$Order$Service service;
@override
List<Object?> get props => [
id,
status,
createdOn,
currency,
costAfterCoupon,
providerShare,
service
];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdge$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$OrderEdge extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$OrderEdge();
factory HistoryOrderItemMixin$OrderEdge.fromJson(Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$OrderEdgeFromJson(json);
late HistoryOrderItemMixin$OrderEdge$Order node;
@override
List<Object?> get props => [node];
@override
Map<String, dynamic> toJson() =>
_$HistoryOrderItemMixin$OrderEdgeToJson(this);
}
@JsonSerializable(explicitToJson: true)
class HistoryOrderItemMixin$PageInfo extends JsonSerializable
with EquatableMixin {
HistoryOrderItemMixin$PageInfo();
factory HistoryOrderItemMixin$PageInfo.fromJson(Map<String, dynamic> json) =>
_$HistoryOrderItemMixin$PageInfoFromJson(json);
bool? hasNextPage;
@JsonKey(
fromJson: fromGraphQLConnectionCursorNullableToDartStringNullable,
toJson: fromDartStringNullableToGraphQLConnectionCursorNullable)
String? endCursor;
@JsonKey(
fromJson: fromGraphQLConnectionCursorNullableToDartStringNullable,
toJson: fromDartStringNullableToGraphQLConnectionCursorNullable)
String? startCursor;
bool? hasPreviousPage;
@override
List<Object?> get props =>
[hasNextPage, endCursor, startCursor, hasPreviousPage];
@override
Map<String, dynamic> toJson() => _$HistoryOrderItemMixin$PageInfoToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order$Point extends JsonSerializable
with EquatableMixin, PointMixin {
GetOrderDetails$Query$Order$Point();
factory GetOrderDetails$Query$Order$Point.fromJson(
Map<String, dynamic> json) =>
_$GetOrderDetails$Query$Order$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() =>
_$GetOrderDetails$Query$Order$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query$Order extends JsonSerializable with EquatableMixin {
GetOrderDetails$Query$Order();
factory GetOrderDetails$Query$Order.fromJson(Map<String, dynamic> json) =>
_$GetOrderDetails$Query$OrderFromJson(json);
late List<GetOrderDetails$Query$Order$Point> points;
late List<String> addresses;
late double costBest;
late String currency;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? startTimestamp;
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? finishTimestamp;
late int distanceBest;
late int durationBest;
double? paymentGatewayId;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime expectedTimestamp;
@override
List<Object?> get props => [
points,
addresses,
costBest,
currency,
startTimestamp,
finishTimestamp,
distanceBest,
durationBest,
paymentGatewayId,
expectedTimestamp
];
@override
Map<String, dynamic> toJson() => _$GetOrderDetails$Query$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetails$Query extends JsonSerializable with EquatableMixin {
GetOrderDetails$Query();
factory GetOrderDetails$Query.fromJson(Map<String, dynamic> json) =>
_$GetOrderDetails$QueryFromJson(json);
GetOrderDetails$Query$Order? order;
@override
List<Object?> get props => [order];
@override
Map<String, dynamic> toJson() => _$GetOrderDetails$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SubmitComplaint$Mutation$Complaint extends JsonSerializable
with EquatableMixin {
SubmitComplaint$Mutation$Complaint();
factory SubmitComplaint$Mutation$Complaint.fromJson(
Map<String, dynamic> json) =>
_$SubmitComplaint$Mutation$ComplaintFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$SubmitComplaint$Mutation$ComplaintToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SubmitComplaint$Mutation extends JsonSerializable with EquatableMixin {
SubmitComplaint$Mutation();
factory SubmitComplaint$Mutation.fromJson(Map<String, dynamic> json) =>
_$SubmitComplaint$MutationFromJson(json);
late SubmitComplaint$Mutation$Complaint createOneComplaint;
@override
List<Object?> get props => [createOneComplaint];
@override
Map<String, dynamic> toJson() => _$SubmitComplaint$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Announcements$Query$Announcement extends JsonSerializable
with EquatableMixin {
Announcements$Query$Announcement();
factory Announcements$Query$Announcement.fromJson(
Map<String, dynamic> json) =>
_$Announcements$Query$AnnouncementFromJson(json);
late String title;
late String description;
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime startAt;
String? url;
@override
List<Object?> get props => [title, description, startAt, url];
@override
Map<String, dynamic> toJson() =>
_$Announcements$Query$AnnouncementToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Announcements$Query extends JsonSerializable with EquatableMixin {
Announcements$Query();
factory Announcements$Query.fromJson(Map<String, dynamic> json) =>
_$Announcements$QueryFromJson(json);
late List<Announcements$Query$Announcement> announcements;
@override
List<Object?> get props => [announcements];
@override
Map<String, dynamic> toJson() => _$Announcements$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateProfile$Mutation$Driver extends JsonSerializable
with EquatableMixin {
UpdateProfile$Mutation$Driver();
factory UpdateProfile$Mutation$Driver.fromJson(Map<String, dynamic> json) =>
_$UpdateProfile$Mutation$DriverFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$UpdateProfile$Mutation$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateProfile$Mutation extends JsonSerializable with EquatableMixin {
UpdateProfile$Mutation();
factory UpdateProfile$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateProfile$MutationFromJson(json);
late UpdateProfile$Mutation$Driver updateOneDriver;
@override
List<Object?> get props => [updateOneDriver];
@override
Map<String, dynamic> toJson() => _$UpdateProfile$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverInput extends JsonSerializable with EquatableMixin {
UpdateDriverInput({
this.carProductionYear,
this.carModelId,
this.carId,
this.carColorId,
this.searchDistance,
this.firstName,
this.lastName,
this.status,
this.certificateNumber,
this.email,
this.carPlate,
this.mediaId,
this.gender,
this.accountNumber,
this.bankName,
this.bankRoutingNumber,
this.bankSwift,
this.address,
this.notificationPlayerId,
});
factory UpdateDriverInput.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverInputFromJson(json);
int? carProductionYear;
String? carModelId;
String? carId;
String? carColorId;
int? searchDistance;
String? firstName;
String? lastName;
@JsonKey(unknownEnumValue: DriverStatus.artemisUnknown)
DriverStatus? status;
String? certificateNumber;
String? email;
String? carPlate;
double? mediaId;
@JsonKey(unknownEnumValue: Gender.artemisUnknown)
Gender? gender;
String? accountNumber;
String? bankName;
String? bankRoutingNumber;
String? bankSwift;
String? address;
String? notificationPlayerId;
@override
List<Object?> get props => [
carProductionYear,
carModelId,
carId,
carColorId,
searchDistance,
firstName,
lastName,
status,
certificateNumber,
email,
carPlate,
mediaId,
gender,
accountNumber,
bankName,
bankRoutingNumber,
bankSwift,
address,
notificationPlayerId
];
@override
Map<String, dynamic> toJson() => _$UpdateDriverInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriver$Query$Driver$Media extends JsonSerializable
with EquatableMixin {
GetDriver$Query$Driver$Media();
factory GetDriver$Query$Driver$Media.fromJson(Map<String, dynamic> json) =>
_$GetDriver$Query$Driver$MediaFromJson(json);
late String id;
late String address;
@override
List<Object?> get props => [id, address];
@override
Map<String, dynamic> toJson() => _$GetDriver$Query$Driver$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriver$Query$Driver extends JsonSerializable with EquatableMixin {
GetDriver$Query$Driver();
factory GetDriver$Query$Driver.fromJson(Map<String, dynamic> json) =>
_$GetDriver$Query$DriverFromJson(json);
late String id;
@JsonKey(unknownEnumValue: DriverStatus.artemisUnknown)
late DriverStatus status;
String? firstName;
String? lastName;
@JsonKey(unknownEnumValue: Gender.artemisUnknown)
Gender? gender;
String? email;
late String mobileNumber;
String? accountNumber;
String? bankName;
String? bankRoutingNumber;
String? address;
late List<GetDriver$Query$Driver$Media> documents;
String? bankSwift;
GetDriver$Query$Driver$Media? media;
String? carPlate;
int? carProductionYear;
String? certificateNumber;
String? carColorId;
String? carId;
@override
List<Object?> get props => [
id,
status,
firstName,
lastName,
gender,
email,
mobileNumber,
accountNumber,
bankName,
bankRoutingNumber,
address,
documents,
bankSwift,
media,
carPlate,
carProductionYear,
certificateNumber,
carColorId,
carId
];
@override
Map<String, dynamic> toJson() => _$GetDriver$Query$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriver$Query$CarModel extends JsonSerializable with EquatableMixin {
GetDriver$Query$CarModel();
factory GetDriver$Query$CarModel.fromJson(Map<String, dynamic> json) =>
_$GetDriver$Query$CarModelFromJson(json);
late String id;
late String name;
@override
List<Object?> get props => [id, name];
@override
Map<String, dynamic> toJson() => _$GetDriver$Query$CarModelToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriver$Query$CarColor extends JsonSerializable with EquatableMixin {
GetDriver$Query$CarColor();
factory GetDriver$Query$CarColor.fromJson(Map<String, dynamic> json) =>
_$GetDriver$Query$CarColorFromJson(json);
late String id;
late String name;
@override
List<Object?> get props => [id, name];
@override
Map<String, dynamic> toJson() => _$GetDriver$Query$CarColorToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetDriver$Query extends JsonSerializable with EquatableMixin {
GetDriver$Query();
factory GetDriver$Query.fromJson(Map<String, dynamic> json) =>
_$GetDriver$QueryFromJson(json);
GetDriver$Query$Driver? driver;
late List<GetDriver$Query$CarModel> carModels;
late List<GetDriver$Query$CarColor> carColors;
@override
List<Object?> get props => [driver, carModels, carColors];
@override
Map<String, dynamic> toJson() => _$GetDriver$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Login$Mutation$Login extends JsonSerializable with EquatableMixin {
Login$Mutation$Login();
factory Login$Mutation$Login.fromJson(Map<String, dynamic> json) =>
_$Login$Mutation$LoginFromJson(json);
late String jwtToken;
@override
List<Object?> get props => [jwtToken];
@override
Map<String, dynamic> toJson() => _$Login$Mutation$LoginToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Login$Mutation extends JsonSerializable with EquatableMixin {
Login$Mutation();
factory Login$Mutation.fromJson(Map<String, dynamic> json) =>
_$Login$MutationFromJson(json);
late Login$Mutation$Login login;
@override
List<Object?> get props => [login];
@override
Map<String, dynamic> toJson() => _$Login$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SetDocumentsOnDriver$Mutation$Driver extends JsonSerializable
with EquatableMixin, BasicProfileMixin {
SetDocumentsOnDriver$Mutation$Driver();
factory SetDocumentsOnDriver$Mutation$Driver.fromJson(
Map<String, dynamic> json) =>
_$SetDocumentsOnDriver$Mutation$DriverFromJson(json);
@override
List<Object?> get props => [
mobileNumber,
firstName,
lastName,
searchDistance,
media,
softRejectionNote,
status,
currentOrders,
wallets,
isWalletHidden
];
@override
Map<String, dynamic> toJson() =>
_$SetDocumentsOnDriver$Mutation$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class SetDocumentsOnDriver$Mutation extends JsonSerializable
with EquatableMixin {
SetDocumentsOnDriver$Mutation();
factory SetDocumentsOnDriver$Mutation.fromJson(Map<String, dynamic> json) =>
_$SetDocumentsOnDriver$MutationFromJson(json);
late SetDocumentsOnDriver$Mutation$Driver updateOneDriver;
late SetDocumentsOnDriver$Mutation$Driver setDocumentsOnDriver;
@override
List<Object?> get props => [updateOneDriver, setDocumentsOnDriver];
@override
Map<String, dynamic> toJson() => _$SetDocumentsOnDriver$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class BasicProfileMixin$Media extends JsonSerializable with EquatableMixin {
BasicProfileMixin$Media();
factory BasicProfileMixin$Media.fromJson(Map<String, dynamic> json) =>
_$BasicProfileMixin$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$BasicProfileMixin$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class BasicProfileMixin$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
BasicProfileMixin$Order();
factory BasicProfileMixin$Order.fromJson(Map<String, dynamic> json) =>
_$BasicProfileMixin$OrderFromJson(json);
@override
List<Object?> get props => [
id,
createdOn,
expectedTimestamp,
status,
currency,
costBest,
costAfterCoupon,
paidAmount,
etaPickup,
tipAmount,
directions,
points,
service,
options,
addresses,
rider
];
@override
Map<String, dynamic> toJson() => _$BasicProfileMixin$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class BasicProfileMixin$DriverWallet extends JsonSerializable
with EquatableMixin {
BasicProfileMixin$DriverWallet();
factory BasicProfileMixin$DriverWallet.fromJson(Map<String, dynamic> json) =>
_$BasicProfileMixin$DriverWalletFromJson(json);
late double balance;
late String currency;
@override
List<Object?> get props => [balance, currency];
@override
Map<String, dynamic> toJson() => _$BasicProfileMixin$DriverWalletToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Point extends JsonSerializable
with EquatableMixin, PointMixin {
CurrentOrderMixin$Point();
factory CurrentOrderMixin$Point.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Service extends JsonSerializable with EquatableMixin {
CurrentOrderMixin$Service();
factory CurrentOrderMixin$Service.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$ServiceFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$ServiceOption extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$ServiceOption();
factory CurrentOrderMixin$ServiceOption.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$ServiceOptionFromJson(json);
late String id;
late String name;
@JsonKey(unknownEnumValue: ServiceOptionIcon.artemisUnknown)
late ServiceOptionIcon icon;
@override
List<Object?> get props => [id, name, icon];
@override
Map<String, dynamic> toJson() =>
_$CurrentOrderMixin$ServiceOptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Rider$Media extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$Rider$Media();
factory CurrentOrderMixin$Rider$Media.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$Rider$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$Rider$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Rider$RiderWallet extends JsonSerializable
with EquatableMixin {
CurrentOrderMixin$Rider$RiderWallet();
factory CurrentOrderMixin$Rider$RiderWallet.fromJson(
Map<String, dynamic> json) =>
_$CurrentOrderMixin$Rider$RiderWalletFromJson(json);
late String currency;
late double balance;
@override
List<Object?> get props => [currency, balance];
@override
Map<String, dynamic> toJson() =>
_$CurrentOrderMixin$Rider$RiderWalletToJson(this);
}
@JsonSerializable(explicitToJson: true)
class CurrentOrderMixin$Rider extends JsonSerializable with EquatableMixin {
CurrentOrderMixin$Rider();
factory CurrentOrderMixin$Rider.fromJson(Map<String, dynamic> json) =>
_$CurrentOrderMixin$RiderFromJson(json);
late String mobileNumber;
String? firstName;
String? lastName;
CurrentOrderMixin$Rider$Media? media;
late List<CurrentOrderMixin$Rider$RiderWallet> wallets;
@override
List<Object?> get props =>
[mobileNumber, firstName, lastName, media, wallets];
@override
Map<String, dynamic> toJson() => _$CurrentOrderMixin$RiderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DeleteUser$Mutation$Driver extends JsonSerializable with EquatableMixin {
DeleteUser$Mutation$Driver();
factory DeleteUser$Mutation$Driver.fromJson(Map<String, dynamic> json) =>
_$DeleteUser$Mutation$DriverFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$DeleteUser$Mutation$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class DeleteUser$Mutation extends JsonSerializable with EquatableMixin {
DeleteUser$Mutation();
factory DeleteUser$Mutation.fromJson(Map<String, dynamic> json) =>
_$DeleteUser$MutationFromJson(json);
late DeleteUser$Mutation$Driver deleteUser;
@override
List<Object?> get props => [deleteUser];
@override
Map<String, dynamic> toJson() => _$DeleteUser$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$Media extends JsonSerializable
with EquatableMixin {
GetProfile$Query$Driver$Media();
factory GetProfile$Query$Driver$Media.fromJson(Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$MediaFromJson(json);
late String id;
late String address;
@override
List<Object?> get props => [id, address];
@override
Map<String, dynamic> toJson() => _$GetProfile$Query$Driver$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$Service extends JsonSerializable
with EquatableMixin {
GetProfile$Query$Driver$Service();
factory GetProfile$Query$Driver$Service.fromJson(Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$ServiceFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$GetProfile$Query$Driver$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$CarColor extends JsonSerializable
with EquatableMixin {
GetProfile$Query$Driver$CarColor();
factory GetProfile$Query$Driver$CarColor.fromJson(
Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$CarColorFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$GetProfile$Query$Driver$CarColorToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$CarModel extends JsonSerializable
with EquatableMixin {
GetProfile$Query$Driver$CarModel();
factory GetProfile$Query$Driver$CarModel.fromJson(
Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$CarModelFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() =>
_$GetProfile$Query$Driver$CarModelToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate
extends JsonSerializable with EquatableMixin {
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate();
factory GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate.fromJson(
Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregateFromJson(
json);
double? distanceBest;
@override
List<Object?> get props => [distanceBest];
@override
Map<String, dynamic> toJson() =>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregateToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate
extends JsonSerializable with EquatableMixin {
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate();
factory GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate.fromJson(
Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregateFromJson(
json);
int? id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregateToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse
extends JsonSerializable with EquatableMixin {
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse();
factory GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse.fromJson(
Map<String, dynamic> json) =>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponseFromJson(
json);
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersSumAggregate?
sum;
GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse$DriverHistoryOrdersCountAggregate?
count;
@override
List<Object?> get props => [sum, count];
@override
Map<String, dynamic> toJson() =>
_$GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponseToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query$Driver extends JsonSerializable with EquatableMixin {
GetProfile$Query$Driver();
factory GetProfile$Query$Driver.fromJson(Map<String, dynamic> json) =>
_$GetProfile$Query$DriverFromJson(json);
late String id;
String? firstName;
String? lastName;
late String mobileNumber;
String? accountNumber;
String? bankName;
String? address;
double? rating;
late List<GetProfile$Query$Driver$Media> documents;
String? bankSwift;
GetProfile$Query$Driver$Media? media;
String? carPlate;
late List<GetProfile$Query$Driver$Service> enabledServices;
GetProfile$Query$Driver$CarColor? carColor;
GetProfile$Query$Driver$CarModel? car;
late List<GetProfile$Query$Driver$DriverHistoryOrdersAggregateResponse>
historyOrdersAggregate;
@override
List<Object?> get props => [
id,
firstName,
lastName,
mobileNumber,
accountNumber,
bankName,
address,
rating,
documents,
bankSwift,
media,
carPlate,
enabledServices,
carColor,
car,
historyOrdersAggregate
];
@override
Map<String, dynamic> toJson() => _$GetProfile$Query$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetProfile$Query extends JsonSerializable with EquatableMixin {
GetProfile$Query();
factory GetProfile$Query.fromJson(Map<String, dynamic> json) =>
_$GetProfile$QueryFromJson(json);
GetProfile$Query$Driver? driver;
@override
List<Object?> get props => [driver];
@override
Map<String, dynamic> toJson() => _$GetProfile$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$StatisticsResult$Datapoint extends JsonSerializable
with EquatableMixin {
GetStats$Query$StatisticsResult$Datapoint();
factory GetStats$Query$StatisticsResult$Datapoint.fromJson(
Map<String, dynamic> json) =>
_$GetStats$Query$StatisticsResult$DatapointFromJson(json);
late double count;
late String current;
late double distance;
late double earning;
late String name;
late double time;
@override
List<Object?> get props => [count, current, distance, earning, name, time];
@override
Map<String, dynamic> toJson() =>
_$GetStats$Query$StatisticsResult$DatapointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$StatisticsResult extends JsonSerializable
with EquatableMixin {
GetStats$Query$StatisticsResult();
factory GetStats$Query$StatisticsResult.fromJson(Map<String, dynamic> json) =>
_$GetStats$Query$StatisticsResultFromJson(json);
late String currency;
late List<GetStats$Query$StatisticsResult$Datapoint> dataset;
@override
List<Object?> get props => [currency, dataset];
@override
Map<String, dynamic> toJson() =>
_$GetStats$Query$StatisticsResultToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$OrderConnection extends JsonSerializable
with EquatableMixin, HistoryOrderItemMixin {
GetStats$Query$OrderConnection();
factory GetStats$Query$OrderConnection.fromJson(Map<String, dynamic> json) =>
_$GetStats$Query$OrderConnectionFromJson(json);
@override
List<Object?> get props => [edges, pageInfo];
@override
Map<String, dynamic> toJson() => _$GetStats$Query$OrderConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy
extends JsonSerializable with EquatableMixin {
GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy();
factory GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy.fromJson(
Map<String, dynamic> json) =>
_$GetStats$Query$OrderAggregateResponse$OrderAggregateGroupByFromJson(
json);
@JsonKey(
fromJson: fromGraphQLTimestampNullableToDartDateTimeNullable,
toJson: fromDartDateTimeNullableToGraphQLTimestampNullable)
DateTime? createdOn;
@override
List<Object?> get props => [createdOn];
@override
Map<String, dynamic> toJson() =>
_$GetStats$Query$OrderAggregateResponse$OrderAggregateGroupByToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$OrderAggregateResponse$OrderCountAggregate
extends JsonSerializable with EquatableMixin {
GetStats$Query$OrderAggregateResponse$OrderCountAggregate();
factory GetStats$Query$OrderAggregateResponse$OrderCountAggregate.fromJson(
Map<String, dynamic> json) =>
_$GetStats$Query$OrderAggregateResponse$OrderCountAggregateFromJson(json);
int? id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$GetStats$Query$OrderAggregateResponse$OrderCountAggregateToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$OrderAggregateResponse$OrderSumAggregate
extends JsonSerializable with EquatableMixin {
GetStats$Query$OrderAggregateResponse$OrderSumAggregate();
factory GetStats$Query$OrderAggregateResponse$OrderSumAggregate.fromJson(
Map<String, dynamic> json) =>
_$GetStats$Query$OrderAggregateResponse$OrderSumAggregateFromJson(json);
double? costBest;
@override
List<Object?> get props => [costBest];
@override
Map<String, dynamic> toJson() =>
_$GetStats$Query$OrderAggregateResponse$OrderSumAggregateToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query$OrderAggregateResponse extends JsonSerializable
with EquatableMixin {
GetStats$Query$OrderAggregateResponse();
factory GetStats$Query$OrderAggregateResponse.fromJson(
Map<String, dynamic> json) =>
_$GetStats$Query$OrderAggregateResponseFromJson(json);
GetStats$Query$OrderAggregateResponse$OrderAggregateGroupBy? groupBy;
GetStats$Query$OrderAggregateResponse$OrderCountAggregate? count;
GetStats$Query$OrderAggregateResponse$OrderSumAggregate? sum;
@override
List<Object?> get props => [groupBy, count, sum];
@override
Map<String, dynamic> toJson() =>
_$GetStats$Query$OrderAggregateResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class GetStats$Query extends JsonSerializable with EquatableMixin {
GetStats$Query();
factory GetStats$Query.fromJson(Map<String, dynamic> json) =>
_$GetStats$QueryFromJson(json);
late GetStats$Query$StatisticsResult getStatsNew;
late GetStats$Query$OrderConnection orders;
late List<GetStats$Query$OrderAggregateResponse> orderAggregate;
@override
List<Object?> get props => [getStatsNew, orders, orderAggregate];
@override
Map<String, dynamic> toJson() => _$GetStats$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$DriverWallet extends JsonSerializable with EquatableMixin {
Wallet$Query$DriverWallet();
factory Wallet$Query$DriverWallet.fromJson(Map<String, dynamic> json) =>
_$Wallet$Query$DriverWalletFromJson(json);
late String id;
late double balance;
late String currency;
@override
List<Object?> get props => [id, balance, currency];
@override
Map<String, dynamic> toJson() => _$Wallet$Query$DriverWalletToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion
extends JsonSerializable with EquatableMixin {
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion();
factory Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion.fromJson(
Map<String, dynamic> json) =>
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacionFromJson(
json);
@JsonKey(
fromJson: fromGraphQLTimestampToDartDateTime,
toJson: fromDartDateTimeToGraphQLTimestamp)
late DateTime createdAt;
late double amount;
late String currency;
String? refrenceNumber;
@JsonKey(unknownEnumValue: DriverDeductTransactionType.artemisUnknown)
DriverDeductTransactionType? deductType;
@JsonKey(unknownEnumValue: TransactionAction.artemisUnknown)
late TransactionAction action;
@JsonKey(unknownEnumValue: DriverRechargeTransactionType.artemisUnknown)
DriverRechargeTransactionType? rechargeType;
@override
List<Object?> get props => [
createdAt,
amount,
currency,
refrenceNumber,
deductType,
action,
rechargeType
];
@override
Map<String, dynamic> toJson() =>
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacionToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$DriverTransacionConnection$DriverTransacionEdge
extends JsonSerializable with EquatableMixin {
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge();
factory Wallet$Query$DriverTransacionConnection$DriverTransacionEdge.fromJson(
Map<String, dynamic> json) =>
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdgeFromJson(
json);
late Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion
node;
@override
List<Object?> get props => [node];
@override
Map<String, dynamic> toJson() =>
_$Wallet$Query$DriverTransacionConnection$DriverTransacionEdgeToJson(
this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query$DriverTransacionConnection extends JsonSerializable
with EquatableMixin {
Wallet$Query$DriverTransacionConnection();
factory Wallet$Query$DriverTransacionConnection.fromJson(
Map<String, dynamic> json) =>
_$Wallet$Query$DriverTransacionConnectionFromJson(json);
late List<Wallet$Query$DriverTransacionConnection$DriverTransacionEdge> edges;
@override
List<Object?> get props => [edges];
@override
Map<String, dynamic> toJson() =>
_$Wallet$Query$DriverTransacionConnectionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Wallet$Query extends JsonSerializable with EquatableMixin {
Wallet$Query();
factory Wallet$Query.fromJson(Map<String, dynamic> json) =>
_$Wallet$QueryFromJson(json);
late List<Wallet$Query$DriverWallet> driverWallets;
late Wallet$Query$DriverTransacionConnection driverTransacions;
@override
List<Object?> get props => [driverWallets, driverTransacions];
@override
Map<String, dynamic> toJson() => _$Wallet$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PaymentGateways$Query$PaymentGateway$Media extends JsonSerializable
with EquatableMixin {
PaymentGateways$Query$PaymentGateway$Media();
factory PaymentGateways$Query$PaymentGateway$Media.fromJson(
Map<String, dynamic> json) =>
_$PaymentGateways$Query$PaymentGateway$MediaFromJson(json);
late String address;
@override
List<Object?> get props => [address];
@override
Map<String, dynamic> toJson() =>
_$PaymentGateways$Query$PaymentGateway$MediaToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PaymentGateways$Query$PaymentGateway extends JsonSerializable
with EquatableMixin {
PaymentGateways$Query$PaymentGateway();
factory PaymentGateways$Query$PaymentGateway.fromJson(
Map<String, dynamic> json) =>
_$PaymentGateways$Query$PaymentGatewayFromJson(json);
late String id;
late String title;
@JsonKey(unknownEnumValue: PaymentGatewayType.artemisUnknown)
late PaymentGatewayType type;
String? publicKey;
PaymentGateways$Query$PaymentGateway$Media? media;
@override
List<Object?> get props => [id, title, type, publicKey, media];
@override
Map<String, dynamic> toJson() =>
_$PaymentGateways$Query$PaymentGatewayToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PaymentGateways$Query extends JsonSerializable with EquatableMixin {
PaymentGateways$Query();
factory PaymentGateways$Query.fromJson(Map<String, dynamic> json) =>
_$PaymentGateways$QueryFromJson(json);
late List<PaymentGateways$Query$PaymentGateway> paymentGateways;
@override
List<Object?> get props => [paymentGateways];
@override
Map<String, dynamic> toJson() => _$PaymentGateways$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TopUpWallet$Mutation$TopUpWalletResponse extends JsonSerializable
with EquatableMixin {
TopUpWallet$Mutation$TopUpWalletResponse();
factory TopUpWallet$Mutation$TopUpWalletResponse.fromJson(
Map<String, dynamic> json) =>
_$TopUpWallet$Mutation$TopUpWalletResponseFromJson(json);
@JsonKey(unknownEnumValue: TopUpWalletStatus.artemisUnknown)
late TopUpWalletStatus status;
late String url;
@override
List<Object?> get props => [status, url];
@override
Map<String, dynamic> toJson() =>
_$TopUpWallet$Mutation$TopUpWalletResponseToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TopUpWallet$Mutation extends JsonSerializable with EquatableMixin {
TopUpWallet$Mutation();
factory TopUpWallet$Mutation.fromJson(Map<String, dynamic> json) =>
_$TopUpWallet$MutationFromJson(json);
late TopUpWallet$Mutation$TopUpWalletResponse topUpWallet;
@override
List<Object?> get props => [topUpWallet];
@override
Map<String, dynamic> toJson() => _$TopUpWallet$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class TopUpWalletInput extends JsonSerializable with EquatableMixin {
TopUpWalletInput({
required this.gatewayId,
required this.amount,
required this.currency,
this.token,
this.pin,
this.otp,
this.transactionId,
});
factory TopUpWalletInput.fromJson(Map<String, dynamic> json) =>
_$TopUpWalletInputFromJson(json);
late String gatewayId;
late double amount;
late String currency;
String? token;
double? pin;
double? otp;
String? transactionId;
@override
List<Object?> get props =>
[gatewayId, amount, currency, token, pin, otp, transactionId];
@override
Map<String, dynamic> toJson() => _$TopUpWalletInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Me$Query$Driver extends JsonSerializable
with EquatableMixin, BasicProfileMixin {
Me$Query$Driver();
factory Me$Query$Driver.fromJson(Map<String, dynamic> json) =>
_$Me$Query$DriverFromJson(json);
@override
List<Object?> get props => [
mobileNumber,
firstName,
lastName,
searchDistance,
media,
softRejectionNote,
status,
currentOrders,
wallets,
isWalletHidden
];
@override
Map<String, dynamic> toJson() => _$Me$Query$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class Me$Query extends JsonSerializable with EquatableMixin {
Me$Query();
factory Me$Query.fromJson(Map<String, dynamic> json) =>
_$Me$QueryFromJson(json);
Me$Query$Driver? driver;
@JsonKey(unknownEnumValue: VersionStatus.artemisUnknown)
late VersionStatus requireUpdate;
@override
List<Object?> get props => [driver, requireUpdate];
@override
Map<String, dynamic> toJson() => _$Me$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class AvailableOrders$Query$Order extends JsonSerializable
with EquatableMixin, AvailableOrderMixin {
AvailableOrders$Query$Order();
factory AvailableOrders$Query$Order.fromJson(Map<String, dynamic> json) =>
_$AvailableOrders$Query$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
currency,
costBest,
addresses,
distanceBest,
durationBest,
directions,
options,
service,
points
];
@override
Map<String, dynamic> toJson() => _$AvailableOrders$Query$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class AvailableOrders$Query extends JsonSerializable with EquatableMixin {
AvailableOrders$Query();
factory AvailableOrders$Query.fromJson(Map<String, dynamic> json) =>
_$AvailableOrders$QueryFromJson(json);
late List<AvailableOrders$Query$Order> availableOrders;
@override
List<Object?> get props => [availableOrders];
@override
Map<String, dynamic> toJson() => _$AvailableOrders$QueryToJson(this);
}
@JsonSerializable(explicitToJson: true)
class AvailableOrderMixin$Point extends JsonSerializable
with EquatableMixin, PointMixin {
AvailableOrderMixin$Point();
factory AvailableOrderMixin$Point.fromJson(Map<String, dynamic> json) =>
_$AvailableOrderMixin$PointFromJson(json);
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$AvailableOrderMixin$PointToJson(this);
}
@JsonSerializable(explicitToJson: true)
class AvailableOrderMixin$ServiceOption extends JsonSerializable
with EquatableMixin {
AvailableOrderMixin$ServiceOption();
factory AvailableOrderMixin$ServiceOption.fromJson(
Map<String, dynamic> json) =>
_$AvailableOrderMixin$ServiceOptionFromJson(json);
late String name;
@JsonKey(unknownEnumValue: ServiceOptionIcon.artemisUnknown)
late ServiceOptionIcon icon;
@override
List<Object?> get props => [name, icon];
@override
Map<String, dynamic> toJson() =>
_$AvailableOrderMixin$ServiceOptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class AvailableOrderMixin$Service extends JsonSerializable with EquatableMixin {
AvailableOrderMixin$Service();
factory AvailableOrderMixin$Service.fromJson(Map<String, dynamic> json) =>
_$AvailableOrderMixin$ServiceFromJson(json);
late String name;
@override
List<Object?> get props => [name];
@override
Map<String, dynamic> toJson() => _$AvailableOrderMixin$ServiceToJson(this);
}
@JsonSerializable(explicitToJson: true)
class OrderCreated$Subscription$Order extends JsonSerializable
with EquatableMixin, AvailableOrderMixin {
OrderCreated$Subscription$Order();
factory OrderCreated$Subscription$Order.fromJson(Map<String, dynamic> json) =>
_$OrderCreated$Subscription$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
currency,
costBest,
addresses,
distanceBest,
durationBest,
directions,
options,
service,
points
];
@override
Map<String, dynamic> toJson() =>
_$OrderCreated$Subscription$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class OrderCreated$Subscription extends JsonSerializable with EquatableMixin {
OrderCreated$Subscription();
factory OrderCreated$Subscription.fromJson(Map<String, dynamic> json) =>
_$OrderCreated$SubscriptionFromJson(json);
late OrderCreated$Subscription$Order orderCreated;
@override
List<Object?> get props => [orderCreated];
@override
Map<String, dynamic> toJson() => _$OrderCreated$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class OrderRemoved$Subscription$Order extends JsonSerializable
with EquatableMixin {
OrderRemoved$Subscription$Order();
factory OrderRemoved$Subscription$Order.fromJson(Map<String, dynamic> json) =>
_$OrderRemoved$Subscription$OrderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$OrderRemoved$Subscription$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class OrderRemoved$Subscription extends JsonSerializable with EquatableMixin {
OrderRemoved$Subscription();
factory OrderRemoved$Subscription.fromJson(Map<String, dynamic> json) =>
_$OrderRemoved$SubscriptionFromJson(json);
late OrderRemoved$Subscription$Order orderRemoved;
@override
List<Object?> get props => [orderRemoved];
@override
Map<String, dynamic> toJson() => _$OrderRemoved$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class OrderUpdated$Subscription$Order extends JsonSerializable
with EquatableMixin {
OrderUpdated$Subscription$Order();
factory OrderUpdated$Subscription$Order.fromJson(Map<String, dynamic> json) =>
_$OrderUpdated$Subscription$OrderFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$OrderUpdated$Subscription$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class OrderUpdated$Subscription extends JsonSerializable with EquatableMixin {
OrderUpdated$Subscription();
factory OrderUpdated$Subscription.fromJson(Map<String, dynamic> json) =>
_$OrderUpdated$SubscriptionFromJson(json);
late OrderUpdated$Subscription$Order orderUpdated;
@override
List<Object?> get props => [orderUpdated];
@override
Map<String, dynamic> toJson() => _$OrderUpdated$SubscriptionToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverLocation$Mutation$Order extends JsonSerializable
with EquatableMixin, AvailableOrderMixin {
UpdateDriverLocation$Mutation$Order();
factory UpdateDriverLocation$Mutation$Order.fromJson(
Map<String, dynamic> json) =>
_$UpdateDriverLocation$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
status,
currency,
costBest,
addresses,
distanceBest,
durationBest,
directions,
options,
service,
points
];
@override
Map<String, dynamic> toJson() =>
_$UpdateDriverLocation$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverLocation$Mutation extends JsonSerializable
with EquatableMixin {
UpdateDriverLocation$Mutation();
factory UpdateDriverLocation$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverLocation$MutationFromJson(json);
late List<UpdateDriverLocation$Mutation$Order> updateDriversLocationNew;
@override
List<Object?> get props => [updateDriversLocationNew];
@override
Map<String, dynamic> toJson() => _$UpdateDriverLocation$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class PointInput extends JsonSerializable with EquatableMixin {
PointInput({
required this.lat,
required this.lng,
});
factory PointInput.fromJson(Map<String, dynamic> json) =>
_$PointInputFromJson(json);
late double lat;
late double lng;
@override
List<Object?> get props => [lat, lng];
@override
Map<String, dynamic> toJson() => _$PointInputToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrderStatus$Mutation$Order extends JsonSerializable
with EquatableMixin, CurrentOrderMixin {
UpdateOrderStatus$Mutation$Order();
factory UpdateOrderStatus$Mutation$Order.fromJson(
Map<String, dynamic> json) =>
_$UpdateOrderStatus$Mutation$OrderFromJson(json);
@override
List<Object?> get props => [
id,
createdOn,
expectedTimestamp,
status,
currency,
costBest,
costAfterCoupon,
paidAmount,
etaPickup,
tipAmount,
directions,
points,
service,
options,
addresses,
rider
];
@override
Map<String, dynamic> toJson() =>
_$UpdateOrderStatus$Mutation$OrderToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrderStatus$Mutation extends JsonSerializable with EquatableMixin {
UpdateOrderStatus$Mutation();
factory UpdateOrderStatus$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateOrderStatus$MutationFromJson(json);
late UpdateOrderStatus$Mutation$Order updateOneOrder;
@override
List<Object?> get props => [updateOneOrder];
@override
Map<String, dynamic> toJson() => _$UpdateOrderStatus$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverStatus$Mutation$Driver extends JsonSerializable
with EquatableMixin, BasicProfileMixin {
UpdateDriverStatus$Mutation$Driver();
factory UpdateDriverStatus$Mutation$Driver.fromJson(
Map<String, dynamic> json) =>
_$UpdateDriverStatus$Mutation$DriverFromJson(json);
@override
List<Object?> get props => [
mobileNumber,
firstName,
lastName,
searchDistance,
media,
softRejectionNote,
status,
currentOrders,
wallets,
isWalletHidden
];
@override
Map<String, dynamic> toJson() =>
_$UpdateDriverStatus$Mutation$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverStatus$Mutation extends JsonSerializable with EquatableMixin {
UpdateDriverStatus$Mutation();
factory UpdateDriverStatus$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverStatus$MutationFromJson(json);
late UpdateDriverStatus$Mutation$Driver updateOneDriver;
@override
List<Object?> get props => [updateOneDriver];
@override
Map<String, dynamic> toJson() => _$UpdateDriverStatus$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverFCMId$Mutation$Driver extends JsonSerializable
with EquatableMixin {
UpdateDriverFCMId$Mutation$Driver();
factory UpdateDriverFCMId$Mutation$Driver.fromJson(
Map<String, dynamic> json) =>
_$UpdateDriverFCMId$Mutation$DriverFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$UpdateDriverFCMId$Mutation$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverFCMId$Mutation extends JsonSerializable with EquatableMixin {
UpdateDriverFCMId$Mutation();
factory UpdateDriverFCMId$Mutation.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverFCMId$MutationFromJson(json);
late UpdateDriverFCMId$Mutation$Driver updateOneDriver;
@override
List<Object?> get props => [updateOneDriver];
@override
Map<String, dynamic> toJson() => _$UpdateDriverFCMId$MutationToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverSearchDistance$Mutation$Driver extends JsonSerializable
with EquatableMixin {
UpdateDriverSearchDistance$Mutation$Driver();
factory UpdateDriverSearchDistance$Mutation$Driver.fromJson(
Map<String, dynamic> json) =>
_$UpdateDriverSearchDistance$Mutation$DriverFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() =>
_$UpdateDriverSearchDistance$Mutation$DriverToJson(this);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverSearchDistance$Mutation extends JsonSerializable
with EquatableMixin {
UpdateDriverSearchDistance$Mutation();
factory UpdateDriverSearchDistance$Mutation.fromJson(
Map<String, dynamic> json) =>
_$UpdateDriverSearchDistance$MutationFromJson(json);
late UpdateDriverSearchDistance$Mutation$Driver updateOneDriver;
@override
List<Object?> get props => [updateOneDriver];
@override
Map<String, dynamic> toJson() =>
_$UpdateDriverSearchDistance$MutationToJson(this);
}
enum OrderStatus {
@JsonValue('Requested')
requested,
@JsonValue('NotFound')
notFound,
@JsonValue('NoCloseFound')
noCloseFound,
@JsonValue('Found')
found,
@JsonValue('DriverAccepted')
driverAccepted,
@JsonValue('Arrived')
arrived,
@JsonValue('WaitingForPrePay')
waitingForPrePay,
@JsonValue('DriverCanceled')
driverCanceled,
@JsonValue('RiderCanceled')
riderCanceled,
@JsonValue('Started')
started,
@JsonValue('WaitingForPostPay')
waitingForPostPay,
@JsonValue('WaitingForReview')
waitingForReview,
@JsonValue('Finished')
finished,
@JsonValue('Booked')
booked,
@JsonValue('Expired')
expired,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum DriverStatus {
@JsonValue('Online')
online,
@JsonValue('Offline')
offline,
@JsonValue('Blocked')
blocked,
@JsonValue('InService')
inService,
@JsonValue('WaitingDocuments')
waitingDocuments,
@JsonValue('PendingApproval')
pendingApproval,
@JsonValue('SoftReject')
softReject,
@JsonValue('HardReject')
hardReject,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum Gender {
@JsonValue('Male')
male,
@JsonValue('Female')
female,
@JsonValue('Unknown')
unknown,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum ServiceOptionIcon {
@JsonValue('Pet')
pet,
@JsonValue('TwoWay')
twoWay,
@JsonValue('Luggage')
luggage,
@JsonValue('PackageDelivery')
packageDelivery,
@JsonValue('Shopping')
shopping,
@JsonValue('Custom1')
custom1,
@JsonValue('Custom2')
custom2,
@JsonValue('Custom3')
custom3,
@JsonValue('Custom4')
custom4,
@JsonValue('Custom5')
custom5,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum DriverDeductTransactionType {
@JsonValue('Withdraw')
withdraw,
@JsonValue('Commission')
commission,
@JsonValue('Correction')
correction,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum TransactionAction {
@JsonValue('Recharge')
recharge,
@JsonValue('Deduct')
deduct,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum DriverRechargeTransactionType {
@JsonValue('OrderFee')
orderFee,
@JsonValue('BankTransfer')
bankTransfer,
@JsonValue('InAppPayment')
inAppPayment,
@JsonValue('Gift')
gift,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum PaymentGatewayType {
@JsonValue('Stripe')
stripe,
@JsonValue('BrainTree')
brainTree,
@JsonValue('PayPal')
payPal,
@JsonValue('Paytm')
paytm,
@JsonValue('Razorpay')
razorpay,
@JsonValue('Paystack')
paystack,
@JsonValue('PayU')
payU,
@JsonValue('Instamojo')
instamojo,
@JsonValue('Flutterwave')
flutterwave,
@JsonValue('PayGate')
payGate,
@JsonValue('MIPS')
mips,
@JsonValue('MercadoPago')
mercadoPago,
@JsonValue('AmazonPaymentServices')
amazonPaymentServices,
@JsonValue('MyTMoney')
myTMoney,
@JsonValue('WayForPay')
wayForPay,
@JsonValue('MyFatoorah')
myFatoorah,
@JsonValue('SberBank')
sberBank,
@JsonValue('CustomLink')
customLink,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum TopUpWalletStatus {
@JsonValue('OK')
ok,
@JsonValue('Redirect')
redirect,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
enum VersionStatus {
@JsonValue('Latest')
latest,
@JsonValue('MandatoryUpdate')
mandatoryUpdate,
@JsonValue('OptionalUpdate')
optionalUpdate,
@JsonValue('ARTEMIS_UNKNOWN')
artemisUnknown,
}
final GET_MESSAGES_QUERY_DOCUMENT_OPERATION_NAME = 'GetMessages';
final GET_MESSAGES_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetMessages'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currentOrders'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatRider'),
directives: [],
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatDriver'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'conversations'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'sorting'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'field'),
value: EnumValueNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'direction'),
value: EnumValueNode(name: NameNode(value: 'DESC')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatMessage'),
directives: [],
)
]),
),
]),
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatRider'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Rider'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatDriver'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Driver'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatMessage'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderMessage'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'content'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'sentByDriver'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class GetMessagesQuery
extends GraphQLQuery<GetMessages$Query, JsonSerializable> {
GetMessagesQuery();
@override
final DocumentNode document = GET_MESSAGES_QUERY_DOCUMENT;
@override
final String operationName = GET_MESSAGES_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetMessages$Query parse(Map<String, dynamic> json) =>
GetMessages$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SendMessageArguments extends JsonSerializable with EquatableMixin {
SendMessageArguments({
required this.requestId,
required this.content,
});
@override
factory SendMessageArguments.fromJson(Map<String, dynamic> json) =>
_$SendMessageArgumentsFromJson(json);
late String requestId;
late String content;
@override
List<Object?> get props => [requestId, content];
@override
Map<String, dynamic> toJson() => _$SendMessageArgumentsToJson(this);
}
final SEND_MESSAGE_MUTATION_DOCUMENT_OPERATION_NAME = 'SendMessage';
final SEND_MESSAGE_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SendMessage'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'requestId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'content')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createOneOrderMessage'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'orderMessage'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'requestId'),
value: VariableNode(name: NameNode(value: 'requestId')),
),
ObjectFieldNode(
name: NameNode(value: 'content'),
value: VariableNode(name: NameNode(value: 'content')),
),
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatMessage'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatMessage'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderMessage'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'content'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'sentByDriver'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class SendMessageMutation
extends GraphQLQuery<SendMessage$Mutation, SendMessageArguments> {
SendMessageMutation({required this.variables});
@override
final DocumentNode document = SEND_MESSAGE_MUTATION_DOCUMENT;
@override
final String operationName = SEND_MESSAGE_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SendMessageArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SendMessage$Mutation parse(Map<String, dynamic> json) =>
SendMessage$Mutation.fromJson(json);
}
final NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME =
'NewMessageReceived';
final NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'NewMessageReceived'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'newMessageReceived'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'ChatMessage'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'ChatMessage'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderMessage'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'content'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'sentByDriver'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class NewMessageReceivedSubscription
extends GraphQLQuery<NewMessageReceived$Subscription, JsonSerializable> {
NewMessageReceivedSubscription();
@override
final DocumentNode document = NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
NEW_MESSAGE_RECEIVED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
NewMessageReceived$Subscription parse(Map<String, dynamic> json) =>
NewMessageReceived$Subscription.fromJson(json);
}
final HISTORY_QUERY_DOCUMENT_OPERATION_NAME = 'History';
final HISTORY_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'History'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orders'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'sorting'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'field'),
value: EnumValueNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'direction'),
value: EnumValueNode(name: NameNode(value: 'DESC')),
),
]),
),
ArgumentNode(
name: NameNode(value: 'paging'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'first'),
value: IntValueNode(value: '20'),
)
]),
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'historyOrderItem'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'historyOrderItem'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderConnection'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'providerShare'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
)
]),
),
FieldNode(
name: NameNode(value: 'pageInfo'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'hasNextPage'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'endCursor'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startCursor'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'hasPreviousPage'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]);
class HistoryQuery extends GraphQLQuery<History$Query, JsonSerializable> {
HistoryQuery();
@override
final DocumentNode document = HISTORY_QUERY_DOCUMENT;
@override
final String operationName = HISTORY_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
History$Query parse(Map<String, dynamic> json) =>
History$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class GetOrderDetailsArguments extends JsonSerializable with EquatableMixin {
GetOrderDetailsArguments({required this.id});
@override
factory GetOrderDetailsArguments.fromJson(Map<String, dynamic> json) =>
_$GetOrderDetailsArgumentsFromJson(json);
late String id;
@override
List<Object?> get props => [id];
@override
Map<String, dynamic> toJson() => _$GetOrderDetailsArgumentsToJson(this);
}
final GET_ORDER_DETAILS_QUERY_DOCUMENT_OPERATION_NAME = 'GetOrderDetails';
final GET_ORDER_DETAILS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetOrderDetails'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'order'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'id')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'finishTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'distanceBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paymentGatewayId'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class GetOrderDetailsQuery
extends GraphQLQuery<GetOrderDetails$Query, GetOrderDetailsArguments> {
GetOrderDetailsQuery({required this.variables});
@override
final DocumentNode document = GET_ORDER_DETAILS_QUERY_DOCUMENT;
@override
final String operationName = GET_ORDER_DETAILS_QUERY_DOCUMENT_OPERATION_NAME;
@override
final GetOrderDetailsArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
GetOrderDetails$Query parse(Map<String, dynamic> json) =>
GetOrderDetails$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SubmitComplaintArguments extends JsonSerializable with EquatableMixin {
SubmitComplaintArguments({
required this.id,
required this.subject,
required this.content,
});
@override
factory SubmitComplaintArguments.fromJson(Map<String, dynamic> json) =>
_$SubmitComplaintArgumentsFromJson(json);
late String id;
late String subject;
late String content;
@override
List<Object?> get props => [id, subject, content];
@override
Map<String, dynamic> toJson() => _$SubmitComplaintArgumentsToJson(this);
}
final SUBMIT_COMPLAINT_MUTATION_DOCUMENT_OPERATION_NAME = 'SubmitComplaint';
final SUBMIT_COMPLAINT_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SubmitComplaint'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'id')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'subject')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'content')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createOneComplaint'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'complaint'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'requestId'),
value: VariableNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'requestedByDriver'),
value: BooleanValueNode(value: false),
),
ObjectFieldNode(
name: NameNode(value: 'subject'),
value: VariableNode(name: NameNode(value: 'subject')),
),
ObjectFieldNode(
name: NameNode(value: 'content'),
value: VariableNode(name: NameNode(value: 'content')),
),
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class SubmitComplaintMutation
extends GraphQLQuery<SubmitComplaint$Mutation, SubmitComplaintArguments> {
SubmitComplaintMutation({required this.variables});
@override
final DocumentNode document = SUBMIT_COMPLAINT_MUTATION_DOCUMENT;
@override
final String operationName =
SUBMIT_COMPLAINT_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SubmitComplaintArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SubmitComplaint$Mutation parse(Map<String, dynamic> json) =>
SubmitComplaint$Mutation.fromJson(json);
}
final ANNOUNCEMENTS_QUERY_DOCUMENT_OPERATION_NAME = 'Announcements';
final ANNOUNCEMENTS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'Announcements'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'announcements'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'description'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startAt'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'url'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]);
class AnnouncementsQuery
extends GraphQLQuery<Announcements$Query, JsonSerializable> {
AnnouncementsQuery();
@override
final DocumentNode document = ANNOUNCEMENTS_QUERY_DOCUMENT;
@override
final String operationName = ANNOUNCEMENTS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
Announcements$Query parse(Map<String, dynamic> json) =>
Announcements$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateProfileArguments extends JsonSerializable with EquatableMixin {
UpdateProfileArguments({required this.input});
@override
factory UpdateProfileArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateProfileArgumentsFromJson(json);
late UpdateDriverInput input;
@override
List<Object?> get props => [input];
@override
Map<String, dynamic> toJson() => _$UpdateProfileArgumentsToJson(this);
}
final UPDATE_PROFILE_MUTATION_DOCUMENT_OPERATION_NAME = 'UpdateProfile';
final UPDATE_PROFILE_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateProfile'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'input')),
type: NamedTypeNode(
name: NameNode(value: 'UpdateDriverInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneDriver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: VariableNode(name: NameNode(value: 'input')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class UpdateProfileMutation
extends GraphQLQuery<UpdateProfile$Mutation, UpdateProfileArguments> {
UpdateProfileMutation({required this.variables});
@override
final DocumentNode document = UPDATE_PROFILE_MUTATION_DOCUMENT;
@override
final String operationName = UPDATE_PROFILE_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateProfileArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateProfile$Mutation parse(Map<String, dynamic> json) =>
UpdateProfile$Mutation.fromJson(json);
}
final GET_DRIVER_QUERY_DOCUMENT_OPERATION_NAME = 'GetDriver';
final GET_DRIVER_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetDriver'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'gender'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'email'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'accountNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'bankName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'bankRoutingNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'documents'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'bankSwift'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carProductionYear'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'certificateNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carColorId'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'carId'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'carModels'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'carColors'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
)
]);
class GetDriverQuery extends GraphQLQuery<GetDriver$Query, JsonSerializable> {
GetDriverQuery();
@override
final DocumentNode document = GET_DRIVER_QUERY_DOCUMENT;
@override
final String operationName = GET_DRIVER_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetDriver$Query parse(Map<String, dynamic> json) =>
GetDriver$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class LoginArguments extends JsonSerializable with EquatableMixin {
LoginArguments({required this.firebaseToken});
@override
factory LoginArguments.fromJson(Map<String, dynamic> json) =>
_$LoginArgumentsFromJson(json);
late String firebaseToken;
@override
List<Object?> get props => [firebaseToken];
@override
Map<String, dynamic> toJson() => _$LoginArgumentsToJson(this);
}
final LOGIN_MUTATION_DOCUMENT_OPERATION_NAME = 'Login';
final LOGIN_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'Login'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'firebaseToken')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'login'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'firebaseToken'),
value: VariableNode(name: NameNode(value: 'firebaseToken')),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'jwtToken'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class LoginMutation extends GraphQLQuery<Login$Mutation, LoginArguments> {
LoginMutation({required this.variables});
@override
final DocumentNode document = LOGIN_MUTATION_DOCUMENT;
@override
final String operationName = LOGIN_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final LoginArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
Login$Mutation parse(Map<String, dynamic> json) =>
Login$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class SetDocumentsOnDriverArguments extends JsonSerializable
with EquatableMixin {
SetDocumentsOnDriverArguments({
required this.driverId,
required this.relationIds,
});
@override
factory SetDocumentsOnDriverArguments.fromJson(Map<String, dynamic> json) =>
_$SetDocumentsOnDriverArgumentsFromJson(json);
late String driverId;
late List<String> relationIds;
@override
List<Object?> get props => [driverId, relationIds];
@override
Map<String, dynamic> toJson() => _$SetDocumentsOnDriverArgumentsToJson(this);
}
final SET_DOCUMENTS_ON_DRIVER_MUTATION_DOCUMENT_OPERATION_NAME =
'SetDocumentsOnDriver';
final SET_DOCUMENTS_ON_DRIVER_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'SetDocumentsOnDriver'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'driverId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'relationIds')),
type: ListTypeNode(
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneDriver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'driverId')),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value:
EnumValueNode(name: NameNode(value: 'PendingApproval')),
)
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'BasicProfile'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'setDocumentsOnDriver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'driverId')),
),
ObjectFieldNode(
name: NameNode(value: 'relationIds'),
value: VariableNode(name: NameNode(value: 'relationIds')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'BasicProfile'),
directives: [],
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'BasicProfile'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Driver'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'searchDistance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'softRejectionNote'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currentOrders'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'isWalletHidden'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'tipAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class SetDocumentsOnDriverMutation extends GraphQLQuery<
SetDocumentsOnDriver$Mutation, SetDocumentsOnDriverArguments> {
SetDocumentsOnDriverMutation({required this.variables});
@override
final DocumentNode document = SET_DOCUMENTS_ON_DRIVER_MUTATION_DOCUMENT;
@override
final String operationName =
SET_DOCUMENTS_ON_DRIVER_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final SetDocumentsOnDriverArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
SetDocumentsOnDriver$Mutation parse(Map<String, dynamic> json) =>
SetDocumentsOnDriver$Mutation.fromJson(json);
}
final DELETE_USER_MUTATION_DOCUMENT_OPERATION_NAME = 'DeleteUser';
final DELETE_USER_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'DeleteUser'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'deleteUser'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class DeleteUserMutation
extends GraphQLQuery<DeleteUser$Mutation, JsonSerializable> {
DeleteUserMutation();
@override
final DocumentNode document = DELETE_USER_MUTATION_DOCUMENT;
@override
final String operationName = DELETE_USER_MUTATION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
DeleteUser$Mutation parse(Map<String, dynamic> json) =>
DeleteUser$Mutation.fromJson(json);
}
final GET_PROFILE_QUERY_DOCUMENT_OPERATION_NAME = 'GetProfile';
final GET_PROFILE_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetProfile'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'accountNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'bankName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rating'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'documents'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'bankSwift'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'carPlate'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'enabledServices'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'carColor'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'car'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'historyOrdersAggregate'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'sum'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'distanceBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'count'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
]),
)
]),
)
]);
class GetProfileQuery extends GraphQLQuery<GetProfile$Query, JsonSerializable> {
GetProfileQuery();
@override
final DocumentNode document = GET_PROFILE_QUERY_DOCUMENT;
@override
final String operationName = GET_PROFILE_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
GetProfile$Query parse(Map<String, dynamic> json) =>
GetProfile$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class GetStatsArguments extends JsonSerializable with EquatableMixin {
GetStatsArguments({
required this.startDate,
required this.endDate,
});
@override
factory GetStatsArguments.fromJson(Map<String, dynamic> json) =>
_$GetStatsArgumentsFromJson(json);
@JsonKey(
fromJson: fromGraphQLDateTimeToDartDateTime,
toJson: fromDartDateTimeToGraphQLDateTime)
late DateTime startDate;
@JsonKey(
fromJson: fromGraphQLDateTimeToDartDateTime,
toJson: fromDartDateTimeToGraphQLDateTime)
late DateTime endDate;
@override
List<Object?> get props => [startDate, endDate];
@override
Map<String, dynamic> toJson() => _$GetStatsArgumentsToJson(this);
}
final GET_STATS_QUERY_DOCUMENT_OPERATION_NAME = 'GetStats';
final GET_STATS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'GetStats'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'startDate')),
type: NamedTypeNode(
name: NameNode(value: 'DateTime'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'endDate')),
type: NamedTypeNode(
name: NameNode(value: 'DateTime'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'getStatsNew'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'timeframe'),
value: EnumValueNode(name: NameNode(value: 'Daily')),
),
ArgumentNode(
name: NameNode(value: 'startDate'),
value: VariableNode(name: NameNode(value: 'startDate')),
),
ArgumentNode(
name: NameNode(value: 'endDate'),
value: VariableNode(name: NameNode(value: 'endDate')),
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'dataset'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'count'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'current'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'distance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'earning'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'time'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
FieldNode(
name: NameNode(value: 'orders'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'filter'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'in'),
value: ListValueNode(values: [
EnumValueNode(name: NameNode(value: 'Finished')),
EnumValueNode(name: NameNode(value: 'WaitingForReview')),
]),
)
]),
),
ObjectFieldNode(
name: NameNode(value: 'createdOn'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'between'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'lower'),
value: VariableNode(name: NameNode(value: 'startDate')),
),
ObjectFieldNode(
name: NameNode(value: 'upper'),
value: VariableNode(name: NameNode(value: 'endDate')),
),
]),
)
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'historyOrderItem'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'orderAggregate'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'filter'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'createdOn'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'between'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'lower'),
value: VariableNode(name: NameNode(value: 'startDate')),
),
ObjectFieldNode(
name: NameNode(value: 'upper'),
value: VariableNode(name: NameNode(value: 'endDate')),
),
]),
)
]),
)
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'groupBy'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'count'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'sum'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'historyOrderItem'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'OrderConnection'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'providerShare'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
)
]),
),
FieldNode(
name: NameNode(value: 'pageInfo'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'hasNextPage'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'endCursor'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'startCursor'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'hasPreviousPage'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]);
class GetStatsQuery extends GraphQLQuery<GetStats$Query, GetStatsArguments> {
GetStatsQuery({required this.variables});
@override
final DocumentNode document = GET_STATS_QUERY_DOCUMENT;
@override
final String operationName = GET_STATS_QUERY_DOCUMENT_OPERATION_NAME;
@override
final GetStatsArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
GetStats$Query parse(Map<String, dynamic> json) =>
GetStats$Query.fromJson(json);
}
final WALLET_QUERY_DOCUMENT_OPERATION_NAME = 'Wallet';
final WALLET_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'Wallet'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'driverWallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'driverTransacions'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'sorting'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'field'),
value: EnumValueNode(name: NameNode(value: 'id')),
),
ObjectFieldNode(
name: NameNode(value: 'direction'),
value: EnumValueNode(name: NameNode(value: 'DESC')),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'edges'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'node'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'createdAt'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'amount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'refrenceNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'deductType'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'action'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rechargeType'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]),
),
]),
)
]);
class WalletQuery extends GraphQLQuery<Wallet$Query, JsonSerializable> {
WalletQuery();
@override
final DocumentNode document = WALLET_QUERY_DOCUMENT;
@override
final String operationName = WALLET_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
Wallet$Query parse(Map<String, dynamic> json) => Wallet$Query.fromJson(json);
}
final PAYMENT_GATEWAYS_QUERY_DOCUMENT_OPERATION_NAME = 'PaymentGateways';
final PAYMENT_GATEWAYS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'PaymentGateways'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'paymentGateways'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'title'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'type'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'publicKey'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
]),
)
]),
)
]);
class PaymentGatewaysQuery
extends GraphQLQuery<PaymentGateways$Query, JsonSerializable> {
PaymentGatewaysQuery();
@override
final DocumentNode document = PAYMENT_GATEWAYS_QUERY_DOCUMENT;
@override
final String operationName = PAYMENT_GATEWAYS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
PaymentGateways$Query parse(Map<String, dynamic> json) =>
PaymentGateways$Query.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class TopUpWalletArguments extends JsonSerializable with EquatableMixin {
TopUpWalletArguments({required this.input});
@override
factory TopUpWalletArguments.fromJson(Map<String, dynamic> json) =>
_$TopUpWalletArgumentsFromJson(json);
late TopUpWalletInput input;
@override
List<Object?> get props => [input];
@override
Map<String, dynamic> toJson() => _$TopUpWalletArgumentsToJson(this);
}
final TOP_UP_WALLET_MUTATION_DOCUMENT_OPERATION_NAME = 'TopUpWallet';
final TOP_UP_WALLET_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'TopUpWallet'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'input')),
type: NamedTypeNode(
name: NameNode(value: 'TopUpWalletInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'topUpWallet'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: VariableNode(name: NameNode(value: 'input')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'url'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
)
]),
)
]);
class TopUpWalletMutation
extends GraphQLQuery<TopUpWallet$Mutation, TopUpWalletArguments> {
TopUpWalletMutation({required this.variables});
@override
final DocumentNode document = TOP_UP_WALLET_MUTATION_DOCUMENT;
@override
final String operationName = TOP_UP_WALLET_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final TopUpWalletArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
TopUpWallet$Mutation parse(Map<String, dynamic> json) =>
TopUpWallet$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class MeArguments extends JsonSerializable with EquatableMixin {
MeArguments({required this.versionCode});
@override
factory MeArguments.fromJson(Map<String, dynamic> json) =>
_$MeArgumentsFromJson(json);
late int versionCode;
@override
List<Object?> get props => [versionCode];
@override
Map<String, dynamic> toJson() => _$MeArgumentsToJson(this);
}
final ME_QUERY_DOCUMENT_OPERATION_NAME = 'Me';
final ME_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'Me'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'versionCode')),
type: NamedTypeNode(
name: NameNode(value: 'Int'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'driver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'id'),
value: IntValueNode(value: '1'),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'BasicProfile'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'requireUpdate'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'versionCode'),
value: VariableNode(name: NameNode(value: 'versionCode')),
)
],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'BasicProfile'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Driver'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'searchDistance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'softRejectionNote'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currentOrders'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'isWalletHidden'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'tipAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class MeQuery extends GraphQLQuery<Me$Query, MeArguments> {
MeQuery({required this.variables});
@override
final DocumentNode document = ME_QUERY_DOCUMENT;
@override
final String operationName = ME_QUERY_DOCUMENT_OPERATION_NAME;
@override
final MeArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
Me$Query parse(Map<String, dynamic> json) => Me$Query.fromJson(json);
}
final AVAILABLE_ORDERS_QUERY_DOCUMENT_OPERATION_NAME = 'AvailableOrders';
final AVAILABLE_ORDERS_QUERY_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.query,
name: NameNode(value: 'AvailableOrders'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'availableOrders'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'AvailableOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'AvailableOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'distanceBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class AvailableOrdersQuery
extends GraphQLQuery<AvailableOrders$Query, JsonSerializable> {
AvailableOrdersQuery();
@override
final DocumentNode document = AVAILABLE_ORDERS_QUERY_DOCUMENT;
@override
final String operationName = AVAILABLE_ORDERS_QUERY_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
AvailableOrders$Query parse(Map<String, dynamic> json) =>
AvailableOrders$Query.fromJson(json);
}
final ORDER_CREATED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME = 'OrderCreated';
final ORDER_CREATED_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'OrderCreated'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orderCreated'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'AvailableOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'AvailableOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'distanceBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class OrderCreatedSubscription
extends GraphQLQuery<OrderCreated$Subscription, JsonSerializable> {
OrderCreatedSubscription();
@override
final DocumentNode document = ORDER_CREATED_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
ORDER_CREATED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
OrderCreated$Subscription parse(Map<String, dynamic> json) =>
OrderCreated$Subscription.fromJson(json);
}
final ORDER_REMOVED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME = 'OrderRemoved';
final ORDER_REMOVED_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'OrderRemoved'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orderRemoved'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class OrderRemovedSubscription
extends GraphQLQuery<OrderRemoved$Subscription, JsonSerializable> {
OrderRemovedSubscription();
@override
final DocumentNode document = ORDER_REMOVED_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
ORDER_REMOVED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
OrderRemoved$Subscription parse(Map<String, dynamic> json) =>
OrderRemoved$Subscription.fromJson(json);
}
final ORDER_UPDATED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME = 'OrderUpdated';
final ORDER_UPDATED_SUBSCRIPTION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.subscription,
name: NameNode(value: 'OrderUpdated'),
variableDefinitions: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'orderUpdated'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class OrderUpdatedSubscription
extends GraphQLQuery<OrderUpdated$Subscription, JsonSerializable> {
OrderUpdatedSubscription();
@override
final DocumentNode document = ORDER_UPDATED_SUBSCRIPTION_DOCUMENT;
@override
final String operationName =
ORDER_UPDATED_SUBSCRIPTION_DOCUMENT_OPERATION_NAME;
@override
List<Object?> get props => [document, operationName];
@override
OrderUpdated$Subscription parse(Map<String, dynamic> json) =>
OrderUpdated$Subscription.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverLocationArguments extends JsonSerializable
with EquatableMixin {
UpdateDriverLocationArguments({required this.point});
@override
factory UpdateDriverLocationArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverLocationArgumentsFromJson(json);
late PointInput point;
@override
List<Object?> get props => [point];
@override
Map<String, dynamic> toJson() => _$UpdateDriverLocationArgumentsToJson(this);
}
final UPDATE_DRIVER_LOCATION_MUTATION_DOCUMENT_OPERATION_NAME =
'UpdateDriverLocation';
final UPDATE_DRIVER_LOCATION_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateDriverLocation'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'point')),
type: NamedTypeNode(
name: NameNode(value: 'PointInput'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateDriversLocationNew'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'point'),
value: VariableNode(name: NameNode(value: 'point')),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'AvailableOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'AvailableOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'distanceBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'durationBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class UpdateDriverLocationMutation extends GraphQLQuery<
UpdateDriverLocation$Mutation, UpdateDriverLocationArguments> {
UpdateDriverLocationMutation({required this.variables});
@override
final DocumentNode document = UPDATE_DRIVER_LOCATION_MUTATION_DOCUMENT;
@override
final String operationName =
UPDATE_DRIVER_LOCATION_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateDriverLocationArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateDriverLocation$Mutation parse(Map<String, dynamic> json) =>
UpdateDriverLocation$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateOrderStatusArguments extends JsonSerializable with EquatableMixin {
UpdateOrderStatusArguments({
required this.orderId,
required this.status,
this.cashPayment,
});
@override
factory UpdateOrderStatusArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateOrderStatusArgumentsFromJson(json);
late String orderId;
@JsonKey(unknownEnumValue: OrderStatus.artemisUnknown)
late OrderStatus status;
final double? cashPayment;
@override
List<Object?> get props => [orderId, status, cashPayment];
@override
Map<String, dynamic> toJson() => _$UpdateOrderStatusArgumentsToJson(this);
}
final UPDATE_ORDER_STATUS_MUTATION_DOCUMENT_OPERATION_NAME =
'UpdateOrderStatus';
final UPDATE_ORDER_STATUS_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateOrderStatus'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'orderId')),
type: NamedTypeNode(
name: NameNode(value: 'ID'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'status')),
type: NamedTypeNode(
name: NameNode(value: 'OrderStatus'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'cashPayment')),
type: NamedTypeNode(
name: NameNode(value: 'Float'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneOrder'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: VariableNode(name: NameNode(value: 'orderId')),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value: VariableNode(name: NameNode(value: 'status')),
),
ObjectFieldNode(
name: NameNode(value: 'paidAmount'),
value: VariableNode(name: NameNode(value: 'cashPayment')),
),
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'tipAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class UpdateOrderStatusMutation extends GraphQLQuery<UpdateOrderStatus$Mutation,
UpdateOrderStatusArguments> {
UpdateOrderStatusMutation({required this.variables});
@override
final DocumentNode document = UPDATE_ORDER_STATUS_MUTATION_DOCUMENT;
@override
final String operationName =
UPDATE_ORDER_STATUS_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateOrderStatusArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateOrderStatus$Mutation parse(Map<String, dynamic> json) =>
UpdateOrderStatus$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverStatusArguments extends JsonSerializable with EquatableMixin {
UpdateDriverStatusArguments({
required this.status,
this.fcmId,
});
@override
factory UpdateDriverStatusArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverStatusArgumentsFromJson(json);
@JsonKey(unknownEnumValue: DriverStatus.artemisUnknown)
late DriverStatus status;
final String? fcmId;
@override
List<Object?> get props => [status, fcmId];
@override
Map<String, dynamic> toJson() => _$UpdateDriverStatusArgumentsToJson(this);
}
final UPDATE_DRIVER_STATUS_MUTATION_DOCUMENT_OPERATION_NAME =
'UpdateDriverStatus';
final UPDATE_DRIVER_STATUS_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateDriverStatus'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'status')),
type: NamedTypeNode(
name: NameNode(value: 'DriverStatus'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'fcmId')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
),
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneDriver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'status'),
value: VariableNode(name: NameNode(value: 'status')),
),
ObjectFieldNode(
name: NameNode(value: 'notificationPlayerId'),
value: VariableNode(name: NameNode(value: 'fcmId')),
),
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'BasicProfile'),
directives: [],
)
]),
)
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'BasicProfile'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Driver'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'searchDistance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'softRejectionNote'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currentOrders'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'CurrentOrder'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'isWalletHidden'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'CurrentOrder'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Order'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'createdOn'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'expectedTimestamp'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'status'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costBest'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'costAfterCoupon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'paidAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'etaPickup'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'tipAmount'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'directions'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'points'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FragmentSpreadNode(
name: NameNode(value: 'Point'),
directives: [],
)
]),
),
FieldNode(
name: NameNode(value: 'service'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'options'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'name'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'icon'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
FieldNode(
name: NameNode(value: 'addresses'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'rider'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'mobileNumber'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'firstName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lastName'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'media'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'address'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
),
FieldNode(
name: NameNode(value: 'wallets'),
alias: null,
arguments: [],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'currency'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'balance'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]),
),
]),
),
FragmentDefinitionNode(
name: NameNode(value: 'Point'),
typeCondition: TypeConditionNode(
on: NamedTypeNode(
name: NameNode(value: 'Point'),
isNonNull: false,
)),
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'lat'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
FieldNode(
name: NameNode(value: 'lng'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
),
]),
),
]);
class UpdateDriverStatusMutation extends GraphQLQuery<
UpdateDriverStatus$Mutation, UpdateDriverStatusArguments> {
UpdateDriverStatusMutation({required this.variables});
@override
final DocumentNode document = UPDATE_DRIVER_STATUS_MUTATION_DOCUMENT;
@override
final String operationName =
UPDATE_DRIVER_STATUS_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateDriverStatusArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateDriverStatus$Mutation parse(Map<String, dynamic> json) =>
UpdateDriverStatus$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverFCMIdArguments extends JsonSerializable with EquatableMixin {
UpdateDriverFCMIdArguments({this.fcmId});
@override
factory UpdateDriverFCMIdArguments.fromJson(Map<String, dynamic> json) =>
_$UpdateDriverFCMIdArgumentsFromJson(json);
final String? fcmId;
@override
List<Object?> get props => [fcmId];
@override
Map<String, dynamic> toJson() => _$UpdateDriverFCMIdArgumentsToJson(this);
}
final UPDATE_DRIVER_F_C_M_ID_MUTATION_DOCUMENT_OPERATION_NAME =
'UpdateDriverFCMId';
final UPDATE_DRIVER_F_C_M_ID_MUTATION_DOCUMENT = DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateDriverFCMId'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'fcmId')),
type: NamedTypeNode(
name: NameNode(value: 'String'),
isNonNull: false,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneDriver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'notificationPlayerId'),
value: VariableNode(name: NameNode(value: 'fcmId')),
)
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class UpdateDriverFCMIdMutation extends GraphQLQuery<UpdateDriverFCMId$Mutation,
UpdateDriverFCMIdArguments> {
UpdateDriverFCMIdMutation({required this.variables});
@override
final DocumentNode document = UPDATE_DRIVER_F_C_M_ID_MUTATION_DOCUMENT;
@override
final String operationName =
UPDATE_DRIVER_F_C_M_ID_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateDriverFCMIdArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateDriverFCMId$Mutation parse(Map<String, dynamic> json) =>
UpdateDriverFCMId$Mutation.fromJson(json);
}
@JsonSerializable(explicitToJson: true)
class UpdateDriverSearchDistanceArguments extends JsonSerializable
with EquatableMixin {
UpdateDriverSearchDistanceArguments({required this.distance});
@override
factory UpdateDriverSearchDistanceArguments.fromJson(
Map<String, dynamic> json) =>
_$UpdateDriverSearchDistanceArgumentsFromJson(json);
late int distance;
@override
List<Object?> get props => [distance];
@override
Map<String, dynamic> toJson() =>
_$UpdateDriverSearchDistanceArgumentsToJson(this);
}
final UPDATE_DRIVER_SEARCH_DISTANCE_MUTATION_DOCUMENT_OPERATION_NAME =
'UpdateDriverSearchDistance';
final UPDATE_DRIVER_SEARCH_DISTANCE_MUTATION_DOCUMENT =
DocumentNode(definitions: [
OperationDefinitionNode(
type: OperationType.mutation,
name: NameNode(value: 'UpdateDriverSearchDistance'),
variableDefinitions: [
VariableDefinitionNode(
variable: VariableNode(name: NameNode(value: 'distance')),
type: NamedTypeNode(
name: NameNode(value: 'Int'),
isNonNull: true,
),
defaultValue: DefaultValueNode(value: null),
directives: [],
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'updateOneDriver'),
alias: null,
arguments: [
ArgumentNode(
name: NameNode(value: 'input'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'id'),
value: StringValueNode(
value: '1',
isBlock: false,
),
),
ObjectFieldNode(
name: NameNode(value: 'update'),
value: ObjectValueNode(fields: [
ObjectFieldNode(
name: NameNode(value: 'searchDistance'),
value: VariableNode(name: NameNode(value: 'distance')),
)
]),
),
]),
)
],
directives: [],
selectionSet: SelectionSetNode(selections: [
FieldNode(
name: NameNode(value: 'id'),
alias: null,
arguments: [],
directives: [],
selectionSet: null,
)
]),
)
]),
)
]);
class UpdateDriverSearchDistanceMutation extends GraphQLQuery<
UpdateDriverSearchDistance$Mutation, UpdateDriverSearchDistanceArguments> {
UpdateDriverSearchDistanceMutation({required this.variables});
@override
final DocumentNode document = UPDATE_DRIVER_SEARCH_DISTANCE_MUTATION_DOCUMENT;
@override
final String operationName =
UPDATE_DRIVER_SEARCH_DISTANCE_MUTATION_DOCUMENT_OPERATION_NAME;
@override
final UpdateDriverSearchDistanceArguments variables;
@override
List<Object?> get props => [document, operationName, variables];
@override
UpdateDriverSearchDistance$Mutation parse(Map<String, dynamic> json) =>
UpdateDriverSearchDistance$Mutation.fromJson(json);
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/earnings/earnings_view.dart | import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/components/empty_state_card_view.dart';
import 'package:client_shared/components/trip_history_item_view.dart';
import 'package:client_shared/theme/theme.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_vector_icons/flutter_vector_icons.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:ridy/graphql/generated/graphql_api.dart';
import 'package:intl/intl.dart';
import 'package:ridy/query_result_view.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
class EarningsView extends StatefulWidget {
static final daysOfWeek = ["M", "T", "W", "T", "F", "S", "S"];
const EarningsView({Key? key}) : super(key: key);
@override
State<EarningsView> createState() => _EarningsViewState();
}
class _EarningsViewState extends State<EarningsView> {
DateTime startDate = DateTime.now().subtract(const Duration(days: 7));
DateTime endDate = DateTime.now();
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
RidyBackButton(text: S.of(context).action_back),
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
CupertinoButton(
child: const Icon(Ionicons.caret_back, color: Colors.black),
onPressed: () {
setState(() {
endDate = startDate.subtract(const Duration(days: 1));
startDate = endDate.subtract(const Duration(days: 7));
});
}),
Column(
children: [
Text(
"${DateFormat('MMMd').format(startDate)}-${DateFormat('MMMd').format(endDate)}",
style: Theme.of(context).textTheme.labelLarge,
),
// const SizedBox(height: 4),
// Text(
// "\$12",
// style: Theme.of(context).textTheme.displaySmall,
// )
],
),
CupertinoButton(
onPressed: endDate.difference(DateTime.now()).inDays > -1
? null
: () {
setState(() {
startDate = endDate.add(const Duration(days: 1));
endDate = startDate.add(const Duration(days: 7));
});
},
child:
const Icon(Ionicons.caret_forward, color: Colors.black))
]),
const SizedBox(height: 16),
Query(
options: QueryOptions(
document: GET_STATS_QUERY_DOCUMENT,
variables: GetStatsArguments(
startDate: startDate, endDate: endDate)
.toJson()),
builder: (QueryResult result,
{Future<QueryResult?> Function()? refetch,
FetchMore? fetchMore}) {
if (result.isLoading) {
return const Expanded(child: QueryResultLoadingView());
}
if (result.hasException) {
return Center(
child: Text(
result.exception?.graphqlErrors.first.message ??
""));
}
final stats = GetStats$Query.fromJson(result.data!);
var index = 0;
final List<BarChartGroupData> barData = stats
.getStatsNew.dataset
.map<BarChartGroupData>(
(data) => BarChartGroupData(x: index++, barRods: [
BarChartRodData(
borderRadius: BorderRadius.circular(10),
width: 200 / stats.getStatsNew.dataset.length,
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
CustomTheme.primaryColors,
CustomTheme.primaryColors.shade700
]),
toY: data.earning,
)
]))
.toList();
if (stats.getStatsNew.dataset.isEmpty) {
return EmptyStateCard(
title: S.of(context).empty_state_title_no_record,
description: S.of(context).earnings_empty_state_body,
icon: Ionicons.cloud_offline);
}
return Expanded(
child: Column(
children: [
SizedBox(
height: 300,
child: BarChart(
BarChartData(
barTouchData: BarTouchData(
touchTooltipData: BarTouchTooltipData(
tooltipBgColor: Colors.grey.shade800,
getTooltipItem: (group, groupIndex, rod,
rodIndex) =>
BarTooltipItem(
NumberFormat.simpleCurrency(
name:
stats.getStatsNew.currency)
.format(stats.getStatsNew
.dataset[groupIndex].earning),
const TextStyle(color: Colors.white)),
)),
barGroups: barData,
groupsSpace: 0,
gridData: FlGridData(show: false),
borderData: FlBorderData(show: false),
titlesData: FlTitlesData(
leftTitles: AxisTitles(
sideTitles:
SideTitles(showTitles: false)),
rightTitles: AxisTitles(
sideTitles:
SideTitles(showTitles: false)),
topTitles: AxisTitles(
sideTitles:
SideTitles(showTitles: false)),
bottomTitles: AxisTitles(
sideTitles: SideTitles(
reservedSize: 40,
showTitles: true,
getTitlesWidget: (index, title) {
return Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
stats.getStatsNew
.dataset[index.toInt()].name
.substring(0, 1),
style: Theme.of(context)
.textTheme
.labelMedium,
),
);
},
))),
),
swapAnimationDuration:
const Duration(milliseconds: 250),
),
),
Expanded(
child: ListView.builder(
itemCount: stats.orders.edges.length,
itemBuilder: ((context, index) {
final item = stats.orders.edges[index].node;
return TripHistoryItemView(
id: item.id,
canceledText:
S.of(context).order_status_canceled,
title: item.service.name,
dateTime: item.createdOn,
currency: item.currency,
price: item.costAfterCoupon -
item.providerShare,
isCanceled: item.status ==
OrderStatus.riderCanceled ||
item.status ==
OrderStatus.driverCanceled,
onPressed: (id) {});
})))
],
),
);
})
],
),
),
);
}
}
| 0 |
mirrored_repositories/RideFlutter/driver-app/lib | mirrored_repositories/RideFlutter/driver-app/lib/wallet/wallet_view.dart | import 'package:client_shared/config.dart';
import 'package:flutter/material.dart';
import 'package:graphql_flutter/graphql_flutter.dart';
import 'package:client_shared/components/back_button.dart';
import 'package:client_shared/wallet/wallet_card_view.dart';
import 'package:client_shared/wallet/wallet_activity_item_view.dart';
import 'package:lifecycle/lifecycle.dart';
import 'package:flutter_gen/gen_l10n/messages.dart';
import 'package:ridy/wallet/add_credit_sheet_view.dart';
import '../graphql/generated/graphql_api.graphql.dart';
import '../query_result_view.dart';
class WalletView extends StatefulWidget {
const WalletView({Key? key}) : super(key: key);
@override
State<WalletView> createState() => _WalletViewState();
}
class _WalletViewState extends State<WalletView> {
int? selectedWalletIndex;
Refetch? refetch;
@override
Widget build(BuildContext context) {
return Scaffold(
body: LifecycleWrapper(
onLifecycleEvent: (event) {
if (event == LifecycleEvent.visible && refetch != null) {
refetch!();
}
},
child: Query(
options: QueryOptions(document: WALLET_QUERY_DOCUMENT),
builder: (QueryResult result,
{Refetch? refetch, FetchMore? fetchMore}) {
this.refetch = refetch;
if (result.isLoading || result.hasException) {
return QueryResultView(result);
}
final query = Wallet$Query.fromJson(result.data!);
final wallet = query.driverWallets;
final transactions = query.driverTransacions.edges;
if (wallet.isNotEmpty && selectedWalletIndex == null) {
selectedWalletIndex = 0;
}
final walletItem =
wallet.isEmpty ? null : wallet[selectedWalletIndex ?? 0];
return SafeArea(
minimum: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
RidyBackButton(text: S.of(context).action_back),
WalletCardView(
title: S.of(context).wallet_card_title(appName),
actionAddCreditText:
S.of(context).add_credit_dialog_title,
currency: walletItem?.currency ?? defaultCurrency,
credit: walletItem?.balance ?? 0,
onAdddCredit: () {
showModalBottomSheet(
context: context,
isScrollControlled: true,
constraints: const BoxConstraints(maxWidth: 600),
builder: (context) {
return AddCreditSheetView(
currency:
walletItem?.currency ?? defaultCurrency,
);
});
},
),
const SizedBox(height: 32),
Text(S.of(context).wallet_activities_heading,
style: Theme.of(context).textTheme.headlineMedium),
const SizedBox(height: 12),
if (transactions.isNotEmpty)
Expanded(
child: ListView.builder(
itemCount: transactions.length,
itemBuilder: (context, index) {
final item = transactions[index].node;
return WalletActivityItemView(
title: item.action == TransactionAction.recharge
? getRechargeText(item.rechargeType!)
: getDeductText(context, item.deductType!),
dateTime: item.createdAt,
amount: item.amount,
currency: item.currency,
icon: getTransactionIcon(item),
);
}),
),
if (transactions.isEmpty)
Expanded(
child: Center(
child: Text(
S.of(context).wallet_empty_state_message))),
],
),
);
}),
),
);
}
String getDeductText(
BuildContext context, DriverDeductTransactionType deductType) {
switch (deductType) {
case DriverDeductTransactionType.commission:
return S.of(context).enum_driver_deduct_transaction_type_commission;
case DriverDeductTransactionType.correction:
return S.of(context).enum_driver_deduct_transaction_type_correction;
case DriverDeductTransactionType.withdraw:
return S.of(context).enum_driver_deduct_transaction_type_withdraw;
case DriverDeductTransactionType.artemisUnknown:
return S.of(context).enum_unknown;
}
}
String getRechargeText(DriverRechargeTransactionType type) {
switch (type) {
case DriverRechargeTransactionType.bankTransfer:
return S.of(context).enum_driver_recharge_type_bank_transfer;
case DriverRechargeTransactionType.gift:
return S.of(context).enum_driver_recharge_type_gift;
case DriverRechargeTransactionType.inAppPayment:
return S.of(context).enum_driver_recharge_type_in_app_payment;
case DriverRechargeTransactionType.orderFee:
return S.of(context).enum_driver_recharge_transaction_type_order_fee;
default:
return S.of(context).enum_unknown;
}
}
IconData getTransactionIcon(
Wallet$Query$DriverTransacionConnection$DriverTransacionEdge$DriverTransacion
transacion) {
if (transacion.action == TransactionAction.recharge) {
switch (transacion.rechargeType) {
case DriverRechargeTransactionType.bankTransfer:
return Icons.payments;
case DriverRechargeTransactionType.gift:
return Icons.card_giftcard_outlined;
case DriverRechargeTransactionType.orderFee:
return Icons.confirmation_number;
case DriverRechargeTransactionType.inAppPayment:
return Icons.receipt;
default:
return Icons.explicit;
}
} else {
switch (transacion.deductType) {
case DriverDeductTransactionType.commission:
return Icons.pie_chart;
default:
return Icons.explicit_outlined;
}
}
}
}
| 0 |
Subsets and Splits