• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5import 'package:fidl/fidl.dart';
6
7import 'package:fuchsia_services/services.dart';
8import 'package:fidl_fuchsia_examples_hello/fidl_async.dart';
9
10class _HelloImpl extends Hello {
11  final HelloBinding _binding = HelloBinding();
12
13  void bind(InterfaceRequest<Hello> request) {
14    _binding.bind(this, request);
15  }
16
17  @override
18  Future<String> say(String request) async {
19    return request == 'hello' ? 'hola from Dart!' : 'adios from Dart!';
20  }
21}
22
23void main(List<String> args) {
24  StartupContext context = StartupContext.fromStartupInfo();
25
26  context.outgoing
27      .addPublicService(_HelloImpl().bind, Hello.$serviceName);
28}
29