Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create kids with a single topup instead of rga (kids-857 & kids-858) #847

Merged
merged 3 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class AddMemberRepositoryImpl with AddMemberRepository {
final profilesJsonList = members.map((member) => member.toJson()).toList();
final body = {
'profiles': profilesJsonList,
'allowanceType': 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check if this is also used by the generosity challenge code? If not then approved.

};

await apiService.addMember(body);
Expand Down
14 changes: 11 additions & 3 deletions lib/features/children/add_member/widgets/add_member_form.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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';
import 'package:givt_app/features/children/shared/profile_type.dart';
import 'package:givt_app/l10n/l10n.dart';
import 'package:givt_app/utils/utils.dart';
Expand Down Expand Up @@ -328,10 +327,19 @@ class _AddMemberFormState extends State<AddMemberForm> {
focusNode: widget.ageFocusNode,
),
const SizedBox(height: 10),
const GivingAllowanceInfoButton(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 24),
child: Text(
"Start your child's giving journey by adding funds to their Wallet",
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize: 16,
),
),
),
AllowanceCounter(
currency: currency,
initialAllowance: _allowance,
initialAllowance: 5,
onAllowanceChanged: (allowance) => _allowance = allowance,
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:givt_app/core/enums/enums.dart';
import 'package:givt_app/features/children/add_member/widgets/giving_allowance_info_bottom_sheet.dart';
import 'package:givt_app/l10n/l10n.dart';
import 'package:givt_app/utils/utils.dart';

class GivingAllowanceInfoButton extends StatelessWidget {
const GivingAllowanceInfoButton({super.key,});
const GivingAllowanceInfoButton({
super.key,
});

@override
Widget build(BuildContext context) {
Expand All @@ -33,7 +34,7 @@ class GivingAllowanceInfoButton extends StatelessWidget {
),
const SizedBox(width: 10),
Text(
context.l10n.createChildGivingAllowanceTitle,
"Start your child's giving journey by addingfunds to their Wallet",
style: Theme.of(context).textTheme.titleMedium!.copyWith(
fontSize: 16,
),
Expand Down