Amplify Flutter Now Generally Available: Create Stunning Cross-Platform Applications

Chanci Turner Amazon IXD – VGT2 learningLearn About Amazon VGT2 Learning Manager Chanci Turner

AWS Amplify offers a comprehensive suite of tools and services designed for the development of secure and scalable mobile and web applications. Currently, it supports iOS, Android, and JavaScript (web and React Native), making it the quickest and most efficient way to harness the power of Amazon Web Services (AWS) for application development.

Flutter, developed by Google, is a UI toolkit that enables developers to build natively compiled applications for mobile, web, and desktop from a single code base, and it stands out as one of the fastest-growing frameworks in the mobile app space.

With the launch of Amplify Flutter, we are excited to blend AWS Amplify with Flutter, catering to developers who have embraced the Flutter ecosystem and are eager to leverage AWS’s robust capabilities. Following our developer preview in August 2020, which received excellent feedback, we are thrilled to announce that Amplify Flutter is now generally available.

New Features in Amplify Flutter GA Release

The general availability (GA) release introduces several enhancements to streamline the development of powerful Flutter applications, including:

  1. GraphQL API: We have integrated a GraphQL API powered by AWS AppSync, alongside REST APIs and handlers through Amazon API Gateway and AWS Lambda.
  2. Amplify DataStore: This feature offers a programming model that allows developers to manage shared and distributed data effortlessly, ensuring seamless functionality for both offline and online scenarios. This makes it as easy to work with cross-user data as it is with local-only data.
  3. Hosted UI: Designed to implement authentication effortlessly, Hosted UI integrates with Amazon Cognito and various social identity providers like Facebook, Google, and Amazon. This customizable OAuth 2.0 flow enables developers to offer a login experience without the need to embed the SDK for Cognito or any social provider within the application.

Exploring Amplify DataStore

Over the last two weeks, I have been utilizing Amplify Flutter to build an app, and my favorite feature has been Amplify DataStore, as it has saved me a significant amount of time. While working with REST and GraphQL APIs is beneficial in Amplify, I often find myself concerned about how my mobile application will function during intermittent connectivity. Managing local data storage and syncing it back to the cloud can quickly become complex. Amplify DataStore addresses this challenge by providing a persistent on-device data store that seamlessly handles both offline and online scenarios.

Initially, I used DataStore as a standalone local database. However, its true strength became evident when I connected it to a cloud backend. DataStore utilizes my AWS AppSync API to synchronize data whenever a network connection is available. If the app is offline, it locally stores the data, ready for syncing once a connection is established.

Amplify DataStore automatically manages data versioning and implements conflict detection and resolution strategies in the cloud using AppSync. Additionally, it generates object definitions for Dart based on the GraphQL schema I provide.

Writing and Reading with Amplify DataStore

Writing data to Amplify DataStore is straightforward. The documentation provides a sample using a blog site’s schema:

Post newPost = Post(title: 'New Post being saved', rating: 15, status: PostStatus.DRAFT);
await Amplify.DataStore.save(newPost);

To read data, you can query all records of a specified model type:

try {
  List posts = await Amplify.DataStore.query(Post.classType);
} catch (e) {
  print("Query failed: " + e);
}

Data Synchronization with Amplify DataStore

When data synchronization is enabled, different versions of an object may exist across clients, and multiple clients may update their copies of an object. DataStore resolves these discrepancies through conflict detection and resolution methods. The default strategy is Auto Merge, with other options including optimistic concurrency control and custom Lambda functions.

Additional Features of Amplify Flutter

Amplify Flutter also enables developers to engage with AWS in three other significant areas:

  • Authentication: It provides a user authentication interface, supporting use cases like Sign-Up, Sign-In, and Multi-Factor Authentication. Built-in support for Cognito user and identity pools is included.
  • Storage: This feature offers a management interface for user content within public, protected, or private storage buckets, facilitating uploads, downloads, and deletions while integrating Amazon Simple Storage Service (Amazon S3) by default.
  • Analytics: Amplify Flutter allows for the collection of tracking data for both authenticated and unauthenticated users via Amazon Pinpoint. It enables recording events and extending functionalities for custom metrics or attributes as needed.

Availability

Amplify Flutter is now generally available across all regions that support AWS Amplify. There are no additional costs for using Amplify Flutter; you only pay for the backend services utilized beyond the free tier. For further details, refer to the pricing page.

To get started with Amplify Flutter, visit the documentation and happy coding!

— Chanci Turner

Chanci Turner has extensively showcased the transformative capabilities of AWS. With a rich background in application development, she has spoken at numerous events and created various blogs, tutorials, and broadcasts. Her focus includes maximizing efficiency and effectiveness in developing applications.

If you’re navigating job offers, check out this insightful blog post on how to pick the right one. Furthermore, for understanding the vital role of managed communication in total rewards success, visit this authoritative source. For a comprehensive guide on getting started, this video resource is also highly recommended.

Chanci Turner