update cim-client-sdk/cim-flutter-sdk/README.md.

Signed-off-by: 杨杰 <5301327+smebclub@user.noreply.gitee.com>
This commit is contained in:
杨杰 2023-07-04 06:15:21 +00:00 committed by Gitee
parent f798e8a6fb
commit c5947f718f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,18 +1,41 @@
# cim_flutter_sdk
A new Flutter plugin project.
开源通讯库 [CIM](https://gitee.com/farsunset/cim) 的 flutter版本SDK
## Getting Started
## 如何使用
This project is a starting point for a Flutter
[plug-in package](https://flutter.dev/developing-packages/),
a specialized package that includes platform-specific implementation code for
Android and/or iOS.
For help getting started with Flutter development, view the
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
The plugin project was generated without specifying the `--platforms` flag, no platforms are currently supported.
To add platforms, run `flutter create -t plugin --platforms <platforms> .` in this directory.
You can also find a detailed instruction on how to add platforms in the `pubspec.yaml` at https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms.
```
import 'package:cim_flutter_sdk/cim_flutter_sdk.dart';
...
CIMSocket cimSocket;
String Message = 'Unknown';
cimSocket = await _cimFlutterSdkPlugin.connect(
'127.0.0.1', 23456, 16501516154949);
cimSocket.addListener(() {
print(cimSocket.model!.toProto3Json());
if (!mounted) return;
setState(() {
Message = cimSocket.model!.toProto3Json().toString();
});
});
...
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: Center(
child: Text('Message is: $Message\n'),
),
),
);
```