diff --git a/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart b/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart index 9aa094f4e..dc9746cdf 100644 --- a/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart +++ b/lib/src/screens/ionia/cards/ionia_gift_card_detail_page.dart @@ -13,6 +13,7 @@ import 'package:cake_wallet/typography.dart'; import 'package:cake_wallet/utils/show_bar.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/ionia/ionia_gift_card_details_view_model.dart'; +import 'package:device_display_brightness/device_display_brightness.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter/src/widgets/framework.dart'; @@ -25,6 +26,8 @@ class IoniaGiftCardDetailPage extends BasePage { final IoniaGiftCardDetailsViewModel viewModel; + + @override Widget leading(BuildContext context) { if (ModalRoute.of(context).isFirst) { @@ -47,7 +50,10 @@ class IoniaGiftCardDetailPage extends BasePage { highlightColor: Colors.transparent, splashColor: Colors.transparent, padding: EdgeInsets.all(0), - onPressed: () => onClose(context), + onPressed: () { + onClose(context); + DeviceDisplayBrightness.setBrightness(viewModel.brightness); + }, child: _backButton), ), ), @@ -64,6 +70,7 @@ class IoniaGiftCardDetailPage extends BasePage { @override Widget body(BuildContext context) { + viewModel.increaseBrightness(); reaction((_) => viewModel.redeemState, (ExecutionState state) { if (state is FailureState) { WidgetsBinding.instance.addPostFrameCallback((_) { diff --git a/lib/view_model/ionia/ionia_gift_card_details_view_model.dart b/lib/view_model/ionia/ionia_gift_card_details_view_model.dart index e6138bb53..cbbfc49f1 100644 --- a/lib/view_model/ionia/ionia_gift_card_details_view_model.dart +++ b/lib/view_model/ionia/ionia_gift_card_details_view_model.dart @@ -2,6 +2,7 @@ import 'package:cake_wallet/core/execution_state.dart'; import 'package:cake_wallet/ionia/ionia_service.dart'; import 'package:cake_wallet/ionia/ionia_gift_card.dart'; import 'package:mobx/mobx.dart'; +import 'package:device_display_brightness/device_display_brightness.dart'; part 'ionia_gift_card_details_view_model.g.dart'; @@ -14,6 +15,7 @@ abstract class IoniaGiftCardDetailsViewModelBase with Store { } final IoniaService ioniaService; + double brightness; @observable IoniaGiftCard giftCard; @@ -32,4 +34,9 @@ abstract class IoniaGiftCardDetailsViewModelBase with Store { redeemState = FailureState(e.toString()); } } + + void increaseBrightness() async { + brightness = await DeviceDisplayBrightness.getBrightness(); + await DeviceDisplayBrightness.setBrightness(1.0); + } } \ No newline at end of file