Introduce
Cloud function is a Serverless Computing services , Provide FaaS(Function as a Service) Ability , It can help developers greatly simplify the affairs related to application development and operation and maintenance , Reduce the implementation threshold of application functions , Quickly build business capabilities . Here's how to do it in Flutter Integrate cloud functions under the framework .
Integration steps
1. install flutter Environmental Science
a) download Flutter sdk package , Address :https://flutter.dev/docs/get-started/install/windows

Unzip the package to any folder
b) take flutter Add the command file to the environment variable
c) stay Android Studio Download Flutter and Dart plug-in unit

2. Opening service & Create a project
a) stay AGC establish Android Apply and activate cloud functions
b) Create the function we need in the cloud function , Refer to the official documents for specific steps :
c) After the function is created, we need to create a trigger , End side trigger we need to create HTTP trigger , Please refer to the official documents for specific operation methods :
d) stay Android Studio New China Flutter engineering

e) take agconnect-services.json File put in Android/app Under the table of contents

f) To configure Maven Warehouse address and AGC Plug-in address .
- open Flutter project android Under folder build.gradle file .
- stay allprojects -> repositories It's equipped with maven Warehouse address .
- stay buildscript ->repositories Middle configuration maven Warehouse address .
- stay buildscript ->dependencies Middle configuration AppGallery Connect Plug-in address .

3. Add compilation dependencies and AGC Plug-in address .
a) open Flutter project android/app Under folder build.gradle file .
b) Add the following configuration to the file .

4. Integrate SDK
stay pubspec.yaml Add remote configuration to the file pub rely on

And then click Pub get To synchronize

5. Basic function
The function of cloud function is actually very simple , All we need to do on the end side is to call the cloud functions , But here are a few steps
a) We need to create one FunctionCallable Example , Pass in the trigger ID when we created the trigger
FunctionCallable functionCallable = FunctionCallable("test-\$latest");b) We need to pass the input parameters of the function map In the format of
Map<String, dynamic> parameters = <String, dynamic> {
'year': _functionTextController.text
};c) Finally, we passed call Method calls the cloud function after the input parameter is passed in.
FunctionResult functionResult = await functionCallable.call(parameters);adopt FunctionResult, We can get the return of the function .
summary
Huawei AGC Cloud functions support the deployment of some complex or the same computing processes on the cloud , Client pass SDK You can get the calculation result you want by calling , It saves a lot of development cost and convenience for developers .
How to be in Flutter More articles about integrating Huawei cloud function services in
- The use of cloud database in Huawei cloud functions JavaScript SDK Basic introduction
Background introduction Using cloud database Server Terminal SDK, Here I take the official provided by Huawei Demo For example , their Demo Open source has been put in GitHub On , You can download what you need . https://github.com/AppG ...
- How to be in Centos7 Using alicloud in yum Source
How to be in Centos7 Using alicloud in yum Source 1. Back up the original yum Source mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Ba ...
- Explain in detail how to Laravel Add custom global function in
http://www.php.cn/php-weizijiaocheng-383928.html How to be in Laravel Add custom global function in ? In our application, there are some functions that may be used globally , How should we ...
- 【 Huawei cloud technology sharing 】 Intelligent diagnosis and optimization , Hua Wei Yun DAS Service cloud DBA The platform makes you worry free
Abstract : With the development of the times , Conventional “ artificial ” Operation and maintenance mode , Has been gradually unable to keep up with the needs of business development . How to better ensure the stability of the database system . Security . Integrity and high performance , Implement operation and maintenance as a tool . Commercialization . Self-help . automation , Is the current data management and operation and maintenance ...
- Kubernetes introduction ( Four )—— How to be in Kubernetes The central department has a service center Tensorflow Machine learning model
Machine learning models are often used Docker Deploy , And how to deal with it Docker Deployment model for management ? The solution for industry is to use Kubernetes To manage . Choreography container .Kubernetes The theoretical knowledge is not the focus of this paper , No more details here , ...
- How to be in ios Wechat login function is integrated in
stay ios There are two ways to integrate the login function of wechat in 1 Using wechat native api To do it , The advantage of this is lightweight , Program load is small , stay Build Settings Set as in Then set the The establishment of friendship League is the same as above , But be careful , Join what you need ...
- How to be in cmd In the integration git
1. To be in cmd In the integration git, To solve the problem in cmd Input in git Don't prompt in command git Not an internal or external command : That is to say, we need to put git Add to path variable , the D:\Git\mingw64\bin and D:\Git\mingw64 ...
- How to be in sharepoint2010 Middle configuration Google Anlytics Analysis Services
brief introduction Google Analytics( analysis ) It can not only help you measure sales and transformation , And can provide you with fresh and in-depth information , Help you understand how visitors use your website , How do they get to your website , And how you can attract them to keep coming back ...
- Huawei's cloud backup service has been comprehensively upgraded ,EI Help to bring extreme speed
Huawei cloud backup " Electronic verification " Official release , Filing is easier . Faster . since 2019 year 9 month 12 The date of , Huawei cloud users apply for ICP Filing can be done through Huawei cloud APP Conduct "ICP Collection of the real identity information of the filing subject &qu ...
- How to be in Knative Deployment in China WebSocket and gRPC service ?
author | Winter Island Alibaba cloud container platform engineer Reading guide : Although I say Knative Support by default WebSocket and gRPC, But it will be found in use , Sometimes I want to put my own WebSocket or gRPC Deploy to Kna ...
Random recommendation
- [SAM4N Learning notes ]SAM4N Construction of Engineering formwork
One . Software to install : Because the author uses MDK-ARM The version developed is 4.72, So you need to install this tool , Where can I download it? Put the dog by yourself or ask Du Niang . In addition to this important tool, I think , It also needs to be installed Atmel Official Atmel Studio, ...
- CURL Use HTTPS Technical summary of
Excerpt from http://www.51testing.com/html/14/175414-248202.html CURL Use HTTPS Technical summary of cURL yes linux Submit from the command line HTTP(S) One of the requests is ...
- tar Combination of orders find Search to package and compress files with specified criteria
Deal with today /tmp Under the temporary directory session The problem of too many files , I found this by the way tar combination find The method of packing and compressing , recorded , Very practical ! Search for /tmp Under the table of contents Create more than 24 Minutes of documents fi ...
- vim - Automatic completion
OmniComplete Is based on ctags Of , So install it first ctags To http://www.vim.org/scripts/script.php?script_id=2358 download cpp_src.tar ...
- combination Pnotify plug-in unit --app-jquery-notify.js
$.NOTIFY = { showSuccess : function (title, text, context) { var opt = { title : title, text : text, ...
- STM32F412 Application development note 8 : Devon serial port screen display driver
Devon's display is easy to use , It uses serial port communication , To support RS232, You can support TTL level . stay NUCLEO-F412ZG On the board ,USART2 It has led to CN9 On , We'll use it USART2 To realize the connection with the Devon serial port screen ...
- npx
npx What is it? ? npm v5.2.0 An order introduced (npx), The purpose of introducing this command is to improve the developer's experience of using the command-line tools provided in the package . give an example : Use create-react-app Create a react project . ...
- Mobile meta Arrangement
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http ...
- [ turn ][easyui] Right-click menu
come from :Zephyr.Net Development Manual var $tab = $('#tabs'); var currentTab = $tab.tabs('getSelected'); var titles = wra ...
- Learning notes (3)—— Lab cluster WMS Service configuration
1. start-up mgt Nodal tomcat service : [[email protected] zmq]# /home/geohpc/softwares/apache-tomcat-/bin/startup.sh Close as [[email protected] ...









