flutter构建桌面应用_使用flutter放大和AWS构建自己的移动文件托管应用程序

flutter构建桌面应用

Nowadays Flutter is becoming more and more recognized as a viable solution for making mobile cross-platform applications. Also, AWS Amplify is rapidly gaining the attention of the developer community as it makes it incredibly simple to setup applications without worrying about backend infrastructure, as the library does that for you.

如今, Flutter越来越被公认为是制作移动跨平台应用程序的可行解决方案。 此外, AWS Amplify正Swift吸引开发人员社区的关注,因为它使应用程序的设置极其简单, 而无需担心后端基础架构 ,因为该库可以为您做到这一点。

Recently these two frameworks joined forces and the first release of Amplify for Flutter has been put online for developers to test out, with support for Amazon Cognito, AWS S3, and Pinpoint for logging.

最近,这两个框架共同发挥作用, Amplify for Flutter的第一个版本已联机发布,供开发人员进行测试,并支持Amazon CognitoAWS S3Pinpoint进行日志记录。

Being eager to try it out, we created a Proof-of-Concept to show how well these libraries work together. Following we present how to develop an AWS S3 powered dropbox-like application with Login capabilities for mobile devices.

渴望尝试,我们创建了概念证明来展示这些库如何协同工作。 接下来,我们介绍如何为移动设备开发具有登录功能的AWS S3驱动的类似Dropbox的应用程序。

As a bonus, we also propose a simple configuration for managing your CI/CD pipeline using Travis CI.

另外,我们还建议使用Travis CI来管理CI / CD管道的简单配置

The project can be created step by step following the guidelines provided or by directly downloading the entire solution from our Github repository.

您可以按照提供的指南逐步创建项目,也可以直接从我们的 Github存储库下载整个解决方案

Let’s get started!

让我们开始吧!

设置环境 (Setup your environment)

In order to start developing applications in Flutter, some preliminary steps are required. You can follow the instructions provided below to set up your environment with all the required tools.

为了开始在Flutter中开发应用程序,需要一些初步步骤。 您可以按照下面提供的说明使用所有必需的工具来设置环境。

具有使用Amplify的有效账户的AWS CLI (AWS CLI with a valid account for using Amplify)

Before doing anything else be sure to create an appropriate account on AWS. Amplify needs access to the following cloud resources:

在执行其他任何操作之前,请确保在AWS上创建适当的帐户。 Amplify需要访问以下云资源:

  • AppSync

    AppSync
  • API Gateway

    API网关
  • CloudFormation

    云形成
  • CloudFront

    CloudFront
  • Cognito

    认知
  • DynamoDB

    DynamoDB
  • IAM

    我是
  • Lambda

    拉姆达
  • S3

    S3
  • Amplify.

    放大。

Therefore here is a simple AWS Policy with the set of rules you need in order to run Amplify:

因此,这是一个简单的AWS策略,其中包含运行Amplify所需的一组规则:

{
       
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"appsync:*",
"apigateway:POST",
"apigateway:DELETE",
"apigateway:PATCH",
"apigateway:PUT",
"cloudformation:CreateStack",
"cloudformation:CreateStackSet",
"cloudformation:DeleteStack",
"cloudformation:DeleteStackSet",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResource",
"cloudformation:DescribeStackResources",
"cloudformation:DescribeStackSet",
"cloudformation:DescribeStackSetOperation",
"cloudformation:DescribeStacks",
"cloudformation:UpdateStack",
"cloudformation:UpdateStackSet",
"cloudfront:CreateCloudFrontOriginAccessIdentity",
"cloudfront:CreateDistribution",
"cloudfront:DeleteCloudFrontOriginAccessIdentity",
"cloudfront:DeleteDistribution",
"cloudfront:GetCloudFrontOriginAccessIdentity",
"cloudfront:GetCloudFrontOriginAccessIdentityConfig",
"cloudfront:GetDistribution",
"cloudfront:GetDistributionConfig",
"cloudfront:TagResource",
"cloudfront:UntagResource",
"cloudfront:UpdateCloudFrontOriginAccessIdentity",
"cloudfront:UpdateDistribution",
"cognito-identity:CreateIdentityPool",
"cognito-identity:DeleteIdentityPool",
"cognito-identity:DescribeIdentity",
"cognito-identity:DescribeIdentityPool",
"cognito-identity:SetIdentityPoolRoles",
"cognito-identity:UpdateIdentityPool",
"cognito-idp:CreateUserPool",
"cognito-idp:CreateUserPoolClient",
"cognito-idp:DeleteUserPool",
"cognito-idp:DeleteUserPoolClient",
"cognito-idp:DescribeUserPool",
"cognito-idp:UpdateUserPool",
"cognito-idp:UpdateUserPoolClient",
"dynamodb:CreateTable",
"dynamodb:DeleteItem",
"dynamodb:DeleteTable",
"dynamodb:DescribeTable",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:UpdateTable",
"iam:CreateRole",
"iam:DeleteRole",
"iam:DeleteRolePolicy",
"iam:GetRole",
"iam:GetUser",
"iam:PassRole",
"iam:PutRolePolicy",
"iam:UpdateRole",
"lambda:AddPermission",
"lambda:CreateFunction",
"lambda:DeleteFunction",
"lambda:GetFunction",
"lambda:GetFunctionConfiguration",
"lambda:InvokeAsync",
"lambda:InvokeFunction",
"lambda:RemovePermission",
"lambda:UpdateFunctionCode",
"lambda:UpdateFunctionConfiguration",
"s3:*",
"amplify:*"
],
"Resource": "*"
}
]
}

Attach the policy to a user with Programmatic Access, take note of the access and secret key. If you are not confident creating an AWS Policy on your own, check this link or choose one of the many guides available online.

将策略附加到具有Programmatic Access的用户, 记下访问权限和密钥 。 如果您不确定自己创建AWS策略, 请查看此链接或选择在线提供的众多指南之一。

A side note: it is advisable to remove the user as soon as Amplify has completed creating all the resources, to avoid leaving potential security breaches.

附带说明:建议在Amplify完成创建所有资源后立即删除用户,以避免留下潜在的安全漏洞。

The next step is to configure AWS CLI on your computer. Download it choosing the appropriate installer for your OS. Install it and then in your terminal of choice type: aws configure.

下一步是在计算机上配置AWS CLI。 下载它,选择适合您操作系统的安装程序。 安装它,然后在您选择的终端中输入: aws configure

Use the Access and Secret keys you’ve taken note of when prompted and the rest leave it as default.

出现提示时,请使用已记下的“ 访问”和“ 秘密”键 ,其余的保留为默认值。

With all this information filled up, you are now able to install Flutter and Amplify correctly.

填写完所有这些信息后,您现在就可以正确安装Flutter和Amplify。

安装Flutter并配置您的第一个项目 (Install Flutter and configure your first project)

We managed to install and launch Flutter without any difficulty by following this guide. We chose MacOS and followed the instructions, setting up everything for working with Android Studio, but you can use IntelliJ as well. After installing the framework, we connect a test phone and run flutter devices in the terminal to verify that it’s found correctly.

通过遵循本指南,我们成功地安装并启动了Flutter。 我们选

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值