Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs

Flutter has always been one of the highly active Appwrite platforms with lots of developers already using Appwrite to power their Flutter Apps. That is why today we are especially excited to announce that our Flutter Client SDK and the Dart Server SDK …

Flutter has always been one of the highly active Appwrite platforms with lots of developers already using Appwrite to power their Flutter Apps. That is why today we are especially excited to announce that our Flutter Client SDK and the Dart Server SDK have both received an upgrade to support null safety, and we have a pre-release version of both SDKs (Flutter v0.5.0-dev.1 & Dart v0.5.0-dev.1) in pub.



Get the Null Safe SDK

To use the Null Safe SDK in your project, you can use the following as a dependency in your pubspec.yaml file.

dependencies:
  appwrite: ^0.5.0-dev.1
  dart_appwrite: ^0.5.0-dev.1



What is null safety?

Sound null safety allows developers to specify which variables can contain null values. This has the potential to eradicate dreaded null reference exceptions, offering guarantees in development and at runtime that types can only contain null values if the developer expressly chooses.



There’s more

To properly support access to private files in the Appwrite Storage, we have updated the methods that access the file-related Storage endpoints along with the Avatars endpoint.
Now, all of the Avatars service methods return Future<Response> instead of the previous String. Also the Storage methods getFilePreview, getFileView and getFileDownload as well return Future<Response> instead of previous String. With the new method signatures you can now easily integrate any Appwrite hosted images in your Flutter app with the Image.memory widget. Below is an example of how you can load and display image preview in your Flutter Application

FutureBuilder(
  future: widget.storage.getFileView(fileId: "<YOUR_FILE_ID>"),
  builder: (context, snapshot) {
    if (snapshot.hasData) {
      return Image.memory(snapshot.data.data);
    }
    if (snapshot.hasError) {
      if (snapshot.error is AppwriteException) {
        print((snapshot.error as AppwriteException).message);
      }
      print(snapshot.error);
    }
    return CircularProgressIndicator();
  },
),

We would love your help in testing the dev releases of both SDKs and provide us with feedback on how we can improve it further. We are excited to see what you build with Flutter 2.0 & Appwrite.



Learn More

Appwrite has many services and tools to allow you to build applications in a much more productive and secure way. You can use the following resources to learn more about Appwrite and how to leverage it in building your next Appwrite + Flutter project:

Don’t forget to join the Appwrite Discord community, where you can learn more about Appwrite, get the latest updates, and get light-speed help with any question you might have.


Print Share Comment Cite Upload Translate
APA
Damodar Lohani | Sciencx (2024-03-29T11:26:59+00:00) » Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs. Retrieved from https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/.
MLA
" » Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs." Damodar Lohani | Sciencx - Wednesday April 21, 2021, https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/
HARVARD
Damodar Lohani | Sciencx Wednesday April 21, 2021 » Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs., viewed 2024-03-29T11:26:59+00:00,<https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/>
VANCOUVER
Damodar Lohani | Sciencx - » Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs. [Internet]. [Accessed 2024-03-29T11:26:59+00:00]. Available from: https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/
CHICAGO
" » Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs." Damodar Lohani | Sciencx - Accessed 2024-03-29T11:26:59+00:00. https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/
IEEE
" » Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs." Damodar Lohani | Sciencx [Online]. Available: https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/. [Accessed: 2024-03-29T11:26:59+00:00]
rf:citation
» Introducing Sound Null Safety Support for Appwrite Flutter and Dart SDKs | Damodar Lohani | Sciencx | https://www.scien.cx/2021/04/21/introducing-sound-null-safety-support-for-appwrite-flutter-and-dart-sdks/ | 2024-03-29T11:26:59+00:00
https://github.com/addpipe/simple-recorderjs-demo