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

Login Page & Improvements #101

Merged
merged 10 commits into from
Dec 11, 2023
Merged

Login Page & Improvements #101

merged 10 commits into from
Dec 11, 2023

Conversation

humanagent
Copy link
Contributor

@humanagent humanagent commented Dec 6, 2023

  • Added XMTP Client.create() tests
  • Added 2 buttons. One for starting with a random key and another from a private key.
ElevatedButton(
      child: const Text('Create Random Wallet'),
      onPressed: () async {
        try {
          print('Creating a random wallet...');
          var wallet = EthPrivateKey.createRandom(Random.secure()).asSigner();
          print('Wallet created with address: ${await wallet.address}');
          print('Authorizing the wallet...');
          bool isAuthorized = await session.authorize(wallet);
          print('Wallet authorized: $isAuthorized');
          print(context);
          context.goNamed('home');
          print('Session: $session');
          print('Context: $context');
          context.goNamed('home');
          print('Navigation to home completed.');
        } catch (e) {
          print('Errorf: $e');
        }
      },
    ),
    ElevatedButton(
      child: const Text('Start from Private Key'),
      onPressed: () async {
        try {
          print('Creating a random wallet...');
          var wallet = EthPrivateKey.fromHex('key').asSigner();
          print('Wallet created with address: ${await wallet.address}');
          print('Authorizing the wallet...');
          await session.authorize(wallet);
          print('Wallet authorized.');
          print('Navigating to home...');
          context.goNamed('home');
          print('Navigation to home completed.');
        } catch (e) {
          print('Errorf: $e');
        }
      },
    ),

@humanagent humanagent changed the title Login Page Improvements Login Page Dec 6, 2023
@humanagent humanagent changed the title Login Page Login Page & Improvements Dec 7, 2023
@humanagent humanagent marked this pull request as ready for review December 11, 2023 11:32
@humanagent humanagent requested a review from a team as a code owner December 11, 2023 11:32
Copy link

@giovasdistillery giovasdistillery left a comment

Choose a reason for hiding this comment

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

LGTM, just see the comment about the prints

example/lib/pages/login_page.dart Show resolved Hide resolved
example/test/widget_test.dart Show resolved Hide resolved
example/lib/pages/login_page.dart Outdated Show resolved Hide resolved
@humanagent humanagent merged commit 0dc6445 into main Dec 11, 2023
1 check passed
@humanagent humanagent deleted the login_tests branch December 11, 2023 21:22
.DS_Store Show resolved Hide resolved
Comment on lines +33 to +36
example/linux
example/macos
example/windows
example/web
Copy link
Contributor

Choose a reason for hiding this comment

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

✂️ we don't support these platforms and the folders shouldn't exist

Comment on lines +22 to +35
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: linux
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: macos
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: web
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
- platform: windows
create_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
base_revision: 7f20e5d18ce4cb80c621533090a7c5113f5bdc52
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't support these and shouldn't include them here

example/lib/pages/login_page.dart Show resolved Hide resolved
example/lib/session/foreground_session.dart Show resolved Hide resolved
example/test/test_from_key.dart Show resolved Hide resolved
example/test/widget_test.dart Show resolved Hide resolved
@humanagent humanagent mentioned this pull request Dec 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants