Organizing my articles for Flutter and Server Side Dart
The articles below are mostly on Medium but also span a few other sites. If Medium is blocking you because you don’t have an account, let me know and I’ll provide a friend link. Click the (🤝) emoji to get the friend link.
These are some of my…
There’s so much more than
flutter pub get
If you’ve been working with Flutter for any length of time, you’ve probably run
flutter pub get in the terminal or at least seen a popup about it from your IDE. The Pub tool has a lot more than just get to offer you, though. Pub is the official repository for the Flutter and Dart packages available at pub.dev, and pub is your commandcommande line interface to that repository. This article will introduce the many optionsoptio that are available with the Pub tool.
Assuming you have a recentune récent version of Flutter…
Loading, looping, seeking, shuffling, and editing
This tutorial will teach you how to play and navigate multiple songs using the Just Audio plugin for Flutter. You’ll learn about loading audio sources, seeking to another song, repeating a song or playlist, randomizing the song order, and editing the contents of the playlist. If you’re new to Just Audio, you should go through the previous tutorials first since this one will assume you’re already familiar with the basics:
How to play a song or podcast from a URL
In my last article, Playing short audio clips in Flutter with Just Audio, I demonstrated how to set up Just Audio and play audio clips that only lasts a few seconds. If you’re new to the Just Audio plugin, I recommend you go through that tutorial first.
This tutorial will demonstrate how to play long-form audio like songs, podcasts, or lectures. While it’s completely possible to play these from files stored on the user’s device, a more common scenario is to stream them based on a URL link, so that’s…
There are a million variables when talking about playing audio in a Flutter app, so this tutorial will seek to limit the scope to one basic task: playing short audio clips. Short audio clips don’t require a background service, setting a playlist, seeking to some position, buffering, or adjusting playback speed. That makes this an ideal topic for your first audio tutorial in Flutter.
There are a number of audio packages on Pub, but this tutorial will be using Just Audio. It supports Android, iOS, web, and macOS, and there is work being done on Windows and Linux.
The biggest challenge for me when coming to Flutter was learning state management. People were saying Provider and Bloc and ScopedModel and Redux and MobX and…I had no idea what they were talking about. As time passed the list of state management solutions continued to grow.
In my learning journey I wrote articles about Stacked (here) and Provider (here and here) and Riverpod (here and here). I went through the Bloc pattern and BlocLibrary tutorials and looked into Cubit and GetX and watched videos about Redux and MobX and Command. But with each one there was always something that I…
What’s the difference?
Exceptionis for an expected bad state that may happen at runtime. Because these exceptions are expected, you should catch them and handle them appropriately.
Error, on the other hand, is for developers who are using your code. You throw an Error to let them know that they are using your code wrong. As the developer using an API, you shouldn't catch errors. You should let them crash your app. Let the crash be a message to you that you need to go find out what you're doing wrong.
A thousand pictures is worth a word
Consider this a visual supplement the
InputDecoration documentation. Sometimes it’s easier to just see and understand rather than reading a long description.
A whole new meaning to mobile developer
What? They don’t have computers?! How am I supposed to teach mobile app development if the students don’t have computers?
When asked if I would teach Mobile App Development in Spring 2021 at Mongolia International University, I gladly agreed. This would be a great opportunity to systematically present Flutter, a modern cross-platform UI framework for making native apps, one that I greatly prefer over plain Android and iOS development.
As Covid-19 continued to drag on throughout 2020 and into 2021, like at many of the schools around the world, the classes at MIU…
If you don’t crawl around the Flutter source code much you’ve probably never heard of text affinity, represented by the TextAffinity enum. It’s an interesting concept, though, and in this article I’ll try to make it easy to understand through the use of images.
The word affinity means attraction. This is referring to which part of the text the cursor (or caret as it’s sometimes called) is attracted to. To explain that, it’s first necessary to talk about text position, represented by the TextPosition class.
TextPosition has an offset property which is used for cursor location or text selection.
A Flutter and Dart developer. Follow me on Twitter @suragch1 to get updates of new articles.