David PHAM-VAN

Fix Flutter Web not happy with FFI

@@ -21,10 +21,10 @@ import 'dart:typed_data'; @@ -21,10 +21,10 @@ import 'dart:typed_data';
21 import 'package:flutter/rendering.dart' show Rect; 21 import 'package:flutter/rendering.dart' show Rect;
22 import 'package:flutter/services.dart'; 22 import 'package:flutter/services.dart';
23 import 'package:pdf/pdf.dart'; 23 import 'package:pdf/pdf.dart';
24 -import 'package:printing/src/method_channel_ffi.dart';  
25 24
26 import 'callback.dart'; 25 import 'callback.dart';
27 import 'interface.dart'; 26 import 'interface.dart';
  27 +import 'method_channel_ffi.dart' if (dart.library.js) 'method_channel_js.dart';
28 import 'print_job.dart'; 28 import 'print_job.dart';
29 import 'printer.dart'; 29 import 'printer.dart';
30 import 'printing_info.dart'; 30 import 'printing_info.dart';
  1 +/*
  2 + * Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
  3 + *
  4 + * Licensed under the Apache License, Version 2.0 (the "License");
  5 + * you may not use this file except in compliance with the License.
  6 + * You may obtain a copy of the License at
  7 + *
  8 + * http://www.apache.org/licenses/LICENSE-2.0
  9 + *
  10 + * Unless required by applicable law or agreed to in writing, software
  11 + * distributed under the License is distributed on an "AS IS" BASIS,
  12 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13 + * See the License for the specific language governing permissions and
  14 + * limitations under the License.
  15 + */
  16 +
  17 +import 'dart:typed_data';
  18 +
  19 +import 'print_job.dart';
  20 +
  21 +/// Set the Pdf document data
  22 +void setDocumentFfi(PrintJob job, Uint8List data) {
  23 + throw UnimplementedError('Not using FFI');
  24 +}
  25 +
  26 +/// Set the Pdf Error message
  27 +void setErrorFfi(PrintJob job, String message) {
  28 + throw UnimplementedError('Not using FFI');
  29 +}
@@ -27,13 +27,13 @@ import 'package:flutter/rendering.dart' show Rect; @@ -27,13 +27,13 @@ import 'package:flutter/rendering.dart' show Rect;
27 import 'package:flutter_web_plugins/flutter_web_plugins.dart'; 27 import 'package:flutter_web_plugins/flutter_web_plugins.dart';
28 import 'package:image/image.dart' as im; 28 import 'package:image/image.dart' as im;
29 import 'package:pdf/pdf.dart'; 29 import 'package:pdf/pdf.dart';
30 -import 'package:printing/src/pdfjs.dart';  
31 -import 'package:printing/src/printer.dart';  
32 -import 'package:printing/src/raster.dart';  
33 30
34 import 'callback.dart'; 31 import 'callback.dart';
35 import 'interface.dart'; 32 import 'interface.dart';
  33 +import 'pdfjs.dart';
  34 +import 'printer.dart';
36 import 'printing_info.dart'; 35 import 'printing_info.dart';
  36 +import 'raster.dart';
37 37
38 /// Print plugin targetting Flutter on the Web 38 /// Print plugin targetting Flutter on the Web
39 class PrintingPlugin extends PrintingPlatform { 39 class PrintingPlugin extends PrintingPlatform {