Overview of Demo ACBrCep Flutter
masterACBrLibCep using the Flutter framework. It serves as a reference for integrating ACBrLibCep capabilities into Flutter-based Android applications.repository·master·Indexed 41 days ago
https://github.com/frones/acbrA collection of libraries and Android/Flutter integration guides for ACBr, including ACBrLibBAL for scale communication, ACBrLibNFe for electronic invoicing, ACBrLibPIXCD, and ACBrLibCep. The documentation also covers the use of Delphi JSON parser libraries such as json4delphi and Json Data Objects for high-performance JSON manipulation across Windows and Android.
ACBrLibCep using the Flutter framework. It serves as a reference for integrating ACBrLibCep capabilities into Flutter-based Android applications.Key features of this library include:
null to value types if JsonSerializationConfig.NullConvertsToValueTypes is set to True.The demo project is organized into logical directories to separate concerns:
lib/model/: Contains Dart data models. Includes examples of using fromJson for JSON serialization (e.g., status_servico.dart).lib/plugin/: Contains acbrnfe_plugin.dart, the Method Channel implementation that communicates with the native ACBrLibNFe functions.lib/ui/: Contains the user interface components:_core/: Global app colors and themes.acbrlib_ini/: Screen for viewing the acbrlib.ini configuration file.configuracoes/: Tabs for Geral, WebServices, Certificados, Arquivos, Email, and Documento Auxiliar.home/: The main navigation screen where the library is initialized.nfe/: Command menus for Envio, Consultas, Eventos, Inutilização, and Distribuição DFe.lib/utils/: Utility functions, including the logic for unzipping schemas.zip and the acbrlib_nfe_helper.dart Singleton implementation.The demo project is organized to separate native communication, UI, and utility logic:
lib/plugin/: Contains acbrbal_plugin.dart, the Method Channel implementation for native calls.lib/utils/: Contains acbrlib_bal_helper.dart, which implements the Singleton pattern for the library instance.lib/ui/: Contains the user interface components:_core/: Global app colors and themes.acbrlib_ini/: Screen for viewing the acbrlib.ini configuration file.bal/: Scale simulation screen for interacting with commands.configuracoes/: Scale settings screen.home/: Main navigation screen where the initialization of ACBrLibBAL occurs.The integration between Flutter and the native ACBrLibNFe library is achieved using Method Channels.
acbrnfe_plugin.dart file serves as the core communication layer. It maps Dart calls to native functions.acbrlib_nfe_helper.dart) to ensure that only one instance of the library is active throughout the application lifecycle.fromJson method in your models) to convert JSON responses from the native side into usable Dart objects.The integration between Flutter (Dart) and the native ACBrLibBAL library (Java/Kotlin) is achieved using a Method Channel.
In the provided example project, this is implemented via:
lib/plugin/acbrbal_plugin.dart: Acts as the bridge, exposing native functions to Dart. Each function in this file corresponds to the official ACBrLibBAL documentation.lib/utils/acbrlib_bal_helper.dart. This ensures only one instance of ACBrLibBAL is active throughout the application lifecycle.When creating unit tests in Delphi or Lazarus, name the test unit by appending the suffix TestsUnit to the original class name.
Example:
[NomeDaClasse]TestsUnitNomeDaClasseTestsUnitTo use ZLibExGZ in your Delphi project, follow these steps:
C:\delphi\zlib).uses clause as needed.This library is compatible with Delphi 5 through Delphi XE3 for both Win32 and Win64 platforms.
-- No specific command provided, follow manual steps above.Test names should be descriptive enough for non-developers (domain experts) to understand the intent, while remaining resilient to code refactoring.
Guidelines:
Good examples:
Purchase_without_funds_is_not_possibleDelivery_with_a_past_date_is_invalidShould_Increase_Balance_When_Deposit_Is_MadeAdd_credit_updates_customer_balancePurchase_without_funds_is_not_possibleTest classes should be named using the original class name followed by either the suffix Testes or Tests.
Examples:
[NomeDaClasse]Testes[NomeDaClasse]TestsNomeDaClasseTestesReact Native requires the Android SDK. You must set the ANDROID_HOME environment variable to the path of your Android SDK location.
To find your SDK path in Android Studio: Go to Tools -> SDK Manager and look for Android SDK Location.
Set the variable in your shell:
export ANDROID_HOME=sdk_pathAdd ANDROID_HOME to your system's environment variables.
export ANDROID_HOME=sdk_pathTo generate the ACBrLibComum.jar library file, you must run the Gradle task from the project root or the Comum folder. This process uses the Gradle wrapper to compile and package the necessary JAR files.
Steps:
Comum folder in your terminal.gradlew createJar.ACBrLibComum.jar will be located in Comum\libs\jars.gradlew createJar