Before you can use Simple Log Service SDK for Flutter to call the API operations of Simple Log Service, you must install Simple Log Service SDK for Flutter. This topic describes how to install Simple Log Service SDK for Flutter.
Prerequisites
Simple Log Service is activated. For more information, visit the product page of Simple Log Service.
An AccessKey pair is created and obtained. For more information, see AccessKey pair.
ImportantThe AccessKey pair of an Alibaba Cloud account has permissions on all API operations. Using these credentials to perform operations in Simple Log Service is a high-risk operation. We recommend that you use a RAM user to call API operations or perform routine O&M. To create a RAM user, log on to the RAM console. Make sure that the RAM user is granted the management permissions on Simple Log Service resources. For more information, see Create a RAM user and authorize the RAM user to access Simple Log Service.
A Flutter development environment is installed. For more information, visit Install Flutter.
Simple Log Service SDK for Flutter supports Android 4.0 and later versions and iOS 10.0 and later versions.
Install the SDK
Import the Simple Log Service SDK for Flutter module. You can run the following command in the root directory of the project:
flutter pub add aliyun_log_dart_sdkAfter the command is run, the following information is added to the
pubspec.yamlfile of the project, and theflutter pub getcommand is implicitly run.dependencies: aliyun_log_dart_sdk: ^1.0.0 // For more information about versions, see Overview of Log Service SDK for Flutter.After the module is imported, import the Simple Log Service module to a specified Dart file to initiate calls and write code.
import 'package:aliyun_log_dart_sdk/aliyun_log_dart_sdk.dart';