Skip to content

Commit

Permalink
Add more Wasm fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavBfr committed Feb 12, 2025
1 parent 974ac37 commit fb908fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions printing/lib/src/platform_js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
*/

const useFFI = false;
const isAndroid = false;
2 changes: 2 additions & 0 deletions printing/lib/src/platform_os.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
import 'dart:io' show Platform;

final useFFI = Platform.isMacOS || Platform.isIOS;

final isAndroid = Platform.isAndroid;
4 changes: 2 additions & 2 deletions printing/lib/src/preview/raster.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/

import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'dart:typed_data';

Expand All @@ -24,6 +23,7 @@ import 'package:flutter/foundation.dart'
import 'package:flutter/material.dart';
import 'package:pdf/pdf.dart';

import '../platform_js.dart' if (dart.library.io) '../platform_os.dart';
import '../printing.dart';
import '../printing_info.dart';
import '../raster.dart';
Expand Down Expand Up @@ -74,7 +74,7 @@ mixin PdfPreviewRaster on State<PdfPreviewCustom> {
} else {
final mq = MediaQuery.of(context);
final double dpr;
if (!kIsWeb && Platform.isAndroid) {
if (isAndroid) {
if (mq.size.shortestSide * mq.devicePixelRatio < 800) {
dpr = 2 * mq.devicePixelRatio;
} else {
Expand Down

0 comments on commit fb908fe

Please sign in to comment.