This is a Flutter app for WearOS.

Overview

Flutter OS (Android Wear OS app)

Checkout my Medium article "Flutter: Building Wear OS app".

First of all I want to state that it is not an OS, it is just an app.

This is an app for Wear OS devices which is inspired from the Medium article written by Matt Sullivan, "Experimenting with Flutter on Wear OS". This article really helped me to understand, how to manage the screen size of the app properly and inheriting it to different classes.

In this app, I tried to optimize the relax app created by Erin Morrissey (made as a Flutter Create Submission 2019, which got nominated for Visual Beauty), to run on Wear OS devices.

The wear app has two modes:

  1. Normal Mode
  2. Ambient Mode (which is the battery saving mode)

You can checkout some snaps of the app below.

Screenshots

App in Action

Plugin

The plugin used in this project is "wear".

Add this to your package's pubspec.yaml file to use wear:

dependencies:
  wear: ^0.0.3

Import using:

import 'package:wear/wear.dart';

Set Up (Important)

Matt has already discussed, in his GitHub project of flutter_wear_plugin, how to set up the project for Flutter Wear OS apps. But, I faced a lot of difficulty while following the steps. So, I recommend that you clone my project or Matt's example project and then work on it, after deleting the UI files which you don't require, because in this way you do not need to set up the whole project which consumes a huge amount of time and you will face a lot of challenges.

I am again stating the set up process below (not recommended):

App Gradle File

Change the min SDK version to API 23:

minSdkVersion 23

Then, add the following dependencies to the Android Gradle file for the app:

dependencies {
    // Wear libraries
    implementation 'com.android.support:wear:27.1.1'
    implementation 'com.google.android.support:wearable:2.3.0'
    compileOnly 'com.google.android.wearable:wearable:2.3.0'
}

Manifest File

Add the following to your AndroidManifest.xml file:

<!-- Required for ambient mode support -->
<uses-permission android:name="android.permission.WAKE_LOCK" />

<!-- Flags the app as a Wear app -->
<uses-feature android:name="android.hardware.type.watch" />

<!-- Flags that the app doesn't require a companion phone app -->
<application>
<meta-data
    android:name="com.google.android.wearable.standalone"
    android:value="true" />
</application>

Update Android's MainActivity

The ambient mode widget needs some initialization in Android's MainActivity code. Update your code as follows:

class MainActivity: FlutterActivity(), AmbientMode.AmbientCallbackProvider {
  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    GeneratedPluginRegistrant.registerWith(this)

    // Wire up the activity for ambient callbacks
    AmbientMode.attachAmbientSupport(this)
  }

  override fun getAmbientCallback(): AmbientMode.AmbientCallback {
    return FlutterAmbientCallback(getChannel(flutterView))
  }
}

Conclusion

After creating this project, I admit that Flutter is not optimized for Wear OS devices till now as many of the simple things are not working on Wear OS like all material Icons which are included in Flutter are not displaying on Wear OS devices, instead a Placeholder image is getting displayed. For this reason, I had to download the material Icons for the Material Design website and add it to assets.

Though after facing a lot of difficulties I have finally done this project.

If you like the project please give star ⭐️ .

License

Copyright (c) 2019 Souvik Biswas

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

You might also like...

WooCommerce App template that uses Flutter. Integrated to work with WooCommerce stores, connect and create an IOS and Android app from Flutter for IOS and Android

WooCommerce App template that uses Flutter. Integrated to work with WooCommerce stores, connect and create an IOS and Android app from Flutter for IOS and Android

WooCommerce App: Label StoreMax Label StoreMax - v5.3.1 Official WooSignal WooCommerce App About Label StoreMax Label StoreMax is an App Template for

Jan 9, 2023

Recipes app in flutter using API to get data. Amazing Recipes app UI in Flutter using dart with simple widgets.

Recipes app in flutter using API to get data. Amazing Recipes app UI in Flutter using dart with simple widgets.

Food Recipe App In Flutter Using API'S Recipe App in Flutter Subscribe Our YouTube Channel. Visit Website Demo OutPut Images ## 🔗 Links Getting Start

Dec 26, 2022

flutter web app with given code and example. Step by step teaching how to build a flutter web app with backend

flutter_web A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if t

Oct 26, 2022

Flutter-for-Wordpress-App - Cross platform wordpress news app built with Flutter and WP REST API

Flutter-for-Wordpress-App - Cross platform wordpress news app built with Flutter and WP REST API

Flutter for Wordpress A flutter app for a wordpress websites with clean and elegant design. This app is available in free and pro version. You can cho

Dec 23, 2022

Flutter-Wordpress-App - Cross platform wordpress news app built with Flutter

Flutter-Wordpress-App - Cross platform wordpress news app built with Flutter

Flutter for Wordpress A flutter app for a wordpress websites with clean and elegant design. This app is available in free and pro version. You can cho

Dec 23, 2022

Flutter-app-food-ordering - Flutter App Food Ordering

Flutter-app-food-ordering - Flutter App Food Ordering

