oichat_ui 0.1.1 copy "oichat_ui: ^0.1.1" to clipboard
oichat_ui: ^0.1.1 copied to clipboard

Pre-built UI widgets for OiChat SDK. Room list, chat view, and more.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:oichat_sdk/oichat_sdk.dart';
import 'package:oichat_ui/oichat_ui.dart';

/// OiChat UI 패키지 최소 사용 예제
///
/// Client Mode로 연결하여 채팅 방 목록 → 채팅 화면 흐름을 보여줍니다.
void main() {
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'OiChat UI Example',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
        useMaterial3: true,
      ),
      home: OiChatProvider(
        // === 서버 설정 (실제 값으로 교체) ===
        config: OiChatConfig(
          apiUrl: 'http://192.168.12.110',
          wsUrl: 'ws://192.168.12.110/connection/websocket',
          publicKey: 'YOUR_PUBLIC_KEY',
          projectId: 'YOUR_PROJECT_ID',
        ),
        userId: 'user_1',
        userName: 'TestUser1',

        // === 테마 커스터마이징 ===
        theme: OiChatThemeData(
          primaryColor: Colors.indigo,
          bubbleMyColor: Colors.indigo,
        ),

        // === 기능 토글 ===
        features: const OiChatFeatures(
          enableMessageEdit: false,
          enableMessageDelete: false,
        ),

        // === 방 생성에 사용할 사용자 목록 ===
        availableUsers: const [
          OiChatUser(userId: 'user_1', displayName: 'TestUser1'),
          OiChatUser(userId: 'user_2', displayName: 'TestUser2'),
          OiChatUser(userId: 'user_3', displayName: 'TestUser3'),
        ],

        // === 콜백 ===
        onConnected: () => debugPrint('Connected!'),
        onError: (e) => debugPrint('Connection error: $e'),

        // === UI ===
        child: const OiChatRoomList(),
      ),
    );
  }
}
0
likes
150
points
15
downloads

Documentation

API reference

Publisher

verified publisheroichatapi.com

Weekly Downloads

Pre-built UI widgets for OiChat SDK. Room list, chat view, and more.

Homepage
Repository (GitHub)

License

MIT (license)

Dependencies

file_picker, flutter, flutter_image_compress, http, image_picker, oichat_sdk, open_filex, path_provider, url_launcher

More

Packages that depend on oichat_ui