ScerIO / packages.flutter

👨‍💻 Plugins and packages for Flutter framework
https://pub.dev/publishers/serge.software/packages
MIT License
461 stars 455 forks source link

not work on Windows #258

Open insinfo opened 2 years ago

insinfo commented 2 years ago

not work on windows flutter: Error getting printing info: MissingPluginException(No implementation found for method open.document.data on channel io.scer.native_pdf_renderer)

Observer(builder: (_) {
                    if (controller.pdfContrachequeState ==
                        LoadingState.loading) {
                      return Center(
                        child: CircularProgressIndicator(),
                      );
                    }
                    if (controller.pdfContrachequeState == LoadingState.none) {
                      return Container();
                    }
                    if (controller.pdfContrachequeState == LoadingState.error) {
                      return Center(
                        child: Text('erro ao carregar o contracheque'),
                      );
                    }

                    final pdfController = PdfController(
                      document:
                          PdfDocument.openData(controller.pdfContracheque!),
                    );
                    return Container(
                        width: MediaQuery.of(context).size.width * 0.9,
                        height: 300,
                        child: PdfView(
                          controller: pdfController,
                        ));
                  })

image

name: riodasostrasapp
description: App Oficial da Prefeitura de Rio das Ostras
version: 1.2.6+6
publish_to: none
environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_localizations:
    sdk: flutter
  #para o Quiz
  font_awesome_flutter: ^9.2.0 #Null safety full
  flutter_custom_clippers: ^2.0.0 #Null safety full
  html_unescape: ^2.0.0 #Null safety full
  auto_size_text: ^3.0.0 #Null safety full
  connectivity_plus: ^2.1.0 #Null safety full
  url_launcher: ^6.0.17 #Null safety full
  share_plus: ^3.0.4 #Null safety share_plus
  map_launcher: ^2.1.1 #Null safety 
  platform_device_id: ^1.0.1 #Null safety full
  #location_permissions: ^4.0.1  # foi substituído pelo permission_handler 8.3.0  #Null safety
  location: ^4.3.0 #Null safety
  flutter_inappwebview: ^5.3.2 #Null safety  
  firebase_messaging: ^11.2.4 #Null safety  
  shared_preferences: ^2.0.11 #Null safety full
  sqflite: ^2.0.1 #Null safety 
  path_provider: ^2.0.8 #Null safety
  flutter_advanced_networkimage_2: ^2.0.0 #Null safety full
  cached_network_image: ^3.2.0 #Null safety 
  webview_flutter: ^3.0.0 #Null safety 
  flutter_map: ^0.14.0 #Null safety full
  latlong2: ^0.8.1 #Null safety full
 # queries: ^0.1.15 
  collection: ^1.15.0 #Null safety
  intl: ^0.17.0 #Null safety full
  http: ^0.13.4 #Null safety full
  dio: ^4.0.4 #Null safety full  
  universal_html: ^2.0.8 #Null safety full

  #wideget para infinit scroll
  incrementally_loading_listview: ^1.0.0 #Null safety
  mobx: any
  flutter_mobx: any 
  provider: ^6.0.1 #Null safety full  
  flutter_modular: ^4.3.0  #Null safety full
  equatable: ^2.0.3 #Null safety full
  carousel_slider: ^4.0.0 #Null safety full
  #para armazenar o token  
  flutter_secure_storage: ^5.0.2 #Null safety full 
  jaguar_jwt: ^3.0.0 #Null safety
  barcode_scan2: ^4.2.0  #Null safety full
  #gerar codigo qr
  #qr_flutter: ^4.0.0  # Null safety full     
  pdf: ^3.6.5 #Null safety full
  #printing: ^5.3.0 #Null safety full
  native_pdf_view: ^5.0.0
  qr: ^3.0.0 #Null safety full

  riodasostrasapp_core:
    path: ../riodasostrasapp_core
   # hosted:
   #   name: riodasostrasapp_core
   #   url: http://pub.riodasostras.rj.gov.br:4000
   # version: ^1.0.39

dependency_overrides:
  rxdart: ^0.27.3 #Null safety full

dev_dependencies:
#  flutter_test:
#    sdk: flutter
#  mockito: ^4.1.1
  build_runner: ^2.1.7 #Null safety
  mobx_codegen: ^2.0.4 #Null safety
  slidy: ^3.2.2+2 #Null safety full

flutter:
  uses-material-design: true

  assets:
    - assets/images/

  fonts:
    - family: Poppins
      fonts:
        - asset: assets/fonts/Poppins/Poppins-Regular.ttf
        - asset: assets/fonts/Poppins/Poppins-Medium.ttf
          weight: 600
        - asset: assets/fonts/Poppins/Poppins-Bold.ttf
          weight: 700
    - family: Montserrat
      fonts:
        - asset: assets/fonts/Montserrat/Montserrat-Regular.ttf
        - asset: assets/fonts/Montserrat/Montserrat-Medium.ttf
          weight: 600
        - asset: assets/fonts/Montserrat/Montserrat-Bold.ttf
          weight: 700      
    - family: pmro_app
      fonts:
        - asset: assets/fonts/pmro.ttf         

scripts:
  mobx: flutter pub run build_runner watch --delete-conflicting-outputs
insinfo commented 2 years ago

image

PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob> flutter build windows

 Building with sound null safety

CMake Error at flutter/ephemeral/.plugin_symlinks/native_pdf_renderer/windows/DownloadProject.cmake:179 (message):
  Build step for pdfium failed: 1
Call Stack (most recent call first):
  flutter/ephemeral/.plugin_symlinks/native_pdf_renderer/windows/CMakeLists.txt:16 (download_project)

Building Windows application...
Unable to generate build files
PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob>
PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob> flutter doctor -v
[√] Flutter (Channel stable, 2.8.1, on Microsoft Windows [versão 10.0.22000.376], locale pt-BR)
    • Flutter version 2.8.1 at C:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (4 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[√] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at C:\Users\isaque\AppData\Local\Android\sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31702.278
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.63.2)
    • VS Code at C:\Users\isaque\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [versão 10.0.22000.376]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 97.0.4692.71
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 96.0.1054.62

• No issues found!
PS C:\MyDartProjects\riodasostras\riodasostrasapp_mob>
albert0m commented 2 years ago

the download_project error is fixed here: https://github.com/rbcprolabs/packages.flutter/pull/233

insinfo commented 2 years ago

I didn't quite understand what you said, but it seems that an update has not yet been released that solves this problem.

barbalex commented 2 years ago

In my case v4.0.0 works but v4.0.1 fails on windows with above error. I can't update to v5 and test that because in my case it is a dependency of a dependency.

I solved using the following in pubspec.yaml:

dependency_overrides:
  native_pdf_renderer: 4.0.0