1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter_bloc/flutter_bloc.dart' ;
3
- import 'package:flutter_stripe/flutter_stripe.dart' ;
4
3
import 'package:font_awesome_flutter/font_awesome_flutter.dart' ;
5
- import 'package:givt_app/app/injection/injection.dart' ;
6
4
import 'package:givt_app/core/enums/enums.dart' ;
7
- import 'package:givt_app/core/logging/logging_service.dart' ;
8
5
import 'package:givt_app/features/account_details/bloc/personal_info_edit_bloc.dart' ;
9
6
import 'package:givt_app/features/account_details/pages/change_address_bottom_sheet.dart' ;
10
7
import 'package:givt_app/features/account_details/pages/change_bank_details_bottom_sheet.dart' ;
@@ -13,12 +10,9 @@ import 'package:givt_app/features/account_details/pages/change_phone_number_bott
13
10
import 'package:givt_app/features/auth/cubit/auth_cubit.dart' ;
14
11
import 'package:givt_app/features/auth/pages/change_password_page.dart' ;
15
12
import 'package:givt_app/features/family/app/family_pages.dart' ;
16
- import 'package:givt_app/features/registration/cubit/stripe_cubit.dart' ;
17
13
import 'package:givt_app/l10n/l10n.dart' ;
18
14
import 'package:givt_app/shared/dialogs/dialogs.dart' ;
19
15
import 'package:givt_app/shared/pages/gift_aid_page.dart' ;
20
- import 'package:givt_app/shared/widgets/parent_avatar.dart' ;
21
- import 'package:givt_app/utils/stripe_helper.dart' ;
22
16
import 'package:givt_app/utils/utils.dart' ;
23
17
import 'package:go_router/go_router.dart' ;
24
18
@@ -34,7 +28,6 @@ class PersonalInfoEditPage extends StatelessWidget {
34
28
final locals = context.l10n;
35
29
final user = context.watch <AuthCubit >().state.user;
36
30
final isUkUser = Country .unitedKingdomCodes ().contains (user.country);
37
- final isUSUser = Country .us.countryCode == user.country;
38
31
39
32
return Scaffold (
40
33
appBar: AppBar (
@@ -108,40 +101,29 @@ class PersonalInfoEditPage extends StatelessWidget {
108
101
const SizedBox (
109
102
height: 20 ,
110
103
),
111
- if (! isUSUser)
112
- Column (
113
- children: [
114
- Text (
115
- locals.personalPageHeader,
116
- style: Theme .of (context).textTheme.bodyLarge,
117
- ),
118
- const SizedBox (
119
- height: 20 ,
120
- ),
121
- Text (
122
- locals.personalPageSubHeader,
123
- style: Theme .of (context).textTheme.bodyLarge,
124
- textAlign: TextAlign .center,
125
- ),
126
- const SizedBox (
127
- height: 20 ,
128
- ),
129
- ],
130
- ),
131
- if (isUSUser)
132
- Padding (
133
- padding: const EdgeInsets .only (bottom: 20 ),
134
- child: ParentAvatar (
135
- firstName: user.firstName,
136
- lastName: user.lastName,
137
- pictureURL: user.profilePicture,
104
+ Column (
105
+ children: [
106
+ Text (
107
+ locals.personalPageHeader,
108
+ style: Theme .of (context).textTheme.bodyLarge,
138
109
),
139
- ),
110
+ const SizedBox (
111
+ height: 20 ,
112
+ ),
113
+ Text (
114
+ locals.personalPageSubHeader,
115
+ style: Theme .of (context).textTheme.bodyLarge,
116
+ textAlign: TextAlign .center,
117
+ ),
118
+ const SizedBox (
119
+ height: 20 ,
120
+ ),
121
+ ],
122
+ ),
140
123
_buildInfoRow (
141
124
icon: const Icon (
142
125
Icons .person,
143
126
),
144
- visible: ! isUSUser,
145
127
value: '${user .firstName } ${user .lastName }' ,
146
128
),
147
129
_buildInfoRow (
@@ -161,7 +143,6 @@ class PersonalInfoEditPage extends StatelessWidget {
161
143
),
162
144
),
163
145
_buildInfoRow (
164
- visible: ! isUSUser,
165
146
icon: const Icon (
166
147
FontAwesomeIcons .house,
167
148
color: AppTheme .givtLightGreen,
@@ -196,7 +177,6 @@ class PersonalInfoEditPage extends StatelessWidget {
196
177
),
197
178
),
198
179
_buildInfoRow (
199
- visible: ! isUSUser,
200
180
icon: const Icon (
201
181
FontAwesomeIcons .creditCard,
202
182
color: AppTheme .givtOrange,
@@ -216,45 +196,6 @@ class PersonalInfoEditPage extends StatelessWidget {
216
196
),
217
197
),
218
198
),
219
- _buildInfoRow (
220
- visible: isUSUser,
221
- icon: const Icon (
222
- FontAwesomeIcons .creditCard,
223
- color: AppTheme .givtOrange,
224
- ),
225
- value:
226
- '${user .accountBrand .toUpperCase ()} ${user .accountNumber }' ,
227
- onTap: () async {
228
- await AnalyticsHelper .logEvent (
229
- eventName: AmplitudeEvents .editPaymentDetailsClicked,
230
- );
231
-
232
- if (! context.mounted) return ;
233
- await getIt <StripeCubit >().fetchSetupIntent ();
234
-
235
- if (! context.mounted) return ;
236
-
237
- try {
238
- await StripeHelper (context).showPaymentSheet ();
239
-
240
- if (! context.mounted) return ;
241
- await context.read <AuthCubit >().refreshUser ();
242
- } on StripeException catch (e, stackTrace) {
243
- await AnalyticsHelper .logEvent (
244
- eventName: AmplitudeEvents .editPaymentDetailsCanceled,
245
- );
246
-
247
- /* Logged as info as stripe is giving exception
248
- when for example people close the bottomsheet.
249
- So it's not a real error :)
250
- */
251
- LoggingInfo .instance.info (
252
- e.toString (),
253
- methodName: stackTrace.toString (),
254
- );
255
- }
256
- },
257
- ),
258
199
_buildInfoRow (
259
200
visible: isUkUser,
260
201
icon: Image .asset (
@@ -290,15 +231,6 @@ class PersonalInfoEditPage extends StatelessWidget {
290
231
const Divider (
291
232
height: 0 ,
292
233
),
293
- if (isUSUser)
294
- Padding (
295
- padding: const EdgeInsets .only (left: 70 , right: 70 , top: 20 ),
296
- child: Text (
297
- locals.personalPageSubHeader,
298
- style: Theme .of (context).textTheme.bodyLarge,
299
- textAlign: TextAlign .center,
300
- ),
301
- ),
302
234
],
303
235
),
304
236
),
0 commit comments