This topic describes how to compile the demo of Push SDK for Flutter.
Environment requirements
Item | Description |
Flutter version | Versions equal to or later than 2.5.0 and earlier than 3.0.0 are supported. |
Dart version | Versions equal to or later than 2.12.0 and earlier than 3.0.0 are supported. |
OS version | Android 5.0 and later are supported. |
CPU architecture | armeabi-v7a and arm64-v8a are supported. |
Development tool | We recommend that you use Android Studio or Visual Studio Code. Note For Android, you can use Android Studio or Visual Studio Code. For iOS, we recommend that you use Visual Studio Code. |
Use Android Studio
Download the demo package of Push SDK for Flutter of the required version. For information about the download link, see Select and download SDKs.
Import the project.
Open Android Studio, click Open, and then select the flutter_livepush_demo project.


Run the project.
When you run the project, we recommend that you add the following argument:
--no-sound-null-safety
If you do not add the preceding argument, the following error may occur.

Use Visual Studio Code
Import the project.
Open Visual Studio Code, choose File > Open, and then select the flutter_livepush_demo project.


Run the project.
Android:
Run the following commands in the flutter_livepush_demo directory:
flutter clean flutter pub get flutter pub upgradeRun the following commands in the terminal:
# Run the debug version. flutter run --debug --no-sound-null-safety # Run the release version. flutter run --release --no-sound-null-safety
iOS:
Run the following commands in the flutter_livepush_demo directory:
flutter clean flutter pub get flutter pub upgradeUse one of the following methods to compile and run the project:
Method 1: Run the
flutter runcommand in the terminal.# Run the debug version. flutter run --debug --no-sound-null-safety # Run the release version. flutter run --release --no-sound-null-safetyMethod 2: Install Xcode and run the following command in the flutter_livepush_demo/ios directory. We recommend that you use CocoaPods 1.11.0 or later to ensure that Push SDK for Flutter is run as expected.
pod installAfter the Podfile.lock file and the Pods folder are generated, open Runner.xcworkspace to run the project in Xcode.
NoteIf null safety issues related to fish_redux or fluttertoast occur after you use Method 2, we recommend that you use Method 1 to run the project by using the
flutter runcommand. If the command succeeds, run the project in Xcode.