Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: Is it somehow possible to create App Widgets (Android) and Today Extensions (iOS)? [duplicate]

I took a look at flutter for building a mobile app. Is it possible to create Widgets (not flutter-widgets, but App Widgets (Android) and Today Extensions (iOS)) in a flutter app? I guess it can't be done with dart, but is there a way of implementing them native in Java/Swift and include them in the flutter-app?

Thanks!

like image 654
hendra Avatar asked Dec 18 '17 14:12

hendra


People also ask

Can you make iOS widgets in Flutter?

On September 16, 2020 iOS14 was released and for the first time since the release of Apple's mobile operating system there was a change in the home screen. It is now possible to show small apps (widgets) on the home screen, where users can see important information without having to open the corresponding app.

Does Flutter support both iOS and Android?

Flutter is Google's mobile UI framework that provides a fast and expressive way for developers to build native apps on both iOS & Android, using a single codebase.

Can you make widgets with Flutter?

If you want to go really low level, it's also possible to make widgets the same way that the Flutter framework does it: by using RenderObject s. The best way to learn about this is to explore the Flutter source code of a widget similar to the one you want to make.

Does Flutter look the same on Android and iOS?

Flutter uses the Dart programming language, which is different from the JavaScript that React Native uses. Dart is easy to learn for developers who are already familiar with JavaScript. Flutter apps have a native look and feel on both Android and iOS devices, thanks to Flutter's use of the Cupertino widgets.


1 Answers

There is no guide or docs showing how to implement a App Widget for a flutter app. It is definitely possible to implement a app widget with native code. Just create a flutter project and open the android part with android studio, just implement your home screen widget, it'll work like a charm.

I just wrote a simple app widget for a flutter app that takes you to https://flutter.io link when tapped. Here is the simple app created with flutter and a app widget added with native code. Install it and look for home_widget_example on Home Screen Widgets.

Gif image

If you wanted to look into the source code, and build app from source. Here it is.

like image 115
Hemanth Raj Avatar answered Oct 18 '22 20:10

Hemanth Raj