Skip to content

Commit

Permalink
Merge pull request #777 from givtnl/develop
Browse files Browse the repository at this point in the history
Production release 4.2.18
  • Loading branch information
TammiLion authored May 28, 2024
2 parents e174b7c + fa47f08 commit 834cb9b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"side": "user",
"text": "No",
"answerText": "No",
"saveKey": "noOtherParent",
"next": {
"branch": "continueChildren"
}
Expand Down Expand Up @@ -55,6 +56,7 @@
"side": "user",
"text": "No",
"answerText": "No",
"saveKey": "noChildren",
"next": {
"branch": "continueChat"
}
Expand Down Expand Up @@ -88,6 +90,7 @@
"side": "user",
"text": "No",
"answerText": "No",
"saveKey": "noMoreChildrenThanOne",
"next": {
"branch": "continueChat"
}
Expand Down Expand Up @@ -121,6 +124,7 @@
"side": "user",
"text": "No",
"answerText": "No",
"saveKey": "noMoreChildrenThanTwo",
"next": {
"branch": "continueChat"
}
Expand Down Expand Up @@ -176,6 +180,7 @@
"side": "user",
"text": "No",
"answerText": "No",
"saveKey": "noMoreChildrenThanThree",
"next": {
"branch": "continueChat"
}
Expand Down
4 changes: 4 additions & 0 deletions lib/features/children/add_member/utils/member_utils.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DateTime getDateOfBirthFromAge(int age) {
final birthYear = DateTime.now().year - age;
return DateTime(birthYear);
}
4 changes: 2 additions & 2 deletions lib/features/children/add_member/widgets/add_member_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:givt_app/core/enums/country.dart';
import 'package:givt_app/features/auth/cubit/auth_cubit.dart';
import 'package:givt_app/features/children/add_member/cubit/add_member_cubit.dart';
import 'package:givt_app/features/children/add_member/models/member.dart';
import 'package:givt_app/features/children/add_member/utils/member_utils.dart';
import 'package:givt_app/features/children/add_member/widgets/allowance_counter.dart';
import 'package:givt_app/features/children/add_member/widgets/family_text_form_field.dart';
import 'package:givt_app/features/children/edit_child/widgets/giving_allowance_info_button.dart';
Expand Down Expand Up @@ -78,8 +79,7 @@ class _AddMemberFormState extends State<AddMemberForm> {

final name = _nameChildController.text.trim();
final age = int.parse(_ageController.text);
final birthYear = DateTime.now().year - age;
final dateOfBirth = DateTime(birthYear);
final dateOfBirth = getDateOfBirthFromAge(age);

final profile = Member(
firstName: name,
Expand Down
4 changes: 2 additions & 2 deletions lib/features/children/details/cubit/child_details_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class ChildDetailsCubit extends Cubit<ChildDetailsState> {
);
}
} catch (e, s) {
_emitData();
await _handleEditAllowanceApiError(e, s);
_emitData();
}
}

Expand All @@ -100,8 +100,8 @@ class ChildDetailsCubit extends Cubit<ChildDetailsState> {
);
}
} catch (e, s) {
_emitData();
await _handleTopUpApiError(e, s);
_emitData();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:async';

import 'package:givt_app/core/logging/logging_service.dart';
import 'package:givt_app/features/children/add_member/models/member.dart';
import 'package:givt_app/features/children/add_member/utils/member_utils.dart';
import 'package:givt_app/features/children/generosity_challenge/cubit/generosity_challenge_vpc_setup_custom.dart';
import 'package:givt_app/features/children/generosity_challenge/domain/exceptions/not_logged_in_exception.dart';
import 'package:givt_app/features/children/generosity_challenge/repositories/generosity_challenge_repository.dart';
Expand Down Expand Up @@ -47,6 +48,7 @@ class GenerosityChallengeVpcSetupCubit
lastName: lastname,
allowance: int.tryParse(allowance ?? ''),
age: int.tryParse(age),
dateOfBirth: getDateOfBirthFromAge(int.tryParse(age) ?? 0),
type: ProfileType.Child,
),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: givt_app
description: Givt App
version: 4.2.17
version: 4.2.18
publish_to: none

environment:
Expand Down

0 comments on commit 834cb9b

Please sign in to comment.