// Autogenerated from Pigeon (v0.1.0), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import import 'dart:async'; import 'package:flutter/services.dart'; class Book { String title; String subtitle; String author; String description; String publishDate; int pageCount; // ignore: unused_element Map _toMap() { final Map pigeonMap = {}; pigeonMap['title'] = title; pigeonMap['subtitle'] = subtitle; pigeonMap['author'] = author; pigeonMap['description'] = description; pigeonMap['publishDate'] = publishDate; pigeonMap['pageCount'] = pageCount; return pigeonMap; } // ignore: unused_element static Book _fromMap(Map pigeonMap) { final Book result = Book(); result.title = pigeonMap['title']; result.subtitle = pigeonMap['subtitle']; result.author = pigeonMap['author']; result.description = pigeonMap['description']; result.publishDate = pigeonMap['publishDate']; result.pageCount = pigeonMap['pageCount']; return result; } } abstract class FlutterBookApi { void displayBookDetails(Book arg); static void setup(FlutterBookApi api) { { const BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FlutterBookApi.displayBookDetails', StandardMessageCodec()); channel.setMessageHandler((dynamic message) async { final Map mapMessage = message as Map; final Book input = Book._fromMap(mapMessage); api.displayBookDetails(input); }); } } } class HostBookApi { Future cancel() async { const BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostBookApi.cancel', StandardMessageCodec()); final Map replyMap = await channel.send(null); if (replyMap == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', details: null); } else if (replyMap['error'] != null) { final Map error = replyMap['error']; throw PlatformException( code: error['code'], message: error['message'], details: error['details']); } else { // noop } } Future finishEditingBook(Book arg) async { final Map requestMap = arg._toMap(); const BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.HostBookApi.finishEditingBook', StandardMessageCodec()); final Map replyMap = await channel.send(requestMap); if (replyMap == null) { throw PlatformException( code: 'channel-error', message: 'Unable to establish connection on channel.', details: null); } else if (replyMap['error'] != null) { final Map error = replyMap['error']; throw PlatformException( code: error['code'], message: error['message'], details: error['details']); } else { // noop } } }