mnemo_cards/lib/widgets/enter_promo_code_widget.dart

19 lines
565 B
Dart
Raw Normal View History

2024-07-18 21:45:04 +00:00
import 'package:flutter/cupertino.dart';
import 'package:mnemo_cards_frontend_common/mnemo_cards_frontend_common.dart';
2024-06-16 19:01:33 +00:00
2024-07-18 21:45:04 +00:00
import '../di/locator.dart';
2024-06-16 19:01:33 +00:00
2024-07-18 21:45:04 +00:00
class MobileEnterPromoCodeWidget extends StatelessWidget {
2024-06-16 19:01:33 +00:00
@override
Widget build(BuildContext context) {
2024-07-18 21:45:04 +00:00
return EnterPromoCodeWidget(onApplyPromoCode: onApplyPromoCode);
}
Future<(bool, String?)> onApplyPromoCode(String code) async {
final result = await locator.userManager.applyPromocode(code);
return (result.success ?? false, result.message);
2024-06-16 19:01:33 +00:00
}
2024-07-18 21:45:04 +00:00
const MobileEnterPromoCodeWidget();
}