Food Ordering App Preview video: https://youtu.be/h1Cw7IoJByU My Twitter My Patr

Dec 29, 2022

Flutter-Tasky-App - A Task App Designed With Flutter With Registration & Login Page

Flutter-Tasky-App - A Task App Designed With Flutter With Registration & Login Page

Flutter-Tasky-App- A task app designed with flutter with registration & login pa

Dec 23, 2022

Music-App-Flutter - This is a flutter app which has some songs displayed in the form of a list and user can play any of them by clicking on the name of the song.

Music-App-Flutter - This is a flutter app which has some songs displayed in the form of a list and user can play any of them by clicking on the name of the song.

music_player_app A music player app made by me in flutter About the App This is a music player which i made to play audio files which we have passed i

Apr 1, 2021

Flutter-watchtips - Flutter App (Embedded Watch Kit app with iOS version)

Flutter-watchtips - Flutter App  (Embedded Watch Kit app with iOS version)

watchtips Update Version 2.2 The Watch tips project has been updated again, The interface has been tidied up and a seperate value for the tip cost has

Dec 31, 2022
Comments
  •  Invalid `Podfile` file: no implicit conversion of nil into String. I am trying to build for Apple Watch

    Invalid `Podfile` file: no implicit conversion of nil into String. I am trying to build for Apple Watch

    Running pod install... CocoaPods' output: ↳

    [!] Invalid `Podfile` file: no implicit conversion of nil into String.
    
     #  from /Volumes/Storage/Bottle/Wearables/flutter_os_wear/ios/Podfile:60
     #  -------------------------------------------
     #      unless File.exist?(copied_podspec_path)
     >        FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
     #      end
     #  -------------------------------------------
    
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:301:in `rescue in block in from_ruby'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:295:in `block in from_ruby'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:50:in `instance_eval'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:50:in `initialize'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:293:in `new'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:293:in `from_ruby'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/podfile.rb:259:in `from_file'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/config.rb:200:in `podfile'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:150:in `verify_podfile_exists!'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command/install.rb:46:in `run'
    /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/lib/cocoapods/command.rb:52:in `run'
    /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.9.3/bin/pod:55:in `<top (required)>'
    /usr/local/bin/pod:23:in `load'
    /usr/local/bin/pod:23:in `<main>'
    

    Error output from CocoaPods: ↳ Ignoring ffi-1.12.2 because its extensions are not built. Try: gem pristine ffi --version 1.12.2

    opened by mhrjnamar 1
  • Not an issue but a question

    Not an issue but a question

    I got your example working on the android wear emulator.

    However I need a lot more functionality in my app because I would like to be able to login with firebase and receive FCM notification.

    But the problem is that the login returns "firebaseAuth: API not available" and I am stuck. There are no other Flutter tutorials with wear OS on the internet and therefore I hoped that it would be ok if I asked you if you possibly can help since you know how wearOS works with flutter.

    opened by emmaxCreative 0
Owner
Souvik Biswas
Android, iOS & Flutter Developer | C++, Java and Dart Programmer | Technical Writer @Medium & @codemagic-ci-cd | @udacity Secure and Private AI '19 Scholar
Souvik Biswas
Taxi App Client App - Taxi Rouge App With Flutter

taxi_rouge_app A new Flutter application. Getting Started This project is a star

Bouchida Youssef 3 Jun 11, 2022
Book app - Book app UI with dark mode enabled, also this app created using the Flutter 2.5 skeleton template

BOOK APP Book app UI with dark mode enabled, also this app created using the Flu

Gülsen Keskin 5 Nov 9, 2022
A Flutter app to show how to implement in-app purchase using the in-app-purchase package

Flutter in-app purchase A Flutter project to show to implement in-app purchase using the in_app_purchase package Simple UI but it's okay ?? ?? WhatsAp

António Nicolau 5 Jul 26, 2022
This is a MVP our app's. The app get the song's list on firebase and display then you can be listen App features.

music_app Requirements: flutter version 3.0.3 Dart 2.17.5 Firebase CLI 11.1.0 flutter sdk: >= 2.15.1 < 3.0.0 flutter dependentcies: http: 0.13.4 mvvm:

Lê Hồng Minh 3 Aug 2, 2022
This is a JazzCash UI clone ( Modern Wallet App in Pakistan), implementing modern app bar animmation. One can take a concept of making app bar with animation.

jazzcash_ui This is a JazzCash UI clone ( Modern Wallet App in Pakistan), implementing modern app bar animmation. One can take a concept of making app

null 9 Nov 27, 2022
🆙🚀 Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in

???? Flutter application upgrade/ Flutter App Upgrade /Flutter App Update/Flutter Update / download Plug-in (with notice bar progress), supports full upgrade, hot update and incremental upgrade

PengHui Li 344 Dec 30, 2022
This is a Flutter app which shows how to use the PageView Class in your Flutter App

page_view_class A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Shehzaan Mansuri 1 Oct 25, 2021
Sibyl App written with Dart/Flutter. (My first experience in writing a real android app in flutter).

sibyl_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if thi

ALi.w 3 Feb 17, 2022