├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugin_registrant.cc │ ├── generated_plugins.cmake │ └── CMakeLists.txt ├── my_application.h ├── my_application.cc └── CMakeLists.txt ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── LaunchImageDark.png │ │ │ ├── LaunchImageDark@2x.png │ │ │ ├── LaunchImageDark@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ ├── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-50x50@1x.png │ │ │ ├── Icon-App-50x50@2x.png │ │ │ ├── Icon-App-57x57@1x.png │ │ │ ├── Icon-App-57x57@2x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-72x72@1x.png │ │ │ ├── Icon-App-72x72@2x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ │ └── LaunchBackground.imageset │ │ │ ├── background.png │ │ │ ├── darkbackground.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── WorkspaceSettings.xcsettings │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── Runner.xcscheme ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── WorkspaceSettings.xcsettings │ │ └── IDEWorkspaceChecks.plist └── .gitignore ├── macos ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ ├── app_icon_64.png │ │ │ ├── app_icon_1024.png │ │ │ └── Contents.json │ ├── AppDelegate.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── MainFlutterWindow.swift │ └── Info.plist ├── .gitignore ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── Runner.xcodeproj │ ├── project.xcworkspace │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ └── xcschemes │ └── Runner.xcscheme ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── splash │ ├── img │ │ ├── dark-1x.png │ │ ├── dark-2x.png │ │ ├── dark-3x.png │ │ ├── dark-4x.png │ │ ├── light-1x.png │ │ ├── light-2x.png │ │ ├── light-3x.png │ │ └── light-4x.png │ ├── splash.js │ └── style.css ├── manifest.json └── index.html ├── screenshots ├── 01.png ├── 02.png ├── 03.png ├── 04.png ├── 05.png ├── 06.png ├── 07.png ├── 08.png ├── 09.png ├── 10.png └── 11.png ├── assets ├── images │ ├── Ai.webp │ ├── TexFusion.png │ └── image_found.png └── fonts │ ├── Nexa-Heavy.ttf │ ├── Cairo-Regular.ttf │ ├── Nexa-ExtraLight.ttf │ └── Aesthetic-Regular.ttf ├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable │ │ │ │ │ ├── background.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ ├── background.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-night │ │ │ │ │ ├── background.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-night-hdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable-night-mdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable-night-xhdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── drawable-night-xxhdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-night-v21 │ │ │ │ │ ├── background.png │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-night-xxxhdpi │ │ │ │ │ └── splash.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── text_to_image_gen │ │ │ │ │ └── MainActivity.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle └── build.gradle ├── windows ├── runner │ ├── resources │ │ └── app_icon.ico │ ├── resource.h │ ├── utils.h │ ├── runner.exe.manifest │ ├── flutter_window.h │ ├── main.cpp │ ├── CMakeLists.txt │ ├── utils.cpp │ ├── flutter_window.cpp │ ├── Runner.rc │ ├── win32_window.h │ └── win32_window.cpp ├── .gitignore ├── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugin_registrant.cc │ ├── generated_plugins.cmake │ └── CMakeLists.txt └── CMakeLists.txt ├── lib ├── bloc │ ├── app_mode_state.dart │ ├── app_directory_state.dart │ ├── app_theme_state.dart │ ├── app_language_state.dart │ ├── image_state.dart │ ├── app_mode_cubit.dart │ ├── image_cubit.dart │ ├── app_directory_cubit.dart │ ├── app_language_cubit.dart │ └── app_theme_cubit.dart ├── utils │ ├── language.dart │ ├── app_directory.dart │ ├── strings.dart │ ├── app_theme_mode.dart │ └── app_language.dart ├── l10n │ ├── app_ar.arb │ ├── app_hi.arb │ └── app_en.arb ├── main.dart ├── widgets │ ├── custom_drawer.dart │ └── app_theme.dart └── Pages │ ├── about_page.dart │ └── settings_page.dart ├── .gitignore ├── flutter_launcher_icons.yaml ├── LICENSE ├── test └── widget_test.dart ├── analysis_options.yaml ├── pubspec.yaml ├── .metadata ├── README.md └── flutter_native_splash.yaml /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "ephemeral/Flutter-Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/favicon.png -------------------------------------------------------------------------------- /screenshots/01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/01.png -------------------------------------------------------------------------------- /screenshots/02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/02.png -------------------------------------------------------------------------------- /screenshots/03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/03.png -------------------------------------------------------------------------------- /screenshots/04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/04.png -------------------------------------------------------------------------------- /screenshots/05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/05.png -------------------------------------------------------------------------------- /screenshots/06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/06.png -------------------------------------------------------------------------------- /screenshots/07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/07.png -------------------------------------------------------------------------------- /screenshots/08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/08.png -------------------------------------------------------------------------------- /screenshots/09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/09.png -------------------------------------------------------------------------------- /screenshots/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/10.png -------------------------------------------------------------------------------- /screenshots/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/screenshots/11.png -------------------------------------------------------------------------------- /assets/images/Ai.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/images/Ai.webp -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /assets/fonts/Nexa-Heavy.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/fonts/Nexa-Heavy.ttf -------------------------------------------------------------------------------- /assets/images/TexFusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/images/TexFusion.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /web/splash/img/dark-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/dark-1x.png -------------------------------------------------------------------------------- /web/splash/img/dark-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/dark-2x.png -------------------------------------------------------------------------------- /web/splash/img/dark-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/dark-3x.png -------------------------------------------------------------------------------- /web/splash/img/dark-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/dark-4x.png -------------------------------------------------------------------------------- /web/splash/img/light-1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/light-1x.png -------------------------------------------------------------------------------- /web/splash/img/light-2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/light-2x.png -------------------------------------------------------------------------------- /web/splash/img/light-3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/light-3x.png -------------------------------------------------------------------------------- /web/splash/img/light-4x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/splash/img/light-4x.png -------------------------------------------------------------------------------- /assets/images/image_found.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/images/image_found.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /assets/fonts/Cairo-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/fonts/Cairo-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/Nexa-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/fonts/Nexa-ExtraLight.ttf -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /assets/fonts/Aesthetic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/assets/fonts/Aesthetic-Regular.ttf -------------------------------------------------------------------------------- /windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-xxxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-hdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night-hdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-mdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night-mdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night-xhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night-xxhdpi/splash.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-v21/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night-v21/background.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-xxxhdpi/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/android/app/src/main/res/drawable-night-xxxhdpi/splash.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImageDark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImageDark.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/darkbackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchBackground.imageset/darkbackground.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImageDark@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImageDark@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImageDark@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/VikramadityaDev/text_to_image_gen/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImageDark@3x.png -------------------------------------------------------------------------------- /linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /web/splash/splash.js: -------------------------------------------------------------------------------- 1 | function removeSplashFromWeb() { 2 | document.getElementById("splash")?.remove(); 3 | document.getElementById("splash-branding")?.remove(); 4 | document.body.style.background = "transparent"; 5 | } 6 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/example/text_to_image_gen/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.text_to_image_gen; 2 | 3 | import io.flutter.embedding.android.FlutterActivity; 4 | 5 | public class MainActivity extends FlutterActivity { 6 | } 7 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | 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. -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-night-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /lib/bloc/app_mode_state.dart: -------------------------------------------------------------------------------- 1 | part of 'app_mode_cubit.dart'; 2 | 3 | abstract class AppModeState extends Equatable { 4 | final String mode; 5 | 6 | const AppModeState(this.mode); 7 | 8 | @override 9 | List get props => [mode]; 10 | } 11 | 12 | class AppModeInitial extends AppModeState { 13 | const AppModeInitial(super.mode); 14 | } 15 | 16 | class AppModeUpdate extends AppModeState { 17 | const AppModeUpdate(super.mode); 18 | } 19 | -------------------------------------------------------------------------------- /lib/utils/language.dart: -------------------------------------------------------------------------------- 1 | class Language { 2 | final int id; 3 | final String flag; 4 | final String name; 5 | final String languageCode; 6 | 7 | Language(this.id, this.flag, this.name, this.languageCode); 8 | 9 | static List languageList() { 10 | return [ 11 | Language(1, "🇺🇸", "English", "en"), 12 | Language(2, "in", "हिंदी", "hi"), 13 | Language(3, "🇩🇿", "اَلْعَرَبِيَّةُ", "ar"), 14 | ]; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /lib/bloc/app_directory_state.dart: -------------------------------------------------------------------------------- 1 | part of 'app_directory_cubit.dart'; 2 | 3 | abstract class AppDirectoryState extends Equatable { 4 | final String path; 5 | const AppDirectoryState(this.path); 6 | @override 7 | List get props => [path]; 8 | } 9 | 10 | class AppDirectoryInitial extends AppDirectoryState { 11 | const AppDirectoryInitial(super.path); 12 | } 13 | 14 | class AppDirectoryUpdated extends AppDirectoryState { 15 | const AppDirectoryUpdated(super.path); 16 | } 17 | -------------------------------------------------------------------------------- /lib/bloc/app_theme_state.dart: -------------------------------------------------------------------------------- 1 | part of 'app_theme_cubit.dart'; 2 | 3 | abstract class AppThemeState extends Equatable { 4 | final AppTheme theme; 5 | 6 | const AppThemeState(this.theme); 7 | @override 8 | List get props => [theme]; 9 | } 10 | 11 | class AppThemeInitial extends AppThemeState { 12 | const AppThemeInitial(AppTheme theme) : super(theme); 13 | } 14 | 15 | class AppThemeUpdate extends AppThemeState { 16 | const AppThemeUpdate(AppTheme theme) : super(theme); 17 | } 18 | -------------------------------------------------------------------------------- /lib/bloc/app_language_state.dart: -------------------------------------------------------------------------------- 1 | part of 'app_language_cubit.dart'; 2 | 3 | abstract class AppLanguageState extends Equatable { 4 | final Locale locale; 5 | 6 | const AppLanguageState(this.locale); 7 | 8 | @override 9 | List get props => [locale]; 10 | } 11 | 12 | class AppLanguageInitial extends AppLanguageState { 13 | const AppLanguageInitial(super.locale); 14 | } 15 | 16 | class AppLanguageUpdate extends AppLanguageState { 17 | const AppLanguageUpdate(super.locale); 18 | } 19 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "background.png", 5 | "idiom" : "universal" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "filename" : "darkbackground.png", 15 | "idiom" : "universal" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/utils/app_directory.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class PathSharedPreferences { 4 | static const String _keyPath = 'path'; 5 | 6 | static Future setPath(String path) async { 7 | final prefs = await SharedPreferences.getInstance(); 8 | await prefs.setString(_keyPath, path); 9 | } 10 | 11 | static Future getPath() async { 12 | final prefs = await SharedPreferences.getInstance(); 13 | return prefs.getString(_keyPath); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /lib/bloc/image_state.dart: -------------------------------------------------------------------------------- 1 | part of 'image_cubit.dart'; 2 | 3 | abstract class ImageState extends Equatable { 4 | const ImageState(); 5 | @override 6 | List get props => []; 7 | } 8 | 9 | class ImageInitial extends ImageState {} 10 | 11 | class ImageLoading extends ImageState {} 12 | 13 | class ImageLoaded extends ImageState { 14 | final Uint8List image; 15 | const ImageLoaded({required this.image}); 16 | @override 17 | List get props => [image]; 18 | } 19 | 20 | class ImageError extends ImageState { 21 | final String error; 22 | const ImageError({required this.error}); 23 | @override 24 | List get props => [error]; 25 | } 26 | -------------------------------------------------------------------------------- /macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = text_to_image_gen 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.textToImageGen 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 com.example. All rights reserved. 15 | -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /lib/bloc/app_mode_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | 4 | import '../utils/app_theme_mode.dart'; 5 | import '../utils/strings.dart'; 6 | 7 | part 'app_mode_state.dart'; 8 | 9 | class AppModeCubit extends Cubit { 10 | AppModeCubit(String mode) : super(AppModeInitial(mode)) { 11 | loadMode(); 12 | } 13 | 14 | Future loadMode() async { 15 | final selectedMode = await ThemeSharedPreferences.getModeName(); 16 | emit(AppModeUpdate(selectedMode ?? system)); 17 | } 18 | 19 | Future changeMode(String value) async { 20 | await ThemeSharedPreferences.setModeName(value); 21 | emit(AppModeUpdate(value)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/bloc/image_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | import 'package:brain_fusion/brain_fusion.dart'; 4 | import 'package:equatable/equatable.dart'; 5 | import 'package:flutter_bloc/flutter_bloc.dart'; 6 | 7 | part 'image_state.dart'; 8 | 9 | class ImageCubit extends Cubit { 10 | ImageCubit() : super(ImageInitial()); 11 | final AI _ai = AI(); 12 | 13 | Future generate(String query, AIStyle style, Resolution resolution) async { 14 | emit(ImageLoading()); 15 | try { 16 | Uint8List image = await _ai.runAI(query, style, resolution); 17 | emit(ImageLoaded(image: image)); 18 | } catch (_) { 19 | emit(const ImageError(error: 'There is error . Try Again Later')); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.2' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | tasks.register("clean", Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /lib/bloc/app_directory_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | 4 | import '../utils/app_directory.dart'; 5 | import '../utils/strings.dart'; 6 | 7 | part 'app_directory_state.dart'; 8 | 9 | class AppDirectoryCubit extends Cubit { 10 | AppDirectoryCubit(String path) : super(AppDirectoryInitial(path)) { 11 | loadPath(); 12 | } 13 | 14 | Future loadPath() async { 15 | final selectedPath = await PathSharedPreferences.getPath(); 16 | emit(AppDirectoryUpdated(selectedPath ?? pathHint)); 17 | } 18 | 19 | Future changePath(String value) async { 20 | await PathSharedPreferences.setPath(value); 21 | emit(AppDirectoryUpdated(value)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/l10n/app_ar.arb: -------------------------------------------------------------------------------- 1 | { 2 | "settingsPage": "الإعدادات", 3 | "changeLanguage": "تغيير اللغة", 4 | "noResultFound": "لا يوجد نتائج ", 5 | "themes": "السمات", 6 | "languages": "اللغات", 7 | "language": "العربية", 8 | "loading": "تحميل...", 9 | "download": "حفظ", 10 | "failed": "فشل", 11 | "appMode":"الوضع (Mode) ", 12 | "darkMode":"وضع الليل", 13 | "lightMode":"وضع الضوء", 14 | "systemMode":"وضع الجهاز", 15 | "putAnythingInYourMind":"اكتب اي شيء يخطر ببالك", 16 | "change":"تغيير", 17 | "mainDirectory":"المجلد الرئيسي", 18 | "imageWasSaved":"تم الحفظ بنجاح في ", 19 | "chooseStyle":"قم باختيار نمط للصورة", 20 | "chooseDirectory":"قم باختيار مجلد", 21 | "confirmDirectory":"هل تريد اختيار مجلد لتسمح للتطبيق بحفظ الصور في الجهاز ؟", 22 | "yes": "نعم", 23 | "no": "لا" 24 | } -------------------------------------------------------------------------------- /windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | void RegisterPlugins(flutter::PluginRegistry* registry) { 14 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 15 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 16 | SentryFlutterPluginRegisterWithRegistrar( 17 | registry->GetRegistrarForPlugin("SentryFlutterPlugin")); 18 | UrlLauncherWindowsRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 20 | } 21 | -------------------------------------------------------------------------------- /lib/l10n/app_hi.arb: -------------------------------------------------------------------------------- 1 | { 2 | "settingsPage": "सेटिंग्स", 3 | "changeLanguage": "चेंज लैंग्वेज", 4 | "noResultFound": "नो रिजल्ट्स फाउंड", 5 | "themes": "थीम्स", 6 | "languages": "लैंग्वेजेज", 7 | "language": "हिंदी", 8 | "loading": "लोडिंग...", 9 | "download": "डाउनलोड", 10 | "failed": "फेल्ड", 11 | "appMode":"मोड ", 12 | "darkMode":"डार्क मोड", 13 | "lightMode":"लाइट मोड", 14 | "systemMode":"सिस्टम मोड", 15 | "putAnythingInYourMind":"अपने मन की बात लिखें", 16 | "change":"चेंज", 17 | "mainDirectory":"मैन डायरेक्टरी", 18 | "imageWasSaved":"इमेज सेव हो गई", 19 | "chooseStyle":"इमेज के लिए स्टाइल चुनें", 20 | "chooseDirectory":"डायरेक्टरी चुनें", 21 | "confirmDirectory":"क्या आपको डायरेक्टरी चुनना है इमेज को डिवाइस में सेव करने के लिए?", 22 | "yes": "हाँ", 23 | "no": "नहीं" 24 | } -------------------------------------------------------------------------------- /lib/utils/strings.dart: -------------------------------------------------------------------------------- 1 | import '../widgets/app_theme.dart'; 2 | 3 | final appThemes = { 4 | material: 'Material', 5 | materialHighContrast: 'Material High Contrast', 6 | espressoAndCream: 'Espresso and Cream', 7 | indigoTheme: 'Indigo Nights', 8 | blueWhaleTheme: 'Blue Whale', 9 | goldSunset: 'Gold Sunset', 10 | dellGenoaGreen: 'Dell Genoe Green', 11 | greyLaw: 'Grey Law', 12 | camaroneGreen: 'Camarone Green', 13 | rustDeepOrange: 'Rust Deep Orange', 14 | }; 15 | 16 | const String system = 'system'; 17 | const String light = 'light'; 18 | const String dark = 'dark'; 19 | 20 | const String pathHint = 'Click to choose folder'; 21 | const String app = 'TexFusion'; 22 | 23 | const String englishLanguage = 'en'; 24 | const String hindiLanguage = 'hi'; 25 | const String arabicLanguage = 'ar'; 26 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void fl_register_plugins(FlPluginRegistry* registry) { 13 | g_autoptr(FlPluginRegistrar) sentry_flutter_registrar = 14 | fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin"); 15 | sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar); 16 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 17 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 18 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 19 | } 20 | -------------------------------------------------------------------------------- /lib/bloc/app_language_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | 3 | import 'package:equatable/equatable.dart'; 4 | import 'package:flutter_bloc/flutter_bloc.dart'; 5 | import 'package:text_to_image_gen/utils/app_language.dart'; 6 | 7 | part 'app_language_state.dart'; 8 | 9 | class AppLanguageCubit extends Cubit { 10 | AppLanguageCubit(Locale locale) : super(AppLanguageInitial(locale)) { 11 | loadLanguage(); 12 | } 13 | 14 | Future loadLanguage() async { 15 | final selectedLanguage = await LanguageSharedPreferences.getLocale(); 16 | emit(AppLanguageUpdate(selectedLanguage)); 17 | } 18 | 19 | Future changeLanguage(String value) async { 20 | await LanguageSharedPreferences.setLocale(value).then((locale) { 21 | emit(AppLanguageUpdate(locale)); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/l10n/app_en.arb: -------------------------------------------------------------------------------- 1 | { 2 | "settingsPage": "Settings", 3 | "changeLanguage": "Change Language", 4 | "noResultFound": "No Results Found", 5 | "themes": "Themes", 6 | "languages": "Languages", 7 | "language": "English", 8 | "loading": "Please Wait...", 9 | "download": "Download", 10 | "failed": "Failed", 11 | "appMode":"Mode ", 12 | "darkMode":"Dark Mode", 13 | "lightMode":"Light Mode", 14 | "systemMode":"System Mode", 15 | "putAnythingInYourMind":"Put Anything in Your Mind", 16 | "change":"Change", 17 | "mainDirectory":"Main Directory", 18 | "imageWasSaved":"Image was Saved Successfully in", 19 | "chooseStyle":"Choose style for the image", 20 | "chooseDirectory":"Choose Directory", 21 | "confirmDirectory":"Do you want to Choose Directory to make the app can save images in your Device?", 22 | "yes": "Yes", 23 | "no": "No" 24 | } -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import device_info_plus 9 | import package_info_plus 10 | import sentry_flutter 11 | import shared_preferences_foundation 12 | import url_launcher_macos 13 | 14 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 15 | DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) 16 | FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) 17 | SentryFlutterPlugin.register(with: registry.registrar(forPlugin: "SentryFlutterPlugin")) 18 | SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) 19 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 20 | } 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 11.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | sentry_flutter 7 | url_launcher_linux 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /lib/utils/app_theme_mode.dart: -------------------------------------------------------------------------------- 1 | import 'package:shared_preferences/shared_preferences.dart'; 2 | 3 | class ThemeSharedPreferences { 4 | static const String _keyTheme = 'theme'; 5 | static const String _keyMode = 'mode'; 6 | 7 | static Future setThemeName(String theme) async { 8 | final prefs = await SharedPreferences.getInstance(); 9 | await prefs.setString(_keyTheme, theme); 10 | } 11 | 12 | static Future getThemeName() async { 13 | final prefs = await SharedPreferences.getInstance(); 14 | return prefs.getString(_keyTheme); 15 | } 16 | 17 | static Future setModeName(String mode) async { 18 | final prefs = await SharedPreferences.getInstance(); 19 | await prefs.setString(_keyMode, mode.toLowerCase()); 20 | } 21 | 22 | static Future getModeName() async { 23 | final prefs = await SharedPreferences.getInstance(); 24 | return prefs.getString(_keyMode); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | permission_handler_windows 7 | sentry_flutter 8 | url_launcher_windows 9 | ) 10 | 11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 12 | ) 13 | 14 | set(PLUGIN_BUNDLED_LIBRARIES) 15 | 16 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 21 | endforeach(plugin) 22 | 23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 26 | endforeach(ffi_plugin) 27 | -------------------------------------------------------------------------------- /windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /flutter_launcher_icons.yaml: -------------------------------------------------------------------------------- 1 | flutter_icons: 2 | #image_path: "assets/icons/movie.png" 3 | image_path_android: "assets/images/TexFusion.png" 4 | image_path_ios: "assets/images/TexFusion.png" 5 | android: true # can specify file name here e.g. "ic_launcher" 6 | ios: true # can specify file name here e.g. "My-Launcher-Icon" 7 | #adaptive_icon_background: "assets/images/christmas-background.png" # only available for Android 8.0 devices and above 8 | #adaptive_icon_foreground: "assets/images/icon-foreground-432x432.png" # only available for Android 8.0 devices and above 9 | #min_sdk_android: 21 # android min sdk min:16, default 21 10 | remove_alpha_ios: true 11 | web: 12 | generate: true 13 | image_path: "assets/images/TexFusion.png" 14 | background_color: "#ffffff" 15 | theme_color: "#ffffff" 16 | windows: 17 | generate: true 18 | image_path: "assets/images/TexFusion.png" 19 | icon_size: 48 # min:48, max:256, default: 48 20 | macos: 21 | generate: true 22 | image_path: "assets/images/TexFusion.png" -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "text_to_image_gen", 3 | "short_name": "text_to_image_gen", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#ffffff", 7 | "theme_color": "#ffffff", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /lib/bloc/app_theme_cubit.dart: -------------------------------------------------------------------------------- 1 | import 'package:equatable/equatable.dart'; 2 | import 'package:flutter_bloc/flutter_bloc.dart'; 3 | 4 | import '../utils/app_theme_mode.dart'; 5 | import '../utils/strings.dart'; 6 | import '../widgets/app_theme.dart'; 7 | 8 | part 'app_theme_state.dart'; 9 | 10 | class AppThemeCubit extends Cubit { 11 | AppThemeCubit(AppTheme initialTheme) : super(AppThemeInitial(initialTheme)) { 12 | loadTheme(); 13 | } 14 | Future loadTheme() async { 15 | final String? themeName = await ThemeSharedPreferences.getThemeName(); 16 | final AppTheme theme = themeName != null 17 | ? appThemes.keys.firstWhere( 18 | (theme) => theme.name.toLowerCase() == themeName.toLowerCase(), 19 | orElse: () => appThemes.keys.first, 20 | ) 21 | : appThemes.keys.first; 22 | emit(AppThemeUpdate(theme)); 23 | } 24 | 25 | Future updateTheme(AppTheme newTheme) async { 26 | await ThemeSharedPreferences.setThemeName(appThemes[newTheme]!); 27 | emit(AppThemeUpdate(newTheme)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /web/splash/style.css: -------------------------------------------------------------------------------- 1 | html { 2 | height: 100% 3 | } 4 | 5 | body { 6 | margin: 0; 7 | min-height: 100%; 8 | background-color: #ffffff; 9 | background-size: 100% 100%; 10 | } 11 | 12 | .center { 13 | margin: 0; 14 | position: absolute; 15 | top: 50%; 16 | left: 50%; 17 | -ms-transform: translate(-50%, -50%); 18 | transform: translate(-50%, -50%); 19 | } 20 | 21 | .contain { 22 | display:block; 23 | width:100%; height:100%; 24 | object-fit: contain; 25 | } 26 | 27 | .stretch { 28 | display:block; 29 | width:100%; height:100%; 30 | } 31 | 32 | .cover { 33 | display:block; 34 | width:100%; height:100%; 35 | object-fit: cover; 36 | } 37 | 38 | .bottom { 39 | position: absolute; 40 | bottom: 0; 41 | left: 50%; 42 | -ms-transform: translate(-50%, 0); 43 | transform: translate(-50%, 0); 44 | } 45 | 46 | .bottomLeft { 47 | position: absolute; 48 | bottom: 0; 49 | left: 0; 50 | } 51 | 52 | .bottomRight { 53 | position: absolute; 54 | bottom: 0; 55 | right: 0; 56 | } 57 | 58 | @media (prefers-color-scheme: dark) { 59 | body { 60 | background-color: #000000; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Vikramaditya 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility in the flutter_test package. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:text_to_image_gen/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(const MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "LaunchImage.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "appearances" : [ 10 | { 11 | "appearance" : "luminosity", 12 | "value" : "dark" 13 | } 14 | ], 15 | "filename" : "LaunchImageDark.png", 16 | "idiom" : "universal", 17 | "scale" : "1x" 18 | }, 19 | { 20 | "filename" : "LaunchImage@2x.png", 21 | "idiom" : "universal", 22 | "scale" : "2x" 23 | }, 24 | { 25 | "appearances" : [ 26 | { 27 | "appearance" : "luminosity", 28 | "value" : "dark" 29 | } 30 | ], 31 | "filename" : "LaunchImageDark@2x.png", 32 | "idiom" : "universal", 33 | "scale" : "2x" 34 | }, 35 | { 36 | "filename" : "LaunchImage@3x.png", 37 | "idiom" : "universal", 38 | "scale" : "3x" 39 | }, 40 | { 41 | "appearances" : [ 42 | { 43 | "appearance" : "luminosity", 44 | "value" : "dark" 45 | } 46 | ], 47 | "filename" : "LaunchImageDark@3x.png", 48 | "idiom" : "universal", 49 | "scale" : "3x" 50 | } 51 | ], 52 | "info" : { 53 | "author" : "xcode", 54 | "version" : 1 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /lib/utils/app_language.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:shared_preferences/shared_preferences.dart'; 3 | import 'package:flutter_gen/gen_l10n/app_localizations.dart'; 4 | 5 | import 'strings.dart'; 6 | 7 | class LanguageSharedPreferences { 8 | static const String appLanguageCode = 'languageCode'; 9 | 10 | static Locale _locale(String languageCode) { 11 | switch (languageCode) { 12 | case englishLanguage: 13 | return const Locale(englishLanguage, 'US'); 14 | case hindiLanguage: 15 | return const Locale(hindiLanguage, 'IN'); 16 | case arabicLanguage: 17 | return const Locale(arabicLanguage, 'DZ'); 18 | default: 19 | return const Locale(englishLanguage, 'US'); 20 | } 21 | } 22 | 23 | static Future setLocale(String languageCode) async { 24 | SharedPreferences prefs = await SharedPreferences.getInstance(); 25 | await prefs.setString(appLanguageCode, languageCode); 26 | return _locale(languageCode); 27 | } 28 | 29 | static Future getLocale() async { 30 | SharedPreferences prefs = await SharedPreferences.getInstance(); 31 | String languageCode = prefs.getString(appLanguageCode) ?? englishLanguage; 32 | return _locale(languageCode); 33 | } 34 | } 35 | 36 | AppLocalizations translation(BuildContext context) { 37 | return AppLocalizations.of(context); 38 | } 39 | -------------------------------------------------------------------------------- /windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"text_to_image_gen", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: text_to_image_gen 2 | description: A new Flutter project. 3 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev 4 | 5 | 6 | version: 1.0.7+1 7 | 8 | environment: 9 | sdk: '>=2.19.6 <3.0.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | brain_fusion: ^0.1.1 16 | lottie: ^2.3.2 17 | url_launcher: ^6.1.10 18 | sentry_flutter: ^7.5.1 19 | iconsax: ^0.0.8 20 | shared_preferences: ^2.1.0 21 | flex_color_scheme: ^7.0.5 22 | flutter_bloc: ^8.1.2 23 | equatable: ^2.0.5 24 | file_picker: ^5.2.11 25 | path: ^1.8.2 26 | permission_handler: ^10.2.0 27 | device_info_plus: ^8.2.2 28 | flutter_native_splash: ^2.2.19 29 | flutter_launcher_icons: ^0.13.1 30 | flutter_localizations: 31 | sdk: flutter 32 | intl: ^0.18.0 33 | onesignal_flutter: ^3.5.1 34 | 35 | dev_dependencies: 36 | flutter_test: 37 | sdk: flutter 38 | flutter_lints: ^2.0.1 39 | 40 | flutter: 41 | generate: true 42 | uses-material-design: true 43 | 44 | # To add assets to your application, add an assets section, like this: 45 | assets: 46 | - assets/animations/ 47 | - assets/images/ 48 | # - images/a_dot_ham.jpeg 49 | 50 | fonts: 51 | - family: Aesthetic 52 | fonts: 53 | - asset: assets/fonts/Aesthetic-Regular.ttf 54 | - family: Nexa 55 | fonts: 56 | - asset: assets/fonts/Nexa-Heavy.ttf 57 | - family: NexaLight 58 | fonts: 59 | - asset: assets/fonts/Nexa-ExtraLight.ttf 60 | - family: Cairo 61 | fonts: 62 | - asset: assets/fonts/Cairo-Regular.ttf 63 | style: normal 64 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 17 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 18 | - platform: android 19 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 20 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 21 | - platform: ios 22 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 23 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 24 | - platform: linux 25 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 26 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 27 | - platform: macos 28 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 29 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 30 | - platform: web 31 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 32 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 33 | - platform: windows 34 | create_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 35 | base_revision: 4d9e56e694b656610ab87fcf2efbcd226e0ed8cf 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "version": 1, 4 | "author": "xcode" 5 | }, 6 | "images": [ 7 | { 8 | "size": "16x16", 9 | "idiom": "mac", 10 | "filename": "app_icon_16.png", 11 | "scale": "1x" 12 | }, 13 | { 14 | "size": "16x16", 15 | "idiom": "mac", 16 | "filename": "app_icon_32.png", 17 | "scale": "2x" 18 | }, 19 | { 20 | "size": "32x32", 21 | "idiom": "mac", 22 | "filename": "app_icon_32.png", 23 | "scale": "1x" 24 | }, 25 | { 26 | "size": "32x32", 27 | "idiom": "mac", 28 | "filename": "app_icon_64.png", 29 | "scale": "2x" 30 | }, 31 | { 32 | "size": "128x128", 33 | "idiom": "mac", 34 | "filename": "app_icon_128.png", 35 | "scale": "1x" 36 | }, 37 | { 38 | "size": "128x128", 39 | "idiom": "mac", 40 | "filename": "app_icon_256.png", 41 | "scale": "2x" 42 | }, 43 | { 44 | "size": "256x256", 45 | "idiom": "mac", 46 | "filename": "app_icon_256.png", 47 | "scale": "1x" 48 | }, 49 | { 50 | "size": "256x256", 51 | "idiom": "mac", 52 | "filename": "app_icon_512.png", 53 | "scale": "2x" 54 | }, 55 | { 56 | "size": "512x512", 57 | "idiom": "mac", 58 | "filename": "app_icon_512.png", 59 | "scale": "1x" 60 | }, 61 | { 62 | "size": "512x512", 63 | "idiom": "mac", 64 | "filename": "app_icon_1024.png", 65 | "scale": "2x" 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleDisplayName 8 | Text To Image Gen 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | text_to_image_gen 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | CADisableMinimumFrameDurationOnPhone 47 | 48 | UIApplicationSupportsIndirectInputEvents 49 | 50 | UIStatusBarHidden 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | return true; 35 | } 36 | 37 | void FlutterWindow::OnDestroy() { 38 | if (flutter_controller_) { 39 | flutter_controller_ = nullptr; 40 | } 41 | 42 | Win32Window::OnDestroy(); 43 | } 44 | 45 | LRESULT 46 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 47 | WPARAM const wparam, 48 | LPARAM const lparam) noexcept { 49 | // Give Flutter, including plugins, an opportunity to handle window messages. 50 | if (flutter_controller_) { 51 | std::optional result = 52 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 53 | lparam); 54 | if (result) { 55 | return *result; 56 | } 57 | } 58 | 59 | switch (message) { 60 | case WM_FONTCHANGE: 61 | flutter_controller_->engine()->ReloadSystemFonts(); 62 | break; 63 | } 64 | 65 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 66 | } 67 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 33 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | defaultConfig { 38 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 39 | applicationId "com.example.text_to_image_gen" 40 | // You can update the following values to match your application needs. 41 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 42 | minSdkVersion 21 43 | targetSdkVersion 33 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | shrinkResources false 54 | minifyEnabled false 55 | } 56 | } 57 | } 58 | 59 | flutter { 60 | source '../..' 61 | } 62 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 15 | 24 | 28 | 32 | 33 | 34 | 35 | 36 | 37 | 39 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | text_to_image_gen 31 | 32 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example" "\0" 93 | VALUE "FileDescription", "text_to_image_gen" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "text_to_image_gen" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 com.example. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "text_to_image_gen.exe" "\0" 98 | VALUE "ProductName", "text_to_image_gen" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:ui'; 2 | import 'dart:io' show Platform; 3 | 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | import 'package:flutter_bloc/flutter_bloc.dart'; 7 | import 'package:flutter_native_splash/flutter_native_splash.dart'; 8 | import 'package:sentry_flutter/sentry_flutter.dart'; 9 | import 'package:text_to_image_gen/bloc/app_language_cubit.dart'; 10 | import 'package:text_to_image_gen/utils/strings.dart'; 11 | import 'package:text_to_image_gen/widgets/app_theme.dart'; 12 | import 'package:flutter_gen/gen_l10n/app_localizations.dart'; 13 | 14 | import 'Pages/home_page.dart'; 15 | import 'Pages/settings_page.dart'; 16 | import 'bloc/app_directory_cubit.dart'; 17 | import 'bloc/app_mode_cubit.dart'; 18 | import 'bloc/app_theme_cubit.dart'; 19 | 20 | Future main() async { 21 | WidgetsFlutterBinding.ensureInitialized(); 22 | if (Platform.isAndroid) { 23 | await Future.delayed(const Duration(milliseconds: 1200)).then( 24 | (value) => FlutterNativeSplash.remove(), 25 | ); 26 | } 27 | await SentryFlutter.init( 28 | (options) => options.dsn = 29 | 'https://725035c013bd4e7495b4fc7e472f6c5f@o4505074740953088.ingest.sentry.io/4505074742132736', 30 | appRunner: () => runApp(const MyApp()), 31 | ); 32 | } 33 | 34 | class MyApp extends StatelessWidget { 35 | const MyApp({Key? key}) : super(key: key); 36 | 37 | @override 38 | Widget build(BuildContext context) { 39 | return MultiBlocProvider( 40 | providers: [ 41 | BlocProvider( 42 | create: (_) => AppLanguageCubit(const Locale(englishLanguage, 'US')) 43 | ..loadLanguage(), 44 | ), 45 | BlocProvider( 46 | create: (_) => AppThemeCubit(material)..loadTheme(), 47 | ), 48 | BlocProvider( 49 | create: (_) => AppModeCubit(system)..loadMode(), 50 | ), 51 | BlocProvider( 52 | create: (_) => AppDirectoryCubit(pathHint)..loadPath(), 53 | ), 54 | ], 55 | child: BlocBuilder( 56 | builder: (context, appTheme) { 57 | return BlocBuilder( 58 | builder: (context, appMode) { 59 | return BlocBuilder( 60 | builder: (context, language) { 61 | return Shortcuts( 62 | shortcuts: { 63 | LogicalKeySet(LogicalKeyboardKey.select): 64 | const ActivateIntent(), 65 | }, 66 | child: MaterialApp( 67 | localizationsDelegates: 68 | AppLocalizations.localizationsDelegates, 69 | supportedLocales: AppLocalizations.supportedLocales, 70 | locale: language.locale, 71 | scrollBehavior: CustomScroll(), 72 | initialRoute: '/', 73 | routes: { 74 | '/': (_) => const HomePage(), 75 | '/Settings': (_) => const SettingsPage(), 76 | }, 77 | debugShowCheckedModeBanner: false, 78 | themeMode: getMode(appMode.mode), 79 | theme: appTheme.theme.lightTheme, 80 | darkTheme: appTheme.theme.darkTheme, 81 | ), 82 | ); 83 | }, 84 | ); 85 | }, 86 | ); 87 | }, 88 | ), 89 | ); 90 | } 91 | } 92 | 93 | class CustomScroll extends MaterialScrollBehavior { 94 | @override 95 | Set get dragDevices => { 96 | PointerDeviceKind.touch, 97 | PointerDeviceKind.mouse, 98 | PointerDeviceKind.trackpad, 99 | }; 100 | } 101 | -------------------------------------------------------------------------------- /windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates a win32 window with |title| that is positioned and sized using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size this function will scale the inputted width and height as 35 | // as appropriate for the default monitor. The window is invisible until 36 | // |Show| is called. Returns true if the window was created successfully. 37 | bool Create(const std::wstring& title, const Point& origin, const Size& size); 38 | 39 | // Show the current window. Returns true if the window was successfully shown. 40 | bool Show(); 41 | 42 | // Release OS resources associated with window. 43 | void Destroy(); 44 | 45 | // Inserts |content| into the window tree. 46 | void SetChildContent(HWND content); 47 | 48 | // Returns the backing Window handle to enable clients to set icon and other 49 | // window properties. Returns nullptr if the window has been destroyed. 50 | HWND GetHandle(); 51 | 52 | // If true, closing this window will quit the application. 53 | void SetQuitOnClose(bool quit_on_close); 54 | 55 | // Return a RECT representing the bounds of the current client area. 56 | RECT GetClientArea(); 57 | 58 | protected: 59 | // Processes and route salient window messages for mouse handling, 60 | // size change and DPI. Delegates handling of these to member overloads that 61 | // inheriting classes can handle. 62 | virtual LRESULT MessageHandler(HWND window, 63 | UINT const message, 64 | WPARAM const wparam, 65 | LPARAM const lparam) noexcept; 66 | 67 | // Called when CreateAndShow is called, allowing subclass window-related 68 | // setup. Subclasses should return false if setup fails. 69 | virtual bool OnCreate(); 70 | 71 | // Called when Destroy is called. 72 | virtual void OnDestroy(); 73 | 74 | private: 75 | friend class WindowClassRegistrar; 76 | 77 | // OS callback called by message pump. Handles the WM_NCCREATE message which 78 | // is passed when the non-client area is being created and enables automatic 79 | // non-client DPI scaling so that the non-client area automatically 80 | // responsponds to changes in DPI. All other messages are handled by 81 | // MessageHandler. 82 | static LRESULT CALLBACK WndProc(HWND const window, 83 | UINT const message, 84 | WPARAM const wparam, 85 | LPARAM const lparam) noexcept; 86 | 87 | // Retrieves a class instance pointer for |window| 88 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 89 | 90 | // Update the window frame's theme to match the system theme. 91 | static void UpdateTheme(HWND const window); 92 | 93 | bool quit_on_close_ = false; 94 | 95 | // window handle for top level window. 96 | HWND window_handle_ = nullptr; 97 | 98 | // window handle for hosted content. 99 | HWND child_content_ = nullptr; 100 | }; 101 | 102 | #endif // RUNNER_WIN32_WINDOW_H_ 103 | -------------------------------------------------------------------------------- /windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "text_to_image_gen"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "text_to_image_gen"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(text_to_image_gen LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "text_to_image_gen") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Text To Image Generator 2 | 3 | TexFusion AI app created by flutter framework and it is a new AI art generation tool that can create amazing images from just text prompt. TexFusion AI can also make variations of your existing image. It uses brain fusion api to get 3d render images. 4 | 5 |
6 |

