shyun_link 3.0.1 copy "shyun_link: ^3.0.1" to clipboard
shyun_link: ^3.0.1 copied to clipboard

Streamlined deeplink and short URL management with Clean Architecture. Focused on core functionality - ShyunLinkManager.createShortLink() and deeplink handling with multiple URL format support.

ShyunLink #

Streamlined deeplink and short URL management with Clean Architecture

ShyunLink provides focused deeplink and short URL management for Flutter apps. Version 3.1.0 is streamlined to focus on core functionality - ShyunLinkManager.createShortLink() and deeplink handling with support for multiple URL formats.

pub version license

โœจ v3.1.0 Core Features #

  • ๐ŸŽฏ Focused API: Streamlined to essential functionality
  • ๐Ÿ”— Short Link Creation: Template-based URL generation with ShyunLinkManager.createShortLink()
  • ๐Ÿ“ฑ Deeplink Handling: Robust support for 4 deeplink formats (parameterized, direct, web URL, fallback)
  • ๐Ÿ—๏ธ Clean Architecture: Strategy Pattern for extensible deeplink processing
  • โšก Lightweight: Reduced dependencies and package size
  • ๐Ÿงน Clean Codebase: Removed unnecessary features for better maintainability

Quick Start #

Installation #

Add this to your pubspec.yaml:

dependencies:
  shyun_link: ^3.1.0
  app_links: ^3.4.3  # Optional for deeplink handling

Setup #

import 'package:flutter/material.dart';
import 'package:shyun_link/shyun_link.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  
  // Initialize ShyunLink system
  await ShyunLinkManager.initialize(
    appScheme: 'myapp',
    webBaseUrl: 'https://myapp.com',
    apiServerUrl: 'https://api.myapp.com', // Optional
    onDeepLink: (context) {
      // Handle deeplink navigation
      Navigator.pushNamed(
        navigatorKey.currentContext!,
        context.route,
        arguments: context.params,
      );
    },
  );
  
  runApp(MyApp());
}

2. Native Platform Setup

For deeplinks to work properly, you need native configuration:

  • Android: Add intent-filter to android/app/src/main/AndroidManifest.xml
  • iOS: Add URL scheme to ios/Runner/Info.plist

See Platform Setup Guide for detailed instructions.

Core Usage #

// Create store link with new template pattern
final storeLink = await ShyunLinkManager.createShortLink(
  pageName: 'store',
  pageType: 'store',
  pageId: 123,
);

// Create curation link
final curationLink = await ShyunLinkManager.createShortLink(
  pageName: 'curationDetail',
  pageType: 'curation',
  pageId: 456,
);

// Simple page link (no ID required)
final eventLink = await ShyunLinkManager.createShortLink(
  pageName: 'event',
  pageType: 'event-promotion',
);

ShyunLink automatically handles 4 types of deeplink formats:

// 1. Parameterized: myapp://page?type=store&id=123
// 2. Direct path: myapp://store/123  
// 3. Web URL: https://myapp.com/store/123
// 4. Fallback: Unknown formats โ†’ home page
// Get details about a short link
final linkInfo = await ShyunLinkManager.getLinkInfo(shortUrl);
if (linkInfo != null) {
  print('Original URL: ${linkInfo.originalUrl}');
  print('Created: ${linkInfo.createdAt}');
}

ShyunLink handles these deeplink formats automatically:

# 1. Parameterized (Query-based)
myapp://page?type=store&id=123
myapp://curationDetail?type=curation&id=456

# 2. Direct Path
myapp://store/123
myapp://curationDetail/456

# 3. Web URLs (Universal/App Links)
https://myapp.com/store/123
https://myapp.ly/abc123

# 4. Fallback (Unknown โ†’ Home)
myapp://unknown-page โ†’ Redirects to home
# Android (ADB)
adb shell am start -W -a android.intent.action.VIEW -d "myapp://store/123" com.example.myapp

# iOS (Simulator)
xcrun simctl openurl booted "myapp://store/123"

# Web testing
open "https://myapp.com/store/123"

Migration from v3.0.x #

Removed Features #

If you were using sharing features, implement them externally:

// Before (v3.0.x)
await ShyunLinkManager.shareStore(123, customText: 'Check this out!');

// After (v3.1.0) - Create link then share manually
final shortUrl = await ShyunLinkManager.createShortLink(
  pageName: 'store',
  pageType: 'store', 
  pageId: 123,
);
// Use share_plus or other sharing package
await Share.share('Check this out!\n\n$shortUrl');

Documentation #

  • Platform Setup Guide - Android/iOS native configuration
  • Architecture Guide - Clean Architecture overview
  • API Reference - Complete API documentation

Example #

Check the example directory for a complete implementation:

  • โœ… Android/iOS native configuration
  • โœ… ShyunLinkManager API demonstration
  • โœ… Deeplink testing utilities
  • โœ… Core functionality showcase

Contributing #

Bug reports, feature suggestions, and contributions are welcome! Please create an issue or submit a Pull Request.

License #

This project is licensed under the MIT License. See the LICENSE file for details.

3
likes
130
points
673
downloads

Publisher

unverified uploader

Weekly Downloads

Streamlined deeplink and short URL management with Clean Architecture. Focused on core functionality - ShyunLinkManager.createShortLink() and deeplink handling with multiple URL format support.

Repository (GitHub)

Topics

#deeplink #url #shortlink #navigation

Documentation

API reference

License

MIT (license)

Dependencies

app_links, dio, flutter, logger, url_launcher

More

Packages that depend on shyun_link

Packages that implement shyun_link