Skip to content

Commit

Permalink
Add try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
bannzai committed Oct 7, 2024
1 parent b7a5c81 commit f9f62dd
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:pilll/components/picker/picker_toolbar.dart';
import 'package:pilll/entity/user.codegen.dart';
import 'package:pilll/features/error/error_alert.dart';
import 'package:pilll/native/present_share_to_sns_for_reward_premium_trial.dart';
import 'package:pilll/provider/user.dart';
import 'package:pilll/utils/analytics.dart';
Expand Down Expand Up @@ -32,7 +34,11 @@ class ShareRewardPremiumTrialAnnoumcenetBar extends HookConsumerWidget {

_showPicker(context, (shareToSNSKind) {
presentShareToSNSForPremiumTrialReward(shareToSNSKind, () async {
await applyShareRewardPremiumTrial(user);
try {
await applyShareRewardPremiumTrial(user);
} catch (error) {
showErrorAlert(context, error);
}
});
});
},
Expand Down

0 comments on commit f9f62dd

Please sign in to comment.