nim 1.0.0-rc.3 copy "nim: ^1.0.0-rc.3" to clipboard
nim: ^1.0.0-rc.3 copied to clipboard

discontinuedreplaced by: nim_core
PlatformAndroidiOS

A Flutter plugin for NetEase NIM SDK on Android and iOS.

example/lib/main.dart

// Copyright (c) 2021 NetEase, Inc.  All rights reserved.
// Use of this source code is governed by a MIT license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';

import 'package:nim/nim.dart';
import 'package:nim_example/contact/friends_page.dart';
import 'package:nim_example/msg/chat_page.dart';
import 'package:nim_example/msg/msg_page.dart';
import 'package:nim_example/passthrough/passthough_page.dart';

import 'auth/loginpage.dart';

void main() => runApp(NimApp());

class NimApp extends StatelessWidget {

  String _appKey = "your app key";

  NimApp() {
    WidgetsFlutterBinding.ensureInitialized();
    print("excute nim app");
    NimPlugin().config(appKey: _appKey);
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        theme: ThemeData(primaryColor: Colors.blue),
        home: LoginPage(),
        routes: <String,WidgetBuilder>{
          'messagePage': (BuildContext context) => MessagePage(),
          'chatRoomPage': (BuildContext context) => ChatPage(),
          'passthroughPage': (BuildContext context) => PassThroughPage(),
          'friendsPage': (BuildContext context) => FriendsPage(),
        }
    );
  }
}
0
likes
105
pub points
1%
popularity

Publisher

verified publisheryunxin.163.com

A Flutter plugin for NetEase NIM SDK on Android and iOS.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on nim