diff --git a/.gemini/settings.json b/.gemini/settings.json index 715d896d9..ab9a0fc75 100644 --- a/.gemini/settings.json +++ b/.gemini/settings.json @@ -1,4 +1,7 @@ { + "context": { + "fileName": "/.prompts/llm.md" + }, "mcpServers": { "dart": { "command": "dart", @@ -6,6 +9,5 @@ "mcp-server" ] } - }, - "contextFileName": "/.prompts/llm.md" -} + } +} \ No newline at end of file diff --git a/.gemini/settings.json.orig b/.gemini/settings.json.orig new file mode 100644 index 000000000..715d896d9 --- /dev/null +++ b/.gemini/settings.json.orig @@ -0,0 +1,11 @@ +{ + "mcpServers": { + "dart": { + "command": "dart", + "args": [ + "mcp-server" + ] + } + }, + "contextFileName": "/.prompts/llm.md" +} diff --git a/README.md b/README.md index 7cc45ae94..42c51a36b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Googler's, you can freely add samples to the [flutter/demos] repository. ### Quickstarts -* [`asset_transformation`] - Demonstrates how to transform images' color scales and formats. +* [`asset_transformation`] - Demonstrates how to transform images' color scales and formats. * [`background_isolate_channels`] - Demonstrates how to use long-lived isolates. * [`code_sharing`] - Demonstrates how to share business logic between Flutter client and Dart server using [`package:shelf`] ) * [`context_menus`] - This sample shows how to create and customize cross-platform context menus, such as the text selection toolbar on mobile or the right click menu on desktop. @@ -25,7 +25,6 @@ Googler's, you can freely add samples to the [flutter/demos] repository. * [`dynamic_theme`] - A developer sample demonstrating how to call on-device Flutter APIs based on output from the Gemini API. * [`form_app`] - A sample demonstrating different types of forms and best practices. * [`game_template`] - (**note: deprecated!**) A starter game in Flutter with all the bells and whistles of a mobile (iOS & Android) game. -* [`gemini_tasks`] - A developer sample written in Flutter demonstrating how to interact with a to-do list in natural language using the Gemini API. * [`google_maps`] - Demonstrates the Google Maps for Flutter plugin. * [`infinite_list`] - A Flutter sample app that shows an implementation of the "infinite list" UX pattern. * [`isolate_example`] - A sample application that demonstrate best practices when using [isolates]. @@ -78,10 +77,10 @@ Googler's, you can freely add samples to the [flutter/demos] repository. ## Flutter sample code -Samples are **correct and concise code** that developers -can **quickly understand** and **easily reuse** with minimal side effects. -Samples teach developers how to be successful using Flutter and Dart. -They are maintained on an ongoing basis +Samples are **correct and concise code** that developers +can **quickly understand** and **easily reuse** with minimal side effects. +Samples teach developers how to be successful using Flutter and Dart. +They are maintained on an ongoing basis to reflect changing APIs and best practices. ### Types of samples @@ -90,18 +89,18 @@ There are two types of sample code in this repository: * **Quickstarts** provide a starting point to extend. They answer the question, "What is the minimal amount of code needed to implement this feature?" -* **Demo apps** are meant to be built and ran. They demo the _product_, +* **Demo apps** are meant to be built and ran. They demo the _product_, not how to write code. A majority of samples in this repository are quickstarts. ## Usage -Every sample in this repo is fully runnable. To run an example, -use `flutter run` inside that example's directory. +Every sample in this repo is fully runnable. To run an example, +use `flutter run` inside that example's directory. See the [getting started guide] to install the `flutter` tool. -> [!IMPORTANT] +> [!IMPORTANT] > If you want to run an add-to-app sample, there are additional requirements. > We suggest reading the [add-to-app documentation]. @@ -129,7 +128,6 @@ If you run into a bug in one of the samples, please file an issue in the [`dynamic_theme`]: ./dynamic_theme [`form_app`]: ./form_app [`game_template`]: ./game_template -[`gemini_tasks`]: ./gemini_tasks [`google_maps`]: ./google_maps [`infinite_list`]: ./infinite_list [`isolate_example`]: ./isolate_example diff --git a/add_to_app/fullscreen/android_fullscreen/app/src/debug/AndroidManifest.xml b/add_to_app/fullscreen/android_fullscreen/app/src/debug/AndroidManifest.xml index 12dc6f24d..a9e3aab8b 100644 --- a/add_to_app/fullscreen/android_fullscreen/app/src/debug/AndroidManifest.xml +++ b/add_to_app/fullscreen/android_fullscreen/app/src/debug/AndroidManifest.xml @@ -1,8 +1,10 @@ - - - - - + + + + diff --git a/add_to_app/fullscreen/android_fullscreen/app/src/debug/res/xml/network_security_config.xml b/add_to_app/fullscreen/android_fullscreen/app/src/debug/res/xml/network_security_config.xml new file mode 100644 index 000000000..3032fe019 --- /dev/null +++ b/add_to_app/fullscreen/android_fullscreen/app/src/debug/res/xml/network_security_config.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/ai_recipe_generation/README.md b/ai_recipe_generation/README.md index 1336a6878..34ce80550 100644 --- a/ai_recipe_generation/README.md +++ b/ai_recipe_generation/README.md @@ -7,10 +7,9 @@ we don't maintain samples that are tied to events. This sample has been copied to [another repository](https://github.com/ericwindmill/gemini_recipe_generation). It will not be updated to reflect changes to Gemini. -## Other Gemini resources +## Other Gemini resources The following resources can assist you in integrating Gemini with Flutter: -* [gemini_tasks sample](https://github.com/flutter/samples/tree/main/gemini_tasks) is a Gemini sample in this repository. * [google_generative_ai package](https://pub.dev/packages/google_generative_ai) is the package that Flutter apps use to integrate with gemini, and it has additional samples. -* The [google-gemini github](https://github.com/google-gemini) has additional Flutter samples. \ No newline at end of file +* The [google-gemini github](https://github.com/google-gemini) has additional Flutter samples. \ No newline at end of file diff --git a/animations/lib/src/misc/animated_list.dart b/animations/lib/src/misc/animated_list.dart index 6e774d990..0144e6f71 100644 --- a/animations/lib/src/misc/animated_list.dart +++ b/animations/lib/src/misc/animated_list.dart @@ -49,6 +49,7 @@ class _AnimatedListDemoState extends State { parent: animation, curve: const Interval(0.0, 1.0), ), + // ignore: deprecated_member_use axisAlignment: 0.0, child: _buildItem(user), ), diff --git a/gemini_tasks/.gitignore b/cupertino_gallery/.gitignore similarity index 95% rename from gemini_tasks/.gitignore rename to cupertino_gallery/.gitignore index 29a3a5017..3820a95c6 100644 --- a/gemini_tasks/.gitignore +++ b/cupertino_gallery/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related @@ -25,11 +27,11 @@ migrate_working_dir/ **/doc/api/ **/ios/Flutter/.last_build_id .dart_tool/ -.flutter-plugins .flutter-plugins-dependencies .pub-cache/ .pub/ /build/ +/coverage/ # Symbolication related app.*.symbols diff --git a/cupertino_gallery/.metadata b/cupertino_gallery/.metadata new file mode 100644 index 000000000..9064db051 --- /dev/null +++ b/cupertino_gallery/.metadata @@ -0,0 +1,45 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "c0f2a1dd60414de7bef59318dc2554a6bb75d4ad" + channel: "beta" + +project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + - platform: android + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + - platform: ios + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + - platform: linux + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + - platform: macos + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + - platform: web + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + - platform: windows + create_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + base_revision: c0f2a1dd60414de7bef59318dc2554a6bb75d4ad + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/cupertino_gallery/README.md b/cupertino_gallery/README.md new file mode 100644 index 000000000..064ec5b31 --- /dev/null +++ b/cupertino_gallery/README.md @@ -0,0 +1,16 @@ +# cupertino_gallery + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) + +For help getting started with Flutter development, view the +[online documentation](https://docs.flutter.dev/), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/gemini_tasks/analysis_options.yaml b/cupertino_gallery/analysis_options.yaml similarity index 100% rename from gemini_tasks/analysis_options.yaml rename to cupertino_gallery/analysis_options.yaml diff --git a/gemini_tasks/android/.gitignore b/cupertino_gallery/android/.gitignore similarity index 69% rename from gemini_tasks/android/.gitignore rename to cupertino_gallery/android/.gitignore index 6f568019d..be3943c96 100644 --- a/gemini_tasks/android/.gitignore +++ b/cupertino_gallery/android/.gitignore @@ -5,9 +5,10 @@ gradle-wrapper.jar /gradlew.bat /local.properties GeneratedPluginRegistrant.java +.cxx/ # Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +# See https://flutter.dev/to/reference-keystore key.properties **/*.keystore **/*.jks diff --git a/cupertino_gallery/android/app/build.gradle.kts b/cupertino_gallery/android/app/build.gradle.kts new file mode 100644 index 000000000..169bea05d --- /dev/null +++ b/cupertino_gallery/android/app/build.gradle.kts @@ -0,0 +1,44 @@ +plugins { + id("com.android.application") + id("kotlin-android") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.example.cupertino_gallery" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_11.toString() + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId = "com.example.cupertino_gallery" + // You can update the following values to match your application needs. + // For more information, see: https://flutter.dev/to/review-gradle-config. + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +flutter { + source = "../.." +} diff --git a/gemini_tasks/android/app/src/debug/AndroidManifest.xml b/cupertino_gallery/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from gemini_tasks/android/app/src/debug/AndroidManifest.xml rename to cupertino_gallery/android/app/src/debug/AndroidManifest.xml diff --git a/gemini_tasks/android/app/src/main/AndroidManifest.xml b/cupertino_gallery/android/app/src/main/AndroidManifest.xml similarity index 96% rename from gemini_tasks/android/app/src/main/AndroidManifest.xml rename to cupertino_gallery/android/app/src/main/AndroidManifest.xml index 04844322d..287f17c08 100644 --- a/gemini_tasks/android/app/src/main/AndroidManifest.xml +++ b/cupertino_gallery/android/app/src/main/AndroidManifest.xml @@ -1,12 +1,13 @@ diff --git a/cupertino_gallery/android/app/src/main/kotlin/com/example/cupertino_gallery/MainActivity.kt b/cupertino_gallery/android/app/src/main/kotlin/com/example/cupertino_gallery/MainActivity.kt new file mode 100644 index 000000000..9ef50d216 --- /dev/null +++ b/cupertino_gallery/android/app/src/main/kotlin/com/example/cupertino_gallery/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.cupertino_gallery + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity : FlutterActivity() diff --git a/gemini_tasks/android/app/src/main/res/drawable-v21/launch_background.xml b/cupertino_gallery/android/app/src/main/res/drawable-v21/launch_background.xml similarity index 100% rename from gemini_tasks/android/app/src/main/res/drawable-v21/launch_background.xml rename to cupertino_gallery/android/app/src/main/res/drawable-v21/launch_background.xml diff --git a/gemini_tasks/android/app/src/main/res/drawable/launch_background.xml b/cupertino_gallery/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from gemini_tasks/android/app/src/main/res/drawable/launch_background.xml rename to cupertino_gallery/android/app/src/main/res/drawable/launch_background.xml diff --git a/gemini_tasks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/cupertino_gallery/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from gemini_tasks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to cupertino_gallery/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/gemini_tasks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/cupertino_gallery/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from gemini_tasks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to cupertino_gallery/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/gemini_tasks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/cupertino_gallery/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from gemini_tasks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to cupertino_gallery/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/gemini_tasks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/cupertino_gallery/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from gemini_tasks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to cupertino_gallery/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/gemini_tasks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/cupertino_gallery/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from gemini_tasks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to cupertino_gallery/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/gemini_tasks/android/app/src/main/res/values-night/styles.xml b/cupertino_gallery/android/app/src/main/res/values-night/styles.xml similarity index 100% rename from gemini_tasks/android/app/src/main/res/values-night/styles.xml rename to cupertino_gallery/android/app/src/main/res/values-night/styles.xml diff --git a/gemini_tasks/android/app/src/main/res/values/styles.xml b/cupertino_gallery/android/app/src/main/res/values/styles.xml similarity index 100% rename from gemini_tasks/android/app/src/main/res/values/styles.xml rename to cupertino_gallery/android/app/src/main/res/values/styles.xml diff --git a/gemini_tasks/android/app/src/profile/AndroidManifest.xml b/cupertino_gallery/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from gemini_tasks/android/app/src/profile/AndroidManifest.xml rename to cupertino_gallery/android/app/src/profile/AndroidManifest.xml diff --git a/cupertino_gallery/android/build.gradle.kts b/cupertino_gallery/android/build.gradle.kts new file mode 100644 index 000000000..dbee657bb --- /dev/null +++ b/cupertino_gallery/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/cupertino_gallery/android/gradle.properties b/cupertino_gallery/android/gradle.properties new file mode 100644 index 000000000..f018a6181 --- /dev/null +++ b/cupertino_gallery/android/gradle.properties @@ -0,0 +1,3 @@ +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError +android.useAndroidX=true +android.enableJetifier=true diff --git a/gemini_tasks/android/gradle/wrapper/gradle-wrapper.properties b/cupertino_gallery/android/gradle/wrapper/gradle-wrapper.properties similarity index 92% rename from gemini_tasks/android/gradle/wrapper/gradle-wrapper.properties rename to cupertino_gallery/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef..ac3b47926 100644 --- a/gemini_tasks/android/gradle/wrapper/gradle-wrapper.properties +++ b/cupertino_gallery/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip diff --git a/cupertino_gallery/android/settings.gradle.kts b/cupertino_gallery/android/settings.gradle.kts new file mode 100644 index 000000000..fb605bc84 --- /dev/null +++ b/cupertino_gallery/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + flutterSdkPath + } + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.9.1" apply false + id("org.jetbrains.kotlin.android") version "2.1.0" apply false +} + +include(":app") diff --git a/gemini_tasks/ios/.gitignore b/cupertino_gallery/ios/.gitignore similarity index 100% rename from gemini_tasks/ios/.gitignore rename to cupertino_gallery/ios/.gitignore diff --git a/gemini_tasks/ios/Flutter/AppFrameworkInfo.plist b/cupertino_gallery/ios/Flutter/AppFrameworkInfo.plist similarity index 96% rename from gemini_tasks/ios/Flutter/AppFrameworkInfo.plist rename to cupertino_gallery/ios/Flutter/AppFrameworkInfo.plist index 7c5696400..1dc6cf765 100644 --- a/gemini_tasks/ios/Flutter/AppFrameworkInfo.plist +++ b/cupertino_gallery/ios/Flutter/AppFrameworkInfo.plist @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 12.0 + 13.0 diff --git a/cupertino_gallery/ios/Flutter/Debug.xcconfig b/cupertino_gallery/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..592ceee85 --- /dev/null +++ b/cupertino_gallery/ios/Flutter/Debug.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/cupertino_gallery/ios/Flutter/Release.xcconfig b/cupertino_gallery/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..592ceee85 --- /dev/null +++ b/cupertino_gallery/ios/Flutter/Release.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/gemini_tasks/ios/Runner.xcodeproj/project.pbxproj b/cupertino_gallery/ios/Runner.xcodeproj/project.pbxproj similarity index 97% rename from gemini_tasks/ios/Runner.xcodeproj/project.pbxproj rename to cupertino_gallery/ios/Runner.xcodeproj/project.pbxproj index 16e2a3544..45736c73b 100644 --- a/gemini_tasks/ios/Runner.xcodeproj/project.pbxproj +++ b/cupertino_gallery/ios/Runner.xcodeproj/project.pbxproj @@ -346,7 +346,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -362,13 +362,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2UUT9AMTS2; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -384,7 +385,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -401,7 +402,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -416,7 +417,7 @@ CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; @@ -472,7 +473,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -523,7 +524,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -541,13 +542,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2UUT9AMTS2; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -563,13 +565,14 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = 2UUT9AMTS2; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; diff --git a/gemini_tasks/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/cupertino_gallery/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from gemini_tasks/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to cupertino_gallery/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/gemini_tasks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cupertino_gallery/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from gemini_tasks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to cupertino_gallery/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/gemini_tasks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/cupertino_gallery/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from gemini_tasks/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to cupertino_gallery/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/gemini_tasks/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/cupertino_gallery/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 95% rename from gemini_tasks/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to cupertino_gallery/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 8e3ca5dfe..e3773d42e 100644 --- a/gemini_tasks/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/cupertino_gallery/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -26,6 +26,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + customLLDBInitFile = "$(SRCROOT)/Flutter/ephemeral/flutter_lldbinit" shouldUseLaunchSchemeArgsEnv = "YES"> diff --git a/gemini_tasks/ios/Runner.xcworkspace/contents.xcworkspacedata b/cupertino_gallery/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from gemini_tasks/ios/Runner.xcworkspace/contents.xcworkspacedata rename to cupertino_gallery/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/gemini_tasks/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cupertino_gallery/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from gemini_tasks/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to cupertino_gallery/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/gemini_tasks/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/cupertino_gallery/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from gemini_tasks/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to cupertino_gallery/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/gemini_tasks/ios/Runner/AppDelegate.swift b/cupertino_gallery/ios/Runner/AppDelegate.swift similarity index 95% rename from gemini_tasks/ios/Runner/AppDelegate.swift rename to cupertino_gallery/ios/Runner/AppDelegate.swift index 70693e4a8..626664468 100644 --- a/gemini_tasks/ios/Runner/AppDelegate.swift +++ b/cupertino_gallery/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ -import UIKit import Flutter +import UIKit -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from gemini_tasks/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to cupertino_gallery/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/gemini_tasks/ios/Runner/Base.lproj/LaunchScreen.storyboard b/cupertino_gallery/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from gemini_tasks/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to cupertino_gallery/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/gemini_tasks/ios/Runner/Base.lproj/Main.storyboard b/cupertino_gallery/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from gemini_tasks/ios/Runner/Base.lproj/Main.storyboard rename to cupertino_gallery/ios/Runner/Base.lproj/Main.storyboard diff --git a/gemini_tasks/ios/Runner/Info.plist b/cupertino_gallery/ios/Runner/Info.plist similarity index 95% rename from gemini_tasks/ios/Runner/Info.plist rename to cupertino_gallery/ios/Runner/Info.plist index d86ff26a5..a8ead9290 100644 --- a/gemini_tasks/ios/Runner/Info.plist +++ b/cupertino_gallery/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - Gemini Tasks + Cupertino Gallery CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -13,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - gemini_tasks + cupertino_gallery CFBundlePackageType APPL CFBundleShortVersionString diff --git a/gemini_tasks/ios/Runner/Runner-Bridging-Header.h b/cupertino_gallery/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from gemini_tasks/ios/Runner/Runner-Bridging-Header.h rename to cupertino_gallery/ios/Runner/Runner-Bridging-Header.h diff --git a/gemini_tasks/ios/RunnerTests/RunnerTests.swift b/cupertino_gallery/ios/RunnerTests/RunnerTests.swift similarity index 100% rename from gemini_tasks/ios/RunnerTests/RunnerTests.swift rename to cupertino_gallery/ios/RunnerTests/RunnerTests.swift diff --git a/cupertino_gallery/lib/gallery_home.dart b/cupertino_gallery/lib/gallery_home.dart new file mode 100644 index 000000000..b5a407567 --- /dev/null +++ b/cupertino_gallery/lib/gallery_home.dart @@ -0,0 +1,52 @@ +import 'package:flutter/cupertino.dart'; +import 'settings_page.dart'; +import 'widgets_page.dart'; + +class GalleryHome extends StatelessWidget { + const GalleryHome({ + super.key, + required this.onThemeChange, + required this.isDarkMode, + required this.onTextSizeChange, + required this.textSize, + }); + + final ValueChanged onThemeChange; + final bool isDarkMode; + final ValueChanged onTextSizeChange; + final double textSize; + + @override + Widget build(BuildContext context) { + return CupertinoTabScaffold( + tabBar: CupertinoTabBar( + items: const [ + BottomNavigationBarItem( + icon: Icon(CupertinoIcons.list_bullet), + label: 'Widgets', + ), + BottomNavigationBarItem( + icon: Icon(CupertinoIcons.settings), + label: 'Settings', + ), + ], + ), + tabBuilder: (BuildContext context, int index) { + return CupertinoTabView( + builder: (BuildContext context) { + return switch (index) { + 0 => const WidgetsPage(), + 1 => SettingsPage( + onThemeChange: onThemeChange, + isDarkMode: isDarkMode, + onTextSizeChange: onTextSizeChange, + textSize: textSize, + ), + _ => const Center(child: Text('Widgets')), + }; + }, + ); + }, + ); + } +} diff --git a/cupertino_gallery/lib/main.dart b/cupertino_gallery/lib/main.dart new file mode 100644 index 000000000..934796db8 --- /dev/null +++ b/cupertino_gallery/lib/main.dart @@ -0,0 +1,72 @@ +// Copyright 2022 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'gallery_home.dart'; + +void main() { + runApp(const CupertinoGalleryApp()); +} + +class CupertinoGalleryApp extends StatefulWidget { + const CupertinoGalleryApp({super.key}); + + @override + State createState() => _CupertinoGalleryAppState(); +} + +class _CupertinoGalleryAppState extends State { + ThemeMode _themeMode = ThemeMode.system; + double _textSize = 1.0; + + void _handleThemeChange(bool isDarkMode) { + setState(() { + _themeMode = isDarkMode ? ThemeMode.dark : ThemeMode.light; + }); + } + + void _handleTextSizeChange(double newTextSize) { + setState(() { + _textSize = newTextSize; + }); + } + + @override + Widget build(BuildContext context) { + final baseTheme = CupertinoThemeData( + brightness: + _themeMode == ThemeMode.dark ? Brightness.dark : Brightness.light, + ); + final textTheme = baseTheme.textTheme.copyWith( + textStyle: + baseTheme.textTheme.textStyle.copyWith(fontSize: 14 * _textSize), + actionTextStyle: baseTheme.textTheme.actionTextStyle + .copyWith(fontSize: 14 * _textSize), + tabLabelTextStyle: baseTheme.textTheme.tabLabelTextStyle + .copyWith(fontSize: 10 * _textSize), + navTitleTextStyle: baseTheme.textTheme.navTitleTextStyle + .copyWith(fontSize: 17 * _textSize), + navLargeTitleTextStyle: baseTheme.textTheme.navLargeTitleTextStyle + .copyWith(fontSize: 34 * _textSize), + navActionTextStyle: baseTheme.textTheme.navActionTextStyle + .copyWith(fontSize: 17 * _textSize), + pickerTextStyle: baseTheme.textTheme.pickerTextStyle + .copyWith(fontSize: 21 * _textSize), + dateTimePickerTextStyle: baseTheme.textTheme.dateTimePickerTextStyle + .copyWith(fontSize: 21 * _textSize), + ); + return CupertinoApp( + title: 'Cupertino Gallery', + theme: baseTheme.copyWith(textTheme: textTheme), + home: GalleryHome( + onThemeChange: _handleThemeChange, + isDarkMode: _themeMode == ThemeMode.dark, + onTextSizeChange: _handleTextSizeChange, + textSize: _textSize, + ), + ); + } +} diff --git a/cupertino_gallery/lib/settings_page.dart b/cupertino_gallery/lib/settings_page.dart new file mode 100644 index 000000000..59a4b3c73 --- /dev/null +++ b/cupertino_gallery/lib/settings_page.dart @@ -0,0 +1,143 @@ +import 'package:flutter/cupertino.dart'; + +class SettingsPage extends StatefulWidget { + const SettingsPage({ + super.key, + required this.onThemeChange, + required this.isDarkMode, + required this.onTextSizeChange, + required this.textSize, + }); + + final ValueChanged onThemeChange; + final bool isDarkMode; + final ValueChanged onTextSizeChange; + final double textSize; + + @override + State createState() => _SettingsPageState(); +} + +class _SettingsPageState extends State { + late bool isDarkMode; + late double _textSize; + + @override + void initState() { + super.initState(); + isDarkMode = widget.isDarkMode; + _textSize = widget.textSize; + } + + @override + void didUpdateWidget(SettingsPage oldWidget) { + super.didUpdateWidget(oldWidget); + if (widget.isDarkMode != oldWidget.isDarkMode) { + isDarkMode = widget.isDarkMode; + } + if (widget.textSize != oldWidget.textSize) { + _textSize = widget.textSize; + } + } + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('Settings')), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CupertinoListSection( + header: const Text('Appearance'), + children: [ + CupertinoListTile( + title: const Text('Dark Mode'), + trailing: CupertinoSwitch( + value: isDarkMode, + onChanged: (bool isActive) { + setState(() { + isDarkMode = isActive; + widget.onThemeChange(isActive); + }); + }, + ), + ), + CupertinoListTile( + title: const Text('Text Size'), + trailing: Text('${(_textSize * 100).toStringAsFixed(0)}%'), + ), + CupertinoSlider( + value: _textSize, + min: 0.5, + max: 1.5, + onChanged: (double value) { + setState(() { + _textSize = value; + }); + widget.onTextSizeChange(value); + }, + ), + ], + ), + CupertinoListSection( + header: const Text('General'), + children: [ + CupertinoListTile( + title: const Text('About'), + trailing: const Icon(CupertinoIcons.forward), + onTap: () {}, + ), + CupertinoListTile( + title: const Text('Privacy'), + trailing: const Icon(CupertinoIcons.forward), + onTap: () {}, + ), + CupertinoListTile( + title: const Text('Help'), + trailing: const Icon(CupertinoIcons.forward), + onTap: () {}, + ), + CupertinoListTile( + title: const Text('Reset Settings'), + trailing: const Icon(CupertinoIcons.forward), + onTap: () { + showCupertinoDialog( + context: context, + builder: (BuildContext context) => CupertinoAlertDialog( + title: const Text('Reset Settings'), + content: const Text( + 'Are you sure you want to reset all settings?', + ), + actions: [ + CupertinoDialogAction( + child: const Text('Cancel'), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoDialogAction( + isDestructiveAction: true, + child: const Text('Reset'), + onPressed: () { + setState(() { + isDarkMode = false; + _textSize = 1.0; + widget.onThemeChange(false); + widget.onTextSizeChange(1.0); + }); + Navigator.pop(context); + }, + ), + ], + ), + ); + }, + ), + ], + ), + ], + ), + ); + } +} + diff --git a/cupertino_gallery/lib/widget_detail_page.dart b/cupertino_gallery/lib/widget_detail_page.dart new file mode 100644 index 000000000..bd289c4f5 --- /dev/null +++ b/cupertino_gallery/lib/widget_detail_page.dart @@ -0,0 +1,84 @@ +import 'package:flutter/cupertino.dart'; + +import 'widgets/action_sheet_page.dart'; +import 'widgets/activity_indicator_page.dart'; +import 'widgets/alert_dialog_page.dart'; +import 'widgets/button_page.dart'; +import 'widgets/checkbox_page.dart'; +import 'widgets/context_menu_page.dart'; +import 'widgets/date_picker_page.dart'; +import 'widgets/list_tile_page.dart'; +import 'widgets/picker_page.dart'; +import 'widgets/popup_surface_page.dart'; +import 'widgets/radio_page.dart'; +import 'widgets/scrollbar_page.dart'; +import 'widgets/search_text_field_page.dart'; +import 'widgets/segmented_control_page.dart'; +import 'widgets/sheet_page.dart'; +import 'widgets/slider_page.dart'; +import 'widgets/sliding_segmented_control_page.dart'; +import 'widgets/switch_page.dart'; +import 'widgets/text_field_page.dart'; +import 'widgets/text_theme_page.dart'; +import 'widgets/time_picker_page.dart'; + +class WidgetDetailPage extends StatelessWidget { + const WidgetDetailPage({super.key, required this.title}); + + final String title; + + @override + Widget build(BuildContext context) { + switch (title) { + case 'Action Sheet': + return const ActionSheetPage(); + case 'Activity Indicator': + return const ActivityIndicatorPage(); + case 'Alert Dialog': + return const AlertDialogPage(); + case 'Button': + return const ButtonPage(); + case 'Checkbox': + return const CheckboxPage(); + case 'Context Menu': + return const ContextMenuPage(); + case 'Date Picker': + return const DatePickerPage(); + case 'List Tile': + return const ListTilePage(); + case 'Picker': + return const PickerPage(); + case 'Popup Surface': + return const PopupSurfacePage(); + case 'Radio': + return const RadioPage(); + case 'Scrollbar': + return const ScrollbarPage(); + case 'Search Text Field': + return const SearchTextFieldPage(); + case 'Segmented Control': + return const SegmentedControlPage(); + case 'Sheet': + return const SheetPage(); + case 'Slider': + return const SliderPage(); + case 'Sliding Segmented Control': + return const SlidingSegmentedControlPage(); + case 'Switch': + return const SwitchPage(); + case 'Text Field': + return const TextFieldPage(); + case 'Text Theme': + return const TextThemePage(); + case 'Time Picker': + return const TimePickerPage(); + default: + return const CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + middle: Text('Widget Not Found'), + ), + child: Center(child: Text('Widget Not Found')), + ); + } + } +} diff --git a/cupertino_gallery/lib/widgets/action_sheet_page.dart b/cupertino_gallery/lib/widgets/action_sheet_page.dart new file mode 100644 index 000000000..5949323cb --- /dev/null +++ b/cupertino_gallery/lib/widgets/action_sheet_page.dart @@ -0,0 +1,49 @@ +import 'package:flutter/cupertino.dart'; + +class ActionSheetPage extends StatelessWidget { + const ActionSheetPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Action Sheet'), + ), + child: Center( + child: CupertinoButton( + child: const Text('Show Action Sheet'), + onPressed: () { + showCupertinoModalPopup( + context: context, + builder: (BuildContext context) => CupertinoActionSheet( + title: const Text('Title'), + message: const Text('Message'), + actions: [ + CupertinoActionSheetAction( + child: const Text('Action One'), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoActionSheetAction( + child: const Text('Action Two'), + onPressed: () { + Navigator.pop(context); + }, + ) + ], + cancelButton: CupertinoActionSheetAction( + isDefaultAction: true, + onPressed: () { + Navigator.pop(context); + }, + child: const Text('Cancel'), + ), + ), + ); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/activity_indicator_page.dart b/cupertino_gallery/lib/widgets/activity_indicator_page.dart new file mode 100644 index 000000000..550da6f62 --- /dev/null +++ b/cupertino_gallery/lib/widgets/activity_indicator_page.dart @@ -0,0 +1,17 @@ +import 'package:flutter/cupertino.dart'; + +class ActivityIndicatorPage extends StatelessWidget { + const ActivityIndicatorPage({super.key}); + + @override + Widget build(BuildContext context) { + return const CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + middle: Text('Activity Indicator'), + ), + child: Center( + child: CupertinoActivityIndicator(), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/alert_dialog_page.dart b/cupertino_gallery/lib/widgets/alert_dialog_page.dart new file mode 100644 index 000000000..416ba5160 --- /dev/null +++ b/cupertino_gallery/lib/widgets/alert_dialog_page.dart @@ -0,0 +1,41 @@ +import 'package:flutter/cupertino.dart'; + +class AlertDialogPage extends StatelessWidget { + const AlertDialogPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('Alert Dialog')), + child: Center( + child: CupertinoButton( + child: const Text('Show Alert Dialog'), + onPressed: () { + showCupertinoDialog( + context: context, + builder: (BuildContext context) => CupertinoAlertDialog( + title: const Text('Alert'), + content: const Text('This is a sample alert dialog.'), + actions: [ + CupertinoDialogAction( + child: const Text('OK'), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoDialogAction( + isDefaultAction: true, + child: const Text('NO'), + onPressed: () { + Navigator.pop(context); + }, + ), + ], + ), + ); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/button_page.dart b/cupertino_gallery/lib/widgets/button_page.dart new file mode 100644 index 000000000..d59916841 --- /dev/null +++ b/cupertino_gallery/lib/widgets/button_page.dart @@ -0,0 +1,42 @@ +import 'package:flutter/cupertino.dart'; + +class ButtonPage extends StatelessWidget { + const ButtonPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('Button')), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'CupertinoButton widget', + style: CupertinoTheme.of(context).textTheme.textStyle, + ), + const SizedBox(height: 16), + CupertinoButton(child: const Text('Enabled'), onPressed: () {}), + const SizedBox(height: 16), + const CupertinoButton(onPressed: null, child: Text('Disabled')), + const SizedBox(height: 32), + Text( + 'CupertinoButton.filled widget', + style: CupertinoTheme.of(context).textTheme.textStyle, + ), + const SizedBox(height: 16), + CupertinoButton.filled( + child: const Text('Enabled'), + onPressed: () {}, + ), + const SizedBox(height: 16), + const CupertinoButton.filled( + onPressed: null, + child: Text('Disabled'), + ), + ], + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/checkbox_page.dart b/cupertino_gallery/lib/widgets/checkbox_page.dart new file mode 100644 index 000000000..357cb0746 --- /dev/null +++ b/cupertino_gallery/lib/widgets/checkbox_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/cupertino.dart'; + +class CheckboxPage extends StatefulWidget { + const CheckboxPage({super.key}); + + @override + State createState() => _CheckboxPageState(); +} + +class _CheckboxPageState extends State { + bool _value = false; + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Checkbox'), + ), + child: Center( + child: CupertinoCheckbox( + value: _value, + onChanged: (bool? value) { + setState(() { + _value = value!; + }); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/context_menu_page.dart b/cupertino_gallery/lib/widgets/context_menu_page.dart new file mode 100644 index 000000000..6e4432426 --- /dev/null +++ b/cupertino_gallery/lib/widgets/context_menu_page.dart @@ -0,0 +1,42 @@ +import 'package:flutter/cupertino.dart'; + +class ContextMenuPage extends StatelessWidget { + const ContextMenuPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('Context Menu')), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text('Long press to activate context menu:'), + SizedBox(height: 16), + SizedBox( + width: 100, + height: 100, + child: CupertinoContextMenu( + actions: [ + CupertinoContextMenuAction( + child: const Text('Action one'), + onPressed: () { + Navigator.pop(context); + }, + ), + CupertinoContextMenuAction( + child: const Text('Action two'), + onPressed: () { + Navigator.pop(context); + }, + ), + ], + child: Container(color: CupertinoColors.activeBlue), + ), + ), + ], + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/date_picker_page.dart b/cupertino_gallery/lib/widgets/date_picker_page.dart new file mode 100644 index 000000000..26395a315 --- /dev/null +++ b/cupertino_gallery/lib/widgets/date_picker_page.dart @@ -0,0 +1,22 @@ +import 'package:flutter/cupertino.dart'; + +class DatePickerPage extends StatelessWidget { + const DatePickerPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Date Picker'), + ), + child: Center( + child: SizedBox( + height: 200, + child: CupertinoDatePicker( + onDateTimeChanged: (DateTime newDate) {}, + ), + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/list_tile_page.dart b/cupertino_gallery/lib/widgets/list_tile_page.dart new file mode 100644 index 000000000..4821c14fd --- /dev/null +++ b/cupertino_gallery/lib/widgets/list_tile_page.dart @@ -0,0 +1,62 @@ +import 'package:flutter/cupertino.dart'; + +class ListTilePage extends StatelessWidget { + const ListTilePage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('List Tile')), + child: Center( + child: ListView( + children: [ + CupertinoListSection.insetGrouped( + children: [ + CupertinoListTile( + title: Text('Title'), + subtitle: Text('Subtitle'), + leading: Icon(CupertinoIcons.info), + trailing: Icon(CupertinoIcons.forward), + ), + CupertinoListTile( + title: Text('Title'), + subtitle: Text('Subtitle'), + leading: Icon(CupertinoIcons.person), + trailing: Icon(CupertinoIcons.forward), + ), + CupertinoListTile( + title: Text('Title'), + subtitle: Text('Subtitle'), + leading: Icon(CupertinoIcons.wifi), + trailing: Icon(CupertinoIcons.forward), + ), + ], + ), + CupertinoListSection( + children: [ + CupertinoListTile( + title: Text('Title'), + subtitle: Text('Subtitle'), + leading: Icon(CupertinoIcons.search), + trailing: Icon(CupertinoIcons.forward), + ), + CupertinoListTile( + title: Text('Title'), + subtitle: Text('Subtitle'), + leading: Icon(CupertinoIcons.heart_fill), + trailing: Icon(CupertinoIcons.forward), + ), + CupertinoListTile( + title: Text('Title'), + subtitle: Text('Subtitle'), + leading: Icon(CupertinoIcons.ant), + trailing: Icon(CupertinoIcons.forward), + ), + ], + ), + ], + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/picker_page.dart b/cupertino_gallery/lib/widgets/picker_page.dart new file mode 100644 index 000000000..21726435b --- /dev/null +++ b/cupertino_gallery/lib/widgets/picker_page.dart @@ -0,0 +1,28 @@ +import 'package:flutter/cupertino.dart'; + +class PickerPage extends StatelessWidget { + const PickerPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Picker'), + ), + child: Center( + child: SizedBox( + height: 200, + child: CupertinoPicker( + itemExtent: 32, + onSelectedItemChanged: (int index) {}, + children: const [ + Text('One'), + Text('Two'), + Text('Three'), + ], + ), + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/popup_surface_page.dart b/cupertino_gallery/lib/widgets/popup_surface_page.dart new file mode 100644 index 000000000..c817ab474 --- /dev/null +++ b/cupertino_gallery/lib/widgets/popup_surface_page.dart @@ -0,0 +1,36 @@ +import 'package:flutter/cupertino.dart'; + +class PopupSurfacePage extends StatelessWidget { + const PopupSurfacePage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Popup Surface'), + ), + child: Center( + child: CupertinoButton( + child: const Text('Show Popup Surface'), + onPressed: () { + showCupertinoModalPopup( + context: context, + builder: (BuildContext context) { + return CupertinoPopupSurface( + child: Container( + color: CupertinoColors.white, + width: 200, + height: 200, + child: const Center( + child: Text('This is a popup surface.'), + ), + ), + ); + }, + ); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/radio_page.dart b/cupertino_gallery/lib/widgets/radio_page.dart new file mode 100644 index 000000000..f5e768472 --- /dev/null +++ b/cupertino_gallery/lib/widgets/radio_page.dart @@ -0,0 +1,46 @@ +import 'package:flutter/cupertino.dart'; + +class RadioPage extends StatefulWidget { + const RadioPage({super.key}); + + @override + State createState() => _RadioPageState(); +} + +class _RadioPageState extends State { + int _selectedValue = 0; + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('Radio')), + child: Center( + child: RadioGroup( + groupValue: _selectedValue, + onChanged: (int? value) { + setState(() { + _selectedValue = value!; + }); + }, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + CupertinoListTile( + title: const Text('Option 1'), + leading: CupertinoRadio(value: 0), + ), + CupertinoListTile( + title: const Text('Option 2'), + leading: CupertinoRadio(value: 1), + ), + CupertinoListTile( + title: const Text('Option 3'), + leading: CupertinoRadio(value: 2), + ), + ], + ), + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/scrollbar_page.dart b/cupertino_gallery/lib/widgets/scrollbar_page.dart new file mode 100644 index 000000000..fdecb34cb --- /dev/null +++ b/cupertino_gallery/lib/widgets/scrollbar_page.dart @@ -0,0 +1,26 @@ +import 'package:flutter/cupertino.dart'; + +class ScrollbarPage extends StatelessWidget { + const ScrollbarPage({super.key}); + + @override + Widget build(BuildContext context) { + final ScrollController controller = ScrollController(); + return CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar(middle: Text('Scrollbar')), + child: CupertinoScrollbar( + controller: controller, + child: ListView.separated( + controller: controller, + itemCount: 100, + itemBuilder: (BuildContext context, int index) { + return CupertinoListTile(title: Text('Item $index')); + }, + separatorBuilder: (BuildContext context, int index) { + return Container(height: 1, color: CupertinoColors.opaqueSeparator); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/search_text_field_page.dart b/cupertino_gallery/lib/widgets/search_text_field_page.dart new file mode 100644 index 000000000..00aefc65c --- /dev/null +++ b/cupertino_gallery/lib/widgets/search_text_field_page.dart @@ -0,0 +1,20 @@ +import 'package:flutter/cupertino.dart'; + +class SearchTextFieldPage extends StatelessWidget { + const SearchTextFieldPage({super.key}); + + @override + Widget build(BuildContext context) { + return const CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + middle: Text('Search Text Field'), + ), + child: Center( + child: Padding( + padding: EdgeInsets.all(16.0), + child: CupertinoSearchTextField(), + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/segmented_control_page.dart b/cupertino_gallery/lib/widgets/segmented_control_page.dart new file mode 100644 index 000000000..614ca44b2 --- /dev/null +++ b/cupertino_gallery/lib/widgets/segmented_control_page.dart @@ -0,0 +1,36 @@ +import 'package:flutter/cupertino.dart'; + +class SegmentedControlPage extends StatefulWidget { + const SegmentedControlPage({super.key}); + + @override + State createState() => _SegmentedControlPageState(); +} + +class _SegmentedControlPageState extends State { + int _selectedIndex = 0; + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Segmented Control'), + ), + child: Center( + child: CupertinoSegmentedControl( + children: { + 0: Text('One'), + 1: Text('Two'), + 2: Text('Three'), + }, + onValueChanged: (int val) { + setState(() { + _selectedIndex = val; + }); + }, + groupValue: _selectedIndex, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/sheet_page.dart b/cupertino_gallery/lib/widgets/sheet_page.dart new file mode 100644 index 000000000..1020135d6 --- /dev/null +++ b/cupertino_gallery/lib/widgets/sheet_page.dart @@ -0,0 +1,39 @@ +import 'package:flutter/cupertino.dart'; + +class SheetPage extends StatelessWidget { + const SheetPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar(middle: Text('Sheet')), + child: Center( + child: CupertinoButton.filled( + child: const Text('Show Sheet'), + onPressed: () { + Navigator.of(context).push( + CupertinoSheetRoute( + builder: (BuildContext context) { + return CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + middle: const Text('Sheet'), + trailing: GestureDetector( + child: const Icon(CupertinoIcons.xmark), + onTap: () { + Navigator.of(context).pop(); + }, + ), + ), + child: const Center( + child: Text('This is a sheet'), + ), + ); + }, + ), + ); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/slider_page.dart b/cupertino_gallery/lib/widgets/slider_page.dart new file mode 100644 index 000000000..61d812a43 --- /dev/null +++ b/cupertino_gallery/lib/widgets/slider_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/cupertino.dart'; + +class SliderPage extends StatefulWidget { + const SliderPage({super.key}); + + @override + State createState() => _SliderPageState(); +} + +class _SliderPageState extends State { + double _value = 0.5; + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Slider'), + ), + child: Center( + child: CupertinoSlider( + value: _value, + onChanged: (double value) { + setState(() { + _value = value; + }); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart b/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart new file mode 100644 index 000000000..528c1512c --- /dev/null +++ b/cupertino_gallery/lib/widgets/sliding_segmented_control_page.dart @@ -0,0 +1,38 @@ +import 'package:flutter/cupertino.dart'; + +class SlidingSegmentedControlPage extends StatefulWidget { + const SlidingSegmentedControlPage({super.key}); + + @override + State createState() => + _SlidingSegmentedControlPageState(); +} + +class _SlidingSegmentedControlPageState + extends State { + int? _groupValue = 0; + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Sliding Segmented Control'), + ), + child: Center( + child: CupertinoSlidingSegmentedControl( + children: const { + 0: Text('One'), + 1: Text('Two'), + 2: Text('Three'), + }, + onValueChanged: (int? value) { + setState(() { + _groupValue = value; + }); + }, + groupValue: _groupValue, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/switch_page.dart b/cupertino_gallery/lib/widgets/switch_page.dart new file mode 100644 index 000000000..627ce29b1 --- /dev/null +++ b/cupertino_gallery/lib/widgets/switch_page.dart @@ -0,0 +1,31 @@ +import 'package:flutter/cupertino.dart'; + +class SwitchPage extends StatefulWidget { + const SwitchPage({super.key}); + + @override + State createState() => _SwitchPageState(); +} + +class _SwitchPageState extends State { + bool _value = true; + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Switch'), + ), + child: Center( + child: CupertinoSwitch( + value: _value, + onChanged: (bool value) { + setState(() { + _value = value; + }); + }, + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/text_field_page.dart b/cupertino_gallery/lib/widgets/text_field_page.dart new file mode 100644 index 000000000..e8a8f27b1 --- /dev/null +++ b/cupertino_gallery/lib/widgets/text_field_page.dart @@ -0,0 +1,22 @@ +import 'package:flutter/cupertino.dart'; + +class TextFieldPage extends StatelessWidget { + const TextFieldPage({super.key}); + + @override + Widget build(BuildContext context) { + return const CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + middle: Text('Text Field'), + ), + child: Center( + child: Padding( + padding: EdgeInsets.all(16.0), + child: CupertinoTextField( + placeholder: 'Enter text', + ), + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/text_theme_page.dart b/cupertino_gallery/lib/widgets/text_theme_page.dart new file mode 100644 index 000000000..9e360b86c --- /dev/null +++ b/cupertino_gallery/lib/widgets/text_theme_page.dart @@ -0,0 +1,58 @@ +import 'package:flutter/cupertino.dart'; + +class TextThemePage extends StatelessWidget { + const TextThemePage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Text Theme'), + ), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'This is the default text style', + style: CupertinoTheme.of(context).textTheme.textStyle, + ), + const SizedBox(height: 16), + Text( + 'This is the action text style', + style: CupertinoTheme.of(context).textTheme.actionTextStyle, + ), + const SizedBox(height: 16), + Text( + 'This is the tab label text style', + style: CupertinoTheme.of(context).textTheme.tabLabelTextStyle, + ), + const SizedBox(height: 16), + Text( + 'This is the nav title text style', + style: CupertinoTheme.of(context).textTheme.navTitleTextStyle, + ), + const SizedBox(height: 16), + Text( + 'This is the nav large title text style', + style: CupertinoTheme.of(context) + .textTheme + .navLargeTitleTextStyle, + ), + const SizedBox(height: 16), + Text( + 'This is the picker text style', + style: CupertinoTheme.of(context).textTheme.pickerTextStyle, + ), + const SizedBox(height: 16), + Text( + 'This is the date time picker text style', + style: + CupertinoTheme.of(context).textTheme.dateTimePickerTextStyle, + ), + ], + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets/time_picker_page.dart b/cupertino_gallery/lib/widgets/time_picker_page.dart new file mode 100644 index 000000000..64a9d28dc --- /dev/null +++ b/cupertino_gallery/lib/widgets/time_picker_page.dart @@ -0,0 +1,22 @@ +import 'package:flutter/cupertino.dart'; + +class TimePickerPage extends StatelessWidget { + const TimePickerPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: const CupertinoNavigationBar( + middle: Text('Time Picker'), + ), + child: Center( + child: SizedBox( + height: 200, + child: CupertinoTimerPicker( + onTimerDurationChanged: (Duration newDuration) {}, + ), + ), + ), + ); + } +} diff --git a/cupertino_gallery/lib/widgets_page.dart b/cupertino_gallery/lib/widgets_page.dart new file mode 100644 index 000000000..3c338299b --- /dev/null +++ b/cupertino_gallery/lib/widgets_page.dart @@ -0,0 +1,75 @@ +import 'package:flutter/cupertino.dart'; +import 'widget_detail_page.dart'; + +class WidgetsPage extends StatelessWidget { + const WidgetsPage({super.key}); + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + child: CustomScrollView( + slivers: [ + CupertinoSliverNavigationBar(largeTitle: Text('Cupertino Gallery')), + SliverFillRemaining( + child: ListView( + children: [ + CustomCupertinoListTile(title: 'Action Sheet'), + CustomCupertinoListTile(title: 'Activity Indicator'), + CustomCupertinoListTile(title: 'Alert Dialog'), + CustomCupertinoListTile(title: 'Button'), + CustomCupertinoListTile(title: 'Checkbox'), + CustomCupertinoListTile(title: 'Context Menu'), + CustomCupertinoListTile(title: 'Date Picker'), + CustomCupertinoListTile(title: 'List Tile'), + CustomCupertinoListTile(title: 'Picker'), + CustomCupertinoListTile(title: 'Popup Surface'), + CustomCupertinoListTile(title: 'Radio'), + CustomCupertinoListTile(title: 'Scrollbar'), + CustomCupertinoListTile(title: 'Search Text Field'), + CustomCupertinoListTile(title: 'Segmented Control'), + CustomCupertinoListTile(title: 'Sheet'), + CustomCupertinoListTile(title: 'Slider'), + CustomCupertinoListTile(title: 'Sliding Segmented Control'), + CustomCupertinoListTile(title: 'Switch'), + CustomCupertinoListTile(title: 'Text Field'), + CustomCupertinoListTile(title: 'Text Theme'), + CustomCupertinoListTile(title: 'Time Picker'), + ], + ), + ), + ], + ), + ); + } +} + +class CustomCupertinoListTile extends StatelessWidget { + const CustomCupertinoListTile({super.key, required this.title}); + + final String title; + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + Navigator.of(context).push( + CupertinoPageRoute( + builder: (BuildContext context) { + return WidgetDetailPage(title: title); + }, + ), + ); + }, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0), + decoration: const BoxDecoration( + border: Border(bottom: BorderSide(color: CupertinoColors.separator)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [Text(title), const Icon(CupertinoIcons.forward)], + ), + ), + ); + } +} diff --git a/gemini_tasks/linux/.gitignore b/cupertino_gallery/linux/.gitignore similarity index 100% rename from gemini_tasks/linux/.gitignore rename to cupertino_gallery/linux/.gitignore diff --git a/gemini_tasks/linux/CMakeLists.txt b/cupertino_gallery/linux/CMakeLists.txt similarity index 84% rename from gemini_tasks/linux/CMakeLists.txt rename to cupertino_gallery/linux/CMakeLists.txt index c394ffce3..cee57a90d 100644 --- a/gemini_tasks/linux/CMakeLists.txt +++ b/cupertino_gallery/linux/CMakeLists.txt @@ -1,13 +1,13 @@ # Project-level configuration. -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.13) project(runner LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "gemini_tasks") +set(BINARY_NAME "cupertino_gallery") # The unique GTK application identifier for this application. See: # https://wiki.gnome.org/HowDoI/ChooseApplicationID -set(APPLICATION_ID "com.example.gemini_tasks") +set(APPLICATION_ID "com.example.cupertino_gallery") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. @@ -54,25 +54,8 @@ add_subdirectory(${FLUTTER_MANAGED_DIR}) find_package(PkgConfig REQUIRED) pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) -add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") - -# Define the application target. To change its name, change BINARY_NAME above, -# not the value here, or `flutter run` will no longer work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} - "main.cc" - "my_application.cc" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add dependency libraries. Add any application-specific dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter) -target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) +# Application build; see runner/CMakeLists.txt. +add_subdirectory("runner") # Run the Flutter tool portions of the build. This must not be removed. add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/gemini_tasks/linux/flutter/CMakeLists.txt b/cupertino_gallery/linux/flutter/CMakeLists.txt similarity index 100% rename from gemini_tasks/linux/flutter/CMakeLists.txt rename to cupertino_gallery/linux/flutter/CMakeLists.txt diff --git a/cupertino_gallery/linux/flutter/generated_plugin_registrant.cc b/cupertino_gallery/linux/flutter/generated_plugin_registrant.cc new file mode 100644 index 000000000..e71a16d23 --- /dev/null +++ b/cupertino_gallery/linux/flutter/generated_plugin_registrant.cc @@ -0,0 +1,11 @@ +// +// Generated file. Do not edit. +// + +// clang-format off + +#include "generated_plugin_registrant.h" + + +void fl_register_plugins(FlPluginRegistry* registry) { +} diff --git a/gemini_tasks/linux/flutter/generated_plugin_registrant.h b/cupertino_gallery/linux/flutter/generated_plugin_registrant.h similarity index 100% rename from gemini_tasks/linux/flutter/generated_plugin_registrant.h rename to cupertino_gallery/linux/flutter/generated_plugin_registrant.h diff --git a/gemini_tasks/linux/flutter/generated_plugins.cmake b/cupertino_gallery/linux/flutter/generated_plugins.cmake similarity index 97% rename from gemini_tasks/linux/flutter/generated_plugins.cmake rename to cupertino_gallery/linux/flutter/generated_plugins.cmake index f16b4c342..2e1de87a7 100644 --- a/gemini_tasks/linux/flutter/generated_plugins.cmake +++ b/cupertino_gallery/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - url_launcher_linux ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/cupertino_gallery/linux/runner/CMakeLists.txt b/cupertino_gallery/linux/runner/CMakeLists.txt new file mode 100644 index 000000000..e97dabc70 --- /dev/null +++ b/cupertino_gallery/linux/runner/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(runner LANGUAGES CXX) + +# Define the application target. To change its name, change BINARY_NAME in the +# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer +# work. +# +# Any new source files that you add to the application should be added here. +add_executable(${BINARY_NAME} + "main.cc" + "my_application.cc" + "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" +) + +# Apply the standard set of build settings. This can be removed for applications +# that need different build settings. +apply_standard_settings(${BINARY_NAME}) + +# Add preprocessor definitions for the application ID. +add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") + +# Add dependency libraries. Add any application-specific dependencies here. +target_link_libraries(${BINARY_NAME} PRIVATE flutter) +target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) + +target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") diff --git a/gemini_tasks/linux/main.cc b/cupertino_gallery/linux/runner/main.cc similarity index 100% rename from gemini_tasks/linux/main.cc rename to cupertino_gallery/linux/runner/main.cc diff --git a/gemini_tasks/linux/my_application.cc b/cupertino_gallery/linux/runner/my_application.cc similarity index 79% rename from gemini_tasks/linux/my_application.cc rename to cupertino_gallery/linux/runner/my_application.cc index 5d36060db..781e7415b 100644 --- a/gemini_tasks/linux/my_application.cc +++ b/cupertino_gallery/linux/runner/my_application.cc @@ -14,6 +14,12 @@ struct _MyApplication { G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) +// Called when first Flutter frame received. +static void first_frame_cb(MyApplication* self, FlView *view) +{ + gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view))); +} + // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); @@ -40,23 +46,31 @@ static void my_application_activate(GApplication* application) { if (use_header_bar) { GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); gtk_widget_show(GTK_WIDGET(header_bar)); - gtk_header_bar_set_title(header_bar, "gemini_tasks"); + gtk_header_bar_set_title(header_bar, "cupertino_gallery"); gtk_header_bar_set_show_close_button(header_bar, TRUE); gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); } else { - gtk_window_set_title(window, "gemini_tasks"); + gtk_window_set_title(window, "cupertino_gallery"); } gtk_window_set_default_size(window, 1280, 720); - gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); FlView* view = fl_view_new(project); + GdkRGBA background_color; + // Background defaults to black, override it here if necessary, e.g. #00000000 for transparent. + gdk_rgba_parse(&background_color, "#000000"); + fl_view_set_background_color(view, &background_color); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); + // Show the window when Flutter renders. + // Requires the view to be realized so we can start rendering. + g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), self); + gtk_widget_realize(GTK_WIDGET(view)); + fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); @@ -117,6 +131,12 @@ static void my_application_class_init(MyApplicationClass* klass) { static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { + // Set the program name to the application ID, which helps various systems + // like GTK and desktop environments map this running application to its + // corresponding .desktop file. This ensures better integration by allowing + // the application to be recognized beyond its binary name. + g_set_prgname(APPLICATION_ID); + return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, diff --git a/gemini_tasks/linux/my_application.h b/cupertino_gallery/linux/runner/my_application.h similarity index 100% rename from gemini_tasks/linux/my_application.h rename to cupertino_gallery/linux/runner/my_application.h diff --git a/gemini_tasks/macos/.gitignore b/cupertino_gallery/macos/.gitignore similarity index 100% rename from gemini_tasks/macos/.gitignore rename to cupertino_gallery/macos/.gitignore diff --git a/cupertino_gallery/macos/Flutter/Flutter-Debug.xcconfig b/cupertino_gallery/macos/Flutter/Flutter-Debug.xcconfig new file mode 100644 index 000000000..c2efd0b60 --- /dev/null +++ b/cupertino_gallery/macos/Flutter/Flutter-Debug.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/cupertino_gallery/macos/Flutter/Flutter-Release.xcconfig b/cupertino_gallery/macos/Flutter/Flutter-Release.xcconfig new file mode 100644 index 000000000..c2efd0b60 --- /dev/null +++ b/cupertino_gallery/macos/Flutter/Flutter-Release.xcconfig @@ -0,0 +1 @@ +#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/gemini_tasks/macos/Flutter/GeneratedPluginRegistrant.swift b/cupertino_gallery/macos/Flutter/GeneratedPluginRegistrant.swift similarity index 56% rename from gemini_tasks/macos/Flutter/GeneratedPluginRegistrant.swift rename to cupertino_gallery/macos/Flutter/GeneratedPluginRegistrant.swift index 8236f5728..cccf817a5 100644 --- a/gemini_tasks/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/cupertino_gallery/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,8 +5,6 @@ import FlutterMacOS import Foundation -import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/gemini_tasks/macos/Runner.xcodeproj/project.pbxproj b/cupertino_gallery/macos/Runner.xcodeproj/project.pbxproj similarity index 77% rename from gemini_tasks/macos/Runner.xcodeproj/project.pbxproj rename to cupertino_gallery/macos/Runner.xcodeproj/project.pbxproj index b649f9488..ad1b7939b 100644 --- a/gemini_tasks/macos/Runner.xcodeproj/project.pbxproj +++ b/cupertino_gallery/macos/Runner.xcodeproj/project.pbxproj @@ -27,8 +27,6 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 569AB26DE3325218E22E891D /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BC72FCA0EA409398BE36D32 /* Pods_RunnerTests.framework */; }; - 7AAA3C27EF6962C0AB012BD5 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D5B3285CC002B474B68160E /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -62,13 +60,11 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 0963E172D33D9015B461746A /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 0F3D4D3AEF8B7B1DC146C6D9 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* gemini_tasks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = gemini_tasks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 33CC10ED2044A3C60003C045 /* cupertino_gallery.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "cupertino_gallery.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; @@ -80,14 +76,8 @@ 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 3D5B3285CC002B474B68160E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4A1CF1EC01D6AD68142F5DDF /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 5C8145B773E109388C918B05 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 917B1F16FE32F9DFF230E9C4 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - 9BC72FCA0EA409398BE36D32 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C597AD32E05276705DB27387 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -95,7 +85,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 569AB26DE3325218E22E891D /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,7 +92,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7AAA3C27EF6962C0AB012BD5 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -137,14 +125,13 @@ 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, - D031B94A0315E6B5F446D309 /* Pods */, ); sourceTree = ""; }; 33CC10EE2044A3C60003C045 /* Products */ = { isa = PBXGroup; children = ( - 33CC10ED2044A3C60003C045 /* gemini_tasks.app */, + 33CC10ED2044A3C60003C045 /* cupertino_gallery.app */, 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, ); name = Products; @@ -185,25 +172,9 @@ path = Runner; sourceTree = ""; }; - D031B94A0315E6B5F446D309 /* Pods */ = { - isa = PBXGroup; - children = ( - 0F3D4D3AEF8B7B1DC146C6D9 /* Pods-Runner.debug.xcconfig */, - C597AD32E05276705DB27387 /* Pods-Runner.release.xcconfig */, - 5C8145B773E109388C918B05 /* Pods-Runner.profile.xcconfig */, - 0963E172D33D9015B461746A /* Pods-RunnerTests.debug.xcconfig */, - 4A1CF1EC01D6AD68142F5DDF /* Pods-RunnerTests.release.xcconfig */, - 917B1F16FE32F9DFF230E9C4 /* Pods-RunnerTests.profile.xcconfig */, - ); - name = Pods; - path = Pods; - sourceTree = ""; - }; D73912EC22F37F3D000D13A0 /* Frameworks */ = { isa = PBXGroup; children = ( - 3D5B3285CC002B474B68160E /* Pods_Runner.framework */, - 9BC72FCA0EA409398BE36D32 /* Pods_RunnerTests.framework */, ); name = Frameworks; sourceTree = ""; @@ -215,7 +186,6 @@ isa = PBXNativeTarget; buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; buildPhases = ( - 8A267290E2BCC08AD16F52BE /* [CP] Check Pods Manifest.lock */, 331C80D1294CF70F00263BE5 /* Sources */, 331C80D2294CF70F00263BE5 /* Frameworks */, 331C80D3294CF70F00263BE5 /* Resources */, @@ -234,13 +204,11 @@ isa = PBXNativeTarget; buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - D8C1514D662336E868B91BC4 /* [CP] Check Pods Manifest.lock */, 33CC10E92044A3C60003C045 /* Sources */, 33CC10EA2044A3C60003C045 /* Frameworks */, 33CC10EB2044A3C60003C045 /* Resources */, 33CC110E2044A8840003C045 /* Bundle Framework */, 3399D490228B24CF009A79C7 /* ShellScript */, - F9FC7745EC629FF04811CC5D /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -249,7 +217,7 @@ ); name = Runner; productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* gemini_tasks.app */; + productReference = 33CC10ED2044A3C60003C045 /* cupertino_gallery.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -361,67 +329,6 @@ shellPath = /bin/sh; shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; }; - 8A267290E2BCC08AD16F52BE /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - D8C1514D662336E868B91BC4 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - F9FC7745EC629FF04811CC5D /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -473,46 +380,43 @@ /* Begin XCBuildConfiguration section */ 331C80DB294CF71000263BE5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0963E172D33D9015B461746A /* Pods-RunnerTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/gemini_tasks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/gemini_tasks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/cupertino_gallery.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/cupertino_gallery"; }; name = Debug; }; 331C80DC294CF71000263BE5 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 4A1CF1EC01D6AD68142F5DDF /* Pods-RunnerTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/gemini_tasks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/gemini_tasks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/cupertino_gallery.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/cupertino_gallery"; }; name = Release; }; 331C80DD294CF71000263BE5 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 917B1F16FE32F9DFF230E9C4 /* Pods-RunnerTests.profile.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CURRENT_PROJECT_VERSION = 1; GENERATE_INFOPLIST_FILE = YES; MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks.RunnerTests; + PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/gemini_tasks.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/gemini_tasks"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/cupertino_gallery.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/cupertino_gallery"; }; name = Profile; }; @@ -557,7 +461,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; @@ -639,7 +543,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; @@ -689,7 +593,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.14; + MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; SWIFT_COMPILATION_MODE = wholemodule; diff --git a/gemini_tasks/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cupertino_gallery/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from gemini_tasks/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to cupertino_gallery/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/gemini_tasks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/cupertino_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 93% rename from gemini_tasks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to cupertino_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 259e9c4cd..6cebf581b 100644 --- a/gemini_tasks/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/cupertino_gallery/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -15,7 +15,7 @@ @@ -31,7 +31,7 @@ @@ -59,13 +59,14 @@ ignoresPersistentStateOnLaunch = "NO" debugDocumentVersioning = "YES" debugServiceExtension = "internal" + enableGPUValidationMode = "1" allowLocationSimulation = "YES"> @@ -82,7 +83,7 @@ diff --git a/gemini_tasks/macos/Runner.xcworkspace/contents.xcworkspacedata b/cupertino_gallery/macos/Runner.xcworkspace/contents.xcworkspacedata similarity index 67% rename from gemini_tasks/macos/Runner.xcworkspace/contents.xcworkspacedata rename to cupertino_gallery/macos/Runner.xcworkspace/contents.xcworkspacedata index 21a3cc14c..1d526a16e 100644 --- a/gemini_tasks/macos/Runner.xcworkspace/contents.xcworkspacedata +++ b/cupertino_gallery/macos/Runner.xcworkspace/contents.xcworkspacedata @@ -4,7 +4,4 @@ - - diff --git a/gemini_tasks/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/cupertino_gallery/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from gemini_tasks/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to cupertino_gallery/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/gemini_tasks/macos/Runner/AppDelegate.swift b/cupertino_gallery/macos/Runner/AppDelegate.swift similarity index 62% rename from gemini_tasks/macos/Runner/AppDelegate.swift rename to cupertino_gallery/macos/Runner/AppDelegate.swift index d53ef6437..b3c176141 100644 --- a/gemini_tasks/macos/Runner/AppDelegate.swift +++ b/cupertino_gallery/macos/Runner/AppDelegate.swift @@ -1,9 +1,13 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } + + override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { + return true + } } diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png diff --git a/gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png similarity index 100% rename from gemini_tasks/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png rename to cupertino_gallery/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png diff --git a/gemini_tasks/macos/Runner/Base.lproj/MainMenu.xib b/cupertino_gallery/macos/Runner/Base.lproj/MainMenu.xib similarity index 100% rename from gemini_tasks/macos/Runner/Base.lproj/MainMenu.xib rename to cupertino_gallery/macos/Runner/Base.lproj/MainMenu.xib diff --git a/gemini_tasks/macos/Runner/Configs/AppInfo.xcconfig b/cupertino_gallery/macos/Runner/Configs/AppInfo.xcconfig similarity index 75% rename from gemini_tasks/macos/Runner/Configs/AppInfo.xcconfig rename to cupertino_gallery/macos/Runner/Configs/AppInfo.xcconfig index cbbcf532e..4aaf31cde 100644 --- a/gemini_tasks/macos/Runner/Configs/AppInfo.xcconfig +++ b/cupertino_gallery/macos/Runner/Configs/AppInfo.xcconfig @@ -5,10 +5,10 @@ // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = gemini_tasks +PRODUCT_NAME = cupertino_gallery // The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.geminiTasks +PRODUCT_BUNDLE_IDENTIFIER = com.example.cupertinoGallery // The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved. +PRODUCT_COPYRIGHT = Copyright © 2025 com.example. All rights reserved. diff --git a/gemini_tasks/macos/Runner/Configs/Debug.xcconfig b/cupertino_gallery/macos/Runner/Configs/Debug.xcconfig similarity index 100% rename from gemini_tasks/macos/Runner/Configs/Debug.xcconfig rename to cupertino_gallery/macos/Runner/Configs/Debug.xcconfig diff --git a/gemini_tasks/macos/Runner/Configs/Release.xcconfig b/cupertino_gallery/macos/Runner/Configs/Release.xcconfig similarity index 100% rename from gemini_tasks/macos/Runner/Configs/Release.xcconfig rename to cupertino_gallery/macos/Runner/Configs/Release.xcconfig diff --git a/gemini_tasks/macos/Runner/Configs/Warnings.xcconfig b/cupertino_gallery/macos/Runner/Configs/Warnings.xcconfig similarity index 100% rename from gemini_tasks/macos/Runner/Configs/Warnings.xcconfig rename to cupertino_gallery/macos/Runner/Configs/Warnings.xcconfig diff --git a/gemini_tasks/macos/Runner/DebugProfile.entitlements b/cupertino_gallery/macos/Runner/DebugProfile.entitlements similarity index 86% rename from gemini_tasks/macos/Runner/DebugProfile.entitlements rename to cupertino_gallery/macos/Runner/DebugProfile.entitlements index 08c3ab17c..dddb8a30c 100644 --- a/gemini_tasks/macos/Runner/DebugProfile.entitlements +++ b/cupertino_gallery/macos/Runner/DebugProfile.entitlements @@ -8,7 +8,5 @@ com.apple.security.network.server - com.apple.security.network.client - diff --git a/gemini_tasks/macos/Runner/Info.plist b/cupertino_gallery/macos/Runner/Info.plist similarity index 100% rename from gemini_tasks/macos/Runner/Info.plist rename to cupertino_gallery/macos/Runner/Info.plist diff --git a/gemini_tasks/macos/Runner/MainFlutterWindow.swift b/cupertino_gallery/macos/Runner/MainFlutterWindow.swift similarity index 100% rename from gemini_tasks/macos/Runner/MainFlutterWindow.swift rename to cupertino_gallery/macos/Runner/MainFlutterWindow.swift diff --git a/gemini_tasks/macos/Runner/Release.entitlements b/cupertino_gallery/macos/Runner/Release.entitlements similarity index 100% rename from gemini_tasks/macos/Runner/Release.entitlements rename to cupertino_gallery/macos/Runner/Release.entitlements diff --git a/gemini_tasks/macos/RunnerTests/RunnerTests.swift b/cupertino_gallery/macos/RunnerTests/RunnerTests.swift similarity index 100% rename from gemini_tasks/macos/RunnerTests/RunnerTests.swift rename to cupertino_gallery/macos/RunnerTests/RunnerTests.swift index 5418c9f53..61f3bd1fc 100644 --- a/gemini_tasks/macos/RunnerTests/RunnerTests.swift +++ b/cupertino_gallery/macos/RunnerTests/RunnerTests.swift @@ -1,5 +1,5 @@ -import FlutterMacOS import Cocoa +import FlutterMacOS import XCTest class RunnerTests: XCTestCase { diff --git a/cupertino_gallery/pubspec.yaml b/cupertino_gallery/pubspec.yaml new file mode 100644 index 000000000..6aac360fd --- /dev/null +++ b/cupertino_gallery/pubspec.yaml @@ -0,0 +1,21 @@ +name: cupertino_gallery +description: A Flutter project showcasing supported Cupertino components. +publish_to: "none" +version: 1.0.0+1 + +environment: + sdk: ^3.9.0-0 + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.8 + +dev_dependencies: + analysis_defaults: + path: ../analysis_defaults + flutter_test: + sdk: flutter + +flutter: + uses-material-design: true \ No newline at end of file diff --git a/cupertino_gallery/test/widget_test.dart b/cupertino_gallery/test/widget_test.dart new file mode 100644 index 000000000..2a2b81928 --- /dev/null +++ b/cupertino_gallery/test/widget_test.dart @@ -0,0 +1,8 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility in the flutter_test package. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +void main() {} diff --git a/gemini_tasks/web/favicon.png b/cupertino_gallery/web/favicon.png similarity index 100% rename from gemini_tasks/web/favicon.png rename to cupertino_gallery/web/favicon.png diff --git a/gemini_tasks/web/icons/Icon-192.png b/cupertino_gallery/web/icons/Icon-192.png similarity index 100% rename from gemini_tasks/web/icons/Icon-192.png rename to cupertino_gallery/web/icons/Icon-192.png diff --git a/gemini_tasks/web/icons/Icon-512.png b/cupertino_gallery/web/icons/Icon-512.png similarity index 100% rename from gemini_tasks/web/icons/Icon-512.png rename to cupertino_gallery/web/icons/Icon-512.png diff --git a/gemini_tasks/web/icons/Icon-maskable-192.png b/cupertino_gallery/web/icons/Icon-maskable-192.png similarity index 100% rename from gemini_tasks/web/icons/Icon-maskable-192.png rename to cupertino_gallery/web/icons/Icon-maskable-192.png diff --git a/gemini_tasks/web/icons/Icon-maskable-512.png b/cupertino_gallery/web/icons/Icon-maskable-512.png similarity index 100% rename from gemini_tasks/web/icons/Icon-maskable-512.png rename to cupertino_gallery/web/icons/Icon-maskable-512.png diff --git a/gemini_tasks/web/index.html b/cupertino_gallery/web/index.html similarity index 87% rename from gemini_tasks/web/index.html rename to cupertino_gallery/web/index.html index bc86c2a2a..927e42791 100644 --- a/gemini_tasks/web/index.html +++ b/cupertino_gallery/web/index.html @@ -21,15 +21,15 @@ - + - + - gemini_tasks + cupertino_gallery diff --git a/gemini_tasks/web/manifest.json b/cupertino_gallery/web/manifest.json similarity index 92% rename from gemini_tasks/web/manifest.json rename to cupertino_gallery/web/manifest.json index 31d30dc5e..363529b98 100644 --- a/gemini_tasks/web/manifest.json +++ b/cupertino_gallery/web/manifest.json @@ -1,6 +1,6 @@ { - "name": "gemini_tasks", - "short_name": "gemini_tasks", + "name": "cupertino_gallery", + "short_name": "cupertino_gallery", "start_url": ".", "display": "standalone", "background_color": "#0175C2", diff --git a/gemini_tasks/windows/.gitignore b/cupertino_gallery/windows/.gitignore similarity index 100% rename from gemini_tasks/windows/.gitignore rename to cupertino_gallery/windows/.gitignore diff --git a/gemini_tasks/windows/CMakeLists.txt b/cupertino_gallery/windows/CMakeLists.txt similarity index 98% rename from gemini_tasks/windows/CMakeLists.txt rename to cupertino_gallery/windows/CMakeLists.txt index 1f6ab2448..dbab392a9 100644 --- a/gemini_tasks/windows/CMakeLists.txt +++ b/cupertino_gallery/windows/CMakeLists.txt @@ -1,10 +1,10 @@ # Project-level configuration. cmake_minimum_required(VERSION 3.14) -project(gemini_tasks LANGUAGES CXX) +project(cupertino_gallery LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. -set(BINARY_NAME "gemini_tasks") +set(BINARY_NAME "cupertino_gallery") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. diff --git a/gemini_tasks/windows/flutter/CMakeLists.txt b/cupertino_gallery/windows/flutter/CMakeLists.txt similarity index 100% rename from gemini_tasks/windows/flutter/CMakeLists.txt rename to cupertino_gallery/windows/flutter/CMakeLists.txt diff --git a/gemini_tasks/windows/flutter/generated_plugin_registrant.cc b/cupertino_gallery/windows/flutter/generated_plugin_registrant.cc similarity index 50% rename from gemini_tasks/windows/flutter/generated_plugin_registrant.cc rename to cupertino_gallery/windows/flutter/generated_plugin_registrant.cc index 4f7884874..8b6d4680a 100644 --- a/gemini_tasks/windows/flutter/generated_plugin_registrant.cc +++ b/cupertino_gallery/windows/flutter/generated_plugin_registrant.cc @@ -6,9 +6,6 @@ #include "generated_plugin_registrant.h" -#include void RegisterPlugins(flutter::PluginRegistry* registry) { - UrlLauncherWindowsRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherWindows")); } diff --git a/gemini_tasks/windows/flutter/generated_plugin_registrant.h b/cupertino_gallery/windows/flutter/generated_plugin_registrant.h similarity index 100% rename from gemini_tasks/windows/flutter/generated_plugin_registrant.h rename to cupertino_gallery/windows/flutter/generated_plugin_registrant.h diff --git a/gemini_tasks/windows/flutter/generated_plugins.cmake b/cupertino_gallery/windows/flutter/generated_plugins.cmake similarity index 96% rename from gemini_tasks/windows/flutter/generated_plugins.cmake rename to cupertino_gallery/windows/flutter/generated_plugins.cmake index 88b22e5c7..b93c4c30c 100644 --- a/gemini_tasks/windows/flutter/generated_plugins.cmake +++ b/cupertino_gallery/windows/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - url_launcher_windows ) list(APPEND FLUTTER_FFI_PLUGIN_LIST diff --git a/gemini_tasks/windows/runner/CMakeLists.txt b/cupertino_gallery/windows/runner/CMakeLists.txt similarity index 100% rename from gemini_tasks/windows/runner/CMakeLists.txt rename to cupertino_gallery/windows/runner/CMakeLists.txt diff --git a/gemini_tasks/windows/runner/Runner.rc b/cupertino_gallery/windows/runner/Runner.rc similarity index 89% rename from gemini_tasks/windows/runner/Runner.rc rename to cupertino_gallery/windows/runner/Runner.rc index bfa89d666..755bfcf15 100644 --- a/gemini_tasks/windows/runner/Runner.rc +++ b/cupertino_gallery/windows/runner/Runner.rc @@ -90,12 +90,12 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "gemini_tasks" "\0" + VALUE "FileDescription", "cupertino_gallery" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "gemini_tasks" "\0" - VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "gemini_tasks.exe" "\0" - VALUE "ProductName", "gemini_tasks" "\0" + VALUE "InternalName", "cupertino_gallery" "\0" + VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0" + VALUE "OriginalFilename", "cupertino_gallery.exe" "\0" + VALUE "ProductName", "cupertino_gallery" "\0" VALUE "ProductVersion", VERSION_AS_STRING "\0" END END diff --git a/gemini_tasks/windows/runner/flutter_window.cpp b/cupertino_gallery/windows/runner/flutter_window.cpp similarity index 100% rename from gemini_tasks/windows/runner/flutter_window.cpp rename to cupertino_gallery/windows/runner/flutter_window.cpp diff --git a/gemini_tasks/windows/runner/flutter_window.h b/cupertino_gallery/windows/runner/flutter_window.h similarity index 100% rename from gemini_tasks/windows/runner/flutter_window.h rename to cupertino_gallery/windows/runner/flutter_window.h diff --git a/gemini_tasks/windows/runner/main.cpp b/cupertino_gallery/windows/runner/main.cpp similarity index 95% rename from gemini_tasks/windows/runner/main.cpp rename to cupertino_gallery/windows/runner/main.cpp index 88476d2d0..d2938f557 100644 --- a/gemini_tasks/windows/runner/main.cpp +++ b/cupertino_gallery/windows/runner/main.cpp @@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); Win32Window::Size size(1280, 720); - if (!window.Create(L"gemini_tasks", origin, size)) { + if (!window.Create(L"cupertino_gallery", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true); diff --git a/gemini_tasks/windows/runner/resource.h b/cupertino_gallery/windows/runner/resource.h similarity index 100% rename from gemini_tasks/windows/runner/resource.h rename to cupertino_gallery/windows/runner/resource.h diff --git a/gemini_tasks/windows/runner/resources/app_icon.ico b/cupertino_gallery/windows/runner/resources/app_icon.ico similarity index 100% rename from gemini_tasks/windows/runner/resources/app_icon.ico rename to cupertino_gallery/windows/runner/resources/app_icon.ico diff --git a/gemini_tasks/windows/runner/runner.exe.manifest b/cupertino_gallery/windows/runner/runner.exe.manifest similarity index 68% rename from gemini_tasks/windows/runner/runner.exe.manifest rename to cupertino_gallery/windows/runner/runner.exe.manifest index a42ea7687..153653e8d 100644 --- a/gemini_tasks/windows/runner/runner.exe.manifest +++ b/cupertino_gallery/windows/runner/runner.exe.manifest @@ -9,12 +9,6 @@ - - - - - - diff --git a/gemini_tasks/windows/runner/utils.cpp b/cupertino_gallery/windows/runner/utils.cpp similarity index 93% rename from gemini_tasks/windows/runner/utils.cpp rename to cupertino_gallery/windows/runner/utils.cpp index b2b08734d..3a0b46511 100644 --- a/gemini_tasks/windows/runner/utils.cpp +++ b/cupertino_gallery/windows/runner/utils.cpp @@ -45,13 +45,13 @@ std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } - int target_length = ::WideCharToMultiByte( + unsigned int target_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, -1, nullptr, 0, nullptr, nullptr) -1; // remove the trailing null character int input_length = (int)wcslen(utf16_string); std::string utf8_string; - if (target_length <= 0 || target_length > utf8_string.max_size()) { + if (target_length == 0 || target_length > utf8_string.max_size()) { return utf8_string; } utf8_string.resize(target_length); diff --git a/gemini_tasks/windows/runner/utils.h b/cupertino_gallery/windows/runner/utils.h similarity index 100% rename from gemini_tasks/windows/runner/utils.h rename to cupertino_gallery/windows/runner/utils.h diff --git a/gemini_tasks/windows/runner/win32_window.cpp b/cupertino_gallery/windows/runner/win32_window.cpp similarity index 100% rename from gemini_tasks/windows/runner/win32_window.cpp rename to cupertino_gallery/windows/runner/win32_window.cpp diff --git a/gemini_tasks/windows/runner/win32_window.h b/cupertino_gallery/windows/runner/win32_window.h similarity index 100% rename from gemini_tasks/windows/runner/win32_window.h rename to cupertino_gallery/windows/runner/win32_window.h diff --git a/gemini_tasks/.idx/dev.nix b/gemini_tasks/.idx/dev.nix deleted file mode 100644 index 0354484f0..000000000 --- a/gemini_tasks/.idx/dev.nix +++ /dev/null @@ -1,62 +0,0 @@ -# To learn more about how to use Nix to configure your environment -# see: https://developers.google.com/idx/guides/customize-idx-env -{ pkgs, ... }: { - # Which nixpkgs channel to use. - channel = "stable-23.11"; # or "unstable" - # Use https://search.nixos.org/packages to find packages - packages = [ - pkgs.nodePackages.firebase-tools - pkgs.jdk17 - pkgs.unzip - ]; - # Sets environment variables in the workspace - env = {}; - idx = { - # Search for the extensions you want on https://open-vsx.org/ and use "publisher.id" - extensions = [ - "Dart-Code.flutter" - "Dart-Code.dart-code" - ]; - workspace = { - # Runs when a workspace is first created with this `dev.nix` file - onCreate = { - build-flutter = '' - cd /home/user/myapp/android - ./gradlew \ - --parallel \ - -Pverbose=true \ - -Ptarget-platform=android-x86 \ - -Ptarget=/home/user/myapp/lib/main.dart \ - -Pbase-application-name=android.app.Application \ - -Pdart-defines=RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC85NzU1MDkwN2I3MGY0ZjNiMzI4YjZjMTYwMGRmMjFmYWMxYTE4ODlhLw== \ - -Pdart-obfuscation=false \ - -Ptrack-widget-creation=true \ - -Ptree-shake-icons=false \ - -Pfilesystem-scheme=org-dartlang-root \ - assembleDebug - # TODO: Execute web build in debug mode. - # flutter run does this transparently either way - # https://github.com/flutter/flutter/issues/96283#issuecomment-1144750411 - # flutter build web --profile --dart-define=Dart2jsOptimization=O0 - adb -s localhost:5555 wait-for-device - ''; - }; - - # To run something each time the workspace is (re)started, use the `onStart` hook - }; - # Enable previews and customize configuration - previews = { - enable = true; - previews = { - web = { - command = ["flutter" "run" "--machine" "-d" "web-server" "--web-hostname" "0.0.0.0" "--web-port" "$PORT"]; - manager = "flutter"; - }; - android = { - command = ["flutter" "run" "--machine" "-d" "android" "-d" "localhost:5555"]; - manager = "flutter"; - }; - }; - }; - }; -} \ No newline at end of file diff --git a/gemini_tasks/.metadata b/gemini_tasks/.metadata deleted file mode 100644 index 8629a4e18..000000000 --- a/gemini_tasks/.metadata +++ /dev/null @@ -1,45 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "abb292a07e20d696c4568099f918f6c5f330e6b0" - channel: "stable" - -project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - platform: android - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - platform: ios - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - platform: linux - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - platform: macos - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - platform: web - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - platform: windows - create_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - base_revision: abb292a07e20d696c4568099f918f6c5f330e6b0 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/gemini_tasks/CONTRIBUTING.md b/gemini_tasks/CONTRIBUTING.md deleted file mode 100644 index 8956a61b8..000000000 --- a/gemini_tasks/CONTRIBUTING.md +++ /dev/null @@ -1,32 +0,0 @@ -# How to Contribute - -We would love to accept your patches and contributions to this project. - -## Before you begin - -### Sign our Contributor License Agreement - -Contributions to this project must be accompanied by a -[Contributor License Agreement](https://cla.developers.google.com/about) (CLA). -You (or your employer) retain the copyright to your contribution; this simply -gives us permission to use and redistribute your contributions as part of the -project. - -If you or your current employer have already signed the Google CLA (even if it -was for a different project), you probably don't need to do it again. - -Visit to see your current agreements or to -sign a new one. - -### Review our Community Guidelines - -This project follows [Google's Open Source Community -Guidelines](https://opensource.google/conduct/). - -## Contribution process - -### Code Reviews - -All submissions, including submissions by project members, require review. We -use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) -for this purpose. diff --git a/gemini_tasks/LICENSE b/gemini_tasks/LICENSE deleted file mode 100644 index 7a4a3ea24..000000000 --- a/gemini_tasks/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file diff --git a/gemini_tasks/README.md b/gemini_tasks/README.md deleted file mode 100644 index 721710432..000000000 --- a/gemini_tasks/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Flutter Todo List Sample - -Developer sample written in Flutter demonstrating how to interact with a to-do -list in natural language using the Gemini API. - -## Goals - -* Show how to use the Gemini API for a chat session. -* Demonstrate how to use functions calls with the Gemini API. -* Show how to manage the state of a list using Gemini. - -## Questions/issues - -If you have a general question about any of the techniques you see in -the sample, Flutter's open source community is a great place to find answers. -You can find links to online and local groups at -[https://flutter.dev/community]! - -If you run into an issue with the sample itself, please file an issue -in the [main Flutter repo](https://github.com/flutter/samples/issues). diff --git a/gemini_tasks/android/app/build.gradle b/gemini_tasks/android/app/build.gradle deleted file mode 100644 index 938b43206..000000000 --- a/gemini_tasks/android/app/build.gradle +++ /dev/null @@ -1,67 +0,0 @@ -plugins { - id "com.android.application" - id "kotlin-android" - id "dev.flutter.flutter-gradle-plugin" -} - -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -android { - namespace "com.example.gemini_tasks" - compileSdk flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.gemini_tasks" - // You can update the following values to match your application needs. - // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies {} diff --git a/gemini_tasks/android/app/src/main/kotlin/com/example/gemini_tasks/MainActivity.kt b/gemini_tasks/android/app/src/main/kotlin/com/example/gemini_tasks/MainActivity.kt deleted file mode 100644 index c2fb91d16..000000000 --- a/gemini_tasks/android/app/src/main/kotlin/com/example/gemini_tasks/MainActivity.kt +++ /dev/null @@ -1,5 +0,0 @@ -package com.example.gemini_tasks - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() diff --git a/gemini_tasks/android/build.gradle b/gemini_tasks/android/build.gradle deleted file mode 100644 index bc157bd1a..000000000 --- a/gemini_tasks/android/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/gemini_tasks/android/gradle.properties b/gemini_tasks/android/gradle.properties deleted file mode 100644 index 598d13fee..000000000 --- a/gemini_tasks/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx4G -android.useAndroidX=true -android.enableJetifier=true diff --git a/gemini_tasks/android/settings.gradle b/gemini_tasks/android/settings.gradle deleted file mode 100644 index 1d6d19b7f..000000000 --- a/gemini_tasks/android/settings.gradle +++ /dev/null @@ -1,26 +0,0 @@ -pluginManagement { - def flutterSdkPath = { - def properties = new Properties() - file("local.properties").withInputStream { properties.load(it) } - def flutterSdkPath = properties.getProperty("flutter.sdk") - assert flutterSdkPath != null, "flutter.sdk not set in local.properties" - return flutterSdkPath - } - settings.ext.flutterSdkPath = flutterSdkPath() - - includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false -} - -include ":app" diff --git a/gemini_tasks/idx-template.json b/gemini_tasks/idx-template.json deleted file mode 100644 index 9db171f54..000000000 --- a/gemini_tasks/idx-template.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "Todo list with Flutter and Gemini", - "description": "A template for a todo list app that integrates with the Gemini API", - "icon": "https://www.gstatic.com/images/branding/productlogos/idx/v1/192px.svg", - "params": [], - "host": { - "virtualization": true - } -} \ No newline at end of file diff --git a/gemini_tasks/idx-template.nix b/gemini_tasks/idx-template.nix deleted file mode 100644 index 5ef65ad7a..000000000 --- a/gemini_tasks/idx-template.nix +++ /dev/null @@ -1,15 +0,0 @@ -# No user-configurable parameters -{ pkgs, ... }: { - packages = [ - pkgs.flutter - ]; - # Shell script that produces the final environment - bootstrap = '' - export HOME=/home/user - export PATH="$PATH":"$HOME/flutter/bin" - - cp -rf ${./.} "$out" - chmod -R +w "$out" - rm -rf "$out/.git" "$out/idx-template".{nix,json} - ''; -} \ No newline at end of file diff --git a/gemini_tasks/ios/Flutter/Debug.xcconfig b/gemini_tasks/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6f3..000000000 --- a/gemini_tasks/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/gemini_tasks/ios/Flutter/Release.xcconfig b/gemini_tasks/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bfe2..000000000 --- a/gemini_tasks/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/gemini_tasks/ios/Podfile b/gemini_tasks/ios/Podfile deleted file mode 100644 index d97f17e22..000000000 --- a/gemini_tasks/ios/Podfile +++ /dev/null @@ -1,44 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/gemini_tasks/lib/main.dart b/gemini_tasks/lib/main.dart deleted file mode 100644 index bde51881d..000000000 --- a/gemini_tasks/lib/main.dart +++ /dev/null @@ -1,394 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:google_generative_ai/google_generative_ai.dart'; - -import 'widgets/api_key_widget.dart'; -import 'widgets/message_widget.dart'; -import 'widgets/text_field_decoration.dart'; - -typedef Task = (int id, {String name, String? description, bool completed}); - -extension on Task { - Map toJson() { - return { - 'id': $1, - 'name': name, - 'description': description, - 'completed': completed, - }; - } -} - -final themeColor = ValueNotifier(Colors.orangeAccent); -final tasks = ValueNotifier([]); -int lastId = 0; - -void main() { - runApp(const GenerativeAISample(title: "Gemini Tasks")); -} - -class GenerativeAISample extends StatefulWidget { - const GenerativeAISample({super.key, required this.title}); - final String title; - - @override - State createState() => _GenerativeAISampleState(); -} - -class _GenerativeAISampleState extends State { - String? apiKey; - - ThemeData theme(Brightness brightness) { - final colors = ColorScheme.fromSeed( - brightness: brightness, - seedColor: themeColor.value, - ); - return ThemeData( - brightness: brightness, - colorScheme: colors, - scaffoldBackgroundColor: colors.surface, - ); - } - - @override - Widget build(BuildContext context) { - return AnimatedBuilder( - animation: themeColor, - builder: (context, child) { - return MaterialApp( - debugShowCheckedModeBanner: false, - title: widget.title, - theme: theme(Brightness.light), - darkTheme: theme(Brightness.dark), - themeMode: ThemeMode.system, - home: switch (apiKey) { - final providedKey? => Example( - title: widget.title, - apiKey: providedKey, - ), - _ => ApiKeyWidget( - title: widget.title, - onSubmitted: (key) { - setState(() => apiKey = key); - }, - ), - }, - ); - }, - ); - } -} - -class Example extends StatefulWidget { - const Example({super.key, required this.apiKey, required this.title}); - - final String apiKey, title; - - @override - State createState() => _ExampleState(); -} - -class _ExampleState extends State { - final loading = ValueNotifier(false); - final menu = ValueNotifier(''); - final messages = ValueNotifier>([]); - final controller = TextEditingController(); - late final _history = []; - - late final model = GenerativeModel( - model: 'gemini-pro', - apiKey: widget.apiKey, - requestOptions: const RequestOptions(apiVersion: 'v1beta'), - tools: [ - Tool( - functionDeclarations: [ - FunctionDeclaration( - 'add_task', - 'Add a new task to the list', - Schema( - SchemaType.object, - properties: { - 'name': Schema(SchemaType.string), - 'description': Schema(SchemaType.string, nullable: true), - }, - ), - ), - FunctionDeclaration( - 'get_completed_tasks', - 'Return all the completed tasks in the list', - Schema( - SchemaType.object, - properties: { - 'name': Schema( - SchemaType.string, - nullable: true, - description: 'Search filter for name', - ), - 'description': Schema( - SchemaType.string, - nullable: true, - description: 'Search filter for description', - ), - }, - ), - ), - FunctionDeclaration( - 'get_active_tasks', - 'Return all the active tasks in the list', - Schema( - SchemaType.object, - properties: { - 'name': Schema( - SchemaType.string, - nullable: true, - description: 'Search filter for name', - ), - 'description': Schema( - SchemaType.string, - nullable: true, - description: 'Search filter for description', - ), - }, - ), - ), - FunctionDeclaration( - 'update_task', - 'Update a task in the list', - Schema( - SchemaType.object, - properties: { - 'name': Schema(SchemaType.string, description: 'Task name'), - 'description': Schema( - SchemaType.string, - nullable: true, - description: 'Task description', - ), - 'completed': Schema( - SchemaType.boolean, - nullable: true, - description: 'Task status', - ), - }, - ), - ), - ], - ), - ], - ); - - Future sendMessage() async { - final message = controller.text.trim(); - if (message.isEmpty) return; - controller.clear(); - addMessage(Sender.user, message); - loading.value = true; - try { - final prompt = StringBuffer(); - prompt.writeln( - 'If the following is not a question assume' - 'it is a new task to be added:', - ); - prompt.writeln(message); - final response = await callWithActions([Content.text(prompt.toString())]); - if (response.text != null) { - addMessage(Sender.system, response.text!); - } else { - addMessage(Sender.system, 'Something went wrong, please try again.'); - } - } catch (e) { - addMessage(Sender.system, 'Error sending message: $e'); - } finally { - loading.value = false; - } - } - - Future callWithActions( - Iterable prompt, - ) async { - final response = await model.generateContent(_history.followedBy(prompt)); - if (response.candidates.isNotEmpty) { - _history.addAll(prompt); - _history.add(response.candidates.first.content); - } - final actions = []; - for (final fn in response.functionCalls) { - final current = tasks.value.toList(); - final args = fn.args; - switch (fn.name) { - case 'add_task': - final name = args['name'] as String; - final description = args['description'] as String?; - final Task task = ( - ++lastId, - name: name, - description: description, - completed: false, - ); - current.add(task); - tasks.value = current; - actions.add(FunctionResponse(fn.name, task.toJson())); - break; - case 'get_completed_tasks': - var filter = current - .toList() - .where((e) => e.completed == true) - .toList(); - final name = args['name'] as String?; - final description = args['description'] as String?; - if (name != null) { - filter = filter.where((e) => e.name.contains(name)).toList(); - } - if (description != null) { - filter = filter - .where((e) => e.description?.contains(description) ?? false) - .toList(); - } - actions.add( - FunctionResponse(fn.name, { - 'tasks': filter.map((e) => e.toJson()).toList(), - }), - ); - break; - case 'get_active_tasks': - var filter = current - .toList() - .where((e) => e.completed == false) - .toList(); - final name = args['name'] as String?; - final description = args['description'] as String?; - if (name != null) { - filter = filter.where((e) => e.name.contains(name)).toList(); - } - if (description != null) { - filter = filter - .where((e) => e.description?.contains(description) ?? false) - .toList(); - } - actions.add( - FunctionResponse(fn.name, { - 'tasks': filter.map((e) => e.toJson()).toList(), - }), - ); - break; - case 'update_task': - final name = args['name'] as String?; - final idx = current.indexWhere((e) => e.name == name); - if (idx == -1) { - actions.add( - FunctionResponse(fn.name, { - "type": "error", - 'message': 'Task with "$name" id not found', - }), - ); - continue; - } - final task = current[idx]; - current[idx] = ( - task.$1, - name: args['name'] as String? ?? task.name, - description: args['description'] as String? ?? task.description, - completed: args['completed'] as bool? ?? task.completed, - ); - tasks.value = current; - actions.add(FunctionResponse(fn.name, current[idx].toJson())); - break; - default: - } - } - if (actions.isNotEmpty) { - return await callWithActions([ - ...prompt, - if (response.functionCalls.isNotEmpty) - Content.model(response.functionCalls), - for (final res in actions) - Content.functionResponse(res.name, res.response), - ]); - } - return response; - } - - void addMessage(Sender sender, String value, {bool clear = false}) { - if (clear) { - _history.clear(); - messages.value = []; - } - messages.value = messages.value.toList()..add((sender, value)); - } - - @override - Widget build(BuildContext context) { - return AnimatedBuilder( - animation: messages, - builder: (context, child) { - final reversed = messages.value.reversed; - return Scaffold( - appBar: AppBar(title: Text(widget.title)), - body: messages.value.isEmpty - ? const Center(child: Text('No tasks found')) - : ListView.builder( - padding: const EdgeInsets.all(8), - reverse: true, - itemCount: reversed.length, - itemBuilder: (context, index) { - final (sender, message) = reversed.elementAt(index); - return MessageWidget( - isFromUser: sender == Sender.user, - text: message, - ); - }, - ), - bottomNavigationBar: BottomAppBar( - padding: const EdgeInsets.all(8), - child: Row( - children: [ - Expanded( - child: TextField( - controller: controller, - decoration: textFieldDecoration( - context, - 'Try "Add a task for..."' - 'or "What are my uncompleted tasks?"', - ), - onEditingComplete: sendMessage, - onSubmitted: (value) => sendMessage(), - ), - ), - const SizedBox(width: 8), - AnimatedBuilder( - animation: loading, - builder: (context, _) { - if (loading.value) { - return const CircularProgressIndicator(); - } - return IconButton( - onPressed: sendMessage, - icon: const Icon(Icons.send), - tooltip: 'Send a message', - ); - }, - ), - ], - ), - ), - ); - }, - ); - } -} - -enum Sender { user, system } diff --git a/gemini_tasks/lib/widgets/api_key_widget.dart b/gemini_tasks/lib/widgets/api_key_widget.dart deleted file mode 100644 index 341d07998..000000000 --- a/gemini_tasks/lib/widgets/api_key_widget.dart +++ /dev/null @@ -1,82 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import 'package:flutter/material.dart'; -import 'package:url_launcher/link.dart'; - -import 'text_field_decoration.dart'; - -class ApiKeyWidget extends StatelessWidget { - ApiKeyWidget({super.key, required this.onSubmitted, required this.title}); - - final String title; - final ValueChanged onSubmitted; - final _textController = TextEditingController(); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar(title: Text(title)), - body: Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - const Text( - 'To use the Gemini API, you\'ll need an API key. ' - 'If you don\'t already have one, ' - 'create a key in Google AI Studio.', - textAlign: TextAlign.center, - ), - const SizedBox(height: 8), - Link( - uri: Uri.https('aistudio.google.com', '/app/apikey'), - target: LinkTarget.blank, - builder: (context, followLink) => TextButton( - onPressed: followLink, - child: const Text('Get an API Key'), - ), - ), - ], - ), - ), - ), - bottomNavigationBar: BottomAppBar( - padding: const EdgeInsets.all(8), - child: Row( - children: [ - Expanded( - child: TextField( - decoration: textFieldDecoration(context, 'Enter your API key'), - controller: _textController, - obscureText: true, - onSubmitted: (value) { - onSubmitted(value); - }, - ), - ), - const SizedBox(height: 8), - TextButton( - onPressed: () { - onSubmitted(_textController.value.text); - }, - child: const Text('Submit'), - ), - ], - ), - ), - ); - } -} diff --git a/gemini_tasks/lib/widgets/message_widget.dart b/gemini_tasks/lib/widgets/message_widget.dart deleted file mode 100644 index 59603ca07..000000000 --- a/gemini_tasks/lib/widgets/message_widget.dart +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import 'package:flutter/material.dart'; -import 'package:flutter_markdown/flutter_markdown.dart'; - -class MessageWidget extends StatelessWidget { - const MessageWidget({ - super.key, - this.text, - this.image, - required this.isFromUser, - }); - - final Image? image; - final String? text; - final bool isFromUser; - - @override - Widget build(BuildContext context) { - return Row( - mainAxisAlignment: isFromUser - ? MainAxisAlignment.end - : MainAxisAlignment.start, - children: [ - Flexible( - child: Container( - constraints: const BoxConstraints(maxWidth: 520), - decoration: BoxDecoration( - color: isFromUser - ? Theme.of(context).colorScheme.primaryContainer - : Theme.of(context).colorScheme.surfaceContainerHighest, - borderRadius: BorderRadius.circular(18), - ), - padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 20), - margin: const EdgeInsets.only(bottom: 8), - child: Column( - children: [ - if (text case final text?) MarkdownBody(data: text), - ?image, - ], - ), - ), - ), - ], - ); - } -} diff --git a/gemini_tasks/lib/widgets/text_field_decoration.dart b/gemini_tasks/lib/widgets/text_field_decoration.dart deleted file mode 100644 index 04cfce2dd..000000000 --- a/gemini_tasks/lib/widgets/text_field_decoration.dart +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import 'package:flutter/material.dart'; - -InputDecoration textFieldDecoration(BuildContext context, String hintText) { - return InputDecoration( - contentPadding: const EdgeInsets.all(15), - hintText: hintText, - border: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(14)), - borderSide: BorderSide(color: Theme.of(context).colorScheme.secondary), - ), - focusedBorder: OutlineInputBorder( - borderRadius: const BorderRadius.all(Radius.circular(14)), - borderSide: BorderSide(color: Theme.of(context).colorScheme.secondary), - ), - ); -} diff --git a/gemini_tasks/linux/flutter/generated_plugin_registrant.cc b/gemini_tasks/linux/flutter/generated_plugin_registrant.cc deleted file mode 100644 index f6f23bfe9..000000000 --- a/gemini_tasks/linux/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include - -void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); - url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); -} diff --git a/gemini_tasks/macos/Flutter/Flutter-Debug.xcconfig b/gemini_tasks/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100644 index 4b81f9b2d..000000000 --- a/gemini_tasks/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/gemini_tasks/macos/Flutter/Flutter-Release.xcconfig b/gemini_tasks/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100644 index 5caa9d157..000000000 --- a/gemini_tasks/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/gemini_tasks/macos/Podfile b/gemini_tasks/macos/Podfile deleted file mode 100644 index c795730db..000000000 --- a/gemini_tasks/macos/Podfile +++ /dev/null @@ -1,43 +0,0 @@ -platform :osx, '10.14' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/gemini_tasks/pubspec.yaml b/gemini_tasks/pubspec.yaml deleted file mode 100644 index 933943179..000000000 --- a/gemini_tasks/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: gemini_tasks -description: "Sample app for the google_generative_ai package" -publish_to: 'none' -version: 1.0.0+1 -resolution: workspace -environment: - sdk: ^3.9.0-0 - -dependencies: - flutter: - sdk: flutter - flutter_markdown: ^0.7.3 - google_generative_ai: ^0.4.0 - url_launcher: ^6.2.6 - -dev_dependencies: - analysis_defaults: - path: ../analysis_defaults - flutter_test: - sdk: flutter - flutter_lints: ^6.0.0 - -flutter: - uses-material-design: true diff --git a/pubspec.yaml b/pubspec.yaml index ef0e64881..b0047f8e9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,7 +31,6 @@ workspace: - dynamic_theme - form_app - game_template - - gemini_tasks - google_maps - infinite_list - ios_app_clip diff --git a/tool/flutter_ci_script_beta.sh b/tool/flutter_ci_script_beta.sh index bc2900a37..af1e154dc 100755 --- a/tool/flutter_ci_script_beta.sh +++ b/tool/flutter_ci_script_beta.sh @@ -32,7 +32,6 @@ declare -ar PROJECT_NAMES=( "flutter_maps_firestore" "form_app" "game_template" - "gemini_tasks" "google_maps" "infinite_list" "ios_app_clip" diff --git a/tool/flutter_ci_script_master.sh b/tool/flutter_ci_script_master.sh index 6cf313167..77711edf7 100755 --- a/tool/flutter_ci_script_master.sh +++ b/tool/flutter_ci_script_master.sh @@ -35,7 +35,6 @@ declare -ar PROJECT_NAMES=( "flutter_maps_firestore" "form_app" "game_template" - "gemini_tasks" "google_maps" "infinite_list" "ios_app_clip" diff --git a/tool/flutter_ci_script_stable.sh b/tool/flutter_ci_script_stable.sh index 40dce5885..2d2604acf 100755 --- a/tool/flutter_ci_script_stable.sh +++ b/tool/flutter_ci_script_stable.sh @@ -32,7 +32,6 @@ declare -ar PROJECT_NAMES=( "flutter_maps_firestore" "form_app" "game_template" - "gemini_tasks" "google_maps" "infinite_list" "ios_app_clip" diff --git a/tool/flutter_clean_packages.sh b/tool/flutter_clean_packages.sh index 6823b428f..f6feecfd8 100644 --- a/tool/flutter_clean_packages.sh +++ b/tool/flutter_clean_packages.sh @@ -38,7 +38,6 @@ declare -ar PROJECT_NAMES=( "flutter_maps_firestore" "form_app" "game_template" - "gemini_tasks" "google_maps" "infinite_list" "ios_app_clip" diff --git a/web_embedding/ng-flutter/package.json b/web_embedding/ng-flutter/package.json index cca76129f..2317017d4 100644 --- a/web_embedding/ng-flutter/package.json +++ b/web_embedding/ng-flutter/package.json @@ -15,10 +15,10 @@ "@angular/cdk": "^21.1.2", "@angular/common": "^21.1.1", "@angular/compiler": "^21.1.0", - "@angular/core": "^20.0.3", + "@angular/core": "^21.2.0", "@angular/forms": "^21.1.0", "@angular/material": "^21.1.1", - "@angular/platform-browser": "^20.0.3", + "@angular/platform-browser": "^21.2.0", "@angular/platform-browser-dynamic": "^21.1.2", "@angular/router": "^21.1.0", "rxjs": "~7.8.1", @@ -28,7 +28,7 @@ "devDependencies": { "@angular-devkit/build-angular": "^21.1.2", "@angular/cli": "~21.1.1", - "@angular/compiler-cli": "^20.0.3", + "@angular/compiler-cli": "^21.2.0", "@types/jasmine": "~6.0.0", "jasmine-core": "~6.0.0", "karma": "~6.4.2",