| // 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 'app.dart'; |
| import 'host.dart'; |
| |
| void main() { |
| runApp(new MaterialApp( |
| title: 'Baku Distro', |
| routes: { |
| '/app': (_) => new BakuDistro(), |
| '/host': (_) => new BakuHost() |
| }, |
| home: new Builder(builder: _buildContainer) |
| )); |
| } |
| |
| Widget _buildContainer(final BuildContext context) { |
| Future<String> _runApp(_) async { |
| Navigator.popAndPushNamed(context, '/app'); |
| return null; |
| } |
| |
| Future<String> _runHost(_) async { |
| Navigator.popAndPushNamed(context, '/host'); |
| return null; |
| } |
| |
| HostMessages.addMessageHandler('runApp', _runApp); |
| HostMessages.addMessageHandler('runHost', _runHost); |
| |
| return new Material(); |
| } |