remit2any_auth 0.0.1 copy "remit2any_auth: ^0.0.1" to clipboard
remit2any_auth: ^0.0.1 copied to clipboard

A Flutter package for Remit2Any authentication

Remit2Any Auth Flutter SDK #

A Flutter package for seamless AWS Cognito authentication via WebView for Remit2Any.

Features #

  • WebView-based sign-in with Remit2Any
  • Secure token storage using flutter_secure_storage
  • Fetch user profile from Cognito
  • Background token refresh

Installation #

Add to your pubspec.yaml:

dependencies:
  remit2any_auth:
    path: ../remit2any_auth # or use your published version

Configuration #

  • Set your Cognito domain, region, and client ID in auth_service.dart:
    • Replace <your_domain>, <region>, and <CLIENT_ID> with your values.

Usage #

import 'package:remit2any_auth/remit2any_auth.dart';

// Sign in (opens WebView)
await signIn();

// Get user info
final user = await getUser();

// Sign out
await signOut();

// Start background token refresh
startTokenRefreshLoop();

Example #

See the example/ app for a working demo.

Security #

  • Tokens are stored securely using flutter_secure_storage.
  • Only trusted domains are used for WebView.

Flutter Package Publishing #

Prerequisites #

  1. Dart/Flutter SDK: Ensure you have the latest stable version installed
  2. pub.dev Account: Create an account at pub.dev
  3. Google Account: Link your Google account to pub.dev
  4. Package Name: Ensure your package name is unique on pub.dev

Version Management #

Semantic Versioning

Follow semantic versioning (MAJOR.MINOR.PATCH):

  • MAJOR: Breaking changes
  • MINOR: New features (backward compatible)
  • PATCH: Bug fixes (backward compatible)

Update Version in pubspec.yaml

name: remit2any_auth
description: A Flutter package for Remit2Any authentication
version: 1.0.0  # Update this before publishing

Pre-Publishing Checklist #

  1. Update Documentation

    • Ensure README.md is complete and accurate
    • Update CHANGELOG.md with new changes
    • Verify all code examples work
  2. Code Quality

    # Run static analysis
    dart analyze
       
    # Run tests
    flutter test
       
    # Check for issues
    flutter doctor
    
  3. Package Validation

    # Validate package structure
    dart pub publish --dry-run
    
  4. Test the Package

    # Test in a local project
    cd example
    flutter pub get
    flutter run
    

Publishing Steps #

1. Prepare for Publishing

# Navigate to package directory
cd remit2any_auth

# Update version in pubspec.yaml
# Edit pubspec.yaml and increment version number

# Update CHANGELOG.md
# Add entry for new version

2. Validate Package

# Run dry-run to check for issues
dart pub publish --dry-run

# Fix any issues reported

3. Publish to pub.dev

# Publish the package
dart pub publish

# Follow the prompts to authenticate

4. Verify Publication

  • Check pub.dev for your package
  • Verify all files are uploaded correctly
  • Test installation in a new project

Post-Publishing #

1. Update Dependencies

After publishing, update the example app to use the published version:

# In example/pubspec.yaml
dependencies:
  remit2any_auth: ^1.0.0  # Use published version

2. Tag Release

# Create git tag
git tag v1.0.0
git push origin v1.0.0

3. Update Documentation

  • Update any references to use the published version
  • Update installation instructions in README

Publishing Checklist #

  • ❌ Update version in pubspec.yaml
  • ❌ Update CHANGELOG.md
  • ❌ Run dart analyze (no issues)
  • ❌ Run flutter test (all tests pass)
  • ❌ Run dart pub publish --dry-run (no issues)
  • ❌ Test package in example app
  • ❌ Publish with dart pub publish
  • ❌ Verify package on pub.dev
  • ❌ Create git tag
  • ❌ Update documentation

Troubleshooting #

Common Issues

  1. Package Name Already Taken

    • Choose a unique package name
    • Check availability on pub.dev
  2. Authentication Issues

    • Ensure you're logged into pub.dev
    • Verify Google account is linked
  3. Validation Errors

    • Fix all dart analyze issues
    • Ensure all dependencies are compatible
  4. Version Conflicts

    • Check for version conflicts in dependencies
    • Update dependencies if needed

Rollback Procedure

If you need to rollback a published version:

  1. Publish a new version with fixes
  2. Update documentation to reflect changes
  3. Communicate changes to users

Continuous Integration #

Consider setting up CI/CD for automated publishing:

# .github/workflows/publish.yml
name: Publish Package
on:
  push:
    tags:
      - 'v*'
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: dart-lang/setup-dart@v1
      - run: dart pub get
      - run: dart analyze
      - run: flutter test
      - run: dart pub publish --force

License #

MIT

0
likes
0
points
309
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for Remit2Any authentication

Homepage

License

unknown (license)

Dependencies

flutter, flutter_inappwebview, flutter_secure_storage, http

More

Packages that depend on remit2any_auth