Skip to content

chore: add dart sample program#22

Open
mir-huzaif wants to merge 1 commit into
masterfrom
huzaif/add-dart
Open

chore: add dart sample program#22
mir-huzaif wants to merge 1 commit into
masterfrom
huzaif/add-dart

Conversation

@mir-huzaif

Copy link
Copy Markdown

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces the legacy C/C++ sample artifacts under examples/ with a new Dart/Flutter sample application under dart/, including platform runner/build scaffolding for Android, iOS, macOS, Linux, and Windows.

Changes:

  • Removed the prior Visual Studio solution/project, Makefile, and C++ sample source/headers in examples/.
  • Added a Flutter example app (dart/) demonstrating LexActivator usage, plus platform runner/build files.
  • Added generated build/registrant files and platform metadata/ignores for Flutter tooling.

Reviewed changes

Copilot reviewed 118 out of 154 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
examples/x86/.gitkeep Keeps the x86 examples directory present in git.
examples/x64/.gitkeep Keeps the x64 examples directory present in git.
examples/Sample.vcxproj Removed legacy VS C++ sample project file.
examples/Sample.sln Removed legacy VS solution for the C++ sample.
examples/Sample.cpp Removed legacy C++ sample program using LexActivator.
examples/Makefile Removed legacy Makefile-based sample build.
examples/LexTypes.h Removed legacy sample type definitions header.
examples/LexStatusCodes.h Removed legacy sample status codes header.
dart/windows/windows/runner/win32_window.h Added (nested) Windows runner header for Win32 window hosting.
dart/windows/windows/runner/win32_window.cpp Added (nested) Windows runner Win32 window implementation (includes theme handling).
dart/windows/windows/runner/utils.h Added (nested) Windows runner utilities header.
dart/windows/windows/runner/utils.cpp Added (nested) Windows runner utilities implementation.
dart/windows/windows/runner/Runner.rc Added (nested) Windows runner resources file.
dart/windows/windows/runner/runner.exe.manifest Added (nested) Windows runner manifest.
dart/windows/windows/runner/resource.h Added (nested) Windows runner resource header.
dart/windows/windows/runner/main.cpp Added (nested) Windows runner entrypoint.
dart/windows/windows/runner/flutter_window.h Added (nested) Windows Flutter host window header.
dart/windows/windows/runner/flutter_window.cpp Added (nested) Windows Flutter host window implementation.
dart/windows/windows/runner/CMakeLists.txt Added (nested) Windows runner CMake target.
dart/windows/windows/flutter/generated_plugins.cmake Added (nested) generated plugin CMake list (empty).
dart/windows/windows/flutter/generated_plugin_registrant.h Added (nested) generated plugin registrant header.
dart/windows/windows/flutter/generated_plugin_registrant.cc Added (nested) generated plugin registrant source.
dart/windows/windows/flutter/CMakeLists.txt Added (nested) Flutter Windows build CMake scaffolding.
dart/windows/windows/CMakeLists.txt Added (nested) top-level Windows CMake project scaffolding.
dart/windows/windows/.gitignore Added (nested) Windows-specific gitignore.
dart/windows/test/widget_test.dart Added (nested project) Flutter widget test skeleton.
dart/windows/runner/win32_window.h Added Windows platform runner Win32 window header.
dart/windows/runner/win32_window.cpp Added Windows platform runner Win32 window implementation.
dart/windows/runner/utils.h Added Windows platform runner utilities header.
dart/windows/runner/utils.cpp Added Windows platform runner utilities implementation.
dart/windows/runner/Runner.rc Added Windows platform runner resources file.
dart/windows/runner/runner.exe.manifest Added Windows platform runner manifest.
dart/windows/runner/resource.h Added Windows platform runner resource header.
dart/windows/runner/main.cpp Added Windows platform runner entrypoint.
dart/windows/runner/flutter_window.h Added Windows Flutter host window header.
dart/windows/runner/flutter_window.cpp Added Windows Flutter host window implementation.
dart/windows/runner/CMakeLists.txt Added Windows runner CMake target.
dart/windows/README.md Added Flutter template README inside nested windows project root.
dart/windows/flutter/generated_plugins.cmake Added generated plugin CMake list (includes lexactivator).
dart/windows/flutter/generated_plugin_registrant.h Added generated plugin registrant header.
dart/windows/flutter/generated_plugin_registrant.cc Added generated plugin registrant source (registers lexactivator).
dart/windows/flutter/CMakeLists.txt Added Flutter Windows build CMake scaffolding.
dart/windows/CMakeLists.txt Added Windows platform top-level CMake scaffolding for the example app.
dart/windows/analysis_options.yaml Added analyzer/lints config inside nested windows project root.
dart/windows/.metadata Added Flutter metadata inside nested windows project root.
dart/windows/.gitignore Added Windows platform gitignore.
dart/test/widget_test.dart Added Flutter widget test skeleton for the example app.
dart/README.md Added example app README describing usage.
dart/pubspec.yaml Added Flutter example pubspec (depends on lexactivator via path).
dart/macos/RunnerTests/RunnerTests.swift Added macOS test skeleton.
dart/macos/Runner/Release.entitlements Added macOS release entitlements.
dart/macos/Runner/MainFlutterWindow.swift Added macOS main Flutter window host.
dart/macos/Runner/Info.plist Added macOS app Info.plist.
dart/macos/Runner/DebugProfile.entitlements Added macOS debug/profile entitlements.
dart/macos/Runner/Configs/Warnings.xcconfig Added macOS warnings build config.
dart/macos/Runner/Configs/Release.xcconfig Added macOS release build config.
dart/macos/Runner/Configs/Debug.xcconfig Added macOS debug build config.
dart/macos/Runner/Configs/AppInfo.xcconfig Added macOS app identity config (name/bundle ID/copyright).
dart/macos/Runner/Base.lproj/MainMenu.xib Added macOS main menu XIB.
dart/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json Added macOS app icon catalog metadata.
dart/macos/Runner/AppDelegate.swift Added macOS app delegate.
dart/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist Added macOS workspace checks plist.
dart/macos/Runner.xcworkspace/contents.xcworkspacedata Added macOS workspace data.
dart/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme Added macOS scheme.
dart/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist Added macOS project workspace checks plist.
dart/macos/Flutter/GeneratedPluginRegistrant.swift Added macOS generated plugin registrant (registers lexactivator).
dart/macos/Flutter/Flutter-Release.xcconfig Added macOS Flutter release xcconfig.
dart/macos/Flutter/Flutter-Debug.xcconfig Added macOS Flutter debug xcconfig.
dart/macos/.gitignore Added macOS gitignore for Flutter/Xcode artifacts.
dart/linux/runner/my_application.h Added Linux runner application header.
dart/linux/runner/my_application.cc Added Linux runner application implementation.
dart/linux/runner/main.cc Added Linux runner entrypoint.
dart/linux/runner/CMakeLists.txt Added Linux runner CMake target.
dart/linux/my_application.h Added Linux application header (non-runner path).
dart/linux/my_application.cc Added Linux application implementation (non-runner path).
dart/linux/main.cc Added Linux entrypoint (non-runner path).
dart/linux/flutter/generated_plugins.cmake Added Linux generated plugin CMake list (includes lexactivator).
dart/linux/flutter/generated_plugin_registrant.h Added Linux generated plugin registrant header.
dart/linux/flutter/generated_plugin_registrant.cc Added Linux generated plugin registrant source (registers lexactivator).
dart/linux/flutter/CMakeLists.txt Added Linux Flutter build CMake scaffolding.
dart/linux/CMakeLists.txt Added Linux top-level CMake for the example app bundle/install.
dart/linux/.gitignore Added Linux ignore for ephemeral Flutter artifacts.
dart/lib/main.dart Added Dart entrypoint demonstrating LexActivator calls and status handling.
dart/ios/RunnerTests/RunnerTests.swift Added iOS test skeleton.
dart/ios/Runner/Runner-Bridging-Header.h Added iOS bridging header.
dart/ios/Runner/Info.plist Added iOS app Info.plist.
dart/ios/Runner/Base.lproj/Main.storyboard Added iOS main storyboard.
dart/ios/Runner/Base.lproj/LaunchScreen.storyboard Added iOS launch screen storyboard.
dart/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md Added iOS launch image README.
dart/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json Added iOS launch image asset catalog.
dart/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json Added iOS app icon catalog metadata.
dart/ios/Runner/AppDelegate.swift Added iOS app delegate.
dart/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings Added iOS workspace settings.
dart/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist Added iOS workspace checks plist.
dart/ios/Runner.xcworkspace/contents.xcworkspacedata Added iOS workspace data.
dart/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme Added iOS scheme.
dart/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings Added iOS project workspace settings.
dart/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist Added iOS project workspace checks plist.
dart/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata Added iOS project workspace data.
dart/ios/Runner.xcodeproj/project.pbxproj Added iOS Xcode project configuration.
dart/ios/Flutter/Release.xcconfig Added iOS Flutter release xcconfig.
dart/ios/Flutter/Debug.xcconfig Added iOS Flutter debug xcconfig.
dart/ios/Flutter/AppFrameworkInfo.plist Added iOS Flutter framework Info.plist.
dart/ios/.gitignore Added iOS gitignore for Flutter/Xcode artifacts.
dart/android/settings.gradle.kts Added Android settings.gradle.kts (Flutter plugin loader + plugin versions).
dart/android/gradle/wrapper/gradle-wrapper.properties Added Gradle wrapper properties.
dart/android/gradle.properties Added Gradle properties (JVM args, AndroidX, Jetifier).
dart/android/build.gradle.kts Added Android root build.gradle.kts.
dart/android/app/src/profile/AndroidManifest.xml Added Android profile manifest.
dart/android/app/src/main/res/values/styles.xml Added Android light theme resources.
dart/android/app/src/main/res/values-night/styles.xml Added Android night theme resources.
dart/android/app/src/main/res/drawable/launch_background.xml Added Android splash drawable (pre-v21).
dart/android/app/src/main/res/drawable-v21/launch_background.xml Added Android splash drawable (v21+).
dart/android/app/src/main/java/com/example/lexactivator_example/MainActivity.java Added Android MainActivity.
dart/android/app/src/main/AndroidManifest.xml Added Android main manifest for the example.
dart/android/app/src/debug/AndroidManifest.xml Added Android debug manifest.
dart/android/app/build.gradle.kts Added Android app module build.gradle.kts.
dart/android/.gitignore Added Android gitignore rules.
dart/analysis_options.yaml Added analyzer/lints config at example root.
dart/.metadata Added Flutter metadata at example root.
dart/.gitignore Added Flutter/Dart/gitignore rules at example root.
Files not reviewed (3)
  • dart/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Generated file
  • dart/ios/Runner.xcworkspace/contents.xcworkspacedata: Generated file
  • dart/macos/Runner.xcworkspace/contents.xcworkspacedata: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +13 to +15
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
Comment on lines +16 to +18
if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
_dup2(_fileno(stdout), 2);
}
Comment on lines +44 to +64
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);
if (target_length == 0) {
return std::string();
}
std::string utf8_string;
utf8_string.resize(target_length);
int converted_length = ::WideCharToMultiByte(
CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
-1, utf8_string.data(),
target_length, nullptr, nullptr);
if (converted_length == 0) {
return std::string();
}
return utf8_string;
}
Comment on lines +32 to +36
if (enable_non_client_dpi_scaling != nullptr) {
enable_non_client_dpi_scaling(hwnd);
FreeLibrary(user32_module);
}
}
Comment thread dart/pubspec.yaml
Comment on lines +12 to +13
lexactivator:
path: ../
Comment on lines +6 to +8
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
</manifest>
Comment on lines +1 to +8
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(windows LANGUAGES CXX)

# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "windows")

Comment on lines +13 to +15
if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
_dup2(_fileno(stdout), 1);
}
Comment on lines +16 to +18
if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
_dup2(_fileno(stdout), 2);
}
Comment thread dart/android/.gitignore
Comment on lines +1 to +6
gradle-wrapper.jar
/.gradle
/captures/
/gradlew
/gradlew.bat
/local.properties
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants