パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.3.0

message_segment_calculator

GSMおよびUCS-2エンコーディングをサポートするメッセージのSMSセグメントを効率的に計算します。正確なSMS長さとコスト管理が必要なアプリに最適です。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
299
いいね数
8
Pub ポイント
160

パッケージをインストール

flutter pub add message_segment_calculator

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

message_segment_calculator パッケージは、指定されたメッセージに必要な SMS セグメントの数を効率的に決定し、GSM および UCS-2 文字エンコーディングをサポートしています。メッセージ長を正確に制御し、SMS のコストを管理するのに役立ちます。メッセージがどのくらいのセグメントを占めるかを正確に計算することで、配信効率とコストが重要な SMS 通知、アラート、マーケティングメッセージを送信するアプリケーションに最適です。このパッケージは軽量で、Android、iOS、Web、macOS、Windows、Linux など複数のプラットフォームと互換性があります。

用途

  • SMSコスト推定
  • メッセージ長さの検証
  • バルクSMS管理
  • 通知システム
  • SMS制限の遵守
  • クロスプラットフォームSMSアプリ

主な機能

  • GSMおよびUCS-2エンコーディングをサポート
  • 正確なセグメントカウント
  • クロスプラットフォーム互換性
  • 軽量で高速
  • リアルタイム長さ計算
  • 特殊文字を正しく処理します

適している対象

  • メッセージングアプリ
  • 通信ツール
  • マーケティングプラットフォーム
  • エンタープライズ通知システム
  • SMSコスト制御を必要とするアプリ

注意事項

  • 長メッセージの手動処理が必要です
  • メッセージを送信しない—セグメントの計算のみ
  • エンコーディングの選択は、コンテンツに基づいて行う必要があります
  • MMSまたはマルチメディアメッセージには適していません
  • SMS固有の利用ケースに限定

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

SMS Segment Calculator

The SMS Segment Calculator is a Dart package designed to help developers accurately calculate the number of SMS segments required for messages. It supports both GSM-7 and UCS-2 encoding standards, providing a robust solution for applications that involve SMS messaging. The package ensures cost-effective messaging by optimizing message segmentation and encoding.

Key Features

  • Accurate SMS Segmentation: Automatically calculates the number of segments needed for a given SMS message based on its content and required encoding (GSM-7 or UCS-2).
  • Support for Special Characters and Emojis: Detects texts containing emojis or special characters and switches to UCS-2 encoding when necessary.
  • Comprehensive Encoding Management: Handles the encoding of individual characters and manages their conversion to the appropriate encoding format.
  • Cost Management: Provides precise segment counts for budgeting and planning SMS costs effectively.
  • Line Break Handling: Identifies different line break styles and issues warnings if incompatible styles are detected.

Installation

To integrate the SMS Segment Calculator into your Dart or Flutter project, add the following dependency to your pubspec.yaml file:

dependencies:
  message_segment_calculator: ^1.1.0



## Usage

import 'package:flutter/material.dart';
import 'package:message_segment_calculator/src/segmented_message.dart';

void main() {
  runApp(const App());
}

/// The root widget of the application.
class App extends StatelessWidget {
  const App({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MessageSegmentCalculatorWidget(),
    );
  }
}

/// A stateful widget that provides a UI for calculating message segments.
class MessageSegmentCalculatorWidget extends StatefulWidget {
  const MessageSegmentCalculatorWidget({super.key});

  @override
  State<MessageSegmentCalculatorWidget> createState() =>
      _MessageSegmentCalculatorWidgetState();
}

/// The state class for [MessageSegmentCalculatorWidget].
class _MessageSegmentCalculatorWidgetState
    extends State<MessageSegmentCalculatorWidget> {
  final textEditingController = TextEditingController();
  SegmentedMessage? segmentedMessage;

  @override
  void dispose() {
    textEditingController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Message Segment Calculator'),
      ),
      body: Padding(
        padding: const EdgeInsets.all(10),
        child: Column(
          children: [
            const Text('Enter text'),
            const SizedBox(height: 10),
            TextFormField(
              decoration: const InputDecoration(),
              controller: textEditingController,
              onChanged: (value) {
                setState(() {
                  segmentedMessage = SegmentedMessage(value);
                });
              },
            ),
            const SizedBox(height: 10),
            Text('Number of characters: ${segmentedMessage?.numberOfCharacters}'),
            Text('Number of segments: ${segmentedMessage?.segmentsCount}'),
            Text('Number of Unicode scalars: ${segmentedMessage?.numberOfUnicodeScalars}'),
            Text('Message size in bits: ${segmentedMessage?.messageSize}'),
            Text('Total size in bits: ${segmentedMessage?.totalSize}'),
          ],
        ),
      ),
    );
  }
}




### Key Additions:
- **Detailed Descriptions**: Each class is explained to clarify its role in the package.
- **Usage Example**: Shows a practical example to help developers quickly understand how to use the package.
- **Installation Instructions**: Guides users on how to add the package to their project.
- **Contribution Guidelines**: Encourages contributions and provides a link to the issues page.

This README provides a comprehensive overview, making it easier for users to understand and use the package effectively.

カテゴリー

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。