

- BLOCS APP FROM HANDLE UPDATE
- BLOCS APP FROM HANDLE FOR ANDROID
- BLOCS APP FROM HANDLE CODE
- BLOCS APP FROM HANDLE BLUETOOTH
We'll learn why the widgets are Stateless / Stateful in a while. Let's look at three Flutter Widgets that we have created for the app.ĭevice Firmware Widget (Stateless): Shows firmware version numbersĭevice Summary Widget (Stateless): Summarises the PineTime infoĭevice Widget (Stateful): The entire PineTime Companion screen Our PineTime Companion App calls the Bloc Library to connect our Flutter Widgets with our application data and processing logic. (If you're familiar with React Redux: Yep Bloc sounds a lot like React Redux, because they are both State Management Frameworks) 2 Flutter Widgets for PineTime There's a good way to handle this messy state in Flutter apps. What happens when the app loses track of its state?
BLOCS APP FROM HANDLE BLUETOOTH
Or talking to Bluetooth gadgets like PineTime. Nope! Behind the scenes, the app could be calling some REST API on the web.

It just reacts to our tapping and updates the display. What could go wrong?Ī mobile app is a simple thing.
BLOCS APP FROM HANDLE FOR ANDROID
It's easy to build a mobile app for Android and iOS with Flutter. Read on to learn how we do this with the Bloc Library for State Management. Today we'll recode the app so that it's more human-friendly, like this. In the previous article "Convert Go to Flutter and Dart for PineTime Companion App" we have built a technically functional (but barely human) app that sends Bluetooth Low Energy commands to PineTime. That's why we have selected Flutter for creating the open source Android and iOS Companion App for PineTime Smart Watch: For updating firmware, syncing date/time, pushing mobile notifications, controlling our smart home gadgets. The programming language is modern (Dart), the debugging tools are excellent (VSCode and Dart DevTools). PineTime Companion App running on an Android phone, fetching the firmware versions from PineTime Smart Watch wirelesslyįlutter is awesome for creating mobile apps for Android and iOS.
BLOCS APP FROM HANDLE CODE
When the token expires, the API will return a specific Authentication error code The Chat client will use the token provider to fetch the token when connectUser is called Here is the regular flow to handle tokens with expiration with a token provider:Ĭhat is initialized using the API Key and the token provider Our React, RN, iOS, Android and Flutter libraries have built-in support for this.
BLOCS APP FROM HANDLE UPDATE
If you're using tokens with an expiration date you'll want to update tokens as soon as a token exception occurs.