7 | 8 |

9 | 10 | ## Features 11 | - Generate Images from Text 12 | - High Quality images 13 | - Unlimited Response 14 | - Added 12 Styles including 3D render. 15 | - Download Image 16 | - Resolution ratio 16:9 17 | - Different Theme And Modes 18 | - Multi Languages 19 | - Custom Font 20 | - Lightweight & user-friendly 21 | 22 | ## How it work ! 23 | - Make sure you enter more descriptive prompt. As this is kind of new api, it produces HD image with less descriptive prompt. So, make sure you describe the image correctly that you want as output. 24 | - The prompt in English only 25 | 26 | Fork the repo 🔥 and don't forget to star the repo 🌟 27 | 28 | ## Screenshots 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Home Screen View In DesktopHome Screen View In MobileSettings Page
Responsive UIDark Mode in MobileSave option
Dark Mode in DesktopDifferent StyleArabic Language
Cross PlatformDifferent Theme
69 | 70 | ## Contributing 71 | Whether you have ideas, design changes, code cleaning, or really heavy code changes, help is always welcome. The more it is done, the better it gets! So feel free to create an issue and make a pull request. 72 | 73 | ## Contributors ✨ 74 | 75 | 76 | 77 | 78 | ## License 79 | ``` 80 | MIT License 81 | 82 | Copyright (c) [2023] [Vikramaditya] 83 | 84 | Permission is hereby granted, free of charge, to any person obtaining a copy 85 | of this software and associated documentation files (the "Software"), to deal 86 | in the Software without restriction, including without limitation the rights 87 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 88 | copies of the Software, and to permit persons to whom the Software is 89 | furnished to do so, subject to the following conditions: 90 | 91 | The above copyright notice and this permission notice shall be included in all 92 | copies or substantial portions of the Software. 93 | 94 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 95 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 96 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 97 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 98 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 99 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 100 | SOFTWARE. 101 | ``` 102 | -------------------------------------------------------------------------------- /linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "text_to_image_gen") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.example.text_to_image_gen") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /lib/widgets/custom_drawer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:iconsax/iconsax.dart'; 3 | import 'package:url_launcher/url_launcher.dart'; 4 | 5 | import '../Pages/about_page.dart'; 6 | 7 | class CustomDrawer extends StatelessWidget { 8 | const CustomDrawer({Key? key}) : super(key: key); 9 | 10 | @override 11 | Widget build(BuildContext context) { 12 | return Drawer( 13 | child: Column( 14 | children: [ 15 | DrawerHeader( 16 | child: Center( 17 | child: Image.asset('assets/images/Ai.webp'), 18 | ), 19 | ), 20 | ListTile( 21 | leading: const Icon(Iconsax.hierarchy_2), 22 | title: Text( 23 | "Source code", 24 | style: TextStyle( 25 | fontSize: 16, 26 | color: Theme.of(context).colorScheme.secondary, 27 | fontFamily: 'Nexa'), 28 | ), 29 | subtitle: Text( 30 | "Github link", 31 | style: TextStyle( 32 | color: Theme.of(context).colorScheme.secondary, 33 | fontWeight: FontWeight.bold, 34 | fontFamily: 'NexaLight', 35 | ), 36 | ), 37 | onTap: () async { 38 | final Uri url = Uri.parse( 39 | 'https://github.com/VikramadityaDev/text_to_image_gen/'); 40 | if (!await launchUrl(url, mode: LaunchMode.externalApplication)) { 41 | throw Exception('Could not launch $url'); 42 | } 43 | }, 44 | ), 45 | ListTile( 46 | leading: const Icon(Iconsax.refresh_circle), 47 | title: Text( 48 | "Check for update", 49 | style: TextStyle( 50 | fontSize: 16, 51 | color: Theme.of(context).colorScheme.secondary, 52 | fontFamily: 'Nexa'), 53 | ), 54 | subtitle: Text( 55 | "Check releases", 56 | style: TextStyle( 57 | color: Theme.of(context).colorScheme.secondary, 58 | fontWeight: FontWeight.bold, 59 | fontFamily: 'NexaLight', 60 | ), 61 | ), 62 | onTap: () async { 63 | final Uri url = Uri.parse( 64 | 'https://github.com/VikramadityaDev/text_to_image_gen/releases/'); 65 | if (!await launchUrl(url, mode: LaunchMode.externalApplication)) { 66 | throw Exception('Could not launch $url'); 67 | } 68 | }, 69 | ), 70 | ListTile( 71 | leading: const Icon( 72 | Iconsax.sms_tracking, 73 | ), 74 | title: Text( 75 | "Join us on telegram", 76 | style: TextStyle( 77 | fontSize: 16, 78 | color: Theme.of(context).colorScheme.secondary, 79 | fontFamily: 'Nexa'), 80 | ), 81 | subtitle: Text( 82 | "For more new apps", 83 | style: TextStyle( 84 | color: Theme.of(context).colorScheme.secondary, 85 | fontWeight: FontWeight.bold, 86 | fontFamily: 'NexaLight', 87 | ), 88 | ), 89 | onTap: () async { 90 | final Uri url = 91 | Uri.parse('https://telegram.me/vikimediaofficial/'); 92 | if (!await launchUrl(url, mode: LaunchMode.externalApplication)) { 93 | throw Exception('Could not launch $url'); 94 | } 95 | }, 96 | ), 97 | ListTile( 98 | leading: const Icon(Iconsax.info_circle), 99 | title: Text( 100 | "About", 101 | style: TextStyle( 102 | fontSize: 16, 103 | color: Theme.of(context).colorScheme.secondary, 104 | fontFamily: 'Nexa'), 105 | ), 106 | subtitle: Text( 107 | "About this project", 108 | style: TextStyle( 109 | color: Theme.of(context).colorScheme.secondary, 110 | fontWeight: FontWeight.bold, 111 | fontFamily: 'NexaLight', 112 | ), 113 | ), 114 | onTap: () { 115 | Navigator.push( 116 | context, 117 | MaterialPageRoute( 118 | builder: (context) => const AboutPage(), 119 | ), 120 | ); 121 | }, 122 | ), 123 | ListTile( 124 | leading: const Icon( 125 | Iconsax.verify, 126 | ), 127 | title: Text( 128 | " & Crafted with 💛", 129 | style: TextStyle( 130 | fontSize: 16, 131 | color: Theme.of(context).colorScheme.secondary, 132 | fontFamily: 'Nexa'), 133 | ), 134 | subtitle: Text( 135 | "VikramadityaDev & DJ-Yacine", 136 | style: TextStyle( 137 | color: Theme.of(context).colorScheme.secondary, 138 | fontWeight: FontWeight.bold, 139 | fontFamily: 'NexaLight', 140 | ), 141 | ), 142 | ), 143 | Expanded( 144 | child: Padding( 145 | padding: const EdgeInsets.all(10), 146 | child: Align( 147 | alignment: Alignment.bottomCenter, 148 | child: Text( 149 | "v1.0.7", 150 | style: TextStyle( 151 | fontSize: 16, 152 | color: Theme.of(context).colorScheme.secondary, 153 | fontFamily: 'Nexa'), 154 | ), 155 | ), 156 | ), 157 | ), 158 | ], 159 | ), 160 | ); 161 | } 162 | } 163 | -------------------------------------------------------------------------------- /flutter_native_splash.yaml: -------------------------------------------------------------------------------- 1 | flutter_native_splash: 2 | # This package generates native code to customize Flutter's default white native splash screen 3 | # with background color and splash image. 4 | # Customize the parameters below, and run the following command in the terminal: 5 | # flutter pub run flutter_native_splash:create 6 | # To restore Flutter's default white splash screen, run the following command in the terminal: 7 | # flutter pub run flutter_native_splash:remove 8 | 9 | # color or background_image is the only required parameter. Use color to set the background 10 | # of your splash screen to a solid color. Use background_image to set the background of your 11 | # splash screen to a png image. This is useful for gradients. The image will be stretch to the 12 | # size of the app. Only one parameter can be used, color and background_image cannot both be set. 13 | color: "#ffffff" 14 | #background_image: "assets/background.png" 15 | 16 | # Optional parameters are listed below. To enable a parameter, uncomment the line by removing 17 | # the leading # character. 18 | 19 | # The image parameter allows you to specify an image used in the splash screen. It must be a 20 | # png file and should be sized for 4x pixel density. 21 | image: assets/images/TexFusion.png 22 | 23 | # The branding property allows you to specify an image used as branding in the splash screen. 24 | # It must be a png file. It is supported for Android, iOS and the Web. For Android 12, 25 | # see the Android 12 section below. 26 | #branding: assets/dart.png 27 | 28 | # To position the branding image at the bottom of the screen you can use bottom, bottomRight, 29 | # and bottomLeft. The default values is bottom if not specified or specified something else. 30 | #branding_mode: bottom 31 | 32 | # The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background 33 | # and image when the device is in dark mode. If they are not specified, the app will use the 34 | # parameters from above. If the image_dark parameter is specified, color_dark or 35 | # background_image_dark must be specified. color_dark and background_image_dark cannot both be 36 | # set. 37 | color_dark: "#000000" 38 | #background_image_dark: "assets/dark-background.png" 39 | image_dark: assets/images/TexFusion.png 40 | #branding_dark: assets/dart_dark.png 41 | 42 | # Android 12 handles the splash screen differently than previous versions. Please visit 43 | # https://developer.android.com/guide/topics/ui/splash-screen 44 | # Following are Android 12 specific parameter. 45 | android_12: 46 | # The image parameter sets the splash screen icon image. If this parameter is not specified, 47 | # the app's launcher icon will be used instead. 48 | # Please note that the splash screen will be clipped to a circle on the center of the screen. 49 | # App icon with an icon background: This should be 960×960 pixels, and fit within a circle 50 | # 640 pixels in diameter. 51 | # App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle 52 | # 768 pixels in diameter. 53 | #image: assets/icons/movie-960x960.png 54 | 55 | # Splash screen background color. 56 | #color: "#000000" 57 | 58 | # App icon background color. 59 | #icon_background_color: "#000000" 60 | 61 | # The branding property allows you to specify an image used as branding in the splash screen. 62 | #branding: assets/dart.png 63 | 64 | # The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that 65 | # apply when the device is in dark mode. If they are not specified, the app will use the 66 | # parameters from above. 67 | #image_dark: assets/icons/movie-960x960.png 68 | #color_dark: "#000000" 69 | #icon_background_color_dark: "#000000" 70 | 71 | # The android, ios and web parameters can be used to disable generating a splash screen on a given 72 | # platform. 73 | #android: true 74 | #ios: true 75 | #web: true 76 | 77 | # Platform specific images can be specified with the following parameters, which will override 78 | # the respective parameter. You may specify all, selected, or none of these parameters: 79 | #color_android: "#42a5f5" 80 | #color_dark_android: "#042a49" 81 | #color_ios: "#42a5f5" 82 | #color_dark_ios: "#042a49" 83 | #color_web: "#42a5f5" 84 | #color_dark_web: "#042a49" 85 | #image_android: assets/splash-android.png 86 | #image_dark_android: assets/splash-invert-android.png 87 | #image_ios: assets/splash-ios.png 88 | #image_dark_ios: assets/splash-invert-ios.png 89 | #image_web: assets/splash-web.png 90 | #image_dark_web: assets/splash-invert-web.png 91 | #background_image_android: "assets/background-android.png" 92 | #background_image_dark_android: "assets/dark-background-android.png" 93 | #background_image_ios: "assets/background-ios.png" 94 | #background_image_dark_ios: "assets/dark-background-ios.png" 95 | #background_image_web: "assets/background-web.png" 96 | #background_image_dark_web: "assets/dark-background-web.png" 97 | #branding_android: assets/brand-android.png 98 | #branding_dark_android: assets/dart_dark-android.png 99 | #branding_ios: assets/brand-ios.png 100 | #branding_dark_ios: assets/dart_dark-ios.png 101 | 102 | # The position of the splash image can be set with android_gravity, ios_content_mode, and 103 | # web_image_mode parameters. All default to center. 104 | # 105 | # android_gravity can be one of the following Android Gravity (see 106 | # https://developer.android.com/reference/android/view/Gravity): bottom, center, 107 | # center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal, 108 | # fill_vertical, left, right, start, or top. 109 | #android_gravity: center 110 | # 111 | # ios_content_mode can be one of the following iOS UIView.ContentMode (see 112 | # https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill, 113 | # scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight, 114 | # bottomLeft, or bottomRight. 115 | #ios_content_mode: center 116 | # 117 | # web_image_mode can be one of the following modes: center, contain, stretch, and cover. 118 | #web_image_mode: center 119 | 120 | # The screen orientation can be set in Android with the android_screen_orientation parameter. 121 | # Valid parameters can be found here: 122 | # https://developer.android.com/guide/topics/manifest/activity-element#screen 123 | #android_screen_orientation: sensorLandscape 124 | 125 | # To hide the notification bar, use the fullscreen parameter. Has no effect in web since web 126 | # has no notification bar. Defaults to false. 127 | # NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads. 128 | # To show the notification bar, add the following code to your Flutter app: 129 | # WidgetsFlutterBinding.ensureInitialized(); 130 | # SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]); 131 | fullscreen: true 132 | 133 | # If you have changed the name(s) of your info.plist file(s), you can specify the filename(s) 134 | # with the info_plist_files parameter. Remove only the # characters in the three lines below, 135 | # do not remove any spaces: 136 | #info_plist_files: 137 | # - 'ios/Runner/Info-Debug.plist' 138 | # - 'ios/Runner/Info-Release.plist' -------------------------------------------------------------------------------- /lib/Pages/about_page.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:url_launcher/url_launcher.dart'; 3 | 4 | class AboutPage extends StatelessWidget { 5 | const AboutPage({Key? key}) : super(key: key); 6 | 7 | @override 8 | Widget build(BuildContext context) { 9 | return Scaffold( 10 | appBar: AppBar( 11 | iconTheme: IconThemeData( 12 | color: Theme.of(context).colorScheme.secondary, 13 | ), 14 | backgroundColor: Colors.transparent, 15 | title: RichText( 16 | text: TextSpan( 17 | text: 'About ', 18 | style: TextStyle( 19 | color: Theme.of(context).colorScheme.primary, 20 | fontWeight: FontWeight.bold, 21 | fontSize: 18, 22 | fontFamily: 'Aesthetic', 23 | ), 24 | children: [ 25 | TextSpan( 26 | text: 'TexFusion', 27 | style: TextStyle( 28 | color: Theme.of(context).colorScheme.secondary, 29 | fontWeight: FontWeight.bold, 30 | fontSize: 18, 31 | fontFamily: 'Aesthetic', 32 | ), 33 | ), 34 | ]), 35 | ), 36 | elevation: 0, 37 | centerTitle: true, 38 | leading: IconButton( 39 | icon: const Icon(Icons.arrow_back_ios_new_outlined), 40 | onPressed: () => Navigator.of(context).pop(), 41 | ), 42 | ), 43 | body: SingleChildScrollView( 44 | physics: const BouncingScrollPhysics(), 45 | scrollDirection: Axis.vertical, 46 | child: Column( 47 | crossAxisAlignment: CrossAxisAlignment.center, 48 | children: [ 49 | Padding( 50 | padding: const EdgeInsets.all(8.0), 51 | child: Text( 52 | 'Description', 53 | style: TextStyle( 54 | fontSize: 18, 55 | fontFamily: 'Nexa', 56 | color: Theme.of(context).colorScheme.secondary), 57 | ), 58 | ), 59 | Padding( 60 | padding: const EdgeInsets.all(5.0), 61 | child: Text( 62 | 'The TexFusion AI app was created by the Flutter framework and is a new AI art generation tool that can create amazing images from just text prompts. TexFusion AI can also make variations of your existing image. It uses the brain_fusion API to get realistically rendered images.', 63 | style: TextStyle( 64 | fontSize: 15, 65 | fontFamily: 'NexaLight', 66 | fontWeight: FontWeight.bold, 67 | color: Theme.of(context).colorScheme.secondary), 68 | textAlign: TextAlign.center, 69 | ), 70 | ), 71 | const Divider(), 72 | Padding( 73 | padding: const EdgeInsets.all(8.0), 74 | child: Text( 75 | 'Features', 76 | style: TextStyle( 77 | fontSize: 18, 78 | fontFamily: 'Nexa', 79 | color: Theme.of(context).colorScheme.secondary), 80 | ), 81 | ), 82 | Padding( 83 | padding: const EdgeInsets.all(5.0), 84 | child: Text( 85 | '- Generate Images from Text \n - High Quality images. \n - Unlimited Response. \n - Added 12 Styles. \n - Download Image \n - Accent Color Mode. \n - Theme Mode. \n - Lightweight & User Friendly.', 86 | style: TextStyle( 87 | fontSize: 15, 88 | fontFamily: 'NexaLight', 89 | fontWeight: FontWeight.bold, 90 | color: Theme.of(context).colorScheme.secondary), 91 | textAlign: TextAlign.center, 92 | ), 93 | ), 94 | const Divider(), 95 | Padding( 96 | padding: const EdgeInsets.all(8.0), 97 | child: Text( 98 | 'How its work ?', 99 | style: TextStyle( 100 | fontSize: 18, 101 | fontFamily: 'Nexa', 102 | color: Theme.of(context).colorScheme.secondary), 103 | ), 104 | ), 105 | Padding( 106 | padding: const EdgeInsets.all(5.0), 107 | child: Text( 108 | "1. Make sure you enter a more descriptive prompt. As this is a new API, it is going to take time to produce HD images with a less descriptive prompt. So, make sure you describe the image correctly that you want as output. \n \n 2. Try to select styles while creating your image. Check different styles and see how the output image looks.", 109 | style: TextStyle( 110 | fontSize: 15, 111 | fontFamily: 'NexaLight', 112 | fontWeight: FontWeight.bold, 113 | color: Theme.of(context).colorScheme.secondary), 114 | textAlign: TextAlign.center, 115 | ), 116 | ), 117 | Padding( 118 | padding: const EdgeInsets.all(5.0), 119 | child: Text( 120 | "Fork the repository, and don't forget to star the repository 🌟", 121 | style: TextStyle( 122 | fontSize: 15, 123 | fontFamily: 'Nexa', 124 | color: Theme.of(context).colorScheme.secondary), 125 | textAlign: TextAlign.center, 126 | ), 127 | ), 128 | const Divider(), 129 | Padding( 130 | padding: const EdgeInsets.all(8.0), 131 | child: Text( 132 | 'Social Links', 133 | style: TextStyle( 134 | fontSize: 18, 135 | fontFamily: 'Nexa', 136 | color: Theme.of(context).colorScheme.secondary), 137 | ), 138 | ), 139 | Row( 140 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 141 | crossAxisAlignment: CrossAxisAlignment.center, 142 | children: [ 143 | ElevatedButton( 144 | onPressed: () async { 145 | final Uri url = 146 | Uri.parse('https://github.com/VikramadityaDev/'); 147 | if (!await launchUrl(url, 148 | mode: LaunchMode.externalApplication)) { 149 | throw Exception('Could not launch $url'); 150 | } 151 | }, 152 | child: const Text( 153 | 'Github', 154 | style: TextStyle(fontSize: 15, fontFamily: 'Nexa'), 155 | ), 156 | ), 157 | ElevatedButton( 158 | onPressed: () async { 159 | final Uri url = 160 | Uri.parse('https://telegram.me/Aditya@1190/'); 161 | if (!await launchUrl(url, 162 | mode: LaunchMode.externalApplication)) { 163 | throw Exception('Could not launch $url'); 164 | } 165 | }, 166 | child: const Text( 167 | 'Telegram', 168 | style: TextStyle(fontSize: 15, fontFamily: 'Nexa'), 169 | ), 170 | ), 171 | ], 172 | ), 173 | const SizedBox( 174 | height: 10, 175 | ), 176 | ], 177 | ), 178 | ), 179 | bottomNavigationBar: Padding( 180 | padding: const EdgeInsets.only(bottom: 7), 181 | child: Text( 182 | "Made By VikramadityaDev &️ DJ-Yacine", 183 | textAlign: TextAlign.center, 184 | style: TextStyle( 185 | fontSize: 11, 186 | fontWeight: FontWeight.bold, 187 | fontFamily: 'NexaLight', 188 | color: Theme.of(context).colorScheme.secondary, 189 | ), 190 | ), 191 | ), 192 | ); 193 | } 194 | } 195 | -------------------------------------------------------------------------------- /windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "resource.h" 7 | 8 | namespace { 9 | 10 | /// Window attribute that enables dark mode window decorations. 11 | /// 12 | /// Redefined in case the developer's machine has a Windows SDK older than 13 | /// version 10.0.22000.0. 14 | /// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute 15 | #ifndef DWMWA_USE_IMMERSIVE_DARK_MODE 16 | #define DWMWA_USE_IMMERSIVE_DARK_MODE 20 17 | #endif 18 | 19 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 20 | 21 | /// Registry key for app theme preference. 22 | /// 23 | /// A value of 0 indicates apps should use dark mode. A non-zero or missing 24 | /// value indicates apps should use light mode. 25 | constexpr const wchar_t kGetPreferredBrightnessRegKey[] = 26 | L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; 27 | constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; 28 | 29 | // The number of Win32Window objects that currently exist. 30 | static int g_active_window_count = 0; 31 | 32 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 33 | 34 | // Scale helper to convert logical scaler values to physical using passed in 35 | // scale factor 36 | int Scale(int source, double scale_factor) { 37 | return static_cast(source * scale_factor); 38 | } 39 | 40 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 41 | // This API is only needed for PerMonitor V1 awareness mode. 42 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 43 | HMODULE user32_module = LoadLibraryA("User32.dll"); 44 | if (!user32_module) { 45 | return; 46 | } 47 | auto enable_non_client_dpi_scaling = 48 | reinterpret_cast( 49 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 50 | if (enable_non_client_dpi_scaling != nullptr) { 51 | enable_non_client_dpi_scaling(hwnd); 52 | } 53 | FreeLibrary(user32_module); 54 | } 55 | 56 | } // namespace 57 | 58 | // Manages the Win32Window's window class registration. 59 | class WindowClassRegistrar { 60 | public: 61 | ~WindowClassRegistrar() = default; 62 | 63 | // Returns the singleton registar instance. 64 | static WindowClassRegistrar* GetInstance() { 65 | if (!instance_) { 66 | instance_ = new WindowClassRegistrar(); 67 | } 68 | return instance_; 69 | } 70 | 71 | // Returns the name of the window class, registering the class if it hasn't 72 | // previously been registered. 73 | const wchar_t* GetWindowClass(); 74 | 75 | // Unregisters the window class. Should only be called if there are no 76 | // instances of the window. 77 | void UnregisterWindowClass(); 78 | 79 | private: 80 | WindowClassRegistrar() = default; 81 | 82 | static WindowClassRegistrar* instance_; 83 | 84 | bool class_registered_ = false; 85 | }; 86 | 87 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 88 | 89 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 90 | if (!class_registered_) { 91 | WNDCLASS window_class{}; 92 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 93 | window_class.lpszClassName = kWindowClassName; 94 | window_class.style = CS_HREDRAW | CS_VREDRAW; 95 | window_class.cbClsExtra = 0; 96 | window_class.cbWndExtra = 0; 97 | window_class.hInstance = GetModuleHandle(nullptr); 98 | window_class.hIcon = 99 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 100 | window_class.hbrBackground = 0; 101 | window_class.lpszMenuName = nullptr; 102 | window_class.lpfnWndProc = Win32Window::WndProc; 103 | RegisterClass(&window_class); 104 | class_registered_ = true; 105 | } 106 | return kWindowClassName; 107 | } 108 | 109 | void WindowClassRegistrar::UnregisterWindowClass() { 110 | UnregisterClass(kWindowClassName, nullptr); 111 | class_registered_ = false; 112 | } 113 | 114 | Win32Window::Win32Window() { 115 | ++g_active_window_count; 116 | } 117 | 118 | Win32Window::~Win32Window() { 119 | --g_active_window_count; 120 | Destroy(); 121 | } 122 | 123 | bool Win32Window::Create(const std::wstring& title, 124 | const Point& origin, 125 | const Size& size) { 126 | Destroy(); 127 | 128 | const wchar_t* window_class = 129 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 130 | 131 | const POINT target_point = {static_cast(origin.x), 132 | static_cast(origin.y)}; 133 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 134 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 135 | double scale_factor = dpi / 96.0; 136 | 137 | HWND window = CreateWindow( 138 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW, 139 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 140 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 141 | nullptr, nullptr, GetModuleHandle(nullptr), this); 142 | 143 | if (!window) { 144 | return false; 145 | } 146 | 147 | UpdateTheme(window); 148 | 149 | return OnCreate(); 150 | } 151 | 152 | bool Win32Window::Show() { 153 | return ShowWindow(window_handle_, SW_SHOWNORMAL); 154 | } 155 | 156 | // static 157 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 158 | UINT const message, 159 | WPARAM const wparam, 160 | LPARAM const lparam) noexcept { 161 | if (message == WM_NCCREATE) { 162 | auto window_struct = reinterpret_cast(lparam); 163 | SetWindowLongPtr(window, GWLP_USERDATA, 164 | reinterpret_cast(window_struct->lpCreateParams)); 165 | 166 | auto that = static_cast(window_struct->lpCreateParams); 167 | EnableFullDpiSupportIfAvailable(window); 168 | that->window_handle_ = window; 169 | } else if (Win32Window* that = GetThisFromHandle(window)) { 170 | return that->MessageHandler(window, message, wparam, lparam); 171 | } 172 | 173 | return DefWindowProc(window, message, wparam, lparam); 174 | } 175 | 176 | LRESULT 177 | Win32Window::MessageHandler(HWND hwnd, 178 | UINT const message, 179 | WPARAM const wparam, 180 | LPARAM const lparam) noexcept { 181 | switch (message) { 182 | case WM_DESTROY: 183 | window_handle_ = nullptr; 184 | Destroy(); 185 | if (quit_on_close_) { 186 | PostQuitMessage(0); 187 | } 188 | return 0; 189 | 190 | case WM_DPICHANGED: { 191 | auto newRectSize = reinterpret_cast(lparam); 192 | LONG newWidth = newRectSize->right - newRectSize->left; 193 | LONG newHeight = newRectSize->bottom - newRectSize->top; 194 | 195 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 196 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 197 | 198 | return 0; 199 | } 200 | case WM_SIZE: { 201 | RECT rect = GetClientArea(); 202 | if (child_content_ != nullptr) { 203 | // Size and position the child window. 204 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 205 | rect.bottom - rect.top, TRUE); 206 | } 207 | return 0; 208 | } 209 | 210 | case WM_ACTIVATE: 211 | if (child_content_ != nullptr) { 212 | SetFocus(child_content_); 213 | } 214 | return 0; 215 | 216 | case WM_DWMCOLORIZATIONCOLORCHANGED: 217 | UpdateTheme(hwnd); 218 | return 0; 219 | } 220 | 221 | return DefWindowProc(window_handle_, message, wparam, lparam); 222 | } 223 | 224 | void Win32Window::Destroy() { 225 | OnDestroy(); 226 | 227 | if (window_handle_) { 228 | DestroyWindow(window_handle_); 229 | window_handle_ = nullptr; 230 | } 231 | if (g_active_window_count == 0) { 232 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 233 | } 234 | } 235 | 236 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 237 | return reinterpret_cast( 238 | GetWindowLongPtr(window, GWLP_USERDATA)); 239 | } 240 | 241 | void Win32Window::SetChildContent(HWND content) { 242 | child_content_ = content; 243 | SetParent(content, window_handle_); 244 | RECT frame = GetClientArea(); 245 | 246 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 247 | frame.bottom - frame.top, true); 248 | 249 | SetFocus(child_content_); 250 | } 251 | 252 | RECT Win32Window::GetClientArea() { 253 | RECT frame; 254 | GetClientRect(window_handle_, &frame); 255 | return frame; 256 | } 257 | 258 | HWND Win32Window::GetHandle() { 259 | return window_handle_; 260 | } 261 | 262 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 263 | quit_on_close_ = quit_on_close; 264 | } 265 | 266 | bool Win32Window::OnCreate() { 267 | // No-op; provided for subclasses. 268 | return true; 269 | } 270 | 271 | void Win32Window::OnDestroy() { 272 | // No-op; provided for subclasses. 273 | } 274 | 275 | void Win32Window::UpdateTheme(HWND const window) { 276 | DWORD light_mode; 277 | DWORD light_mode_size = sizeof(light_mode); 278 | LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, 279 | kGetPreferredBrightnessRegValue, 280 | RRF_RT_REG_DWORD, nullptr, &light_mode, 281 | &light_mode_size); 282 | 283 | if (result == ERROR_SUCCESS) { 284 | BOOL enable_dark_mode = light_mode == 0; 285 | DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, 286 | &enable_dark_mode, sizeof(enable_dark_mode)); 287 | } 288 | } 289 | -------------------------------------------------------------------------------- /lib/widgets/app_theme.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flex_color_scheme/flex_color_scheme.dart'; 3 | 4 | import '../utils/strings.dart'; 5 | 6 | ThemeMode getMode(String appMode) { 7 | switch (appMode) { 8 | case light: 9 | return ThemeMode.light; 10 | case dark: 11 | return ThemeMode.dark; 12 | default: 13 | return ThemeMode.system; 14 | } 15 | } 16 | 17 | class AppTheme { 18 | final String name; 19 | final ThemeData lightTheme; 20 | final ThemeData darkTheme; 21 | 22 | const AppTheme({ 23 | required this.lightTheme, 24 | required this.name, 25 | required this.darkTheme, 26 | }); 27 | } 28 | 29 | AppTheme indigoTheme = AppTheme( 30 | name: 'Indigo Nights', 31 | lightTheme: FlexThemeData.light( 32 | scheme: FlexScheme.indigo, 33 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 34 | blendLevel: 7, 35 | subThemesData: const FlexSubThemesData( 36 | blendOnLevel: 10, 37 | blendOnColors: false, 38 | useM2StyleDividerInM3: true, 39 | ), 40 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 41 | useMaterial3: true, 42 | swapLegacyOnMaterial3: true, 43 | ), 44 | darkTheme: FlexThemeData.dark( 45 | scheme: FlexScheme.indigo, 46 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 47 | blendLevel: 13, 48 | subThemesData: const FlexSubThemesData( 49 | blendOnLevel: 20, 50 | useM2StyleDividerInM3: true, 51 | ), 52 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 53 | useMaterial3: true, 54 | swapLegacyOnMaterial3: true, 55 | ), 56 | ); 57 | 58 | AppTheme blueWhaleTheme = AppTheme( 59 | name: 'Blue Whale', 60 | lightTheme: FlexThemeData.light( 61 | scheme: FlexScheme.blueWhale, 62 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 63 | blendLevel: 7, 64 | subThemesData: const FlexSubThemesData( 65 | blendOnLevel: 10, 66 | blendOnColors: false, 67 | useM2StyleDividerInM3: true, 68 | ), 69 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 70 | useMaterial3: true, 71 | swapLegacyOnMaterial3: true, 72 | ), 73 | darkTheme: FlexThemeData.dark( 74 | scheme: FlexScheme.blueWhale, 75 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 76 | blendLevel: 13, 77 | subThemesData: const FlexSubThemesData( 78 | blendOnLevel: 20, 79 | useM2StyleDividerInM3: true, 80 | ), 81 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 82 | useMaterial3: true, 83 | swapLegacyOnMaterial3: true, 84 | ), 85 | ); 86 | 87 | AppTheme material = AppTheme( 88 | name: 'Material', 89 | lightTheme: FlexThemeData.light( 90 | scheme: FlexScheme.material, 91 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 92 | blendLevel: 7, 93 | subThemesData: const FlexSubThemesData( 94 | blendOnLevel: 10, 95 | blendOnColors: false, 96 | useM2StyleDividerInM3: true, 97 | ), 98 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 99 | useMaterial3: true, 100 | swapLegacyOnMaterial3: true, 101 | ), 102 | darkTheme: FlexThemeData.dark( 103 | scheme: FlexScheme.material, 104 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 105 | blendLevel: 13, 106 | subThemesData: const FlexSubThemesData( 107 | blendOnLevel: 20, 108 | useM2StyleDividerInM3: true, 109 | ), 110 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 111 | useMaterial3: true, 112 | swapLegacyOnMaterial3: true, 113 | ), 114 | ); 115 | 116 | AppTheme materialHighContrast = AppTheme( 117 | name: 'Material High Contrast', 118 | lightTheme: FlexThemeData.light( 119 | scheme: FlexScheme.materialHc, 120 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 121 | blendLevel: 7, 122 | subThemesData: const FlexSubThemesData( 123 | blendOnLevel: 10, 124 | blendOnColors: false, 125 | useM2StyleDividerInM3: true, 126 | ), 127 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 128 | useMaterial3: true, 129 | swapLegacyOnMaterial3: true, 130 | ), 131 | darkTheme: FlexThemeData.dark( 132 | scheme: FlexScheme.materialHc, 133 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 134 | blendLevel: 13, 135 | subThemesData: const FlexSubThemesData( 136 | blendOnLevel: 20, 137 | useM2StyleDividerInM3: true, 138 | ), 139 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 140 | useMaterial3: true, 141 | swapLegacyOnMaterial3: true, 142 | ), 143 | ); 144 | 145 | AppTheme goldSunset = AppTheme( 146 | name: 'Gold Sunset', 147 | lightTheme: FlexThemeData.light( 148 | scheme: FlexScheme.gold, 149 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 150 | blendLevel: 7, 151 | subThemesData: const FlexSubThemesData( 152 | blendOnLevel: 10, 153 | blendOnColors: false, 154 | useM2StyleDividerInM3: true, 155 | ), 156 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 157 | useMaterial3: true, 158 | swapLegacyOnMaterial3: true, 159 | ), 160 | darkTheme: FlexThemeData.dark( 161 | scheme: FlexScheme.gold, 162 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 163 | blendLevel: 13, 164 | subThemesData: const FlexSubThemesData( 165 | blendOnLevel: 20, 166 | useM2StyleDividerInM3: true, 167 | ), 168 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 169 | useMaterial3: true, 170 | swapLegacyOnMaterial3: true, 171 | ), 172 | ); 173 | 174 | AppTheme dellGenoaGreen = AppTheme( 175 | name: 'Dell Genoe Green', 176 | lightTheme: FlexThemeData.light( 177 | scheme: FlexScheme.dellGenoa, 178 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 179 | blendLevel: 7, 180 | subThemesData: const FlexSubThemesData( 181 | blendOnLevel: 10, 182 | blendOnColors: false, 183 | useM2StyleDividerInM3: true, 184 | ), 185 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 186 | useMaterial3: true, 187 | swapLegacyOnMaterial3: true, 188 | ), 189 | darkTheme: FlexThemeData.dark( 190 | scheme: FlexScheme.dellGenoa, 191 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 192 | blendLevel: 13, 193 | subThemesData: const FlexSubThemesData( 194 | blendOnLevel: 20, 195 | useM2StyleDividerInM3: true, 196 | ), 197 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 198 | useMaterial3: true, 199 | swapLegacyOnMaterial3: true, 200 | ), 201 | ); 202 | 203 | AppTheme greyLaw = AppTheme( 204 | name: 'Grey Law', 205 | lightTheme: FlexThemeData.light( 206 | scheme: FlexScheme.greyLaw, 207 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 208 | blendLevel: 7, 209 | subThemesData: const FlexSubThemesData( 210 | blendOnLevel: 10, 211 | blendOnColors: false, 212 | useM2StyleDividerInM3: true, 213 | ), 214 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 215 | useMaterial3: true, 216 | swapLegacyOnMaterial3: true, 217 | ), 218 | darkTheme: FlexThemeData.dark( 219 | scheme: FlexScheme.greyLaw, 220 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 221 | blendLevel: 13, 222 | subThemesData: const FlexSubThemesData( 223 | blendOnLevel: 20, 224 | useM2StyleDividerInM3: true, 225 | ), 226 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 227 | useMaterial3: true, 228 | swapLegacyOnMaterial3: true, 229 | ), 230 | ); 231 | 232 | AppTheme camaroneGreen = AppTheme( 233 | name: 'Camarone Green', 234 | lightTheme: FlexThemeData.light( 235 | scheme: FlexScheme.greenM3, 236 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 237 | blendLevel: 7, 238 | subThemesData: const FlexSubThemesData( 239 | blendOnLevel: 10, 240 | blendOnColors: false, 241 | useM2StyleDividerInM3: true, 242 | ), 243 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 244 | useMaterial3: true, 245 | swapLegacyOnMaterial3: true, 246 | ), 247 | darkTheme: FlexThemeData.dark( 248 | scheme: FlexScheme.greenM3, 249 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 250 | blendLevel: 13, 251 | subThemesData: const FlexSubThemesData( 252 | blendOnLevel: 20, 253 | useM2StyleDividerInM3: true, 254 | ), 255 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 256 | useMaterial3: true, 257 | swapLegacyOnMaterial3: true, 258 | ), 259 | ); 260 | 261 | AppTheme rustDeepOrange = AppTheme( 262 | name: 'Rust Deep Orange', 263 | lightTheme: FlexThemeData.light( 264 | scheme: FlexScheme.deepOrangeM3, 265 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 266 | blendLevel: 7, 267 | subThemesData: const FlexSubThemesData( 268 | blendOnLevel: 10, 269 | blendOnColors: false, 270 | useM2StyleDividerInM3: true, 271 | ), 272 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 273 | useMaterial3: true, 274 | swapLegacyOnMaterial3: true, 275 | ), 276 | darkTheme: FlexThemeData.dark( 277 | scheme: FlexScheme.deepOrangeM3, 278 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 279 | blendLevel: 13, 280 | subThemesData: const FlexSubThemesData( 281 | blendOnLevel: 20, 282 | useM2StyleDividerInM3: true, 283 | ), 284 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 285 | useMaterial3: true, 286 | swapLegacyOnMaterial3: true, 287 | ), 288 | ); 289 | 290 | AppTheme espressoAndCream = AppTheme( 291 | name: 'Espresso and Cream', 292 | lightTheme: FlexThemeData.light( 293 | scheme: FlexScheme.espresso, 294 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 295 | blendLevel: 7, 296 | subThemesData: const FlexSubThemesData( 297 | blendOnLevel: 10, 298 | blendOnColors: false, 299 | useM2StyleDividerInM3: true, 300 | ), 301 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 302 | useMaterial3: true, 303 | swapLegacyOnMaterial3: true, 304 | ), 305 | darkTheme: FlexThemeData.dark( 306 | scheme: FlexScheme.espresso, 307 | surfaceMode: FlexSurfaceMode.levelSurfacesLowScaffold, 308 | blendLevel: 13, 309 | subThemesData: const FlexSubThemesData( 310 | blendOnLevel: 20, 311 | useM2StyleDividerInM3: true, 312 | ), 313 | visualDensity: FlexColorScheme.comfortablePlatformDensity, 314 | useMaterial3: true, 315 | swapLegacyOnMaterial3: true, 316 | ), 317 | ); 318 | -------------------------------------------------------------------------------- /lib/Pages/settings_page.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:device_info_plus/device_info_plus.dart'; 4 | import 'package:file_picker/file_picker.dart'; 5 | import 'package:flutter/foundation.dart'; 6 | import 'package:flutter/material.dart'; 7 | import 'package:flutter_bloc/flutter_bloc.dart'; 8 | import 'package:permission_handler/permission_handler.dart'; 9 | import 'package:text_to_image_gen/bloc/app_directory_cubit.dart'; 10 | import 'package:text_to_image_gen/bloc/app_language_cubit.dart'; 11 | 12 | import '../bloc/app_mode_cubit.dart'; 13 | import '../bloc/app_theme_cubit.dart'; 14 | import '../utils/app_language.dart'; 15 | import '../utils/language.dart'; 16 | import '../utils/strings.dart'; 17 | import '../widgets/app_theme.dart'; 18 | 19 | class SettingsPage extends StatefulWidget { 20 | const SettingsPage({Key? key}) : super(key: key); 21 | 22 | @override 23 | State createState() => _SettingsPageState(); 24 | } 25 | 26 | class _SettingsPageState extends State { 27 | final FilePicker filePicker = FilePicker.platform; 28 | 29 | late AppModeCubit _appModeCubit; 30 | late AppThemeCubit _appThemeCubit; 31 | late AppDirectoryCubit _appDirectoryCubit; 32 | late AppLanguageCubit _appLanguageCubit; 33 | 34 | final List _themes = appThemes.keys.toList(); 35 | final List _languages = Language.languageList(); 36 | 37 | @override 38 | void initState() { 39 | super.initState(); 40 | _appLanguageCubit = context.read()..loadLanguage(); 41 | _appDirectoryCubit = context.read()..loadPath(); 42 | _appModeCubit = context.read()..loadMode(); 43 | _appThemeCubit = context.read()..loadTheme(); 44 | } 45 | 46 | Future _pickDirectory() async { 47 | String? directoryPath; 48 | if (Platform.isAndroid) { 49 | AndroidDeviceInfo androidInfo = await DeviceInfoPlugin().androidInfo; 50 | int versionNumber = int.parse(androidInfo.version.release.split('.')[0]); 51 | try { 52 | if (versionNumber < 10) { 53 | if (await Permission.storage.isDenied) { 54 | await Permission.storage.request(); 55 | } else if (await Permission.storage.isGranted) { 56 | directoryPath = await filePicker.getDirectoryPath(); 57 | if (directoryPath != null) { 58 | _appDirectoryCubit.changePath(directoryPath); 59 | } else { 60 | message(); 61 | } 62 | } else { 63 | await Permission.storage.request(); 64 | } 65 | } else { 66 | if (await Permission.manageExternalStorage.isDenied) { 67 | await Permission.manageExternalStorage.request(); 68 | } else if (await Permission.manageExternalStorage.isGranted) { 69 | directoryPath = await filePicker.getDirectoryPath(); 70 | if (directoryPath != null) { 71 | _appDirectoryCubit.changePath(directoryPath); 72 | } else { 73 | message(); 74 | } 75 | } else { 76 | await Permission.manageExternalStorage.request(); 77 | } 78 | } 79 | } catch (e) { 80 | message(); 81 | if (kDebugMode) { 82 | print('Error picking directory in android: $e'); 83 | } 84 | } 85 | } else { 86 | try { 87 | directoryPath = await filePicker.getDirectoryPath(); 88 | if (directoryPath != null) { 89 | _appDirectoryCubit.changePath(directoryPath); 90 | } else { 91 | message(); 92 | } 93 | } catch (e) { 94 | message(); 95 | if (kDebugMode) { 96 | print('Error picking directory: $e'); 97 | } 98 | } 99 | } 100 | } 101 | 102 | void message() { 103 | showDialog( 104 | context: context, 105 | builder: (BuildContext context) { 106 | return AlertDialog( 107 | title: const Text('Error'), 108 | content: 109 | const Text('There is error . Try Again later or restart the app'), 110 | actions: [ 111 | TextButton( 112 | onPressed: () => Navigator.of(context).pop(), 113 | child: const Text('ok'), 114 | ), 115 | ], 116 | ); 117 | }, 118 | ); 119 | } 120 | 121 | @override 122 | Widget build(BuildContext context) { 123 | return Scaffold( 124 | appBar: AppBar( 125 | title: Text(translation(context).settingsPage), 126 | ), 127 | body: SingleChildScrollView( 128 | physics: const BouncingScrollPhysics(), 129 | child: Column( 130 | crossAxisAlignment: CrossAxisAlignment.center, 131 | mainAxisAlignment: MainAxisAlignment.center, 132 | children: [ 133 | BlocBuilder( 134 | builder: (context, state) { 135 | return Padding( 136 | padding: const EdgeInsets.all(8.0), 137 | child: ListTile( 138 | leading: const Icon(Icons.folder), 139 | title: Text(translation(context).mainDirectory), 140 | subtitle: Text(state.path), 141 | trailing: ElevatedButton( 142 | onPressed: _pickDirectory, 143 | child: Text(translation(context).change), 144 | ), 145 | ), 146 | ); 147 | }), 148 | BlocBuilder( 149 | builder: (context, state) { 150 | return Padding( 151 | padding: 152 | const EdgeInsets.symmetric(vertical: 16, horizontal: 16), 153 | child: Column( 154 | mainAxisAlignment: MainAxisAlignment.center, 155 | crossAxisAlignment: CrossAxisAlignment.start, 156 | children: [ 157 | Padding( 158 | padding: const EdgeInsets.symmetric(horizontal: 8.0), 159 | child: Text( 160 | '${translation(context).changeLanguage} :', 161 | style: const TextStyle( 162 | fontSize: 18, 163 | ), 164 | ), 165 | ), 166 | ListView.builder( 167 | physics: const BouncingScrollPhysics(), 168 | shrinkWrap: true, 169 | itemCount: _languages.length, 170 | itemBuilder: (BuildContext context, int index) { 171 | Language language = _languages[index]; 172 | return Padding( 173 | padding: const EdgeInsets.all(8.0), 174 | child: Container( 175 | decoration: BoxDecoration( 176 | color: Theme.of(context).splashColor, 177 | ), 178 | child: CheckboxListTile( 179 | title: Text(language.name), 180 | value: state.locale.languageCode == 181 | _languages[index].languageCode, 182 | onChanged: (value) { 183 | _appLanguageCubit 184 | .changeLanguage(language.languageCode); 185 | }, 186 | ), 187 | ), 188 | ); 189 | }, 190 | ), 191 | ]), 192 | ); 193 | }), 194 | BlocBuilder( 195 | builder: (context, state) { 196 | return Padding( 197 | padding: const EdgeInsets.all(16), 198 | child: Column( 199 | mainAxisAlignment: MainAxisAlignment.center, 200 | crossAxisAlignment: CrossAxisAlignment.start, 201 | children: [ 202 | Padding( 203 | padding: const EdgeInsets.symmetric(horizontal: 8.0), 204 | child: Text( 205 | "${translation(context).appMode} :", 206 | style: const TextStyle( 207 | fontSize: 18, 208 | ), 209 | ), 210 | ), 211 | Padding( 212 | padding: const EdgeInsets.all(8.0), 213 | child: Container( 214 | decoration: BoxDecoration( 215 | color: Theme.of(context).splashColor, 216 | ), 217 | child: CheckboxListTile( 218 | title: Text(translation(context).systemMode), 219 | value: state.mode == system, 220 | onChanged: (value) { 221 | if (value == true) { 222 | _appModeCubit.changeMode(system); 223 | } 224 | }, 225 | ), 226 | ), 227 | ), 228 | Padding( 229 | padding: const EdgeInsets.all(8.0), 230 | child: Container( 231 | decoration: BoxDecoration( 232 | color: Theme.of(context).splashColor, 233 | ), 234 | child: CheckboxListTile( 235 | title: Text(translation(context).lightMode), 236 | value: state.mode == light, 237 | onChanged: (value) { 238 | if (value == true) { 239 | _appModeCubit.changeMode(light); 240 | } 241 | }, 242 | ), 243 | ), 244 | ), 245 | Padding( 246 | padding: const EdgeInsets.all(8.0), 247 | child: Container( 248 | decoration: BoxDecoration( 249 | color: Theme.of(context).splashColor, 250 | ), 251 | child: CheckboxListTile( 252 | title: Text(translation(context).darkMode), 253 | value: state.mode == dark, 254 | onChanged: (value) { 255 | if (value == true) { 256 | _appModeCubit.changeMode(dark); 257 | } 258 | }, 259 | ), 260 | ), 261 | ), 262 | ], 263 | ), 264 | ); 265 | }, 266 | ), 267 | BlocBuilder( 268 | builder: (context, state) { 269 | return Padding( 270 | padding: 271 | const EdgeInsets.symmetric(vertical: 16, horizontal: 16), 272 | child: Column( 273 | mainAxisAlignment: MainAxisAlignment.center, 274 | crossAxisAlignment: CrossAxisAlignment.start, 275 | children: [ 276 | Padding( 277 | padding: const EdgeInsets.symmetric(horizontal: 8.0), 278 | child: Text( 279 | "${translation(context).themes} :", 280 | style: const TextStyle( 281 | fontSize: 18, 282 | ), 283 | ), 284 | ), 285 | ListView( 286 | physics: const BouncingScrollPhysics(), 287 | shrinkWrap: true, 288 | children: _themes.map((theme) { 289 | return Padding( 290 | padding: const EdgeInsets.all(8.0), 291 | child: Container( 292 | decoration: BoxDecoration( 293 | color: Theme.of(context).splashColor, 294 | ), 295 | child: CheckboxListTile( 296 | title: Text(theme.name), 297 | value: _appThemeCubit.state.theme == theme, 298 | onChanged: (bool? value) { 299 | if (value == true) { 300 | _appThemeCubit.updateTheme(theme); 301 | } 302 | }, 303 | ), 304 | ), 305 | ); 306 | }).toList(), 307 | ), 308 | ]), 309 | ); 310 | }, 311 | ), 312 | ], 313 | ), 314 | ), 315 | ); 316 | } 317 | } 318 | --------------------------------------------------------------------------------