Skip to content

Commit

Permalink
refactor(cat-voices): make link wallet dialog private, move learn mor…
Browse files Browse the repository at this point in the history
…e button
  • Loading branch information
dtscalac committed Sep 25, 2024
1 parent b6915c3 commit 5fcdf53
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:catalyst_voices/pages/account/creation/task_picture.dart';
import 'package:catalyst_voices/widgets/buttons/specialized/voices_learn_more_button.dart';
import 'package:catalyst_voices/widgets/widgets.dart';
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import 'package:flutter/material.dart';
/// The link wallet flow consisting
/// of [LinkWalletStage]'s during the registration.
class LinkWalletDialog extends StatefulWidget {
const LinkWalletDialog({super.key});
const LinkWalletDialog._();

/// Shows the [LinkWalletDialog] flow.
static Future<void> show({required BuildContext context}) {
return VoicesDialog.show(
context: context,
routeSettings: const RouteSettings(name: '/register/link-wallet'),
builder: (context) => const LinkWalletDialog(),
builder: (context) => const LinkWalletDialog._(),
);
}

Expand Down

This file was deleted.

21 changes: 21 additions & 0 deletions catalyst_voices/lib/widgets/buttons/voices_buttons.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:async';

import 'package:catalyst_voices/widgets/buttons/voices_icon_button.dart';
import 'package:catalyst_voices/widgets/buttons/voices_text_button.dart';
import 'package:catalyst_voices_assets/catalyst_voices_assets.dart';
import 'package:catalyst_voices_localization/catalyst_voices_localization.dart';
import 'package:flutter/material.dart';

class DrawerToggleButton extends StatelessWidget {
Expand Down Expand Up @@ -146,3 +148,22 @@ class MoreOptionsButton extends StatelessWidget {
);
}
}

/// A "Learn More" button that redirects usually to an external content.
class VoicesLearnMoreButton extends StatelessWidget {
final VoidCallback onTap;

const VoicesLearnMoreButton({
super.key,
required this.onTap,
});

@override
Widget build(BuildContext context) {
return VoicesTextButton(
trailing: VoicesAssets.icons.externalLink.buildIcon(),
onTap: onTap,
child: Text(context.l10n.learnMore),
);
}
}

0 comments on commit 5fcdf53

Please sign in to comment.