패키지, 저장소 및 앱 카테고리 검색

패키지 상세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.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.