{"id":18456389,"url":"https://github.com/nicosnicolaou16/android_widget_with_compose_with_flutter","last_synced_at":"2025-04-08T04:34:49.911Z","repository":{"id":224326168,"uuid":"759383332","full_name":"NicosNicolaou16/Android_Widget_With_Compose_With_Flutter","owner":"NicosNicolaou16","description":"This project sets up the Widget in Flutter using Jetpack Compose Glance for Android.","archived":false,"fork":false,"pushed_at":"2024-12-29T23:50:09.000Z","size":101,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T06:41:23.157Z","etag":null,"topics":["android-compose","android-widget","compose","dart","flutter","flutter-app","kotlin","kotlin-android","widget"],"latest_commit_sha":null,"homepage":"https://medium.com/@nicosnicolaou/android-widget-setup-with-jetpack-compose-glance-with-a-flutter-example-e07fb63c9466","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NicosNicolaou16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-18T12:53:19.000Z","updated_at":"2024-12-29T23:50:12.000Z","dependencies_parsed_at":"2024-02-25T10:43:37.379Z","dependency_job_id":"5ca3b588-a5ee-4bbd-b87e-9695dbef0be7","html_url":"https://github.com/NicosNicolaou16/Android_Widget_With_Compose_With_Flutter","commit_stats":null,"previous_names":["nicosnicolaou16/android_widget_with_compose_with_flutter"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FAndroid_Widget_With_Compose_With_Flutter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FAndroid_Widget_With_Compose_With_Flutter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FAndroid_Widget_With_Compose_With_Flutter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NicosNicolaou16%2FAndroid_Widget_With_Compose_With_Flutter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NicosNicolaou16","download_url":"https://codeload.github.com/NicosNicolaou16/Android_Widget_With_Compose_With_Flutter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247779796,"owners_count":20994569,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android-compose","android-widget","compose","dart","flutter","flutter-app","kotlin","kotlin-android","widget"],"created_at":"2024-11-06T08:11:22.559Z","updated_at":"2025-04-08T04:34:49.901Z","avatar_url":"https://github.com/NicosNicolaou16.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android_widget_with_compose_with_flutter\n\nThis project sets up the Widget in Flutter using Jetpack Compose Glance for Android.\n\n\u003e [!IMPORTANT]\n\u003e NOTE: EXAMPLE FOR ANDROID ONLY. \u003cbr /\u003e\n\n# Setup\n\n## Step 1 add the follow dependencies libraries\n\n```Kotlin\nval composeGlanceWidgetVersion by extra(\"1.1.1\")\n\ndependencies {\n\n    //...\n    //Glance Widget\n    implementation(\"androidx.glance:glance-appwidget:$composeGlanceWidgetVersion\")\n    //Using Material 2\n    implementation(\"androidx.glance:glance-material:$composeGlanceWidgetVersion\")\n    //Using Material 3\n    implementation(\"androidx.glance:glance-material3:$composeGlanceWidgetVersion\")\n}\n```\n\n## Steps 2 Create the Glance Receiver class that extend GlanceAppWidgetReceiver() and return the Widget Class\n\n```Kotlin\nclass MyAppWidgetReceiver : GlanceAppWidgetReceiver() {\n    override val glanceAppWidget: GlanceAppWidget\n        get() = MyAppWidget()\n}\n```\n\n## Step 3 Create the xml file into the xml directory (configuration to declare the size etc.)\n\n```XML\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cappwidget-provider xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:initialLayout=\"@layout/glance_default_loading_layout\" android:minWidth=\"250dp\"\n    android:minHeight=\"50dp\" android:resizeMode=\"horizontal|vertical\"\n    android:widgetCategory=\"home_screen\"\u003e\n    \n\u003c/appwidget-provider\u003e\n```\n\n## Step 4 Register the Receiver Class into the Manifest and set the xml configuration for the Glance Widget\n\n```XML\n\n\u003creceiver android:name=\".glance_widget.receiver.MyAppWidgetReceiver\" android:exported=\"true\"\u003e\n    \u003cintent-filter\u003e\n        \u003caction android:name=\"android.appwidget.action.APPWIDGET_UPDATE\" /\u003e\n    \u003c/intent-filter\u003e\n    \u003cmeta-data android:name=\"android.appwidget.provider\"\n        android:resource=\"@xml/my_app_widget_info\" /\u003e\n\u003c/receiver\u003e\n```\n\n## Step 5 Create the Widget that extend GlanceAppWidget() class\n\n```Kotlin\n//...\nclass MyAppWidget : GlanceAppWidget() {\n\n    override suspend fun provideGlance(context: Context, id: GlanceId) {\n        provideContent {\n            MyContent(context) //Compose UI\n        }\n    }\n    //....\n}\n```\n\n\u003e [!IMPORTANT]  \n\u003e Check my article for the setup :point_right: [Android Widget Setup with Jetpack Compose Glance (with a Flutter example) - Medium](https://medium.com/@nicosnicolaou/android-widget-setup-with-jetpack-compose-glance-with-a-flutter-example-e07fb63c9466) :point_left: \u003cbr /\u003e\n\n\u003e [!IMPORTANT]\n\u003e Similar project with (Kotlin Language) :point_right: [AndroidWidgetWithCompose](https://github.com/NicosNicolaou16/AndroidWidgetWithCompose) :point_left: \u003cbr /\u003e\n\n# Versioning\n\nFlutter SDK version: 3.27.1 \u003cbr /\u003e\nDart Version: 3.6.0 \u003cbr /\u003e\n\n# References\n\nhttps://developer.android.com/jetpack/compose/glance/create-app-widget  \u003cbr /\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicosnicolaou16%2Fandroid_widget_with_compose_with_flutter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicosnicolaou16%2Fandroid_widget_with_compose_with_flutter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicosnicolaou16%2Fandroid_widget_with_compose_with_flutter/lists"}