text
stringlengths
6
13.6M
id
stringlengths
13
176
metadata
dict
__index_level_0__
int64
0
1.69k
// // Generated file. Do not edit. // import FlutterMacOS import Foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { }
codelabs/adaptive_app/step_03/macos/Flutter/GeneratedPluginRegistrant.swift/0
{ "file_path": "codelabs/adaptive_app/step_03/macos/Flutter/GeneratedPluginRegistrant.swift", "repo_id": "codelabs", "token_count": 46 }
0
<!DOCTYPE html> <html> <head> <!-- If you are serving your web app in a path other than the root, change the href value below to reflect the base path you are serving from. The path provided below has to start and end with a slash "/" in order for it to work correctly. For more details: * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base This is a placeholder for base href that will be replaced by the value of the `--base-href` argument provided to `flutter build`. --> <base href="$FLUTTER_BASE_HREF"> <meta charset="UTF-8"> <meta content="IE=Edge" http-equiv="X-UA-Compatible"> <meta name="description" content="A new Flutter project."> <!-- iOS meta tags & icons --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="adaptive_app"> <link rel="apple-touch-icon" href="icons/Icon-192.png"> <!-- Favicon --> <link rel="icon" type="image/png" href="favicon.png"/> <title>adaptive_app</title> <link rel="manifest" href="manifest.json"> <script> // The value below is injected by flutter build, do not touch. const serviceWorkerVersion = null; </script> <!-- This script adds the flutter initialization JS code --> <script src="flutter.js" defer></script> </head> <body> <script> window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); }); } }); }); </script> </body> </html>
codelabs/adaptive_app/step_03/web/index.html/0
{ "file_path": "codelabs/adaptive_app/step_03/web/index.html", "repo_id": "codelabs", "token_count": 668 }
1
#include "utils.h" #include <flutter_windows.h> #include <io.h> #include <stdio.h> #include <windows.h> #include <iostream> void CreateAndAttachConsole() { if (::AllocConsole()) { FILE *unused; if (freopen_s(&unused, "CONOUT$", "w", stdout)) { _dup2(_fileno(stdout), 1); } if (freopen_s(&unused, "CONOUT$", "w", stderr)) { _dup2(_fileno(stdout), 2); } std::ios::sync_with_stdio(); FlutterDesktopResyncOutputStreams(); } } std::vector<std::string> GetCommandLineArguments() { // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. int argc; wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); if (argv == nullptr) { return std::vector<std::string>(); } std::vector<std::string> command_line_arguments; // Skip the first argument as it's the binary name. for (int i = 1; i < argc; i++) { command_line_arguments.push_back(Utf8FromUtf16(argv[i])); } ::LocalFree(argv); return command_line_arguments; } std::string Utf8FromUtf16(const wchar_t* utf16_string) { if (utf16_string == nullptr) { return std::string(); } 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()) { return utf8_string; } utf8_string.resize(target_length); int converted_length = ::WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, input_length, utf8_string.data(), target_length, nullptr, nullptr); if (converted_length == 0) { return std::string(); } return utf8_string; }
codelabs/adaptive_app/step_03/windows/runner/utils.cpp/0
{ "file_path": "codelabs/adaptive_app/step_03/windows/runner/utils.cpp", "repo_id": "codelabs", "token_count": 733 }
2
#import "GeneratedPluginRegistrant.h"
codelabs/adaptive_app/step_04/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/adaptive_app/step_04/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
3
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig"
codelabs/adaptive_app/step_04/macos/Flutter/Flutter-Debug.xcconfig/0
{ "file_path": "codelabs/adaptive_app/step_04/macos/Flutter/Flutter-Debug.xcconfig", "repo_id": "codelabs", "token_count": 48 }
4
//{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by Runner.rc // #define IDI_APP_ICON 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif
codelabs/adaptive_app/step_04/windows/runner/resource.h/0
{ "file_path": "codelabs/adaptive_app/step_04/windows/runner/resource.h", "repo_id": "codelabs", "token_count": 200 }
5
<?xml version="1.0" encoding="utf-8"?> <!-- Modify this file to customize your launch splash screen --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@android:color/white" /> <!-- You can insert your own image assets here --> <!-- <item> <bitmap android:gravity="center" android:src="@mipmap/launch_image" /> </item> --> </layer-list>
codelabs/adaptive_app/step_05/android/app/src/main/res/drawable/launch_background.xml/0
{ "file_path": "codelabs/adaptive_app/step_05/android/app/src/main/res/drawable/launch_background.xml", "repo_id": "codelabs", "token_count": 167 }
6
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig"
codelabs/adaptive_app/step_05/ios/Flutter/Release.xcconfig/0
{ "file_path": "codelabs/adaptive_app/step_05/ios/Flutter/Release.xcconfig", "repo_id": "codelabs", "token_count": 41 }
7
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/> </dependencies> <scenes> <!--View Controller--> <scene sceneID="EHf-IW-A2E"> <objects> <viewController id="01J-lp-oVM" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/> <viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <subviews> <imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4"> </imageView> </subviews> <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <constraints> <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/> <constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/> </constraints> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> </objects> <point key="canvasLocation" x="53" y="375"/> </scene> </scenes> <resources> <image name="LaunchImage" width="168" height="185"/> </resources> </document>
codelabs/adaptive_app/step_05/ios/Runner/Base.lproj/LaunchScreen.storyboard/0
{ "file_path": "codelabs/adaptive_app/step_05/ios/Runner/Base.lproj/LaunchScreen.storyboard", "repo_id": "codelabs", "token_count": 1150 }
8
#include "my_application.h" int main(int argc, char** argv) { g_autoptr(MyApplication) app = my_application_new(); return g_application_run(G_APPLICATION(app), argc, argv); }
codelabs/adaptive_app/step_05/linux/main.cc/0
{ "file_path": "codelabs/adaptive_app/step_05/linux/main.cc", "repo_id": "codelabs", "token_count": 69 }
9
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"
codelabs/adaptive_app/step_06/android/settings.gradle/0
{ "file_path": "codelabs/adaptive_app/step_06/android/settings.gradle", "repo_id": "codelabs", "token_count": 317 }
10
WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings GCC_WARN_UNDECLARED_SELECTOR = YES CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE CLANG_WARN__DUPLICATE_METHOD_MATCH = YES CLANG_WARN_PRAGMA_PACK = YES CLANG_WARN_STRICT_PROTOTYPES = YES CLANG_WARN_COMMA = YES GCC_WARN_STRICT_SELECTOR_MATCH = YES CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES GCC_WARN_SHADOW = YES CLANG_WARN_UNREACHABLE_CODE = YES
codelabs/adaptive_app/step_06/macos/Runner/Configs/Warnings.xcconfig/0
{ "file_path": "codelabs/adaptive_app/step_06/macos/Runner/Configs/Warnings.xcconfig", "repo_id": "codelabs", "token_count": 245 }
11
#ifndef RUNNER_WIN32_WINDOW_H_ #define RUNNER_WIN32_WINDOW_H_ #include <windows.h> #include <functional> #include <memory> #include <string> // A class abstraction for a high DPI-aware Win32 Window. Intended to be // inherited from by classes that wish to specialize with custom // rendering and input handling class Win32Window { public: struct Point { unsigned int x; unsigned int y; Point(unsigned int x, unsigned int y) : x(x), y(y) {} }; struct Size { unsigned int width; unsigned int height; Size(unsigned int width, unsigned int height) : width(width), height(height) {} }; Win32Window(); virtual ~Win32Window(); // Creates a win32 window with |title| that is positioned and sized using // |origin| and |size|. New windows are created on the default monitor. Window // sizes are specified to the OS in physical pixels, hence to ensure a // consistent size this function will scale the inputted width and height as // as appropriate for the default monitor. The window is invisible until // |Show| is called. Returns true if the window was created successfully. bool Create(const std::wstring& title, const Point& origin, const Size& size); // Show the current window. Returns true if the window was successfully shown. bool Show(); // Release OS resources associated with window. void Destroy(); // Inserts |content| into the window tree. void SetChildContent(HWND content); // Returns the backing Window handle to enable clients to set icon and other // window properties. Returns nullptr if the window has been destroyed. HWND GetHandle(); // If true, closing this window will quit the application. void SetQuitOnClose(bool quit_on_close); // Return a RECT representing the bounds of the current client area. RECT GetClientArea(); protected: // Processes and route salient window messages for mouse handling, // size change and DPI. Delegates handling of these to member overloads that // inheriting classes can handle. virtual LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Called when CreateAndShow is called, allowing subclass window-related // setup. Subclasses should return false if setup fails. virtual bool OnCreate(); // Called when Destroy is called. virtual void OnDestroy(); private: friend class WindowClassRegistrar; // OS callback called by message pump. Handles the WM_NCCREATE message which // is passed when the non-client area is being created and enables automatic // non-client DPI scaling so that the non-client area automatically // responds to changes in DPI. All other messages are handled by // MessageHandler. static LRESULT CALLBACK WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept; // Retrieves a class instance pointer for |window| static Win32Window* GetThisFromHandle(HWND const window) noexcept; // Update the window frame's theme to match the system theme. static void UpdateTheme(HWND const window); bool quit_on_close_ = false; // window handle for top level window. HWND window_handle_ = nullptr; // window handle for hosted content. HWND child_content_ = nullptr; }; #endif // RUNNER_WIN32_WINDOW_H_
codelabs/adaptive_app/step_06/windows/runner/win32_window.h/0
{ "file_path": "codelabs/adaptive_app/step_06/windows/runner/win32_window.h", "repo_id": "codelabs", "token_count": 1111 }
12
// // Generated file. Do not edit. // // clang-format off #include "generated_plugin_registrant.h" #include <url_launcher_linux/url_launcher_plugin.h> 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); }
codelabs/adaptive_app/step_07/linux/flutter/generated_plugin_registrant.cc/0
{ "file_path": "codelabs/adaptive_app/step_07/linux/flutter/generated_plugin_registrant.cc", "repo_id": "codelabs", "token_count": 163 }
13
import Cocoa import FlutterMacOS @NSApplicationMain class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true } }
codelabs/adaptive_app/step_07/macos/Runner/AppDelegate.swift/0
{ "file_path": "codelabs/adaptive_app/step_07/macos/Runner/AppDelegate.swift", "repo_id": "codelabs", "token_count": 64 }
14
import Cocoa import FlutterMacOS class MainFlutterWindow: NSWindow { override func awakeFromNib() { let flutterViewController = FlutterViewController() let windowFrame = self.frame self.contentViewController = flutterViewController self.setFrame(windowFrame, display: true) RegisterGeneratedPlugins(registry: flutterViewController) super.awakeFromNib() } }
codelabs/adaptive_app/step_07/macos/Runner/MainFlutterWindow.swift/0
{ "file_path": "codelabs/adaptive_app/step_07/macos/Runner/MainFlutterWindow.swift", "repo_id": "codelabs", "token_count": 122 }
15
// // Generated file. Do not edit. // // clang-format off #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ #include <flutter/plugin_registry.h> // Registers Flutter plugins. void RegisterPlugins(flutter::PluginRegistry* registry); #endif // GENERATED_PLUGIN_REGISTRANT_
codelabs/adaptive_app/step_07/windows/flutter/generated_plugin_registrant.h/0
{ "file_path": "codelabs/adaptive_app/step_07/windows/flutter/generated_plugin_registrant.h", "repo_id": "codelabs", "token_count": 116 }
16
# Use latest stable channel SDK. FROM dart:stable AS build # Resolve app dependencies. WORKDIR /app COPY pubspec.* ./ RUN dart pub get # Copy app source code (except anything in .dockerignore) and AOT compile app. COPY . . RUN dart compile exe bin/server.dart -o bin/server # Build minimal serving image from AOT-compiled `/server` # and the pre-built AOT-runtime in the `/runtime/` directory of the base image. FROM scratch COPY --from=build /runtime/ / COPY --from=build /app/bin/server /app/bin/ # Start server. EXPOSE 8080 CMD ["/app/bin/server"]
codelabs/adaptive_app/step_07/yt_cors_proxy/Dockerfile/0
{ "file_path": "codelabs/adaptive_app/step_07/yt_cors_proxy/Dockerfile", "repo_id": "codelabs", "token_count": 186 }
17
<?xml version="1.0" encoding="UTF-8"?> <Workspace version = "1.0"> <FileRef location = "group:Runner.xcodeproj"> </FileRef> </Workspace>
codelabs/animated-responsive-layout/step_04/macos/Runner.xcworkspace/contents.xcworkspacedata/0
{ "file_path": "codelabs/animated-responsive-layout/step_04/macos/Runner.xcworkspace/contents.xcworkspacedata", "repo_id": "codelabs", "token_count": 67 }
18
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.cs.allow-jit</key> <true/> <key>com.apple.security.network.server</key> <true/> </dict> </plist>
codelabs/animated-responsive-layout/step_04/macos/Runner/DebugProfile.entitlements/0
{ "file_path": "codelabs/animated-responsive-layout/step_04/macos/Runner/DebugProfile.entitlements", "repo_id": "codelabs", "token_count": 155 }
19
<?xml version="1.0" encoding="utf-8"?> <resources> <!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off --> <style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar"> <!-- Show a splash screen on the activity. Automatically removed when the Flutter engine draws its first frame --> <item name="android:windowBackground">@drawable/launch_background</item> </style> <!-- Theme applied to the Android Window as soon as the process has started. This theme determines the color of the Android Window while your Flutter UI initializes, as well as behind your Flutter UI while its running. This Theme is only used starting with V2 of Flutter's Android embedding. --> <style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar"> <item name="android:windowBackground">?android:colorBackground</item> </style> </resources>
codelabs/animated-responsive-layout/step_05/android/app/src/main/res/values/styles.xml/0
{ "file_path": "codelabs/animated-responsive-layout/step_05/android/app/src/main/res/values/styles.xml", "repo_id": "codelabs", "token_count": 313 }
20
#include "Generated.xcconfig"
codelabs/animated-responsive-layout/step_05/ios/Flutter/Debug.xcconfig/0
{ "file_path": "codelabs/animated-responsive-layout/step_05/ios/Flutter/Debug.xcconfig", "repo_id": "codelabs", "token_count": 12 }
21
// // Generated file. Do not edit. // // clang-format off #include "generated_plugin_registrant.h" void fl_register_plugins(FlPluginRegistry* registry) { }
codelabs/animated-responsive-layout/step_05/linux/flutter/generated_plugin_registrant.cc/0
{ "file_path": "codelabs/animated-responsive-layout/step_05/linux/flutter/generated_plugin_registrant.cc", "repo_id": "codelabs", "token_count": 57 }
22
{ "images" : [ { "size" : "16x16", "idiom" : "mac", "filename" : "app_icon_16.png", "scale" : "1x" }, { "size" : "16x16", "idiom" : "mac", "filename" : "app_icon_32.png", "scale" : "2x" }, { "size" : "32x32", "idiom" : "mac", "filename" : "app_icon_32.png", "scale" : "1x" }, { "size" : "32x32", "idiom" : "mac", "filename" : "app_icon_64.png", "scale" : "2x" }, { "size" : "128x128", "idiom" : "mac", "filename" : "app_icon_128.png", "scale" : "1x" }, { "size" : "128x128", "idiom" : "mac", "filename" : "app_icon_256.png", "scale" : "2x" }, { "size" : "256x256", "idiom" : "mac", "filename" : "app_icon_256.png", "scale" : "1x" }, { "size" : "256x256", "idiom" : "mac", "filename" : "app_icon_512.png", "scale" : "2x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "app_icon_512.png", "scale" : "1x" }, { "size" : "512x512", "idiom" : "mac", "filename" : "app_icon_1024.png", "scale" : "2x" } ], "info" : { "version" : 1, "author" : "xcode" } }
codelabs/animated-responsive-layout/step_05/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json/0
{ "file_path": "codelabs/animated-responsive-layout/step_05/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json", "repo_id": "codelabs", "token_count": 766 }
23
# # Generated file, do not edit. # list(APPEND FLUTTER_PLUGIN_LIST ) list(APPEND FLUTTER_FFI_PLUGIN_LIST ) set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) endforeach(ffi_plugin)
codelabs/animated-responsive-layout/step_05/windows/flutter/generated_plugins.cmake/0
{ "file_path": "codelabs/animated-responsive-layout/step_05/windows/flutter/generated_plugins.cmake", "repo_id": "codelabs", "token_count": 312 }
24
org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true
codelabs/animated-responsive-layout/step_06/android/gradle.properties/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/android/gradle.properties", "repo_id": "codelabs", "token_count": 30 }
25
#import "GeneratedPluginRegistrant.h"
codelabs/animated-responsive-layout/step_06/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
26
// // Generated file. Do not edit. // // clang-format off #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ #include <flutter_linux/flutter_linux.h> // Registers Flutter plugins. void fl_register_plugins(FlPluginRegistry* registry); #endif // GENERATED_PLUGIN_REGISTRANT_
codelabs/animated-responsive-layout/step_06/linux/flutter/generated_plugin_registrant.h/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/linux/flutter/generated_plugin_registrant.h", "repo_id": "codelabs", "token_count": 118 }
27
import FlutterMacOS import Cocoa import XCTest class RunnerTests: XCTestCase { func testExample() { // If you add code to the Runner application, consider adding tests here. // See https://developer.apple.com/documentation/xctest for more information about using XCTest. } }
codelabs/animated-responsive-layout/step_06/macos/RunnerTests/RunnerTests.swift/0
{ "file_path": "codelabs/animated-responsive-layout/step_06/macos/RunnerTests/RunnerTests.swift", "repo_id": "codelabs", "token_count": 89 }
28
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
codelabs/animated-responsive-layout/step_07/android/gradle/wrapper/gradle-wrapper.properties/0
{ "file_path": "codelabs/animated-responsive-layout/step_07/android/gradle/wrapper/gradle-wrapper.properties", "repo_id": "codelabs", "token_count": 73 }
29
import Flutter import UIKit import XCTest class RunnerTests: XCTestCase { func testExample() { // If you add code to the Runner application, consider adding tests here. // See https://developer.apple.com/documentation/xctest for more information about using XCTest. } }
codelabs/animated-responsive-layout/step_07/ios/RunnerTests/RunnerTests.swift/0
{ "file_path": "codelabs/animated-responsive-layout/step_07/ios/RunnerTests/RunnerTests.swift", "repo_id": "codelabs", "token_count": 87 }
30
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>IDEDidComputeMac32BitWarning</key> <true/> </dict> </plist>
codelabs/animated-responsive-layout/step_07/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist/0
{ "file_path": "codelabs/animated-responsive-layout/step_07/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist", "repo_id": "codelabs", "token_count": 108 }
31
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>$(DEVELOPMENT_LANGUAGE)</string> <key>CFBundleExecutable</key> <string>$(EXECUTABLE_NAME)</string> <key>CFBundleIconFile</key> <string></string> <key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>$(PRODUCT_NAME)</string> <key>CFBundlePackageType</key> <string>APPL</string> <key>CFBundleShortVersionString</key> <string>$(FLUTTER_BUILD_NAME)</string> <key>CFBundleVersion</key> <string>$(FLUTTER_BUILD_NUMBER)</string> <key>LSMinimumSystemVersion</key> <string>$(MACOSX_DEPLOYMENT_TARGET)</string> <key>NSHumanReadableCopyright</key> <string>$(PRODUCT_COPYRIGHT)</string> <key>NSMainNibFile</key> <string>MainMenu</string> <key>NSPrincipalClass</key> <string>NSApplication</string> </dict> </plist>
codelabs/animated-responsive-layout/step_07/macos/Runner/Info.plist/0
{ "file_path": "codelabs/animated-responsive-layout/step_07/macos/Runner/Info.plist", "repo_id": "codelabs", "token_count": 450 }
32
// // Generated file. Do not edit. // // clang-format off #include "generated_plugin_registrant.h" void RegisterPlugins(flutter::PluginRegistry* registry) { }
codelabs/animated-responsive-layout/step_07/windows/flutter/generated_plugin_registrant.cc/0
{ "file_path": "codelabs/animated-responsive-layout/step_07/windows/flutter/generated_plugin_registrant.cc", "repo_id": "codelabs", "token_count": 57 }
33
#include "Generated.xcconfig"
codelabs/animated-responsive-layout/step_08/ios/Flutter/Release.xcconfig/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/ios/Flutter/Release.xcconfig", "repo_id": "codelabs", "token_count": 12 }
34
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> <dependencies> <deployment identifier="iOS"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> </dependencies> <scenes> <!--Flutter View Controller--> <scene sceneID="tne-QT-ifu"> <objects> <viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController"> <layoutGuides> <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> </layoutGuides> <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> </view> </viewController> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> </objects> </scene> </scenes> </document>
codelabs/animated-responsive-layout/step_08/ios/Runner/Base.lproj/Main.storyboard/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/ios/Runner/Base.lproj/Main.storyboard", "repo_id": "codelabs", "token_count": 736 }
35
// Copyright 2022 The Flutter Authors. 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/material.dart'; import '../models/models.dart'; import 'star_button.dart'; enum EmailType { preview, threaded, primaryThreaded, } class EmailWidget extends StatefulWidget { const EmailWidget({ super.key, required this.email, this.isSelected = false, this.isPreview = true, this.isThreaded = false, this.showHeadline = false, this.onSelected, }); final bool isSelected; final bool isPreview; final bool showHeadline; final bool isThreaded; final void Function()? onSelected; final Email email; @override State<EmailWidget> createState() => _EmailWidgetState(); } class _EmailWidgetState extends State<EmailWidget> { late final ColorScheme _colorScheme = Theme.of(context).colorScheme; late Color unselectedColor = Color.alphaBlend( _colorScheme.primary.withOpacity(0.08), _colorScheme.surface, ); Color get _surfaceColor => switch (widget) { EmailWidget(isPreview: false) => _colorScheme.surface, EmailWidget(isSelected: true) => _colorScheme.primaryContainer, _ => unselectedColor, }; @override Widget build(BuildContext context) { return GestureDetector( onTap: widget.onSelected, child: Card( elevation: 0, color: _surfaceColor, clipBehavior: Clip.hardEdge, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, children: [ if (widget.showHeadline) ...[ EmailHeadline( email: widget.email, isSelected: widget.isSelected, ), ], EmailContent( email: widget.email, isPreview: widget.isPreview, isThreaded: widget.isThreaded, isSelected: widget.isSelected, ), ], ), ), ); } } class EmailContent extends StatefulWidget { const EmailContent({ super.key, required this.email, required this.isPreview, required this.isThreaded, required this.isSelected, }); final Email email; final bool isPreview; final bool isThreaded; final bool isSelected; @override State<EmailContent> createState() => _EmailContentState(); } class _EmailContentState extends State<EmailContent> { late final ColorScheme _colorScheme = Theme.of(context).colorScheme; late final TextTheme _textTheme = Theme.of(context).textTheme; Widget get contentSpacer => SizedBox(height: widget.isThreaded ? 20 : 2); String get lastActiveLabel { final DateTime now = DateTime.now(); if (widget.email.sender.lastActive.isAfter(now)) throw ArgumentError(); final Duration elapsedTime = widget.email.sender.lastActive.difference(now).abs(); return switch (elapsedTime) { Duration(inSeconds: < 60) => '${elapsedTime.inSeconds}s', Duration(inMinutes: < 60) => '${elapsedTime.inMinutes}m', Duration(inHours: < 24) => '${elapsedTime.inHours}h', Duration(inDays: < 365) => '${elapsedTime.inDays}d', _ => throw UnimplementedError(), }; } TextStyle? get contentTextStyle => switch (widget) { EmailContent(isThreaded: true) => _textTheme.bodyLarge, EmailContent(isSelected: true) => _textTheme.bodyMedium ?.copyWith(color: _colorScheme.onPrimaryContainer), _ => _textTheme.bodyMedium?.copyWith(color: _colorScheme.onSurfaceVariant), }; @override Widget build(BuildContext context) { return Padding( padding: const EdgeInsets.all(20), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ LayoutBuilder(builder: (context, constraints) { return Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ if (constraints.maxWidth - 200 > 0) ...[ CircleAvatar( backgroundImage: AssetImage(widget.email.sender.avatarUrl), ), const Padding(padding: EdgeInsets.symmetric(horizontal: 6.0)), ], Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( widget.email.sender.name.fullName, overflow: TextOverflow.fade, maxLines: 1, style: widget.isSelected ? _textTheme.labelMedium?.copyWith( color: _colorScheme.onSecondaryContainer) : _textTheme.labelMedium ?.copyWith(color: _colorScheme.onSurface), ), Text( lastActiveLabel, overflow: TextOverflow.fade, maxLines: 1, style: widget.isSelected ? _textTheme.labelMedium?.copyWith( color: _colorScheme.onSecondaryContainer) : _textTheme.labelMedium?.copyWith( color: _colorScheme.onSurfaceVariant), ), ], ), ), if (constraints.maxWidth - 200 > 0) ...[ const StarButton(), ] ], ); }), const SizedBox(width: 8), Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ if (widget.isPreview) ...[ Text( widget.email.subject, style: const TextStyle(fontSize: 18) .copyWith(color: _colorScheme.onSurface), ), ], if (widget.isThreaded) ...[ contentSpacer, Text( "To ${widget.email.recipients.map((recipient) => recipient.name.first).join(", ")}", style: _textTheme.bodyMedium, ) ], contentSpacer, Text( widget.email.content, maxLines: widget.isPreview ? 2 : 100, overflow: TextOverflow.ellipsis, style: contentTextStyle, ), ], ), const SizedBox(width: 12), widget.email.attachments.isNotEmpty ? Container( height: 96, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.0), image: DecorationImage( fit: BoxFit.cover, image: AssetImage(widget.email.attachments.first.url), ), ), ) : const SizedBox.shrink(), if (!widget.isPreview) ...[ const EmailReplyOptions(), ], ], ), ); } } class EmailHeadline extends StatefulWidget { const EmailHeadline({ super.key, required this.email, required this.isSelected, }); final Email email; final bool isSelected; @override State<EmailHeadline> createState() => _EmailHeadlineState(); } class _EmailHeadlineState extends State<EmailHeadline> { late final TextTheme _textTheme = Theme.of(context).textTheme; late final ColorScheme _colorScheme = Theme.of(context).colorScheme; @override Widget build(BuildContext context) { return LayoutBuilder(builder: (context, constraints) { return Container( height: 84, color: Color.alphaBlend( _colorScheme.primary.withOpacity(0.05), _colorScheme.surface, ), child: Padding( padding: const EdgeInsets.fromLTRB(24, 12, 12, 12), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ Expanded( child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( widget.email.subject, maxLines: 1, overflow: TextOverflow.fade, style: const TextStyle( fontSize: 18, fontWeight: FontWeight.w400), ), Text( '${widget.email.replies.toString()} Messages', maxLines: 1, overflow: TextOverflow.fade, style: _textTheme.labelMedium ?.copyWith(fontWeight: FontWeight.w500), ), ], ), ), // Display a "condensed" version if the widget in the row are // expected to overflow. if (constraints.maxWidth - 200 > 0) ...[ SizedBox( height: 40, width: 40, child: FloatingActionButton( onPressed: () {}, elevation: 0, backgroundColor: _colorScheme.surface, child: const Icon(Icons.delete_outline), ), ), const Padding(padding: EdgeInsets.only(right: 8.0)), SizedBox( height: 40, width: 40, child: FloatingActionButton( onPressed: () {}, elevation: 0, backgroundColor: _colorScheme.surface, child: const Icon(Icons.more_vert), ), ), ] ], ), ), ); }); } } class EmailReplyOptions extends StatefulWidget { const EmailReplyOptions({super.key}); @override State<EmailReplyOptions> createState() => _EmailReplyOptionsState(); } class _EmailReplyOptionsState extends State<EmailReplyOptions> { late final ColorScheme _colorScheme = Theme.of(context).colorScheme; @override Widget build(BuildContext context) { return LayoutBuilder( builder: (context, constraints) { if (constraints.maxWidth < 100) { return const SizedBox.shrink(); } return Row( children: [ Expanded( child: TextButton( style: ButtonStyle( backgroundColor: MaterialStateProperty.all(_colorScheme.onInverseSurface), ), onPressed: () {}, child: Text( 'Reply', style: TextStyle(color: _colorScheme.onSurfaceVariant), ), ), ), const SizedBox(width: 8), Expanded( child: TextButton( style: ButtonStyle( backgroundColor: MaterialStateProperty.all(_colorScheme.onInverseSurface), ), onPressed: () {}, child: Text( 'Reply All', style: TextStyle(color: _colorScheme.onSurfaceVariant), ), ), ), ], ); }, ); } }
codelabs/animated-responsive-layout/step_08/lib/widgets/email_widget.dart/0
{ "file_path": "codelabs/animated-responsive-layout/step_08/lib/widgets/email_widget.dart", "repo_id": "codelabs", "token_count": 6089 }
36
// Copyright 2022 The Flutter Authors. 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:desktop_window/desktop_window.dart'; import 'package:flutter/material.dart'; import 'package:universal_platform/universal_platform.dart'; import 'src/shared/app.dart'; Future setDesktopWindow() async { await DesktopWindow.setMinWindowSize(const Size(400, 400)); await DesktopWindow.setWindowSize(const Size(1300, 900)); } void main() { WidgetsFlutterBinding.ensureInitialized(); if (UniversalPlatform.isDesktop) { setDesktopWindow(); } runApp(const MyApp()); }
codelabs/boring_to_beautiful/final/lib/main.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/main.dart", "repo_id": "codelabs", "token_count": 199 }
37
// Copyright 2022 The Flutter Authors. 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/material.dart'; import '../providers/providers.dart'; class BrightnessToggle extends StatelessWidget { const BrightnessToggle({super.key}); @override Widget build(BuildContext context) { final isDark = Theme.of(context).brightness == Brightness.dark; return IconButton( icon: Theme.of(context).brightness == Brightness.light ? const Icon(Icons.brightness_3) : const Icon(Icons.brightness_7), onPressed: () { final themeProvider = ThemeProvider.of(context); final settings = themeProvider.settings.value; final newSettings = ThemeSettings( sourceColor: settings.sourceColor, themeMode: isDark ? ThemeMode.light : ThemeMode.dark, ); ThemeSettingChange(settings: newSettings).dispatch(context); }, ); } }
codelabs/boring_to_beautiful/final/lib/src/shared/views/brightness_toggle.dart/0
{ "file_path": "codelabs/boring_to_beautiful/final/lib/src/shared/views/brightness_toggle.dart", "repo_id": "codelabs", "token_count": 360 }
38
include: ../../analysis_options.yaml
codelabs/boring_to_beautiful/step_01/analysis_options.yaml/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/analysis_options.yaml", "repo_id": "codelabs", "token_count": 12 }
39
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 }
codelabs/boring_to_beautiful/step_01/android/build.gradle/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/android/build.gradle", "repo_id": "codelabs", "token_count": 125 }
40
// Copyright 2022 The Flutter Authors. 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/material.dart'; import '../../../shared/classes/classes.dart'; import '../../../shared/views/outlined_card.dart'; class ArtistUpdates extends StatelessWidget { const ArtistUpdates({super.key, required this.artist}); final Artist artist; @override Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ for (final update in artist.updates) Padding( padding: const EdgeInsets.all(8.0), child: OutlinedCard( clickable: false, child: Padding( padding: const EdgeInsets.symmetric( vertical: 15, horizontal: 20, ), child: Text(update), ), ), ) ], ); } }
codelabs/boring_to_beautiful/step_01/lib/src/features/artists/view/artist_updates.dart/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/lib/src/features/artists/view/artist_updates.dart", "repo_id": "codelabs", "token_count": 452 }
41
// Copyright 2022 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import '../classes/classes.dart'; import '../extensions.dart'; import './artists.dart'; class SongsProvider { static SongsProvider get shared => SongsProvider(); List<RankedSong> get songs => _songs; } // Separated out to avoid reinstantiating the list on every access. final _songs = <RankedSong>[ RankedSong( 1, 'Before You', ArtistsProvider.shared.getArtist('jmo')!, '2:45'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist6-album1.jpg', sourceLink: 'https://unsplash.com/photos/cTKGZJTMJQU', sourceName: 'Drew Dizzy Graham', ), ), RankedSong( 2, 'Hopeful Romantics', ArtistsProvider.shared.getArtist('jmo')!, '4:44'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist6-album2.jpg', sourceLink: 'https://unsplash.com/photos/Vya8eGk5Y64', sourceName: 'Saffu', ), ), RankedSong( 3, 'I Still Believe', ArtistsProvider.shared.getArtist('jmo')!, '3:07'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist6-album3.jpg', sourceLink: 'https://unsplash.com/photos/m82uh_vamhg', sourceName: 'Vicko Mozara', ), ), RankedSong( 1, 'Forever Dancing', ArtistsProvider.shared.getArtist('jonjames')!, '3:35'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist4-album2.jpg', sourceLink: 'https://unsplash.com/photos/RQgKM1h2agA', sourceName: 'Alexandru Acea'), ), RankedSong( 2, 'So In Love', ArtistsProvider.shared.getArtist('jonjames')!, '3:52'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist4-album1.jpg', sourceLink: 'https://unsplash.com/photos/ZWDg7v2FPWE', sourceName: 'Jr Korpa'), ), RankedSong( 3, 'Remembering Us', ArtistsProvider.shared.getArtist('jonjames')!, '3:39'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist4-album3.jpg', sourceLink: 'https://unsplash.com/photos/rX12B5uX7QM', sourceName: 'Stormseeker'), ), RankedSong( 1, 'That Song On The Radio', ArtistsProvider.shared.getArtist('lb')!, '3:46'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist1-album2.jpg', sourceLink: 'https://unsplash.com/photos/6etHcucBiRg', sourceName: 'Keagan Henman', ), ), RankedSong( 2, 'Those Country Hills', ArtistsProvider.shared.getArtist('lb')!, '3:48'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist1-album1.jpg', sourceLink: 'https://unsplash.com/photos/f0WoQluZ8XI', sourceName: 'Keagan Henman', ), ), RankedSong( 3, 'Hard To Say Goodbye', ArtistsProvider.shared.getArtist('lb')!, '3:48'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist1-album1.jpg', sourceLink: 'https://unsplash.com/photos/f0WoQluZ8XI', sourceName: 'Keagan Henman', ), ), RankedSong( 4, 'Being Your Man', ArtistsProvider.shared.getArtist('lb')!, '3:36'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist1-album2.jpg', sourceLink: 'https://unsplash.com/photos/6etHcucBiRg', sourceName: 'Keagan Henman', ), ), RankedSong( 5, 'Typical Friday Night', ArtistsProvider.shared.getArtist('lb')!, '3:41'.toDuration(), const MyArtistImage( image: 'assets/images/albums/artist1-album2.jpg', sourceLink: 'https://unsplash.com/photos/6etHcucBiRg', sourceName: 'Keagan Henman', ), ), ];
codelabs/boring_to_beautiful/step_01/lib/src/shared/providers/songs.dart/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/lib/src/shared/providers/songs.dart", "repo_id": "codelabs", "token_count": 1613 }
42
// Copyright 2022 The Flutter Authors. 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/material.dart'; import '../extensions.dart'; import 'outlined_card.dart'; class ImageTile extends StatelessWidget { const ImageTile({ super.key, required this.image, required this.title, required this.subtitle, }); final String image; final String title; final String subtitle; @override Widget build(BuildContext context) { return OutlinedCard( child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ Expanded( child: Image.asset(image, fit: BoxFit.cover), ), ], ), Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( padding: const EdgeInsets.fromLTRB(10, 5, 10, 5), child: Text( title, textAlign: TextAlign.center, style: context.titleSmall!.copyWith( fontWeight: FontWeight.bold, ), overflow: TextOverflow.ellipsis, maxLines: 1, )), Padding( padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10), child: Text( subtitle, overflow: TextOverflow.ellipsis, style: context.labelSmall, maxLines: 2, textAlign: TextAlign.center, ), ), ], ) ]), ); } }
codelabs/boring_to_beautiful/step_01/lib/src/shared/views/image_tile.dart/0
{ "file_path": "codelabs/boring_to_beautiful/step_01/lib/src/shared/views/image_tile.dart", "repo_id": "codelabs", "token_count": 885 }
43
include: ../../analysis_options.yaml
codelabs/boring_to_beautiful/step_03/analysis_options.yaml/0
{ "file_path": "codelabs/boring_to_beautiful/step_03/analysis_options.yaml", "repo_id": "codelabs", "token_count": 12 }
44
include: ../../analysis_options.yaml
codelabs/boring_to_beautiful/step_05/analysis_options.yaml/0
{ "file_path": "codelabs/boring_to_beautiful/step_05/analysis_options.yaml", "repo_id": "codelabs", "token_count": 12 }
45
include: ../../analysis_options.yaml
codelabs/boring_to_beautiful/step_07/analysis_options.yaml/0
{ "file_path": "codelabs/boring_to_beautiful/step_07/analysis_options.yaml", "repo_id": "codelabs", "token_count": 12 }
46
<?xml version="1.0" encoding="utf-8"?> <!-- Modify this file to customize your launch splash screen --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="?android:colorBackground" /> <!-- You can insert your own image assets here --> <!-- <item> <bitmap android:gravity="center" android:src="@mipmap/launch_image" /> </item> --> </layer-list>
codelabs/brick_breaker/step_03/android/app/src/main/res/drawable-v21/launch_background.xml/0
{ "file_path": "codelabs/brick_breaker/step_03/android/app/src/main/res/drawable-v21/launch_background.xml", "repo_id": "codelabs", "token_count": 166 }
47
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig"
codelabs/brick_breaker/step_03/ios/Flutter/Debug.xcconfig/0
{ "file_path": "codelabs/brick_breaker/step_03/ios/Flutter/Debug.xcconfig", "repo_id": "codelabs", "token_count": 41 }
48
# Launch Screen Assets You can customize the launch screen with your own desired assets by replacing the image files in this directory. You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
codelabs/brick_breaker/step_03/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md/0
{ "file_path": "codelabs/brick_breaker/step_03/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md", "repo_id": "codelabs", "token_count": 77 }
49
name: brick_breaker description: "Re-implementing Woz's Breakout" publish_to: 'none' version: 0.1.0 environment: sdk: '>=3.3.0 <4.0.0' dependencies: flame: ^1.16.0 flutter: sdk: flutter flutter_animate: ^4.5.0 google_fonts: ^6.1.0 dev_dependencies: flutter_test: sdk: flutter flutter_lints: ^3.0.1 flutter: uses-material-design: true
codelabs/brick_breaker/step_04/pubspec.yaml/0
{ "file_path": "codelabs/brick_breaker/step_04/pubspec.yaml", "repo_id": "codelabs", "token_count": 168 }
50
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> <application android:label="brick_breaker" android:name="${applicationName}" android:icon="@mipmap/ic_launcher"> <activity android:name=".MainActivity" android:exported="true" android:launchMode="singleTop" android:theme="@style/LaunchTheme" android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" android:hardwareAccelerated="true" android:windowSoftInputMode="adjustResize"> <!-- Specifies an Android theme to apply to this Activity as soon as the Android process has started. This theme is visible to the user while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. --> <meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="@style/NormalTheme" /> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <!-- Don't delete the meta-data below. This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --> <meta-data android:name="flutterEmbedding" android:value="2" /> </application> <!-- Required to query activities that can process text, see: https://developer.android.com/training/package-visibility?hl=en and https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT. In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --> <queries> <intent> <action android:name="android.intent.action.PROCESS_TEXT"/> <data android:mimeType="text/plain"/> </intent> </queries> </manifest>
codelabs/brick_breaker/step_05/android/app/src/main/AndroidManifest.xml/0
{ "file_path": "codelabs/brick_breaker/step_05/android/app/src/main/AndroidManifest.xml", "repo_id": "codelabs", "token_count": 908 }
51
include: ../../analysis_options.yaml
codelabs/brick_breaker/step_06/analysis_options.yaml/0
{ "file_path": "codelabs/brick_breaker/step_06/analysis_options.yaml", "repo_id": "codelabs", "token_count": 12 }
52
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>PreviewsEnabled</key> <false/> </dict> </plist>
codelabs/brick_breaker/step_06/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings/0
{ "file_path": "codelabs/brick_breaker/step_06/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings", "repo_id": "codelabs", "token_count": 102 }
53
import 'dart:async'; import 'package:flame/collisions.dart'; import 'package:flame/components.dart'; import 'package:flutter/material.dart'; import '../brick_breaker.dart'; class PlayArea extends RectangleComponent with HasGameReference<BrickBreaker> { PlayArea() : super( paint: Paint()..color = const Color(0xfff2e8cf), children: [RectangleHitbox()], ); @override FutureOr<void> onLoad() async { super.onLoad(); size = Vector2(game.width, game.height); } }
codelabs/brick_breaker/step_06/lib/src/components/play_area.dart/0
{ "file_path": "codelabs/brick_breaker/step_06/lib/src/components/play_area.dart", "repo_id": "codelabs", "token_count": 200 }
54
#include "../../Flutter/Flutter-Debug.xcconfig" #include "Warnings.xcconfig"
codelabs/brick_breaker/step_06/macos/Runner/Configs/Debug.xcconfig/0
{ "file_path": "codelabs/brick_breaker/step_06/macos/Runner/Configs/Debug.xcconfig", "repo_id": "codelabs", "token_count": 32 }
55
#include "win32_window.h" #include <dwmapi.h> #include <flutter_windows.h> #include "resource.h" namespace { /// Window attribute that enables dark mode window decorations. /// /// Redefined in case the developer's machine has a Windows SDK older than /// version 10.0.22000.0. /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute #ifndef DWMWA_USE_IMMERSIVE_DARK_MODE #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 #endif constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; /// Registry key for app theme preference. /// /// A value of 0 indicates apps should use dark mode. A non-zero or missing /// value indicates apps should use light mode. constexpr const wchar_t kGetPreferredBrightnessRegKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; // The number of Win32Window objects that currently exist. static int g_active_window_count = 0; using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); // Scale helper to convert logical scaler values to physical using passed in // scale factor int Scale(int source, double scale_factor) { return static_cast<int>(source * scale_factor); } // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. // This API is only needed for PerMonitor V1 awareness mode. void EnableFullDpiSupportIfAvailable(HWND hwnd) { HMODULE user32_module = LoadLibraryA("User32.dll"); if (!user32_module) { return; } auto enable_non_client_dpi_scaling = reinterpret_cast<EnableNonClientDpiScaling*>( GetProcAddress(user32_module, "EnableNonClientDpiScaling")); if (enable_non_client_dpi_scaling != nullptr) { enable_non_client_dpi_scaling(hwnd); } FreeLibrary(user32_module); } } // namespace // Manages the Win32Window's window class registration. class WindowClassRegistrar { public: ~WindowClassRegistrar() = default; // Returns the singleton registrar instance. static WindowClassRegistrar* GetInstance() { if (!instance_) { instance_ = new WindowClassRegistrar(); } return instance_; } // Returns the name of the window class, registering the class if it hasn't // previously been registered. const wchar_t* GetWindowClass(); // Unregisters the window class. Should only be called if there are no // instances of the window. void UnregisterWindowClass(); private: WindowClassRegistrar() = default; static WindowClassRegistrar* instance_; bool class_registered_ = false; }; WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; const wchar_t* WindowClassRegistrar::GetWindowClass() { if (!class_registered_) { WNDCLASS window_class{}; window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); window_class.lpszClassName = kWindowClassName; window_class.style = CS_HREDRAW | CS_VREDRAW; window_class.cbClsExtra = 0; window_class.cbWndExtra = 0; window_class.hInstance = GetModuleHandle(nullptr); window_class.hIcon = LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); window_class.hbrBackground = 0; window_class.lpszMenuName = nullptr; window_class.lpfnWndProc = Win32Window::WndProc; RegisterClass(&window_class); class_registered_ = true; } return kWindowClassName; } void WindowClassRegistrar::UnregisterWindowClass() { UnregisterClass(kWindowClassName, nullptr); class_registered_ = false; } Win32Window::Win32Window() { ++g_active_window_count; } Win32Window::~Win32Window() { --g_active_window_count; Destroy(); } bool Win32Window::Create(const std::wstring& title, const Point& origin, const Size& size) { Destroy(); const wchar_t* window_class = WindowClassRegistrar::GetInstance()->GetWindowClass(); const POINT target_point = {static_cast<LONG>(origin.x), static_cast<LONG>(origin.y)}; HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); double scale_factor = dpi / 96.0; HWND window = CreateWindow( window_class, title.c_str(), WS_OVERLAPPEDWINDOW, Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), Scale(size.width, scale_factor), Scale(size.height, scale_factor), nullptr, nullptr, GetModuleHandle(nullptr), this); if (!window) { return false; } UpdateTheme(window); return OnCreate(); } bool Win32Window::Show() { return ShowWindow(window_handle_, SW_SHOWNORMAL); } // static LRESULT CALLBACK Win32Window::WndProc(HWND const window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { if (message == WM_NCCREATE) { auto window_struct = reinterpret_cast<CREATESTRUCT*>(lparam); SetWindowLongPtr(window, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(window_struct->lpCreateParams)); auto that = static_cast<Win32Window*>(window_struct->lpCreateParams); EnableFullDpiSupportIfAvailable(window); that->window_handle_ = window; } else if (Win32Window* that = GetThisFromHandle(window)) { return that->MessageHandler(window, message, wparam, lparam); } return DefWindowProc(window, message, wparam, lparam); } LRESULT Win32Window::MessageHandler(HWND hwnd, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept { switch (message) { case WM_DESTROY: window_handle_ = nullptr; Destroy(); if (quit_on_close_) { PostQuitMessage(0); } return 0; case WM_DPICHANGED: { auto newRectSize = reinterpret_cast<RECT*>(lparam); LONG newWidth = newRectSize->right - newRectSize->left; LONG newHeight = newRectSize->bottom - newRectSize->top; SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, newHeight, SWP_NOZORDER | SWP_NOACTIVATE); return 0; } case WM_SIZE: { RECT rect = GetClientArea(); if (child_content_ != nullptr) { // Size and position the child window. MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, TRUE); } return 0; } case WM_ACTIVATE: if (child_content_ != nullptr) { SetFocus(child_content_); } return 0; case WM_DWMCOLORIZATIONCOLORCHANGED: UpdateTheme(hwnd); return 0; } return DefWindowProc(window_handle_, message, wparam, lparam); } void Win32Window::Destroy() { OnDestroy(); if (window_handle_) { DestroyWindow(window_handle_); window_handle_ = nullptr; } if (g_active_window_count == 0) { WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); } } Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { return reinterpret_cast<Win32Window*>( GetWindowLongPtr(window, GWLP_USERDATA)); } void Win32Window::SetChildContent(HWND content) { child_content_ = content; SetParent(content, window_handle_); RECT frame = GetClientArea(); MoveWindow(content, frame.left, frame.top, frame.right - frame.left, frame.bottom - frame.top, true); SetFocus(child_content_); } RECT Win32Window::GetClientArea() { RECT frame; GetClientRect(window_handle_, &frame); return frame; } HWND Win32Window::GetHandle() { return window_handle_; } void Win32Window::SetQuitOnClose(bool quit_on_close) { quit_on_close_ = quit_on_close; } bool Win32Window::OnCreate() { // No-op; provided for subclasses. return true; } void Win32Window::OnDestroy() { // No-op; provided for subclasses. } void Win32Window::UpdateTheme(HWND const window) { DWORD light_mode; DWORD light_mode_size = sizeof(light_mode); LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, kGetPreferredBrightnessRegValue, RRF_RT_REG_DWORD, nullptr, &light_mode, &light_mode_size); if (result == ERROR_SUCCESS) { BOOL enable_dark_mode = light_mode == 0; DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, &enable_dark_mode, sizeof(enable_dark_mode)); } }
codelabs/brick_breaker/step_06/windows/runner/win32_window.cpp/0
{ "file_path": "codelabs/brick_breaker/step_06/windows/runner/win32_window.cpp", "repo_id": "codelabs", "token_count": 3358 }
56
import 'package:flame/game.dart'; import 'package:flutter/material.dart'; import 'src/brick_breaker.dart'; void main() { final game = BrickBreaker(); runApp(GameWidget(game: game)); }
codelabs/brick_breaker/step_07/lib/main.dart/0
{ "file_path": "codelabs/brick_breaker/step_07/lib/main.dart", "repo_id": "codelabs", "token_count": 68 }
57
org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true
codelabs/brick_breaker/step_09/android/gradle.properties/0
{ "file_path": "codelabs/brick_breaker/step_09/android/gradle.properties", "repo_id": "codelabs", "token_count": 30 }
58
import UIKit import Flutter @UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } }
codelabs/brick_breaker/step_09/ios/Runner/AppDelegate.swift/0
{ "file_path": "codelabs/brick_breaker/step_09/ios/Runner/AppDelegate.swift", "repo_id": "codelabs", "token_count": 125 }
59
export 'ball.dart'; export 'bat.dart'; export 'brick.dart'; export 'play_area.dart';
codelabs/brick_breaker/step_09/lib/src/components/components.dart/0
{ "file_path": "codelabs/brick_breaker/step_09/lib/src/components/components.dart", "repo_id": "codelabs", "token_count": 35 }
60
// // Generated file. Do not edit. // import FlutterMacOS import Foundation import path_provider_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) }
codelabs/brick_breaker/step_09/macos/Flutter/GeneratedPluginRegistrant.swift/0
{ "file_path": "codelabs/brick_breaker/step_09/macos/Flutter/GeneratedPluginRegistrant.swift", "repo_id": "codelabs", "token_count": 79 }
61
<?xml version="1.0" encoding="UTF-8"?> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <dependencies> <deployment identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> <objects> <customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> <connections> <outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/> </connections> </customObject> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/> <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Runner" customModuleProvider="target"> <connections> <outlet property="applicationMenu" destination="uQy-DD-JDr" id="XBo-yE-nKs"/> <outlet property="mainFlutterWindow" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/> </connections> </customObject> <customObject id="YLy-65-1bz" customClass="NSFontManager"/> <menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6"> <items> <menuItem title="APP_NAME" id="1Xt-HY-uBw"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="APP_NAME" systemMenu="apple" id="uQy-DD-JDr"> <items> <menuItem title="About APP_NAME" id="5kV-Vb-QxS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/> <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/> <menuItem title="Services" id="NMo-om-nkz"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/> </menuItem> <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/> <menuItem title="Hide APP_NAME" keyEquivalent="h" id="Olw-nP-bQN"> <connections> <action selector="hide:" target="-1" id="PnN-Uc-m68"/> </connections> </menuItem> <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/> </connections> </menuItem> <menuItem title="Show All" id="Kd2-mp-pUS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/> <menuItem title="Quit APP_NAME" keyEquivalent="q" id="4sb-4s-VLi"> <connections> <action selector="terminate:" target="-1" id="Te7-pn-YzF"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Edit" id="5QF-Oa-p0T"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Edit" id="W48-6f-4Dl"> <items> <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg"> <connections> <action selector="undo:" target="-1" id="M6e-cu-g7V"/> </connections> </menuItem> <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam"> <connections> <action selector="redo:" target="-1" id="oIA-Rs-6OD"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/> <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG"> <connections> <action selector="cut:" target="-1" id="YJe-68-I9s"/> </connections> </menuItem> <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU"> <connections> <action selector="copy:" target="-1" id="G1f-GL-Joy"/> </connections> </menuItem> <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL"> <connections> <action selector="paste:" target="-1" id="UvS-8e-Qdg"/> </connections> </menuItem> <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/> </connections> </menuItem> <menuItem title="Delete" id="pa3-QI-u2k"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="delete:" target="-1" id="0Mk-Ml-PaM"/> </connections> </menuItem> <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m"> <connections> <action selector="selectAll:" target="-1" id="VNm-Mi-diN"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/> <menuItem title="Find" id="4EN-yA-p0u"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Find" id="1b7-l0-nxx"> <items> <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W"> <connections> <action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/> </connections> </menuItem> <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz"> <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/> <connections> <action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/> </connections> </menuItem> <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye"> <connections> <action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/> </connections> </menuItem> <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV"> <connections> <action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/> </connections> </menuItem> <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt"> <connections> <action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/> </connections> </menuItem> <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd"> <connections> <action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Spelling" id="3IN-sU-3Bg"> <items> <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI"> <connections> <action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/> </connections> </menuItem> <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7"> <connections> <action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/> <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/> </connections> </menuItem> <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/> </connections> </menuItem> <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Substitutions" id="9ic-FL-obx"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Substitutions" id="FeM-D8-WVr"> <items> <menuItem title="Show Substitutions" id="z6F-FW-3nz"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/> <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/> </connections> </menuItem> <menuItem title="Smart Quotes" id="hQb-2v-fYv"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/> </connections> </menuItem> <menuItem title="Smart Dashes" id="rgM-f4-ycn"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/> </connections> </menuItem> <menuItem title="Smart Links" id="cwL-P1-jid"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/> </connections> </menuItem> <menuItem title="Data Detectors" id="tRr-pd-1PS"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/> </connections> </menuItem> <menuItem title="Text Replacement" id="HFQ-gK-NFA"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Transformations" id="2oI-Rn-ZJC"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Transformations" id="c8a-y6-VQd"> <items> <menuItem title="Make Upper Case" id="vmV-6d-7jI"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/> </connections> </menuItem> <menuItem title="Make Lower Case" id="d9M-CD-aMd"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/> </connections> </menuItem> <menuItem title="Capitalize" id="UEZ-Bs-lqG"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Speech" id="xrE-MZ-jX0"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Speech" id="3rS-ZA-NoH"> <items> <menuItem title="Start Speaking" id="Ynk-f8-cLZ"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/> </connections> </menuItem> <menuItem title="Stop Speaking" id="Oyz-dy-DGm"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/> </connections> </menuItem> </items> </menu> </menuItem> </items> </menu> </menuItem> <menuItem title="View" id="H8h-7b-M4v"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="View" id="HyV-fh-RgO"> <items> <menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa"> <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/> <connections> <action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Window" id="aUF-d1-5bR"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo"> <items> <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV"> <connections> <action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/> </connections> </menuItem> <menuItem title="Zoom" id="R4o-n2-Eq4"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="performZoom:" target="-1" id="DIl-cC-cCs"/> </connections> </menuItem> <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/> <menuItem title="Bring All to Front" id="LE2-aR-0XJ"> <modifierMask key="keyEquivalentModifierMask"/> <connections> <action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/> </connections> </menuItem> </items> </menu> </menuItem> <menuItem title="Help" id="EPT-qC-fAb"> <modifierMask key="keyEquivalentModifierMask"/> <menu key="submenu" title="Help" systemMenu="help" id="rJ0-wn-3NY"/> </menuItem> </items> <point key="canvasLocation" x="142" y="-258"/> </menu> <window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target"> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <rect key="contentRect" x="335" y="390" width="800" height="600"/> <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/> <view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ"> <rect key="frame" x="0.0" y="0.0" width="800" height="600"/> <autoresizingMask key="autoresizingMask"/> </view> </window> </objects> </document>
codelabs/brick_breaker/step_09/macos/Runner/Base.lproj/MainMenu.xib/0
{ "file_path": "codelabs/brick_breaker/step_09/macos/Runner/Base.lproj/MainMenu.xib", "repo_id": "codelabs", "token_count": 15560 }
62
#import "GeneratedPluginRegistrant.h"
codelabs/brick_breaker/step_10/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/brick_breaker/step_10/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
63
include: ../../analysis_options.yaml analyzer: errors: unused_field: ignore language: strict-casts: false strict-inference: false linter: rules: - prefer_final_in_for_each
codelabs/dart-patterns-and-records/step_03/analysis_options.yaml/0
{ "file_path": "codelabs/dart-patterns-and-records/step_03/analysis_options.yaml", "repo_id": "codelabs", "token_count": 76 }
64
#ifndef RUNNER_FLUTTER_WINDOW_H_ #define RUNNER_FLUTTER_WINDOW_H_ #include <flutter/dart_project.h> #include <flutter/flutter_view_controller.h> #include <memory> #include "win32_window.h" // A window that does nothing but host a Flutter view. class FlutterWindow : public Win32Window { public: // Creates a new FlutterWindow hosting a Flutter view running |project|. explicit FlutterWindow(const flutter::DartProject& project); virtual ~FlutterWindow(); protected: // Win32Window: bool OnCreate() override; void OnDestroy() override; LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept override; private: // The project to run. flutter::DartProject project_; // The Flutter instance hosted by this window. std::unique_ptr<flutter::FlutterViewController> flutter_controller_; }; #endif // RUNNER_FLUTTER_WINDOW_H_
codelabs/dart-patterns-and-records/step_04/windows/runner/flutter_window.h/0
{ "file_path": "codelabs/dart-patterns-and-records/step_04/windows/runner/flutter_window.h", "repo_id": "codelabs", "token_count": 319 }
65
package com.example.patterns_codelab import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity()
codelabs/dart-patterns-and-records/step_05/android/app/src/main/kotlin/com/example/patterns_codelab/MainActivity.kt/0
{ "file_path": "codelabs/dart-patterns-and-records/step_05/android/app/src/main/kotlin/com/example/patterns_codelab/MainActivity.kt", "repo_id": "codelabs", "token_count": 38 }
66
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleExecutable</key> <string>App</string> <key>CFBundleIdentifier</key> <string>io.flutter.flutter.app</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundleName</key> <string>App</string> <key>CFBundlePackageType</key> <string>FMWK</string> <key>CFBundleShortVersionString</key> <string>1.0</string> <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> <string>1.0</string> <key>MinimumOSVersion</key> <string>12.0</string> </dict> </plist>
codelabs/dart-patterns-and-records/step_05/ios/Flutter/AppFrameworkInfo.plist/0
{ "file_path": "codelabs/dart-patterns-and-records/step_05/ios/Flutter/AppFrameworkInfo.plist", "repo_id": "codelabs", "token_count": 323 }
67
#ifndef FLUTTER_MY_APPLICATION_H_ #define FLUTTER_MY_APPLICATION_H_ #include <gtk/gtk.h> G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, GtkApplication) /** * my_application_new: * * Creates a new Flutter-based application. * * Returns: a new #MyApplication. */ MyApplication* my_application_new(); #endif // FLUTTER_MY_APPLICATION_H_
codelabs/dart-patterns-and-records/step_05/linux/my_application.h/0
{ "file_path": "codelabs/dart-patterns-and-records/step_05/linux/my_application.h", "repo_id": "codelabs", "token_count": 162 }
68
#include "Generated.xcconfig"
codelabs/dart-patterns-and-records/step_06_a/ios/Flutter/Release.xcconfig/0
{ "file_path": "codelabs/dart-patterns-and-records/step_06_a/ios/Flutter/Release.xcconfig", "repo_id": "codelabs", "token_count": 12 }
69
#include "ephemeral/Flutter-Generated.xcconfig"
codelabs/dart-patterns-and-records/step_06_a/macos/Flutter/Flutter-Debug.xcconfig/0
{ "file_path": "codelabs/dart-patterns-and-records/step_06_a/macos/Flutter/Flutter-Debug.xcconfig", "repo_id": "codelabs", "token_count": 19 }
70
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <application xmlns="urn:schemas-microsoft-com:asm.v3"> <windowsSettings> <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness> </windowsSettings> </application> <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> <application> <!-- Windows 10 and Windows 11 --> <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/> <!-- Windows 8.1 --> <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/> <!-- Windows 8 --> <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/> <!-- Windows 7 --> <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/> </application> </compatibility> </assembly>
codelabs/dart-patterns-and-records/step_06_a/windows/runner/runner.exe.manifest/0
{ "file_path": "codelabs/dart-patterns-and-records/step_06_a/windows/runner/runner.exe.manifest", "repo_id": "codelabs", "token_count": 393 }
71
#import "GeneratedPluginRegistrant.h"
codelabs/dart-patterns-and-records/step_06_b/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/dart-patterns-and-records/step_06_b/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
72
#ifndef RUNNER_UTILS_H_ #define RUNNER_UTILS_H_ #include <string> #include <vector> // Creates a console for the process, and redirects stdout and stderr to // it for both the runner and the Flutter library. void CreateAndAttachConsole(); // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string // encoded in UTF-8. Returns an empty std::string on failure. std::string Utf8FromUtf16(const wchar_t* utf16_string); // Gets the command line arguments passed in as a std::vector<std::string>, // encoded in UTF-8. Returns an empty std::vector<std::string> on failure. std::vector<std::string> GetCommandLineArguments(); #endif // RUNNER_UTILS_H_
codelabs/dart-patterns-and-records/step_06_b/windows/runner/utils.h/0
{ "file_path": "codelabs/dart-patterns-and-records/step_06_b/windows/runner/utils.h", "repo_id": "codelabs", "token_count": 215 }
73
// Copyright 2023 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:convert'; class Document { final Map<String, Object?> _json; Document() : _json = jsonDecode(documentJson); (String, {DateTime modified}) get metadata { if (_json.containsKey('metadata')) { final metadataJson = _json['metadata']; if (metadataJson is Map) { final title = metadataJson['title'] as String; final localModified = DateTime.parse(metadataJson['modified'] as String); return (title, modified: localModified); } } throw const FormatException('Unexpected JSON'); } } const documentJson = ''' { "metadata": { "title": "My Document", "modified": "2023-05-10" }, "blocks": [ { "type": "h1", "text": "Chapter 1" }, { "type": "p", "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit." }, { "type": "checkbox", "checked": false, "text": "Learn Dart 3" } ] } ''';
codelabs/dart-patterns-and-records/step_07_a/lib/data.dart/0
{ "file_path": "codelabs/dart-patterns-and-records/step_07_a/lib/data.dart", "repo_id": "codelabs", "token_count": 451 }
74
#include "../../Flutter/Flutter-Release.xcconfig" #include "Warnings.xcconfig"
codelabs/dart-patterns-and-records/step_07_a/macos/Runner/Configs/Release.xcconfig/0
{ "file_path": "codelabs/dart-patterns-and-records/step_07_a/macos/Runner/Configs/Release.xcconfig", "repo_id": "codelabs", "token_count": 32 }
75
org.gradle.jvmargs=-Xmx4G android.useAndroidX=true android.enableJetifier=true
codelabs/dart-patterns-and-records/step_09/android/gradle.properties/0
{ "file_path": "codelabs/dart-patterns-and-records/step_09/android/gradle.properties", "repo_id": "codelabs", "token_count": 30 }
76
{ "images" : [ { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "20x20", "idiom" : "iphone", "filename" : "Icon-App-20x20@3x.png", "scale" : "3x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "iphone", "filename" : "Icon-App-29x29@3x.png", "scale" : "3x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "iphone", "filename" : "Icon-App-40x40@3x.png", "scale" : "3x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@2x.png", "scale" : "2x" }, { "size" : "60x60", "idiom" : "iphone", "filename" : "Icon-App-60x60@3x.png", "scale" : "3x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@1x.png", "scale" : "1x" }, { "size" : "20x20", "idiom" : "ipad", "filename" : "Icon-App-20x20@2x.png", "scale" : "2x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@1x.png", "scale" : "1x" }, { "size" : "29x29", "idiom" : "ipad", "filename" : "Icon-App-29x29@2x.png", "scale" : "2x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@1x.png", "scale" : "1x" }, { "size" : "40x40", "idiom" : "ipad", "filename" : "Icon-App-40x40@2x.png", "scale" : "2x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@1x.png", "scale" : "1x" }, { "size" : "76x76", "idiom" : "ipad", "filename" : "Icon-App-76x76@2x.png", "scale" : "2x" }, { "size" : "83.5x83.5", "idiom" : "ipad", "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" }, { "size" : "1024x1024", "idiom" : "ios-marketing", "filename" : "Icon-App-1024x1024@1x.png", "scale" : "1x" } ], "info" : { "version" : 1, "author" : "xcode" } }
codelabs/dart-patterns-and-records/step_09/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json/0
{ "file_path": "codelabs/dart-patterns-and-records/step_09/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json", "repo_id": "codelabs", "token_count": 1538 }
77
{ "images" : [ { "idiom" : "universal", "filename" : "LaunchImage.png", "scale" : "1x" }, { "idiom" : "universal", "filename" : "LaunchImage@2x.png", "scale" : "2x" }, { "idiom" : "universal", "filename" : "LaunchImage@3x.png", "scale" : "3x" } ], "info" : { "version" : 1, "author" : "xcode" } }
codelabs/dart-patterns-and-records/step_09/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json/0
{ "file_path": "codelabs/dart-patterns-and-records/step_09/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json", "repo_id": "codelabs", "token_count": 214 }
78
#include "Generated.xcconfig"
codelabs/dart-patterns-and-records/step_11_b/ios/Flutter/Release.xcconfig/0
{ "file_path": "codelabs/dart-patterns-and-records/step_11_b/ios/Flutter/Release.xcconfig", "repo_id": "codelabs", "token_count": 12 }
79
#include "ephemeral/Flutter-Generated.xcconfig"
codelabs/dart-patterns-and-records/step_11_b/macos/Flutter/Flutter-Debug.xcconfig/0
{ "file_path": "codelabs/dart-patterns-and-records/step_11_b/macos/Flutter/Flutter-Debug.xcconfig", "repo_id": "codelabs", "token_count": 19 }
80
#import "GeneratedPluginRegistrant.h"
codelabs/dart-patterns-and-records/step_12/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/dart-patterns-and-records/step_12/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
81
#include "../../Flutter/Flutter-Release.xcconfig" #include "Warnings.xcconfig"
codelabs/deeplink_cookbook/macos/Runner/Configs/Release.xcconfig/0
{ "file_path": "codelabs/deeplink_cookbook/macos/Runner/Configs/Release.xcconfig", "repo_id": "codelabs", "token_count": 32 }
82
#include "my_application.h" #include <flutter_linux/flutter_linux.h> #ifdef GDK_WINDOWING_X11 #include <gdk/gdkx.h> #endif #include "flutter/generated_plugin_registrant.h" struct _MyApplication { GtkApplication parent_instance; char** dart_entrypoint_arguments; }; G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) // Implements GApplication::activate. static void my_application_activate(GApplication* application) { MyApplication* self = MY_APPLICATION(application); GtkWindow* window = GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); // Use a header bar when running in GNOME as this is the common style used // by applications and is the setup most users will be using (e.g. Ubuntu // desktop). // If running on X and not using GNOME then just use a traditional title bar // in case the window manager does more exotic layout, e.g. tiling. // If running on Wayland assume the header bar will work (may need changing // if future cases occur). gboolean use_header_bar = TRUE; #ifdef GDK_WINDOWING_X11 GdkScreen* screen = gtk_window_get_screen(window); if (GDK_IS_X11_SCREEN(screen)) { const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); if (g_strcmp0(wm_name, "GNOME Shell") != 0) { use_header_bar = FALSE; } } #endif 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, "ffigen_app_example"); 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, "ffigen_app_example"); } 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); gtk_widget_show(GTK_WIDGET(view)); gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); fl_register_plugins(FL_PLUGIN_REGISTRY(view)); gtk_widget_grab_focus(GTK_WIDGET(view)); } // Implements GApplication::local_command_line. static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { MyApplication* self = MY_APPLICATION(application); // Strip out the first argument as it is the binary name. self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); g_autoptr(GError) error = nullptr; if (!g_application_register(application, nullptr, &error)) { g_warning("Failed to register: %s", error->message); *exit_status = 1; return TRUE; } g_application_activate(application); *exit_status = 0; return TRUE; } // Implements GApplication::startup. static void my_application_startup(GApplication* application) { //MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application startup. G_APPLICATION_CLASS(my_application_parent_class)->startup(application); } // Implements GApplication::shutdown. static void my_application_shutdown(GApplication* application) { //MyApplication* self = MY_APPLICATION(object); // Perform any actions required at application shutdown. G_APPLICATION_CLASS(my_application_parent_class)->shutdown(application); } // Implements GObject::dispose. static void my_application_dispose(GObject* object) { MyApplication* self = MY_APPLICATION(object); g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); G_OBJECT_CLASS(my_application_parent_class)->dispose(object); } static void my_application_class_init(MyApplicationClass* klass) { G_APPLICATION_CLASS(klass)->activate = my_application_activate; G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; G_APPLICATION_CLASS(klass)->startup = my_application_startup; G_APPLICATION_CLASS(klass)->shutdown = my_application_shutdown; G_OBJECT_CLASS(klass)->dispose = my_application_dispose; } static void my_application_init(MyApplication* self) {} MyApplication* my_application_new() { return MY_APPLICATION(g_object_new(my_application_get_type(), "application-id", APPLICATION_ID, "flags", G_APPLICATION_NON_UNIQUE, nullptr)); }
codelabs/ffigen_codelab/step_03/example/linux/my_application.cc/0
{ "file_path": "codelabs/ffigen_codelab/step_03/example/linux/my_application.cc", "repo_id": "codelabs", "token_count": 1632 }
83
// Relative import to be able to reuse the C sources. // See the comment in ../{projectName}}.podspec for more information. #include "../../src/ffigen_app.c"
codelabs/ffigen_codelab/step_05/ios/Classes/ffigen_app.c/0
{ "file_path": "codelabs/ffigen_codelab/step_05/ios/Classes/ffigen_app.c", "repo_id": "codelabs", "token_count": 47 }
84
# Run with `flutter pub run ffigen --config ffigen.yaml`. name: DuktapeBindings description: | Bindings for `src/duktape.h`. Regenerate bindings with `flutter pub run ffigen --config ffigen.yaml`. output: 'lib/duktape_bindings_generated.dart' headers: entry-points: - 'src/duktape.h' include-directives: - 'src/duktape.h' preamble: | // ignore_for_file: always_specify_types // ignore_for_file: camel_case_types // ignore_for_file: non_constant_identifier_names comments: style: any length: full ignore-source-errors: true
codelabs/ffigen_codelab/step_06/ffigen.yaml/0
{ "file_path": "codelabs/ffigen_codelab/step_06/ffigen.yaml", "repo_id": "codelabs", "token_count": 207 }
85
// // Generated file. Do not edit. // import FlutterMacOS import Foundation import desktop_webview_auth import firebase_auth import firebase_core import google_sign_in_ios func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DesktopWebviewAuthPlugin.register(with: registry.registrar(forPlugin: "DesktopWebviewAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTGoogleSignInPlugin.register(with: registry.registrar(forPlugin: "FLTGoogleSignInPlugin")) }
codelabs/firebase-auth-flutterfire-ui/complete/macos/Flutter/GeneratedPluginRegistrant.swift/0
{ "file_path": "codelabs/firebase-auth-flutterfire-ui/complete/macos/Flutter/GeneratedPluginRegistrant.swift", "repo_id": "codelabs", "token_count": 194 }
86
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
codelabs/firebase-auth-flutterfire-ui/start/macos/Podfile/0
{ "file_path": "codelabs/firebase-auth-flutterfire-ui/start/macos/Podfile", "repo_id": "codelabs", "token_count": 492 }
87
// Application-level settings for the Runner target. // // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the // future. If not, the values below would default to using the project name when this becomes a // 'flutter create' template. // The application's name. By default this is also the title of the Flutter window. PRODUCT_NAME = complete // The application's bundle identifier PRODUCT_BUNDLE_IDENTIFIER = com.example.complete // The copyright displayed in application information PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
codelabs/firebase-auth-flutterfire-ui/start/macos/Runner/Configs/AppInfo.xcconfig/0
{ "file_path": "codelabs/firebase-auth-flutterfire-ui/start/macos/Runner/Configs/AppInfo.xcconfig", "repo_id": "codelabs", "token_count": 152 }
88
<!DOCTYPE html> <html> <head> <!-- If you are serving your web app in a path other than the root, change the href value below to reflect the base path you are serving from. The path provided below has to start and end with a slash "/" in order for it to work correctly. For more details: * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base This is a placeholder for base href that will be replaced by the value of the `--base-href` argument provided to `flutter build`. --> <base href="$FLUTTER_BASE_HREF"> <meta charset="UTF-8"> <meta content="IE=Edge" http-equiv="X-UA-Compatible"> <meta name="description" content="A new Flutter project."> <meta name="google-signin-client_id" content="963656261848-bor24o4vro2n6fo65h1tc7ktv7d3j065.apps.googleusercontent.com"> <!-- iOS meta tags & icons --> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-title" content="complete"> <link rel="apple-touch-icon" href="icons/Icon-192.png"> <!-- Favicon --> <link rel="icon" type="image/png" href="favicon.png"/> <title>complete</title> <link rel="manifest" href="manifest.json"> <script src="https://apis.google.com/js/platform.js" async defer></script> <script> // The value below is injected by flutter build, do not touch. const serviceWorkerVersion = null; </script> <!-- This script adds the flutter initialization JS code --> <script src="flutter.js" defer></script> </head> <body> <script> window.addEventListener('load', function(ev) { // Download main.dart.js _flutter.loader.loadEntrypoint({ serviceWorker: { serviceWorkerVersion: serviceWorkerVersion, }, onEntrypointLoaded: function(engineInitializer) { engineInitializer.initializeEngine().then(function(appRunner) { appRunner.runApp(); }); } }); }); </script> <script type="module"> // Import the functions you need from the SDKs you need import { initializeApp } from "https://www.gstatic.com/firebasejs/9.9.1/firebase-app.js"; import { getAnalytics } from "https://www.gstatic.com/firebasejs/9.9.1/firebase-analytics.js"; // TODO: Add SDKs for Firebase products that you want to use // https://firebase.google.com/docs/web/setup#available-libraries // Your web app's Firebase configuration // For Firebase JS SDK v7.20.0 and later, measurementId is optional const firebaseConfig = { apiKey: "AIzaSyCqFjCV_9CZmYeIvcK9FVy4drmKUlSaIWY", authDomain: "flutterfire-ui-codelab.firebaseapp.com", projectId: "flutterfire-ui-codelab", storageBucket: "flutterfire-ui-codelab.appspot.com", messagingSenderId: "963656261848", appId: "1:963656261848:web:7219f7fca5fc70afb237ad", measurementId: "G-DGF0CP099H" }; // Initialize Firebase const app = initializeApp(firebaseConfig); const analytics = getAnalytics(app); </script> </body> </html>
codelabs/firebase-auth-flutterfire-ui/start/web/index.html/0
{ "file_path": "codelabs/firebase-auth-flutterfire-ui/start/web/index.html", "repo_id": "codelabs", "token_count": 1164 }
89
{ "firestore": { "rules": "firestore.rules", "indexes": "firestore.indexes.json" }, "emulators": { "auth": { "port": 9099 }, "firestore": { "port": 8080 }, "ui": { "enabled": true } } }
codelabs/firebase-emulator-suite/complete/firebase.json/0
{ "file_path": "codelabs/firebase-emulator-suite/complete/firebase.json", "repo_id": "codelabs", "token_count": 126 }
90
import 'dart:math'; import 'package:flutter/material.dart'; import 'app_state.dart'; import 'entry.dart'; import 'journal_entry_form.dart'; import 'journal_entry_widget.dart'; class LoggedInView extends StatelessWidget { final AppState state; LoggedInView({super.key, required this.state}); final PageController _controller = PageController(initialPage: 1); @override Widget build(BuildContext context) { final name = state.user!.displayName ?? 'No Name'; return Scaffold( body: Column( children: [ Center( child: Text( 'Welcome back, $name!', style: Theme.of(context).textTheme.headlineSmall!.copyWith(), ), ), Flexible( child: Padding( padding: const EdgeInsets.all(16.0), child: StreamBuilder<List<Entry>>( stream: state.entries, builder: (context, snapshot) { if (snapshot.hasData) { final allEntries = snapshot.data; return PageView( controller: _controller, scrollDirection: Axis.horizontal, children: [ EntryForm( key: Key('${Random().nextDouble()}'), onSubmit: (e) { state.writeEntryToFirebase(e); }, ), for (var entry in allEntries!) EntryView( key: Key('${Random().nextDouble()}'), entry: entry, ) ], ); } else { return const CircularProgressIndicator(); } }, ), ), ) ], ), ); } }
codelabs/firebase-emulator-suite/complete/lib/logged_in_view.dart/0
{ "file_path": "codelabs/firebase-emulator-suite/complete/lib/logged_in_view.dart", "repo_id": "codelabs", "token_count": 1118 }
91
include: ../../analysis_options.yaml linter: rules: avoid_print: false prefer_const_constructors: false prefer_const_declarations: false
codelabs/firebase-emulator-suite/start/analysis_options.yaml/0
{ "file_path": "codelabs/firebase-emulator-suite/start/analysis_options.yaml", "repo_id": "codelabs", "token_count": 53 }
92
import 'dart:math'; import 'package:flutter/material.dart'; import 'app_state.dart'; import 'entry.dart'; import 'journal_entry_form.dart'; import 'journal_entry_widget.dart'; class LoggedInView extends StatelessWidget { final AppState state; LoggedInView({super.key, required this.state}); final PageController _controller = PageController(initialPage: 1); @override Widget build(BuildContext context) { // TODO: get name from Firebase User final name = 'Person'; return Scaffold( body: Column( children: [ Center( child: Padding( padding: const EdgeInsets.symmetric( vertical: 16.0, ), child: Text( 'Welcome back, $name!', style: Theme.of(context).textTheme.headlineSmall!.copyWith(), ), ), ), Flexible( child: Padding( padding: const EdgeInsets.all(16.0), child: StreamBuilder<List<Entry>>( stream: state.entries, initialData: const [], builder: (context, snapshot) { final allEntries = snapshot.data; return PageView( controller: _controller, scrollDirection: Axis.horizontal, children: [ EntryForm( key: Key('${Random().nextDouble()}'), onSubmit: (e) { state.writeEntryToFirebase(e); }, ), for (var entry in allEntries!) EntryView( entry: entry, ) ], ); }, ), ), ) ], ), ); } }
codelabs/firebase-emulator-suite/start/lib/logged_in_view.dart/0
{ "file_path": "codelabs/firebase-emulator-suite/start/lib/logged_in_view.dart", "repo_id": "codelabs", "token_count": 1077 }
93
package com.example.gtk_flutter import io.flutter.embedding.android.FlutterActivity class MainActivity: FlutterActivity() { }
codelabs/firebase-get-to-know-flutter/step_02/android/app/src/main/kotlin/com/example/gtk_flutter/MainActivity.kt/0
{ "file_path": "codelabs/firebase-get-to-know-flutter/step_02/android/app/src/main/kotlin/com/example/gtk_flutter/MainActivity.kt", "repo_id": "codelabs", "token_count": 40 }
94
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.gtk_flutter" compileSdkVersion 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.gtk_flutter" // 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 21 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 {}
codelabs/firebase-get-to-know-flutter/step_05/android/app/build.gradle/0
{ "file_path": "codelabs/firebase-get-to-know-flutter/step_05/android/app/build.gradle", "repo_id": "codelabs", "token_count": 722 }
95
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
codelabs/firebase-get-to-know-flutter/step_05/android/gradle/wrapper/gradle-wrapper.properties/0
{ "file_path": "codelabs/firebase-get-to-know-flutter/step_05/android/gradle/wrapper/gradle-wrapper.properties", "repo_id": "codelabs", "token_count": 71 }
96
// Copyright 2022 The Flutter Authors. 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/material.dart'; class Header extends StatelessWidget { const Header(this.heading, {super.key}); final String heading; @override Widget build(BuildContext context) => Padding( padding: const EdgeInsets.all(8.0), child: Text( heading, style: const TextStyle(fontSize: 24), ), ); } class Paragraph extends StatelessWidget { const Paragraph(this.content, {super.key}); final String content; @override Widget build(BuildContext context) => Padding( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), child: Text( content, style: const TextStyle(fontSize: 18), ), ); } class IconAndDetail extends StatelessWidget { const IconAndDetail(this.icon, this.detail, {super.key}); final IconData icon; final String detail; @override Widget build(BuildContext context) => Padding( padding: const EdgeInsets.all(8.0), child: Row( children: [ Icon(icon), const SizedBox(width: 8), Text( detail, style: const TextStyle(fontSize: 18), ) ], ), ); } class StyledButton extends StatelessWidget { const StyledButton({required this.child, required this.onPressed, super.key}); final Widget child; final void Function() onPressed; @override Widget build(BuildContext context) => OutlinedButton( style: OutlinedButton.styleFrom( side: const BorderSide(color: Colors.deepPurple)), onPressed: onPressed, child: child, ); }
codelabs/firebase-get-to-know-flutter/step_05/lib/src/widgets.dart/0
{ "file_path": "codelabs/firebase-get-to-know-flutter/step_05/lib/src/widgets.dart", "repo_id": "codelabs", "token_count": 724 }
97
// // Generated file. Do not edit. // import FlutterMacOS import Foundation import cloud_firestore import desktop_webview_auth import firebase_auth import firebase_core import path_provider_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTFirebaseFirestorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseFirestorePlugin")) DesktopWebviewAuthPlugin.register(with: registry.registrar(forPlugin: "DesktopWebviewAuthPlugin")) FLTFirebaseAuthPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseAuthPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) }
codelabs/firebase-get-to-know-flutter/step_06/macos/Flutter/GeneratedPluginRegistrant.swift/0
{ "file_path": "codelabs/firebase-get-to-know-flutter/step_06/macos/Flutter/GeneratedPluginRegistrant.swift", "repo_id": "codelabs", "token_count": 225 }
98
#import "GeneratedPluginRegistrant.h"
codelabs/firebase-get-to-know-flutter/step_07/ios/Runner/Runner-Bridging-Header.h/0
{ "file_path": "codelabs/firebase-get-to-know-flutter/step_07/ios/Runner/Runner-Bridging-Header.h", "repo_id": "codelabs", "token_count": 13 }
99