get_server 0.5.0 copy "get_server: ^0.5.0" to clipboard
get_server: ^0.5.0 copied to clipboard

outdated

A backend server that makes it possible to program with Flutter syntax and reuse existing code

[0.5.0] #

  • Added PageNotFound on GetServer

[0.4.0] #

  • Added Widgets "Text", "Json" and "Html"
  • Breaking changes: now you need return a widget. The syntax that used to be similar to that of Flutter, is now identical to that of Flutter:

To show clear text:

void main() {
  runApp(GetServer(
    getPages: [
      GetPage(name: '/', page: Home()),
    ],
  ));
}

class Home extends GetView {
  @override
  Widget build(Context context) {
    return Text("Welcome to GetX");
  }
}

To create Websocket page:

class SocketPage extends GetView {
  @override
  build(Context context) {
    return Socket(context, builder: (socket) {
      socket.onMessage.listen((data) {
        print('data: $data');
        socket.send(data);
      });

      socket.onOpen.listen((ws) {
        print('new socket opened');
      });

      socket.onClose.listen((ws) {
        print('socket has been closed');
      });
    });
  }
}

Great performance Improvement. Now Get_Server is 2.3X faster than Node.js to http requests.

[0.3.0] #

  • Added join, leave and sendToRoom to websocket

[0.2.0] #

  • Added "pageNotFound" to context, and "close"

[0.1.0] #

  • Added optional "Functional way" of create server

[0.0.1] #

  • Initial Release
323
likes
0
pub points
87%
popularity

Publisher

verified publishergetx.site

A backend server that makes it possible to program with Flutter syntax and reuse existing code

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http_server, meta, mime

More

Packages that depend on get_server