| // Copyright 2016 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| import 'dart:async'; |
| |
| import 'package:flutter/material.dart'; |
| import 'package:flutter/services.dart'; |
| import 'package:flutter/widgets.dart'; |
| |
| class BakuHost extends StatefulWidget { |
| @override |
| _BakuHostState createState() => new _BakuHostState(); |
| } |
| |
| class _BakuHostState extends State<BakuHost> { |
| String data; |
| |
| Future<String> _updateCast(final String data) async { |
| setState(() => this.data = data); |
| return null; |
| } |
| |
| _BakuHostState() { |
| HostMessages.addMessageHandler("updateCast", _updateCast); |
| } |
| |
| @override |
| Widget build(final BuildContext context) { |
| return new Material( |
| child: new Padding( |
| padding: new EdgeInsets.all(16.0), |
| child: new Text(data, |
| style: Theme.of(context).textTheme.display3 |
| ) |
| ) |
| ); |
| } |
| } |