Skip to content

Commit

Permalink
(More merge changes)
Browse files Browse the repository at this point in the history
  • Loading branch information
marfavi committed May 19, 2023
1 parent aec4d7f commit 26bfe3c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
5 changes: 0 additions & 5 deletions lib/features/purchase/presentation/cubit/purchase_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,15 @@ class PurchaseCubit extends Cubit<PurchaseState> {
case PaymentStatus.completed:
sl<FirebaseAnalyticsEventLogging>().purchaseCompletedEvent(payment);
emit(PurchaseCompleted(payment.copyWith(status: status)));
break;
case PaymentStatus.error:
emit(PurchasePaymentRejected(payment.copyWith(status: status)));
break;
case PaymentStatus.reserved:
case PaymentStatus.awaitingPayment:
await onSuccess();
break;
case PaymentStatus.rejectedPayment:
emit(PurchasePaymentRejected(payment));
break;
case PaymentStatus.refunded:
emit(PurchasePaymentRejected(payment));
break;
}
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class LoadingDialog extends StatelessWidget {
borderRadius: BorderRadius.all(Radius.circular(16)),
),
title: Text(title),
children: [
children: const [
Column(
children: const [
children: [
Padding(
padding: EdgeInsets.all(16),
child: CircularProgressIndicator(color: AppColor.primary),
Expand Down
7 changes: 5 additions & 2 deletions lib/features/user/domain/entities/role.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import 'package:coffeecard/generated/api/coffeecard_api_v2.enums.swagger.dart';
import 'package:coffeecard/generated/api/coffeecard_api_v2.models.swagger.dart';

enum Role { customer, barista, manager, board }
enum Role {
customer,
barista,
manager,
board;

extension RoleExtension on Role {
// json is a dynamic object by its very nature
// ignore: avoid-dynamic
static Role fromJson(dynamic json) {
Expand Down

0 comments on commit 26bfe3c

Please sign in to comment.