Page MenuHomec4science

homePage.dart
No OneTemporary

File Metadata

Created
Thu, May 23, 03:49

homePage.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
import 'package:student/SoCKet.dart';
class HomePage extends StatefulWidget {
final String title;
final WebSocketChannel channel;
final SoCKet webSoCKet = new SoCKet();
HomePage({Key key, @required this.title, @required this.channel})
: super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
TextEditingController _controller = TextEditingController();
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Padding(
padding: const EdgeInsets.all(20.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
'Group Members',
style: const TextStyle(
color: Colors.blue,
fontSize: 25.0,
fontWeight: FontWeight.bold,
),
),
Form(
child: TextFormField(
controller: _controller,
decoration: InputDecoration(labelText: 'your name'),
),
),
Form(
child: TextFormField(
controller: _controller,
decoration: InputDecoration(labelText: 'your name'),
),
),
Form(
child: TextFormField(
controller: _controller,
decoration: InputDecoration(labelText: 'your name'),
),
),
StreamBuilder(
stream: widget.channel.stream,
builder: (context, snapshot) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 24.0),
child: Text(snapshot.hasData ? '${snapshot.data}' : ''),
);
},
)
],
),
),
floatingActionButton: FloatingActionButton(
tooltip: 'Send message',
child: Icon(Icons.send),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
@override
void dispose() {
// widget.channel.sink.close();
super.dispose();
}
}

Event Timeline