GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - waitwalker/flutter_socket_plugin: FlutterSocket

BranchesTags
Open more actions menu

Latest commit

 

History

58 Commits
58 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
android
android
 
 
example
example
 
 
ios
ios
 
 
lib
lib
 
 
test
test
 
 
.gitignore
.gitignore
 
 
.metadata
.metadata
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README-ZH.md
README-ZH.md
 
 
README.md
README.md
 
 
flutter_socket_plugin.iml
flutter_socket_plugin.iml
 
 
pubspec.lock
pubspec.lock
 
 
pubspec.yaml
pubspec.yaml
 
 

Repository files navigation

Language: English | 中文简体

FlutterSocket

build status Pub support

FlutterSocket is a practical cross-platform socket plugin. At present, it has realized the basic functions of client side: create, connect, send, receive, disconnect and so on.

If you need other functions, you can expand on this basis.

Demo

Demo

Video

video url: https://www.youtube.com/watch?v=fmtwYHeOvE0

Add dependency

dependencies:
  flutter_socket_plugin: lastest version  

Simple to use

import 'package:flutter_socket_plugin/flutter_socket_plugin.dart';
  ///
  /// @Method: initSocket
  /// @Parameter:
  /// @ReturnType:
  /// @Description: init socket
  /// @author: waitwalker
  /// @Date: 2019-08-23
  ///
  initSocket() {
    
    /// init socket
    flutterSocket = FlutterSocket();

    /// listen connect callback
    flutterSocket.connectListener((data){
      print("connect listener data:$data");
    });

    /// listen error callback
    flutterSocket.errorListener((data){
      print("error listener data:$data");
    });

    /// listen receive callback
    flutterSocket.receiveListener((data){
      print("receive listener data:$data");
      if (data != null) {
        receiveMessage = receiveMessage + "\n" + data;
      }
      setState(() {

      });
    });

    /// listen disconnect callback
    flutterSocket.disconnectListener((data){
      print("disconnect listener data:$data");
    });

  }

Steps

Create socket :

await flutterSocket.createSocket("192.168.8.120", 10007, timeout: 20);

Connect connect :

flutterSocket.tryConnect();

Send message send :

flutterSocket.send(textEditingController.text);

Disconnect disconnect :

flutterSocket.tryDisconnect();

Examples

you can find all examples code here.

Future

FlutterSocket currently implements the sending and receiving of basic String messages on the client. In the future, it will gradually improve its functions if conditions permit. If you need some functions urgently, you can continue to add functions on the basis of FlutterSocket to make the function of FlutterSocket more powerful and perfect.

Copyright & License

This project is completely open source and the license is MIT. If you like, welcome star.

Features and bugs

Please file feature requests and bugs at the issue tracker.

Flutter Technology and Other Communication Groups

wechat:dbzy_duzhao

About

FlutterSocket

waitwalker.cn

Resources

Readme
MIT license
Activity

Stars

16 stars

Watchers

2 watching

Forks

11 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.