├── linux ├── .gitignore ├── main.cc ├── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ ├── generated_plugin_registrant.cc │ └── CMakeLists.txt ├── my_application.h └── my_application.cc ├── ios ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── icon_1024x1024.png │ │ │ ├── icon_40x40@2x.png │ │ │ ├── icon_58x58@2x.png │ │ │ ├── icon_60x60@2x.png │ │ │ ├── icon_60x60@3x.png │ │ │ ├── icon_76x76@2x.png │ │ │ ├── icon_80x80@2x.png │ │ │ ├── icon_87x87@3x.png │ │ │ ├── Icon_167x167@2x.png │ │ │ ├── icon_114x114@3x.png │ │ │ ├── icon_120x120@2x.png │ │ │ ├── icon_120x120@3x.png │ │ │ ├── icon_128x128@2x.png │ │ │ ├── icon_136x136@2x.png │ │ │ ├── icon_152x152@2x.png │ │ │ ├── icon_180x180@3x.png │ │ │ ├── icon_192x192@3x.png │ │ │ ├── icon_40x40@2x 1.png │ │ │ ├── icon_58x58@2x 1.png │ │ │ ├── icon_80x80@2x 1.png │ │ │ ├── icon_83.5x83.5@2x.png │ │ │ └── Contents.json │ │ └── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ ├── Runner.entitlements │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.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 ├── RunnerTests │ └── RunnerTests.swift ├── .gitignore └── Podfile ├── web ├── favicon.png ├── icons │ ├── Icon-192.png │ ├── Icon-512.png │ ├── Icon-maskable-192.png │ └── Icon-maskable-512.png ├── manifest.json └── index.html ├── assets └── images │ ├── logo.png │ ├── logo512.png │ └── logo-white.png ├── macos ├── Runner │ ├── Configs │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ ├── Warnings.xcconfig │ │ └── AppInfo.xcconfig │ ├── Assets.xcassets │ │ └── AppIcon.iconset │ │ │ ├── icon_16x16.png │ │ │ ├── icon_32x32.png │ │ │ ├── icon_128x128.png │ │ │ ├── icon_16x16@2x.png │ │ │ ├── icon_256x256.png │ │ │ ├── icon_32x32@2x.png │ │ │ ├── icon_512x512.png │ │ │ ├── icon_128x128@2x.png │ │ │ ├── icon_256x256@2x.png │ │ │ └── icon_512x512@2x.png │ ├── AppDelegate.swift │ ├── MainFlutterWindow.swift │ ├── Release.entitlements │ ├── DebugProfile.entitlements │ ├── RunnerDebug.entitlements │ └── Info.plist ├── .gitignore ├── Flutter │ ├── Flutter-Debug.xcconfig │ ├── Flutter-Release.xcconfig │ └── GeneratedPluginRegistrant.swift ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── Runner.xcodeproj │ ├── project.xcworkspace │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ ├── Flutter Assemble.xcscheme │ │ └── Runner.xcscheme ├── RunnerTests │ └── RunnerTests.swift └── Podfile ├── windows ├── runner │ ├── resources │ │ └── icon_256.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 ├── .gitignore └── flutter │ ├── generated_plugin_registrant.h │ ├── generated_plugins.cmake │ └── generated_plugin_registrant.cc ├── android ├── app │ ├── src │ │ ├── main │ │ │ ├── ic_launcher-playstore.png │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_mono.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── ic_launcher_foreground.webp │ │ │ │ │ ├── ic_launcher_monochrome.webp │ │ │ │ │ └── ic_launcher_monochrome_round.webp │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_mono.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── ic_launcher_foreground.webp │ │ │ │ │ ├── ic_launcher_monochrome.webp │ │ │ │ │ └── ic_launcher_monochrome_round.webp │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_mono.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── ic_launcher_foreground.webp │ │ │ │ │ ├── ic_launcher_monochrome.webp │ │ │ │ │ └── ic_launcher_monochrome_round.webp │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_mono.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── ic_launcher_foreground.webp │ │ │ │ │ ├── ic_launcher_monochrome.webp │ │ │ │ │ └── ic_launcher_monochrome_round.webp │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ ├── ic_launcher_mono.webp │ │ │ │ │ ├── ic_launcher_round.webp │ │ │ │ │ ├── ic_launcher_foreground.webp │ │ │ │ │ ├── ic_launcher_monochrome.webp │ │ │ │ │ └── ic_launcher_monochrome_round.webp │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── drawable-xxxhdpi │ │ │ │ │ └── ic_notification.png │ │ │ │ ├── raw │ │ │ │ │ └── keep.xml │ │ │ │ ├── values │ │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ │ ├── ic_launcher_monochrome_background.xml │ │ │ │ │ └── styles.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ │ ├── ic_launcher_monochrome.xml │ │ │ │ │ ├── ic_launcher_monochrome_round.xml │ │ │ │ │ └── ic_launcher.xml │ │ │ │ ├── drawable │ │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable-v21 │ │ │ │ │ └── launch_background.xml │ │ │ │ └── values-night │ │ │ │ │ └── styles.xml │ │ │ ├── ic_launcher_monochrome-playstore.png │ │ │ ├── kotlin │ │ │ │ └── me │ │ │ │ │ └── voidspace │ │ │ │ │ └── recon │ │ │ │ │ └── MainActivity.kt │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── .gitignore ├── build.gradle └── settings.gradle ├── lib ├── stack.dart ├── widgets │ ├── settings_app_bar.dart │ ├── friends │ │ ├── friend_online_status_indicator.dart │ │ ├── expanding_input_fab.dart │ │ └── friends_list.dart │ ├── formatted_text.dart │ ├── sessions │ │ └── session_list_app_bar.dart │ ├── messages │ │ ├── message_state_indicator.dart │ │ ├── messages_session_header.dart │ │ ├── message_bubble.dart │ │ ├── camera_image_view.dart │ │ ├── message_text.dart │ │ ├── message_invite_request.dart │ │ ├── message_session_invite.dart │ │ └── message_asset.dart │ ├── default_error_widget.dart │ ├── inventory │ │ └── path_inventory_tile.dart │ ├── generic_avatar.dart │ ├── update_notifier.dart │ └── homepage.dart ├── models │ ├── users │ │ ├── friend_status.dart │ │ ├── user_profile.dart │ │ ├── user.dart │ │ ├── online_status.dart │ │ └── entitlement.dart │ ├── hub_events.dart │ ├── records │ │ ├── resonite_db_asset.dart │ │ ├── asset_digest.dart │ │ ├── search_sort.dart │ │ ├── asset_diff.dart │ │ ├── asset_upload_data.dart │ │ └── preprocess_status.dart │ ├── cloud_variable.dart │ ├── photo_asset.dart │ ├── session_metadata.dart │ ├── inventory │ │ └── resonite_directory.dart │ ├── authentication_data.dart │ ├── sem_ver.dart │ └── invite_request.dart ├── config.dart ├── apis │ ├── github_api.dart │ ├── contact_api.dart │ ├── message_api.dart │ ├── session_api.dart │ ├── cloud_variable_api.dart │ └── user_api.dart ├── crypto_helper.dart ├── clients │ ├── settings_client.dart │ ├── audio_cache_client.dart │ └── session_client.dart ├── client_holder.dart └── auxiliary.dart ├── .github └── ISSUE_TEMPLATE │ ├── feature-request.yml │ └── bug-report.yml ├── AppImageBuilder.yml ├── .gitignore ├── README.md ├── test └── widget_test.dart ├── .metadata └── analysis_options.yaml /linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/web/favicon.png -------------------------------------------------------------------------------- /assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/assets/images/logo.png -------------------------------------------------------------------------------- /web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/web/icons/Icon-192.png -------------------------------------------------------------------------------- /web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/web/icons/Icon-512.png -------------------------------------------------------------------------------- /assets/images/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/assets/images/logo512.png -------------------------------------------------------------------------------- /assets/images/logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/assets/images/logo-white.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /windows/runner/resources/icon_256.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/windows/runner/resources/icon_256.ico -------------------------------------------------------------------------------- /macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/ic_launcher_monochrome-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/ic_launcher_monochrome-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-hdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/drawable-hdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-mdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/drawable-mdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/drawable-xhdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_mono.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_mono.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_mono.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_mono.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_mono.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_mono.webp -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_16x16.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_32x32.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/drawable-xxhdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-xxxhdpi/ic_notification.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/drawable-xxxhdpi/ic_notification.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_mono.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_mono.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_mono.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_mono.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/raw/keep.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_128x128.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_256x256.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_512x512.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.webp -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_1024x1024.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_58x58@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_58x58@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_80x80@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_80x80@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_87x87@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_87x87@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /macos/Runner/Assets.xcassets/AppIcon.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/macos/Runner/Assets.xcassets/AppIcon.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.webp -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon_167x167@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon_167x167@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_114x114@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_114x114@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_120x120@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_120x120@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_120x120@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_120x120@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_136x136@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_136x136@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_152x152@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_152x152@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_180x180@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_180x180@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_192x192@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_192x192@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_40x40@2x 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_40x40@2x 1.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_58x58@2x 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_58x58@2x 1.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_80x80@2x 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_80x80@2x 1.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon_83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome_round.webp -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #050505 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nutcake/ReCon/HEAD/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome_round.webp -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /android/app/src/main/kotlin/me/voidspace/recon/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package me.voidspace.recon 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/ic_launcher_monochrome_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #050505 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-8.11.1-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 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /lib/stack.dart: -------------------------------------------------------------------------------- 1 | 2 | class Stack { 3 | final List _data = []; 4 | 5 | void push(T entry) => _data.add(entry); 6 | 7 | T pop() => _data.removeLast(); 8 | 9 | T? get peek => _data.lastOrNull; 10 | 11 | List get entries => List.from(_data); 12 | 13 | bool get isEmpty => _data.isEmpty; 14 | } -------------------------------------------------------------------------------- /macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/widgets/settings_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class SettingsAppBar extends StatelessWidget { 4 | const SettingsAppBar({super.key}); 5 | 6 | @override 7 | Widget build(BuildContext context) { 8 | return AppBar( 9 | title: const Text("Settings"), 10 | ); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /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/app/src/main/res/mipmap-anydpi-v26/ic_launcher_monochrome.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_monochrome_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ios/Runner/Runner.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | keychain-access-groups 6 | 7 | $(AppIdentifierPrefix)ch.isota.recon 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ios/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import FlutterMacOS 2 | import Cocoa 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /lib/models/users/friend_status.dart: -------------------------------------------------------------------------------- 1 | enum ContactStatus { 2 | none, 3 | searchResult, 4 | requested, 5 | ignored, 6 | blocked, 7 | accepted; 8 | 9 | factory ContactStatus.fromString(String text) { 10 | return ContactStatus.values.firstWhere((element) => element.name.toLowerCase() == text.toLowerCase(), 11 | orElse: () => ContactStatus.none, 12 | ); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = '../build' 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(':app') 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /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() 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/config.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | class Config { 4 | static const String apiBaseUrl = "https://api.resonite.com"; 5 | static const String skyfrostAssetsUrl = "https://assets.resonite.com"; 6 | static const String resoniteHubUrl = "$apiBaseUrl/hub"; 7 | 8 | static const int messageCacheValiditySeconds = 90; 9 | 10 | static const String latestCompatHash = "YPDxN4N9fu7ZgV+Nr/AHQw=="; 11 | 12 | static bool isDesktop = Platform.isLinux || Platform.isWindows || Platform.isMacOS; 13 | } 14 | -------------------------------------------------------------------------------- /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/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /lib/apis/github_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:http/http.dart' as http; 4 | 5 | class GithubApi { 6 | static const baseUrl = "https://api.github.com"; 7 | 8 | static Future getLatestTagName() async { 9 | final response = await http.get(Uri.parse("$baseUrl/repos/Nutcake/ReCon/releases?per_page=1")); 10 | if (response.statusCode != 200) return ""; 11 | final body = jsonDecode(response.body) as List; 12 | if (body.isEmpty) return ""; 13 | return body.first["tag_name"] ?? ""; 14 | } 15 | } -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lib/crypto_helper.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'dart:math'; 3 | 4 | import 'package:crypto/crypto.dart'; 5 | 6 | class CryptoHelper { 7 | static final Random _random = Random.secure(); 8 | 9 | static List randomBytes(int length) => List.generate(length, (i) => _random.nextInt(256)); 10 | 11 | static String cryptoToken([int length = 128]) => base64UrlEncode(randomBytes(length)).replaceAll("/", "_"); 12 | 13 | static String idHash(String id) => sha256.convert(utf8.encode(id)).toString().replaceAll("-", "").toUpperCase(); 14 | } 15 | -------------------------------------------------------------------------------- /macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.device.audio-input 8 | 9 | com.apple.security.network.client 10 | 11 | keychain-access-groups 12 | 13 | $(AppIdentifierPrefix)ch.isota.recon 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | name: Feature Request 2 | description: Request a feature to be added. 3 | labels: [enhancement] 4 | body: 5 | - type: textarea 6 | id: request 7 | attributes: 8 | label: Describe your request. 9 | description: Clearly describe what you would like added. 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: additional-context 14 | attributes: 15 | label: Additional Context 16 | description: Add any other context about why you are requesting this feature here. 17 | validations: 18 | required: false -------------------------------------------------------------------------------- /lib/apis/contact_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/clients/api_client.dart'; 4 | import 'package:recon/models/users/friend.dart'; 5 | 6 | class ContactApi { 7 | static Future> getFriendsList(ApiClient client, {DateTime? lastStatusUpdate}) async { 8 | final response = await client.get("/users/${client.userId}/contacts${lastStatusUpdate != null ? "?lastStatusUpdate=${lastStatusUpdate.toUtc().toIso8601String()}" : ""}"); 9 | client.checkResponse(response); 10 | final data = jsonDecode(response.body) as List; 11 | return data.map((e) => Friend.fromMap(e)).toList(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 = recon 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = me.voidspace.recon 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2023 me.voidspace. All rights reserved. 15 | -------------------------------------------------------------------------------- /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.device.audio-input 10 | 11 | com.apple.security.network.client 12 | 13 | com.apple.security.network.server 14 | 15 | keychain-access-groups 16 | 17 | $(AppIdentifierPrefix)ch.isota.recon 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /macos/Runner/RunnerDebug.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.device.audio-input 10 | 11 | com.apple.security.network.client 12 | 13 | com.apple.security.network.server 14 | 15 | keychain-access-groups 16 | 17 | $(AppIdentifierPrefix)ch.isota.recon 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /lib/models/hub_events.dart: -------------------------------------------------------------------------------- 1 | enum EventType { 2 | undefined, 3 | invocation, 4 | streamItem, 5 | completion, 6 | streamInvocation, 7 | cancelInvocation, 8 | ping, 9 | close; 10 | } 11 | 12 | enum EventTarget { 13 | unknown, 14 | debug, 15 | messageSent, 16 | receiveMessage, 17 | messagesRead, 18 | receiveSessionUpdate, 19 | removeSession, 20 | sendStatusToUser, 21 | receiveStatusUpdate; 22 | 23 | factory EventTarget.parse(String? text) { 24 | if (text == null) return EventTarget.unknown; 25 | return EventTarget.values.firstWhere( 26 | (element) => element.name.toLowerCase() == text.toLowerCase(), 27 | orElse: () => EventTarget.unknown, 28 | ); 29 | } 30 | } -------------------------------------------------------------------------------- /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/models/records/resonite_db_asset.dart: -------------------------------------------------------------------------------- 1 | import 'dart:typed_data'; 2 | 3 | import 'package:crypto/crypto.dart'; 4 | 5 | class ResoniteDBAsset { 6 | final String hash; 7 | final int bytes; 8 | 9 | const ResoniteDBAsset({required this.hash, required this.bytes}); 10 | 11 | factory ResoniteDBAsset.fromMap(Map map) { 12 | return ResoniteDBAsset(hash: map["hash"] ?? "", bytes: map["bytes"] ?? -1); 13 | } 14 | 15 | factory ResoniteDBAsset.fromData(Uint8List data) { 16 | final digest = sha256.convert(data); 17 | return ResoniteDBAsset(hash: digest.toString().replaceAll("-", "").toLowerCase(), bytes: data.length); 18 | } 19 | 20 | Map toMap() { 21 | return { 22 | "hash": hash, 23 | "bytes": bytes, 24 | }; 25 | } 26 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /AppImageBuilder.yml: -------------------------------------------------------------------------------- 1 | # appimage-builder recipe see https://appimage-builder.readthedocs.io for details 2 | version: 1 3 | AppDir: 4 | path: ./AppDir 5 | app_info: 6 | id: me.voidspace.recon 7 | name: ReCon 8 | icon: ReCon 9 | version: latest 10 | exec: recon 11 | exec_args: $@ 12 | apt: 13 | arch: [ x86_64 ] 14 | allow_unauthenticated: true 15 | sources: [] 16 | include: [] 17 | files: 18 | include: 19 | - /lib64/ld-linux-x86-64.so.2 20 | exclude: 21 | - usr/share/man 22 | - usr/share/doc/*/README.* 23 | - usr/share/doc/*/changelog.* 24 | - usr/share/doc/*/NEWS.* 25 | - usr/share/doc/*/TODO.* 26 | AppImage: 27 | arch: x86_64 28 | update-information: guess 29 | file_name: "recon-linux.AppImage" -------------------------------------------------------------------------------- /lib/models/records/asset_digest.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:typed_data'; 3 | 4 | import 'package:recon/models/records/resonite_db_asset.dart'; 5 | import 'package:path/path.dart'; 6 | 7 | class AssetDigest { 8 | final Uint8List data; 9 | final ResoniteDBAsset asset; 10 | final String name; 11 | final String dbUri; 12 | 13 | AssetDigest({required this.data, required this.asset, required this.name, required this.dbUri}); 14 | 15 | static Future fromData(Uint8List data, String filename) async { 16 | final asset = ResoniteDBAsset.fromData(data); 17 | 18 | return AssetDigest( 19 | data: data, 20 | asset: asset, 21 | name: basenameWithoutExtension(filename), 22 | dbUri: "resdb:///${asset.hash}${extension(filename)}", 23 | ); 24 | } 25 | } -------------------------------------------------------------------------------- /lib/apis/message_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/clients/api_client.dart'; 4 | import 'package:recon/models/message.dart'; 5 | 6 | class MessageApi { 7 | static Future> getUserMessages(ApiClient client, {String userId = "", DateTime? fromTime, 8 | int maxItems = 50, bool unreadOnly = false}) async { 9 | 10 | final response = await client.get("/users/${client.userId}/messages" 11 | "?maxItems=$maxItems" 12 | "${fromTime == null ? "" : "&fromTime${fromTime.toLocal().toIso8601String()}"}" 13 | "${userId.isEmpty ? "" : "&user=$userId"}" 14 | "&unread=$unreadOnly" 15 | ); 16 | client.checkResponse(response); 17 | final data = jsonDecode(response.body) as List; 18 | return data.map((e) => Message.fromMap(e)).toList(); 19 | } 20 | } -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version "8.9.1" apply false 22 | id "org.jetbrains.kotlin.android" version "2.1.0" apply false 23 | } 24 | 25 | include ":app" -------------------------------------------------------------------------------- /lib/clients/settings_client.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/models/settings.dart'; 4 | import 'package:flutter_secure_storage/flutter_secure_storage.dart'; 5 | 6 | 7 | class SettingsClient { 8 | static const String _settingsKey = "settings"; 9 | static const _storage = FlutterSecureStorage(); 10 | Settings _currentSettings = Settings(); 11 | 12 | Settings get currentSettings => _currentSettings; 13 | 14 | Future loadSettings() async { 15 | final data = await _storage.read(key: _settingsKey); 16 | if (data == null) return; 17 | _currentSettings = Settings.fromMap(jsonDecode(data)); 18 | } 19 | 20 | Future changeSettings(Settings newSettings) async { 21 | _currentSettings = newSettings; 22 | await _storage.write(key: _settingsKey, value: jsonEncode(newSettings.toMap())); 23 | } 24 | } -------------------------------------------------------------------------------- /lib/models/users/user_profile.dart: -------------------------------------------------------------------------------- 1 | class UserProfile { 2 | final String iconUrl; 3 | final String? tagline; 4 | //final List displayBadges; 5 | final String? description; 6 | 7 | UserProfile({ 8 | required this.iconUrl, 9 | this.tagline, 10 | this.description 11 | }); 12 | 13 | factory UserProfile.empty() => UserProfile( 14 | iconUrl: "", 15 | tagline: null, 16 | description: null, 17 | ); 18 | 19 | factory UserProfile.fromMap(Map? map) { 20 | return UserProfile( 21 | iconUrl: map?["iconUrl"] ?? "", 22 | tagline: map?["tagline"], 23 | description: map?["description"], 24 | ); 25 | } 26 | 27 | Map toMap() { 28 | return { 29 | "iconUrl": iconUrl, 30 | if (tagline != null) "tagline": tagline, 31 | if (description != null) "description": description, 32 | }; 33 | } 34 | } -------------------------------------------------------------------------------- /lib/models/records/search_sort.dart: -------------------------------------------------------------------------------- 1 | import 'package:intl/intl.dart'; 2 | 3 | enum SearchSortDirection { 4 | ascending, 5 | descending; 6 | 7 | @override 8 | String toString() => toBeginningOfSentenceCase(name); 9 | } 10 | 11 | enum SearchSortParameter { 12 | creationDate, 13 | lastUpdateDate, 14 | firstPublishTime, 15 | totalVisits, 16 | name, 17 | rand; 18 | 19 | @override 20 | String toString() => const { 21 | SearchSortParameter.creationDate: "Created", 22 | SearchSortParameter.lastUpdateDate: "Last Updated", 23 | SearchSortParameter.firstPublishTime: "First Published", 24 | SearchSortParameter.totalVisits: "Total Visits", 25 | SearchSortParameter.name: "Name", 26 | SearchSortParameter.rand: "Random", 27 | }[this]!; 28 | 29 | String serialize() => toBeginningOfSentenceCase(this.name); 30 | } 31 | -------------------------------------------------------------------------------- /lib/apis/session_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/clients/api_client.dart'; 4 | import 'package:recon/models/session.dart'; 5 | 6 | class SessionApi { 7 | static Future getSession(ApiClient client, {required String sessionId}) async { 8 | final response = await client.get("/sessions/$sessionId"); 9 | client.checkResponse(response); 10 | final body = jsonDecode(response.body); 11 | return Session.fromMap(body); 12 | } 13 | 14 | static Future> getSessions(ApiClient client, {SessionFilterSettings? filterSettings}) async { 15 | final response = await client.get("/sessions${filterSettings == null ? "" : filterSettings.buildRequestString()}"); 16 | client.checkResponse(response); 17 | final body = jsonDecode(response.body) as List; 18 | return body.map((e) => Session.fromMap(e)).toList(); 19 | } 20 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/models/cloud_variable.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/auxiliary.dart'; 2 | 3 | class CloudVariable { 4 | final String ownerId; 5 | final String path; 6 | final String value; 7 | final String partitionKey; 8 | final String rowKey; 9 | final DateTime timestamp; 10 | final String eTag; 11 | 12 | const CloudVariable({ 13 | required this.ownerId, 14 | required this.path, 15 | required this.value, 16 | required this.partitionKey, 17 | required this.rowKey, 18 | required this.timestamp, 19 | required this.eTag, 20 | }); 21 | 22 | factory CloudVariable.fromMap(Map map) { 23 | return CloudVariable( 24 | ownerId: map["ownerId"], 25 | path: map["path"], 26 | value: map["value"], 27 | partitionKey: map["partitionKey"], 28 | rowKey: map["rowKey"], 29 | timestamp: DateTime.tryParse(map["timestamp"]) ?? DateTimeX.epoch, 30 | eTag: map["eTag"], 31 | ); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /lib/models/records/asset_diff.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'package:recon/models/records/resonite_db_asset.dart'; 3 | 4 | class AssetDiff extends ResoniteDBAsset{ 5 | final Diff state; 6 | final bool isUploaded; 7 | 8 | const AssetDiff({required super.hash, required super.bytes, required this.state, required this.isUploaded}); 9 | 10 | factory AssetDiff.fromMap(Map map) { 11 | return AssetDiff( 12 | hash: map["hash"], 13 | bytes: map["bytes"], 14 | state: Diff.fromInt(map["state"]), 15 | isUploaded: map["isUploaded"], 16 | ); 17 | } 18 | } 19 | 20 | enum Diff { 21 | added, 22 | unchanged, 23 | removed; 24 | 25 | factory Diff.fromInt(int? idx) { 26 | return Diff.values[idx ?? 1]; 27 | } 28 | 29 | factory Diff.fromString(String? text) { 30 | return Diff.values.firstWhere((element) => element.name.toLowerCase() == text?.toLowerCase(), 31 | orElse: () => Diff.unchanged, 32 | ); 33 | } 34 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/models/users/user.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/models/users/user_profile.dart'; 2 | 3 | class User { 4 | final String id; 5 | final String username; 6 | final DateTime registrationDate; 7 | final UserProfile? userProfile; 8 | 9 | const User({required this.id, required this.username, required this.registrationDate, this.userProfile}); 10 | 11 | factory User.fromMap(Map map) { 12 | UserProfile? profile; 13 | try { 14 | profile = UserProfile.fromMap(map["profile"]); 15 | } catch (e) { 16 | profile = null; 17 | } 18 | return User( 19 | id: map["id"], 20 | username: map["username"], 21 | registrationDate: DateTime.parse(map["registrationDate"]), 22 | userProfile: profile, 23 | ); 24 | } 25 | 26 | Map toMap() { 27 | return { 28 | "id": id, 29 | "username": username, 30 | "registrationDate": registrationDate.toUtc().toIso8601String(), 31 | "profile": userProfile?.toMap(), 32 | }; 33 | } 34 | } -------------------------------------------------------------------------------- /linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | dynamic_color 7 | file_selector_linux 8 | flutter_secure_storage_linux 9 | record_linux 10 | url_launcher_linux 11 | ) 12 | 13 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 14 | ) 15 | 16 | set(PLUGIN_BUNDLED_LIBRARIES) 17 | 18 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 19 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 20 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 21 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 23 | endforeach(plugin) 24 | 25 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 26 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 27 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 28 | endforeach(ffi_plugin) 29 | -------------------------------------------------------------------------------- /web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "recon", 3 | "short_name": "recon", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 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 | } 36 | -------------------------------------------------------------------------------- /.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 | # In case flutter is in the project directory 29 | /flutter 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .packages 33 | .pub-cache/ 34 | .pub/ 35 | /build/ 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | /android/key.properties 48 | 49 | # AppimageBuilder will create this for building, exclude 50 | /AppDir 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # ReCon 4 | 5 | A Resonite Contacts App 6 | 7 | [Get it here](https://github.com/Nutcake/ReCon/releases/latest) 8 | 9 | ## Building 10 | 11 | This is a standard Flutter application, refer to the [Flutter docs](https://docs.flutter.dev/get-started/install) on how to build it. 12 | 13 | Currently only Android is fully supported. 14 | 15 | The app works on other platforms, though not every feature will be functional. 16 | For example, notifications are currently not supported on non-android builds. 17 | 18 | ## Screenshots 19 | 20 | 21 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | dynamic_color 7 | file_selector_windows 8 | flutter_secure_storage_windows 9 | permission_handler_windows 10 | record_windows 11 | share_plus 12 | url_launcher_windows 13 | ) 14 | 15 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 16 | flutter_local_notifications_windows 17 | ) 18 | 19 | set(PLUGIN_BUNDLED_LIBRARIES) 20 | 21 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 23 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 26 | endforeach(plugin) 27 | 28 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 29 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 30 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 31 | endforeach(ffi_plugin) 32 | -------------------------------------------------------------------------------- /android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /lib/models/photo_asset.dart: -------------------------------------------------------------------------------- 1 | 2 | import 'dart:math'; 3 | 4 | class PhotoAsset { 5 | final String locationName; 6 | final List userIds; 7 | final DateTime timestamp; 8 | final String imageUri; 9 | 10 | PhotoAsset({required this.locationName, required this.userIds, required this.timestamp, required this.imageUri}); 11 | 12 | factory PhotoAsset.fromTags(List tags) { 13 | final List userIds = []; 14 | Map parsedTags = Map.fromEntries(tags.map((e) { 15 | final delimIdx = e.indexOf(":"); 16 | if (delimIdx == -1) return null; 17 | final key = e.substring(0, delimIdx); 18 | final value = e.substring(min(delimIdx+1, e.length)); 19 | if (key == "user") { 20 | userIds.add(value); 21 | return null; 22 | } 23 | return MapEntry(key, value); 24 | }).nonNulls); 25 | return PhotoAsset( 26 | locationName: parsedTags["location_name"]!, 27 | userIds: userIds, 28 | timestamp: DateTime.parse(parsedTags["timestamp"]!), 29 | imageUri: parsedTags["texture_asset"]!, 30 | ); 31 | } 32 | } -------------------------------------------------------------------------------- /lib/models/session_metadata.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/models/session.dart'; 2 | import 'package:intl/intl.dart'; 3 | 4 | class SessionMetadata { 5 | final String sessionHash; 6 | final SessionAccessLevel accessLevel; 7 | final bool sessionHidden; 8 | final bool? isHost; 9 | final String? broadcastKey; 10 | 11 | SessionMetadata({ 12 | required this.sessionHash, 13 | required this.accessLevel, 14 | required this.sessionHidden, 15 | required this.isHost, 16 | required this.broadcastKey, 17 | }); 18 | 19 | factory SessionMetadata.fromMap(Map map) { 20 | return SessionMetadata( 21 | sessionHash: map["sessionHash"], 22 | accessLevel: SessionAccessLevel.fromName(map["accessLevel"]), 23 | sessionHidden: map["sessionHidden"], 24 | isHost: map["ishost"], 25 | broadcastKey: map["broadcastKey"], 26 | ); 27 | } 28 | 29 | Map toMap() { 30 | return { 31 | "sessionHash": sessionHash, 32 | "accessLevel": toBeginningOfSentenceCase(accessLevel.name), 33 | "sessionHidden": sessionHidden, 34 | "isHost": isHost, 35 | "broadcastKey": broadcastKey, 36 | }; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/client_holder.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:recon/clients/api_client.dart'; 3 | import 'package:recon/clients/notification_client.dart'; 4 | import 'package:recon/clients/settings_client.dart'; 5 | 6 | class ClientHolder extends InheritedWidget { 7 | final ApiClient apiClient; 8 | final SettingsClient settingsClient; 9 | final NotificationClient notificationClient = NotificationClient(); 10 | 11 | ClientHolder({ 12 | super.key, 13 | required this.settingsClient, 14 | required this.apiClient, 15 | required super.child, 16 | }); 17 | 18 | static ClientHolder? maybeOf(BuildContext context) { 19 | return context.dependOnInheritedWidgetOfExactType(); 20 | } 21 | 22 | static ClientHolder of(BuildContext context) { 23 | final result = maybeOf(context); 24 | assert(result != null, 'No AuthenticatedClient found in context'); 25 | return result!; 26 | } 27 | 28 | @override 29 | bool updateShouldNotify(covariant ClientHolder oldWidget) => 30 | oldWidget.apiClient != apiClient || oldWidget.settingsClient != settingsClient || oldWidget.notificationClient != notificationClient; 31 | } 32 | -------------------------------------------------------------------------------- /macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | AppIcon 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 | UILaunchStoryboardName 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/widgets/friends/friend_online_status_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:recon/models/users/friend.dart'; 3 | import 'package:recon/models/users/online_status.dart'; 4 | import 'package:recon/models/users/user_status.dart'; 5 | 6 | class FriendOnlineStatusIndicator extends StatelessWidget { 7 | const FriendOnlineStatusIndicator({required this.friend, super.key}); 8 | 9 | final Friend friend; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | final UserStatus userStatus = friend.userStatus; 14 | final OnlineStatus onlineStatus = userStatus.onlineStatus; 15 | return userStatus.appVersion.contains("ReCon") && friend.isOnline 16 | ? SizedBox.square( 17 | dimension: 10, 18 | child: Image.asset( 19 | "assets/images/logo-white.png", 20 | color: onlineStatus.color(context), 21 | filterQuality: FilterQuality.medium, 22 | isAntiAlias: true, 23 | ), 24 | ) 25 | : Icon( 26 | friend.isOffline ? Icons.circle_outlined : Icons.circle, 27 | color: friend.isHeadless ? const Color.fromARGB(255, 41, 77, 92) : onlineStatus.color(context), 28 | size: 10, 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /lib/apis/cloud_variable_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/clients/api_client.dart'; 4 | import 'package:recon/models/cloud_variable.dart'; 5 | 6 | class CloudVariableApi { 7 | static Future readCloudVariable(ApiClient client, 8 | {required String ownerId, required String path,}) async { 9 | final response = await client.get("/${ownerId.isEmpty ? "globalvars" : "users/$ownerId/vars"}/$path"); 10 | client.checkResponse(response); 11 | final body = jsonDecode(response.body); 12 | return CloudVariable.fromMap(body); 13 | } 14 | 15 | static Future readGlobalCloudVariable(ApiClient client, {required String path}) async => 16 | await readCloudVariable(client, ownerId: "", path: path); 17 | 18 | static Future deleteCloudVariable(ApiClient client, {required String ownerId, required String path}) async { 19 | final response = await client.delete("/users/vars/$path"); 20 | client.checkResponse(response); 21 | } 22 | 23 | static Future writeCloudVariable(ApiClient client, {required String ownerId, required String path, required String value}) async { 24 | final response = await client.put("/users/$ownerId/vars/$path", body: value); 25 | client.checkResponse(response); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: Report a feature that is not working as expected. 3 | labels: [bug] 4 | body: 5 | - type: textarea 6 | id: describe 7 | attributes: 8 | label: Describe the bug 9 | description: A clear and consice description of the issue. 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: screenshots 14 | attributes: 15 | label: Screenshots 16 | description: Add screenshots to illustrate your issue. 17 | validations: 18 | required: false 19 | - type: input 20 | id: version 21 | attributes: 22 | label: ReCon Version Number 23 | placeholder: v0.11.4-beta 24 | validations: 25 | required: true 26 | - type: dropdown 27 | id: platforms 28 | attributes: 29 | label: What Platforms does this occur on? 30 | multiple: true 31 | options: 32 | - "Android" 33 | - "IOS" 34 | - "Windows" 35 | - "Linux" 36 | - "MacOS" 37 | validations: 38 | required: true 39 | - type: textarea 40 | id: additional-context 41 | attributes: 42 | label: Additional Context 43 | description: Add any other context about the problem here. 44 | validations: 45 | required: false -------------------------------------------------------------------------------- /lib/widgets/formatted_text.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/string_formatter.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class FormattedText extends StatelessWidget { 5 | const FormattedText(this.formatTree, { 6 | this.style, 7 | this.textAlign, 8 | this.overflow, 9 | this.softWrap, 10 | this.maxLines, 11 | super.key 12 | }); 13 | 14 | final FormatNode formatTree; 15 | final TextStyle? style; 16 | final TextAlign? textAlign; 17 | final TextOverflow? overflow; 18 | final bool? softWrap; 19 | final int? maxLines; 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | if (formatTree.isUnformatted) { 24 | return Text( 25 | formatTree.text, 26 | style: style, 27 | textAlign: textAlign, 28 | overflow: overflow, 29 | softWrap: softWrap, 30 | maxLines: maxLines, 31 | ); 32 | } else { 33 | return RichText( 34 | text: formatTree.toTextSpan( 35 | baseStyle: style ?? Theme 36 | .of(context) 37 | .textTheme 38 | .bodyMedium! 39 | ), 40 | textAlign: textAlign ?? TextAlign.start, 41 | overflow: overflow ?? TextOverflow.clip, 42 | softWrap: softWrap ?? true, 43 | maxLines: maxLines, 44 | ); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /lib/models/records/asset_upload_data.dart: -------------------------------------------------------------------------------- 1 | 2 | enum UploadState { 3 | uploadingChunks, 4 | finalizing, 5 | uploaded, 6 | failed, 7 | unknown; 8 | 9 | factory UploadState.fromString(String? text) { 10 | return UploadState.values.firstWhere((element) => element.name.toLowerCase() == text?.toLowerCase(), 11 | orElse: () => UploadState.unknown, 12 | ); 13 | } 14 | } 15 | 16 | class AssetUploadData { 17 | final String signature; 18 | final String variant; 19 | final String ownerId; 20 | final int totalBytes; 21 | final int chunkSize; 22 | final int totalChunks; 23 | final UploadState uploadState; 24 | 25 | const AssetUploadData({ 26 | required this.signature, 27 | required this.variant, 28 | required this.ownerId, 29 | required this.totalBytes, 30 | required this.chunkSize, 31 | required this.totalChunks, 32 | required this.uploadState, 33 | }); 34 | 35 | factory AssetUploadData.fromMap(Map map) { 36 | return AssetUploadData( 37 | signature: map["signature"], 38 | variant: map["variant"] ?? "", 39 | ownerId: map["ownerId"] ?? "", 40 | totalBytes: map["totalBytes"] ?? -1, 41 | chunkSize: map["chunkSize"] ?? -1, 42 | totalChunks: map["totalChunks"] ?? -1, 43 | uploadState: UploadState.fromString(map["uploadStat"]), 44 | ); 45 | } 46 | } -------------------------------------------------------------------------------- /lib/models/inventory/resonite_directory.dart: -------------------------------------------------------------------------------- 1 | import 'package:collection/collection.dart'; 2 | import 'package:recon/models/records/record.dart'; 3 | 4 | class ResoniteDirectory { 5 | static const rootName = "Inventory"; 6 | 7 | final Record record; 8 | final ResoniteDirectory? parent; 9 | final List children; 10 | 11 | ResoniteDirectory({required this.record, this.parent, required this.children}); 12 | 13 | factory ResoniteDirectory.fromRecord({required Record record, ResoniteDirectory? parent}) { 14 | return ResoniteDirectory(record: record, parent: parent, children: []); 15 | } 16 | 17 | @override 18 | String toString() { 19 | return record.formattedName.toString(); 20 | } 21 | 22 | bool get isRoot => record.isRoot; 23 | 24 | String get absolutePath => "${parent?.absolutePath ?? ""}/${(record.name)}"; 25 | 26 | List get absolutePathSegments => (parent?.absolutePathSegments ?? []) + [record.formattedName.toString()]; 27 | 28 | bool containsRecord(Record record) => children.where((element) => element.record.id == record.id).isNotEmpty; 29 | 30 | List get records => children.map((e) => e.record).toList(); 31 | 32 | bool get isLoaded => children.isNotEmpty; 33 | 34 | ResoniteDirectory? findChildByRecord(Record record) => children.firstWhereOrNull((element) => element.record.id == record.id); 35 | } 36 | -------------------------------------------------------------------------------- /lib/models/users/online_status.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | enum OnlineStatus { 4 | offline, 5 | invisible, 6 | away, 7 | busy, 8 | online, 9 | sociable; 10 | 11 | static final List _colors = [ 12 | Colors.transparent, 13 | Colors.transparent, 14 | Colors.yellow, 15 | Colors.red, 16 | Colors.green, 17 | Colors.blue, 18 | ]; 19 | 20 | Color color(BuildContext context) => this == OnlineStatus.offline || this == OnlineStatus.invisible 21 | ? Theme.of(context).colorScheme.onSecondaryContainer.withAlpha(150) 22 | : _colors[index]; 23 | 24 | factory OnlineStatus.fromString(String? text) { 25 | return OnlineStatus.values.firstWhere( 26 | (element) => element.name.toLowerCase() == text?.toLowerCase(), 27 | orElse: () => OnlineStatus.online, 28 | ); 29 | } 30 | 31 | int compareTo(OnlineStatus other) { 32 | if (this == other) return 0; 33 | if (this == OnlineStatus.sociable) return -1; 34 | if (other == OnlineStatus.sociable) return 1; 35 | if (this == OnlineStatus.online) return -1; 36 | if (other == OnlineStatus.online) return 1; 37 | if (this == OnlineStatus.away) return -1; 38 | if (other == OnlineStatus.away) return 1; 39 | if (this == OnlineStatus.busy) return -1; 40 | if (other == OnlineStatus.busy) return 1; 41 | return 0; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/models/records/preprocess_status.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/models/records/asset_diff.dart'; 2 | 3 | enum RecordPreprocessState 4 | { 5 | preprocessing, 6 | success, 7 | failed; 8 | 9 | factory RecordPreprocessState.fromString(String? text) { 10 | return RecordPreprocessState.values.firstWhere((element) => element.name.toLowerCase() == text?.toLowerCase(), 11 | orElse: () => RecordPreprocessState.failed, 12 | ); 13 | } 14 | } 15 | 16 | 17 | class PreprocessStatus { 18 | final String id; 19 | final String ownerId; 20 | final String recordId; 21 | final RecordPreprocessState state; 22 | final num progress; 23 | final String failReason; 24 | final List resultDiffs; 25 | 26 | const PreprocessStatus({required this.id, required this.ownerId, required this.recordId, required this.state, 27 | required this.progress, required this.failReason, required this.resultDiffs, 28 | }); 29 | 30 | factory PreprocessStatus.fromMap(Map map) { 31 | return PreprocessStatus( 32 | id: map["id"], 33 | ownerId: map["ownerId"], 34 | recordId: map["recordId"], 35 | state: RecordPreprocessState.fromString(map["state"]), 36 | progress: map["progress"], 37 | failReason: map["failReason"] ?? "", 38 | resultDiffs: (map["resultDiffs"] as List? ?? []).map((e) => AssetDiff.fromMap(e)).toList(), 39 | ); 40 | } 41 | } -------------------------------------------------------------------------------- /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 | import 'package:recon/clients/settings_client.dart'; 11 | import 'package:recon/main.dart'; 12 | import 'package:recon/models/authentication_data.dart'; 13 | 14 | void main() { 15 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 16 | // Build our app and trigger a frame. 17 | await tester.pumpWidget(ReCon( 18 | settingsClient: SettingsClient(), 19 | cachedAuthentication: AuthenticationData.unauthenticated(), 20 | )); 21 | 22 | // Verify that our counter starts at 0. 23 | expect(find.text('0'), findsOneWidget); 24 | expect(find.text('1'), findsNothing); 25 | 26 | // Tap the '+' icon and trigger a frame. 27 | await tester.tap(find.byIcon(Icons.add)); 28 | await tester.pump(); 29 | 30 | // Verify that our counter has incremented. 31 | expect(find.text('0'), findsNothing); 32 | expect(find.text('1'), findsOneWidget); 33 | }); 34 | } 35 | -------------------------------------------------------------------------------- /lib/widgets/sessions/session_list_app_bar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:recon/clients/session_client.dart'; 4 | import 'package:recon/widgets/sessions/session_filter_dialog.dart'; 5 | 6 | class SessionListAppBar extends StatefulWidget { 7 | const SessionListAppBar({super.key}); 8 | 9 | @override 10 | State createState() => _SessionListAppBarState(); 11 | } 12 | 13 | class _SessionListAppBarState extends State { 14 | @override 15 | Widget build(BuildContext context) { 16 | return AppBar( 17 | title: const Text("Sessions"), 18 | actions: [ 19 | Padding( 20 | padding: const EdgeInsets.only(right: 4.0), 21 | child: IconButton( 22 | onPressed: () async { 23 | final sessionClient = Provider.of(context, listen: false); 24 | await showDialog( 25 | context: context, 26 | builder: (context) => ChangeNotifierProvider.value( 27 | value: sessionClient, 28 | child: SessionFilterDialog( 29 | lastFilter: sessionClient.filterSettings, 30 | ), 31 | ), 32 | ); 33 | }, 34 | icon: const Icon(Icons.filter_alt_outlined), 35 | ), 36 | ) 37 | ], 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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"recon", 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 | -------------------------------------------------------------------------------- /lib/widgets/messages/message_state_indicator.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/client_holder.dart'; 2 | import 'package:recon/models/message.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:intl/intl.dart'; 5 | 6 | class MessageStateIndicator extends StatelessWidget { 7 | MessageStateIndicator({required this.message, this.foregroundColor, super.key}); 8 | 9 | final DateFormat _dateFormat = DateFormat.Hm(); 10 | final Message message; 11 | final Color? foregroundColor; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | final color = foregroundColor?.withAlpha(150); 16 | return Row( 17 | children: [ 18 | Padding( 19 | padding: const EdgeInsets.symmetric(horizontal: 4.0), 20 | child: Text( 21 | _dateFormat.format(message.sendTime.toLocal()), 22 | style: Theme 23 | .of(context) 24 | .textTheme 25 | .labelMedium 26 | ?.copyWith(color: color), 27 | ), 28 | ), 29 | if (message.senderId == ClientHolder 30 | .of(context) 31 | .apiClient 32 | .userId) 33 | Icon( 34 | switch (message.state) { 35 | MessageState.local => Icons.alarm, 36 | MessageState.sent => Icons.done, 37 | MessageState.read => Icons.done_all, 38 | }, 39 | size: 12, 40 | color: color, 41 | ), 42 | ], 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /lib/models/authentication_data.dart: -------------------------------------------------------------------------------- 1 | class AuthenticationData { 2 | static const _unauthenticated = AuthenticationData( 3 | userId: "", 4 | token: "", 5 | secretMachineIdHash: "", 6 | isAuthenticated: false, 7 | uid: "", 8 | ); 9 | final String userId; 10 | final String token; 11 | final String secretMachineIdHash; 12 | final bool isAuthenticated; 13 | final String uid; 14 | 15 | const AuthenticationData({ 16 | required this.userId, 17 | required this.token, 18 | required this.secretMachineIdHash, 19 | required this.isAuthenticated, 20 | required this.uid, 21 | }); 22 | 23 | factory AuthenticationData.fromMap(Map map) { 24 | map = map["entity"]; 25 | final userId = map["userId"]; 26 | final token = map["token"]; 27 | final machineId = map["secretMachineIdHash"]; 28 | final uid = map["uid"]; 29 | if (userId == null || token == null || machineId == null || uid == null) { 30 | return _unauthenticated; 31 | } 32 | return AuthenticationData(userId: userId, token: token, secretMachineIdHash: machineId, isAuthenticated: true, uid: uid); 33 | } 34 | 35 | factory AuthenticationData.unauthenticated() => _unauthenticated; 36 | 37 | Map get authorizationHeader => { 38 | "Authorization": "res $userId:$token", 39 | }; 40 | 41 | Map toMap() { 42 | return { 43 | "userId": userId, 44 | "token": token, 45 | "secretMachineId": secretMachineIdHash, 46 | "uid": uid, 47 | }; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /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 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | void RegisterPlugins(flutter::PluginRegistry* registry) { 18 | DynamicColorPluginCApiRegisterWithRegistrar( 19 | registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); 20 | FileSelectorWindowsRegisterWithRegistrar( 21 | registry->GetRegistrarForPlugin("FileSelectorWindows")); 22 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar( 23 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); 24 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 25 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 26 | RecordWindowsPluginCApiRegisterWithRegistrar( 27 | registry->GetRegistrarForPlugin("RecordWindowsPluginCApi")); 28 | SharePlusWindowsPluginCApiRegisterWithRegistrar( 29 | registry->GetRegistrarForPlugin("SharePlusWindowsPluginCApi")); 30 | UrlLauncherWindowsRegisterWithRegistrar( 31 | registry->GetRegistrarForPlugin("UrlLauncherWindows")); 32 | } 33 | -------------------------------------------------------------------------------- /macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import audio_session 9 | import dynamic_color 10 | import file_picker 11 | import file_selector_macos 12 | import flutter_local_notifications 13 | import flutter_secure_storage_macos 14 | import just_audio 15 | import package_info_plus 16 | import record_macos 17 | import share_plus 18 | import sqflite_darwin 19 | import url_launcher_macos 20 | 21 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 22 | AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin")) 23 | DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin")) 24 | FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) 25 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) 26 | FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) 27 | FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) 28 | JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin")) 29 | FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) 30 | RecordMacOsPlugin.register(with: registry.registrar(forPlugin: "RecordMacOsPlugin")) 31 | SharePlusMacosPlugin.register(with: registry.registrar(forPlugin: "SharePlusMacosPlugin")) 32 | SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) 33 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) 34 | } 35 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | #include 12 | #include 13 | #include 14 | 15 | void fl_register_plugins(FlPluginRegistry* registry) { 16 | g_autoptr(FlPluginRegistrar) dynamic_color_registrar = 17 | fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin"); 18 | dynamic_color_plugin_register_with_registrar(dynamic_color_registrar); 19 | g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = 20 | fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); 21 | file_selector_plugin_register_with_registrar(file_selector_linux_registrar); 22 | g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = 23 | fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); 24 | flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); 25 | g_autoptr(FlPluginRegistrar) record_linux_registrar = 26 | fl_plugin_registry_get_registrar_for_plugin(registry, "RecordLinuxPlugin"); 27 | record_linux_plugin_register_with_registrar(record_linux_registrar); 28 | g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = 29 | fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); 30 | url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); 31 | } 32 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '13.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | target 'RunnerTests' do 36 | inherit! :search_paths 37 | end 38 | end 39 | 40 | post_install do |installer| 41 | installer.pods_project.targets.each do |target| 42 | flutter_additional_ios_build_settings(target) 43 | target.build_configurations.each do |config| 44 | config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /lib/clients/audio_cache_client.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | //import 'package:ffmpeg_kit_flutter_audio/ffmpeg_kit.dart'; 4 | import 'package:http/http.dart' as http; 5 | import 'package:path/path.dart'; 6 | import 'package:path_provider/path_provider.dart'; 7 | import 'package:recon/auxiliary.dart'; 8 | import 'package:recon/clients/api_client.dart'; 9 | import 'package:recon/models/message.dart'; 10 | 11 | class AudioCacheClient { 12 | final Future _directoryFuture = getTemporaryDirectory(); 13 | //final bool _isDarwin = Platform.isMacOS || Platform.isIOS; 14 | 15 | Future cachedNetworkAudioFile(AudioClipContent clip) async { 16 | final directory = await _directoryFuture; 17 | final fileName = basenameWithoutExtension(clip.assetUri); 18 | final file = File("${directory.path}/$fileName.ogg"); 19 | if (!file.existsSync()) { 20 | await file.create(recursive: true); 21 | final response = await http.get(Uri.parse(Aux.resdbToHttp(clip.assetUri))); 22 | ApiClient.checkResponseCode(response); 23 | await file.writeAsBytes(response.bodyBytes); 24 | } 25 | /* This requires ffmpeg_kit_flutter_audio which is no longer maintained. 26 | if (_isDarwin) { 27 | final wavFile = File("${directory.path}/$fileName.wav"); 28 | final wavFileExists = await wavFile.exists(); 29 | if (wavFileExists && await wavFile.length() == 0) { 30 | await wavFile.delete(); 31 | } 32 | if (!wavFileExists) { 33 | await wavFile.create(recursive: true); 34 | await FFmpegKit.executeAsync("-y -acodec libvorbis -i ${file.path} -acodec pcm_s16le ${wavFile.path}"); 35 | } 36 | return wavFile; 37 | } 38 | */ 39 | return file; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /lib/widgets/default_error_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class DefaultErrorWidget extends StatelessWidget { 4 | const DefaultErrorWidget({this.title, this.message, this.onRetry, this.iconOverride, super.key}); 5 | 6 | final String? title; 7 | final String? message; 8 | final void Function()? onRetry; 9 | final IconData? iconOverride; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Padding( 14 | padding: const EdgeInsets.all(64), 15 | child: Center( 16 | child: Column( 17 | mainAxisSize: MainAxisSize.max, 18 | mainAxisAlignment: MainAxisAlignment.center, 19 | crossAxisAlignment: CrossAxisAlignment.center, 20 | children: [ 21 | Icon(iconOverride ?? Icons.warning, size: 32,), 22 | const SizedBox(height: 16,), 23 | Text(title ?? "Something went wrong: ", 24 | textAlign: TextAlign.center, 25 | style: Theme 26 | .of(context) 27 | .textTheme 28 | .titleMedium,), 29 | if (message != null) Padding( 30 | padding: const EdgeInsets.all(16), 31 | child: Text(message ?? "", 32 | textAlign: TextAlign.center, 33 | ), 34 | ), 35 | if (onRetry != null) TextButton.icon( 36 | onPressed: onRetry, 37 | style: TextButton.styleFrom( 38 | padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 16), 39 | ), 40 | icon: const Icon(Icons.refresh), 41 | label: const Text("Retry"), 42 | ), 43 | ], 44 | ), 45 | ), 46 | ); 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /lib/widgets/inventory/path_inventory_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/models/records/record.dart'; 2 | import 'package:recon/widgets/formatted_text.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | class PathInventoryTile extends StatelessWidget { 6 | const PathInventoryTile({required this.record, this.selected = false, this.onTap, this.onLongPress, super.key}); 7 | 8 | final Record record; 9 | final Function()? onTap; 10 | final Function()? onLongPress; 11 | final bool selected; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return Card( 16 | elevation: 0, 17 | shape: RoundedRectangleBorder( 18 | side: BorderSide( 19 | color: selected ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.outline, 20 | ), 21 | borderRadius: BorderRadius.circular(16), 22 | ), 23 | child: InkWell( 24 | borderRadius: BorderRadius.circular(16), 25 | onTap: onTap, 26 | onLongPress: onLongPress, 27 | child: Padding( 28 | padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 0), 29 | child: Row( 30 | children: [ 31 | if (record.recordType == RecordType.directory) 32 | const Icon(Icons.folder) 33 | else 34 | RotatedBox( 35 | quarterTurns: 1, 36 | child: const Icon(Icons.link), 37 | ), 38 | const SizedBox(width: 4), 39 | Expanded( 40 | child: FormattedText( 41 | record.formattedName, 42 | maxLines: 2, 43 | overflow: TextOverflow.fade, 44 | ), 45 | ), 46 | ], 47 | ), 48 | ), 49 | ), 50 | ); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /lib/clients/session_client.dart: -------------------------------------------------------------------------------- 1 | import 'package:collection/collection.dart'; 2 | import 'package:recon/apis/session_api.dart'; 3 | import 'package:recon/clients/api_client.dart'; 4 | import 'package:recon/clients/settings_client.dart'; 5 | import 'package:recon/models/session.dart'; 6 | import 'package:flutter/foundation.dart'; 7 | 8 | class SessionClient extends ChangeNotifier { 9 | final ApiClient apiClient; 10 | final SettingsClient settingsClient; 11 | 12 | Future>? _sessionsFuture; 13 | 14 | SessionFilterSettings _filterSettings = SessionFilterSettings.empty(); 15 | 16 | SessionClient({required this.apiClient, required this.settingsClient}) { 17 | _filterSettings = SessionFilterSettings( 18 | name: "", 19 | hostName: "", 20 | includeEnded: settingsClient.currentSettings.sessionViewLastIncludeEnded.valueOrDefault, 21 | includeIncompatible: settingsClient.currentSettings.sessionViewLastIncludeIncompatible.valueOrDefault, 22 | minActiveUsers: settingsClient.currentSettings.sessionViewLastMinimumUsers.valueOrDefault, 23 | includeEmptyHeadless: settingsClient.currentSettings.sessionViewLastIncludeEmpty.valueOrDefault, 24 | ); 25 | } 26 | 27 | SessionFilterSettings get filterSettings => _filterSettings; 28 | 29 | Future>? get sessionsFuture => _sessionsFuture; 30 | 31 | set filterSettings(value) { 32 | _filterSettings = value; 33 | reloadSessions(); 34 | } 35 | 36 | void initSessions() { 37 | _sessionsFuture = SessionApi.getSessions(apiClient, filterSettings: _filterSettings).then( 38 | (value) => value.sorted( 39 | (a, b) => b.sessionUsers.length.compareTo(a.sessionUsers.length), 40 | ), 41 | ); 42 | } 43 | 44 | void reloadSessions() { 45 | initSessions(); 46 | notifyListeners(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | ReCon 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ReCon 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | $(FLUTTER_BUILD_NUMBER) 27 | LSRequiresIPhoneOS 28 | 29 | UIApplicationSupportsIndirectInputEvents 30 | 31 | UIBackgroundModes 32 | 33 | fetch 34 | processing 35 | 36 | UILaunchStoryboardName 37 | LaunchScreen.storyboard 38 | UIMainStoryboardFile 39 | Main 40 | UISupportedInterfaceOrientations 41 | 42 | UIInterfaceOrientationPortrait 43 | 44 | UISupportedInterfaceOrientations~ipad 45 | 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationPortraitUpsideDown 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /.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 and should not be manually edited. 5 | 6 | version: 7 | revision: "6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e" 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: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 17 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 18 | - platform: android 19 | create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 20 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 21 | - platform: ios 22 | create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 23 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 24 | - platform: linux 25 | create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 26 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 27 | - platform: macos 28 | create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 29 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 30 | - platform: web 31 | create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 32 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 33 | - platform: windows 34 | create_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 35 | base_revision: 6c4930c4ac86fb286f30e31d0ec8bffbcbb9953e 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 | -------------------------------------------------------------------------------- /lib/widgets/messages/messages_session_header.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:recon/auxiliary.dart'; 3 | import 'package:recon/models/session.dart'; 4 | import 'package:recon/widgets/formatted_text.dart'; 5 | import 'package:recon/widgets/generic_avatar.dart'; 6 | import 'package:recon/widgets/sessions/session_view.dart'; 7 | 8 | class SessionTile extends StatelessWidget { 9 | const SessionTile({required this.session, super.key}); 10 | 11 | final Session session; 12 | 13 | @override 14 | Widget build(BuildContext context) { 15 | return TextButton( 16 | style: TextButton.styleFrom( 17 | foregroundColor: Theme.of(context).colorScheme.onSurface, 18 | ), 19 | onPressed: () { 20 | Navigator.of(context).push(MaterialPageRoute(builder: (context) => SessionView(session: session))); 21 | }, 22 | child: Row( 23 | mainAxisAlignment: MainAxisAlignment.center, 24 | children: [ 25 | GenericAvatar(imageUri: Aux.resdbToHttp(session.thumbnailUrl), placeholderIcon: Icons.no_photography), 26 | Padding( 27 | padding: const EdgeInsets.symmetric(horizontal: 12.0), 28 | child: Column( 29 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 30 | crossAxisAlignment: CrossAxisAlignment.start, 31 | children: [ 32 | FormattedText(session.formattedName), 33 | Text( 34 | "${session.sessionUsers.length.toString().padLeft(2, "0")}/${session.maxUsers.toString().padLeft(2, "0")} active users", 35 | style: Theme.of(context) 36 | .textTheme 37 | .labelMedium 38 | ?.copyWith(color: Theme.of(context).colorScheme.onSurface.withValues(alpha: 0.6)), 39 | ) 40 | ], 41 | ), 42 | ) 43 | ], 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.15' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | target.build_configurations.each do |config| 43 | config.build_settings['MACOSX_DEPLOYMENT_TARGET'] = '10.15' 44 | xcconfig_path = config.base_configuration_reference.real_path 45 | xcconfig = File.read(xcconfig_path) 46 | xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR") 47 | File.open(xcconfig_path, "w") { |file| file << xcconfig_mod } 48 | end 49 | end 50 | end 51 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /lib/apis/user_api.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/clients/api_client.dart'; 4 | import 'package:recon/models/personal_profile.dart'; 5 | import 'package:recon/models/users/user.dart'; 6 | import 'package:recon/models/users/user_status.dart'; 7 | 8 | class UserApi { 9 | static Future> searchUsers(ApiClient client, {required String needle}) async { 10 | final response = await client.get("/users?name=$needle"); 11 | client.checkResponse(response); 12 | final data = jsonDecode(response.body) as List; 13 | return data.map((e) => User.fromMap(e)); 14 | } 15 | 16 | static Future getUser(ApiClient client, {required String userId}) async { 17 | final response = await client.get("/users/$userId/"); 18 | client.checkResponse(response); 19 | final data = jsonDecode(response.body); 20 | return User.fromMap(data); 21 | } 22 | 23 | static Future getUserStatus(ApiClient client, {required String userId}) async { 24 | final response = await client.get("/users/$userId/status"); 25 | client.checkResponse(response); 26 | final data = jsonDecode(response.body); 27 | return UserStatus.fromMap(data); 28 | } 29 | 30 | static Future notifyOnlineInstance(ApiClient client) async { 31 | final response = await client.post("/stats/instanceOnline/${client.authenticationData.secretMachineIdHash}"); 32 | client.checkResponse(response); 33 | } 34 | 35 | static Future getPersonalProfile(ApiClient client) async { 36 | final response = await client.get("/users/${client.userId}"); 37 | client.checkResponse(response); 38 | final data = jsonDecode(response.body); 39 | return PersonalProfile.fromMap(data); 40 | } 41 | 42 | static Future getStorageQuota(ApiClient client) async { 43 | final response = await client.get("/users/${client.userId}/storage"); 44 | client.checkResponse(response); 45 | final data = jsonDecode(response.body); 46 | return StorageQuota.fromMap(data); 47 | } 48 | } -------------------------------------------------------------------------------- /web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | recon 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /lib/widgets/generic_avatar.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class GenericAvatar extends StatelessWidget { 5 | const GenericAvatar({this.imageUri="", super.key, this.placeholderIcon=Icons.person, this.radius, this.foregroundColor}); 6 | 7 | final String imageUri; 8 | final IconData placeholderIcon; 9 | final double? radius; 10 | final Color? foregroundColor; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return imageUri.isEmpty ? CircleAvatar( 15 | radius: radius, 16 | foregroundColor: foregroundColor ?? Theme.of(context).colorScheme.onPrimaryContainer, 17 | backgroundColor: Theme.of(context).colorScheme.primaryContainer, 18 | child: Icon(placeholderIcon, color: foregroundColor,), 19 | ) : CachedNetworkImage( 20 | imageBuilder: (context, imageProvider) { 21 | return CircleAvatar( 22 | foregroundImage: imageProvider, 23 | foregroundColor: Colors.transparent, 24 | backgroundColor: Colors.transparent, 25 | radius: radius, 26 | ); 27 | }, 28 | imageUrl: imageUri, 29 | placeholder: (context, url) { 30 | return CircleAvatar( 31 | backgroundColor: Theme.of(context).colorScheme.primaryContainer, 32 | foregroundColor: foregroundColor ?? Theme.of(context).colorScheme.onPrimaryContainer, 33 | radius: radius, 34 | child: Padding( 35 | padding: const EdgeInsets.all(8.0), 36 | child: CircularProgressIndicator(color: foregroundColor ?? Theme.of(context).colorScheme.onPrimaryContainer, strokeWidth: 2), 37 | ), 38 | ); 39 | }, 40 | errorWidget: (context, error, what) => CircleAvatar( 41 | radius: radius, 42 | foregroundColor: foregroundColor ?? Theme.of(context).colorScheme.onPrimaryContainer, 43 | backgroundColor: Theme.of(context).colorScheme.primaryContainer, 44 | child: Icon(placeholderIcon, color: foregroundColor ?? Theme.of(context).colorScheme.onPrimaryContainer,), 45 | ), 46 | ); 47 | } 48 | 49 | } -------------------------------------------------------------------------------- /lib/auxiliary.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:html/parser.dart' as htmlparser; 5 | import 'package:path/path.dart' as p; 6 | import 'package:recon/config.dart'; 7 | 8 | class Aux { 9 | static String resdbToHttp(String? resdb) { 10 | if (resdb == null || resdb.isEmpty) return ""; 11 | if (resdb.startsWith("http")) return resdb; 12 | final filename = p.basenameWithoutExtension(resdb); 13 | return "${Config.skyfrostAssetsUrl}/$filename"; 14 | } 15 | } 16 | 17 | extension Unique on List { 18 | List unique([Id Function(E element)? id, bool inplace = true]) { 19 | final ids = {}; 20 | final list = inplace ? this : List.from(this) 21 | ..retainWhere((x) => ids.add(id != null ? id(x) : x as Id)); 22 | return list; 23 | } 24 | } 25 | 26 | extension StringX on String { 27 | String stripHtml() { 28 | final document = htmlparser.parse(this); 29 | return htmlparser.parse(document.body?.text).documentElement?.text ?? ""; 30 | } 31 | 32 | // This won't be accurate since userIds can't contain certain characters that usernames can 33 | // but it's fine for just having a name to display 34 | String stripUid() => startsWith("U-") ? substring(2) : this; 35 | 36 | String? get asNullable => isEmpty ? null : this; 37 | } 38 | 39 | extension Format on Duration { 40 | String format() { 41 | final hh = (inHours).toString().padLeft(2, '0'); 42 | final mm = (inMinutes % 60).toString().padLeft(2, '0'); 43 | final ss = (inSeconds % 60).toString().padLeft(2, '0'); 44 | if (inHours == 0) { 45 | return "$mm:$ss"; 46 | } else { 47 | return "$hh:$mm:$ss"; 48 | } 49 | } 50 | } 51 | 52 | extension DateTimeX on DateTime { 53 | static DateTime epoch = DateTime.fromMillisecondsSinceEpoch(0); 54 | static DateTime one = DateTime(1); 55 | } 56 | 57 | extension ColorX on Color { 58 | Color invert() { 59 | final ir = 1.0 - r; 60 | final ig = 1.0 - g; 61 | final ib = 1.0 - b; 62 | 63 | return Color.fromARGB((a * 255).round(), (ir * 255).round(), (ig * 255).round(), (ib * 255).round()); 64 | } 65 | } 66 | 67 | class EventNotifier extends ChangeNotifier { 68 | void notify() => notifyListeners(); 69 | } -------------------------------------------------------------------------------- /lib/widgets/messages/message_bubble.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/client_holder.dart'; 2 | import 'package:recon/models/message.dart'; 3 | import 'package:recon/widgets/messages/message_asset.dart'; 4 | import 'package:recon/widgets/messages/message_audio_player.dart'; 5 | import 'package:recon/widgets/messages/message_session_invite.dart'; 6 | import 'package:recon/widgets/messages/message_invite_request.dart'; 7 | import 'package:recon/widgets/messages/message_text.dart'; 8 | import 'package:flutter/material.dart'; 9 | 10 | class MessageBubble extends StatelessWidget { 11 | const MessageBubble({required this.message, super.key}); 12 | 13 | final Message message; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | final bool mine = message.senderId == ClientHolder.of(context).apiClient.userId; 18 | final colorScheme = Theme.of(context).colorScheme; 19 | final foregroundColor = mine ? colorScheme.onPrimaryContainer : colorScheme.onSurfaceVariant; 20 | final backgroundColor = mine ? colorScheme.primaryContainer : colorScheme.surfaceContainerHighest; 21 | return Padding( 22 | padding: EdgeInsets.only(left: mine ? 32 : 12, bottom: 16, right: mine ? 12 : 32), 23 | child: Row( 24 | mainAxisAlignment: mine ? MainAxisAlignment.end : MainAxisAlignment.start, 25 | children: [ 26 | Material( 27 | borderRadius: BorderRadius.circular(16), 28 | color: backgroundColor, 29 | textStyle: Theme.of(context).textTheme.bodySmall?.copyWith(color: foregroundColor), 30 | child: Container( 31 | padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 8), 32 | child: switch (message.type) { 33 | MessageType.sessionInvite => MessageSessionInvite(message: message, foregroundColor: foregroundColor,), 34 | MessageType.object => MessageAsset(message: message, foregroundColor: foregroundColor,), 35 | MessageType.sound => MessageAudioPlayer(message: message, foregroundColor: foregroundColor,), 36 | MessageType.inviteRequest => MessageInviteRequest(message: message, foregroundColor: foregroundColor,), 37 | MessageType.unknown || MessageType.text => MessageText(message: message, foregroundColor: foregroundColor,) 38 | }, 39 | ), 40 | ), 41 | ], 42 | ), 43 | ); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /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 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | id "dev.flutter.flutter-gradle-plugin" 5 | } 6 | 7 | def localProperties = new Properties() 8 | def localPropertiesFile = rootProject.file('local.properties') 9 | if (localPropertiesFile.exists()) { 10 | localPropertiesFile.withReader('UTF-8') { reader -> 11 | localProperties.load(reader) 12 | } 13 | } 14 | 15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 16 | if (flutterVersionCode == null) { 17 | flutterVersionCode = '1' 18 | } 19 | 20 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 21 | if (flutterVersionName == null) { 22 | flutterVersionName = '1.0' 23 | } 24 | 25 | def keystoreProperties = new Properties() 26 | def keystorePropertiesFile = rootProject.file('key.properties') 27 | if (keystorePropertiesFile.exists()) { 28 | keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) 29 | } 30 | 31 | android { 32 | namespace "me.voidspace.recon" 33 | compileSdkVersion flutter.compileSdkVersion 34 | ndkVersion flutter.ndkVersion 35 | 36 | compileOptions { 37 | sourceCompatibility JavaVersion.VERSION_1_8 38 | targetCompatibility JavaVersion.VERSION_1_8 39 | coreLibraryDesugaringEnabled true 40 | } 41 | 42 | kotlinOptions { 43 | jvmTarget = '1.8' 44 | } 45 | 46 | sourceSets { 47 | main.java.srcDirs += 'src/main/kotlin' 48 | } 49 | 50 | defaultConfig { 51 | applicationId "me.voidspace.recon" 52 | minSdkVersion 24 53 | targetSdkVersion flutter.targetSdkVersion 54 | versionCode flutterVersionCode.toInteger() 55 | versionName flutterVersionName 56 | } 57 | 58 | signingConfigs { 59 | release { 60 | keyAlias keystoreProperties['keyAlias'] 61 | keyPassword keystoreProperties['keyPassword'] 62 | storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null 63 | storePassword keystoreProperties['storePassword'] 64 | } 65 | } 66 | buildTypes { 67 | release { 68 | signingConfig signingConfigs.release 69 | } 70 | } 71 | } 72 | 73 | dependencies { 74 | // For AGP 7.4+ 75 | coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.4' 76 | } 77 | 78 | flutter { 79 | source '../..' 80 | } 81 | -------------------------------------------------------------------------------- /lib/widgets/messages/camera_image_view.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:photo_view/photo_view.dart'; 5 | 6 | class CameraImageView extends StatelessWidget { 7 | const CameraImageView({required this.file, super.key}); 8 | 9 | final File file; 10 | 11 | @override 12 | Widget build(BuildContext context) { 13 | return Scaffold( 14 | appBar: AppBar(), 15 | body: Stack( 16 | children: [ 17 | PhotoView( 18 | imageProvider: FileImage( 19 | file, 20 | ), 21 | initialScale: PhotoViewComputedScale.covered, 22 | minScale: PhotoViewComputedScale.contained, 23 | ), 24 | Align( 25 | alignment: Alignment.bottomCenter, 26 | child: Padding( 27 | padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 32), 28 | child: Row( 29 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 30 | children: [ 31 | TextButton.icon( 32 | onPressed: () { 33 | Navigator.of(context).pop(false); 34 | }, 35 | style: TextButton.styleFrom( 36 | foregroundColor: Theme.of(context).colorScheme.onSurface, 37 | backgroundColor: Theme.of(context).colorScheme.surface, 38 | side: BorderSide(width: 1, color: Theme.of(context).colorScheme.error) 39 | ), 40 | icon: const Icon(Icons.close), 41 | label: const Text("Cancel",), 42 | ), 43 | TextButton.icon( 44 | onPressed: () { 45 | Navigator.of(context).pop(true); 46 | }, 47 | style: TextButton.styleFrom( 48 | foregroundColor: Theme.of(context).colorScheme.onSurface, 49 | backgroundColor: Theme.of(context).colorScheme.surface, 50 | side: BorderSide(width: 1, color: Theme.of(context).colorScheme.primary) 51 | ), 52 | icon: const Icon(Icons.check), 53 | label: const Text("Okay"), 54 | ) 55 | ], 56 | ), 57 | ), 58 | ), 59 | ], 60 | ), 61 | ); 62 | } 63 | } -------------------------------------------------------------------------------- /lib/widgets/messages/message_text.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/services.dart'; 5 | import 'package:recon/models/message.dart'; 6 | import 'package:recon/widgets/formatted_text.dart'; 7 | import 'package:recon/widgets/messages/message_state_indicator.dart'; 8 | 9 | class MessageText extends StatelessWidget { 10 | const MessageText({required this.message, this.foregroundColor, super.key}); 11 | 12 | final Message message; 13 | final Color? foregroundColor; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return InkWell( 18 | borderRadius: BorderRadius.circular(16), 19 | onLongPress: () async { 20 | await Clipboard.setData(ClipboardData(text: message.content)); 21 | if (context.mounted) { 22 | const content = Text("Copied to clipboard"); 23 | ScaffoldMessenger.of(context).showSnackBar( 24 | Platform.isIOS 25 | ? const SnackBar(content: content) 26 | : SnackBar( 27 | content: content, 28 | behavior: SnackBarBehavior.floating, 29 | shape: RoundedRectangleBorder( 30 | borderRadius: BorderRadius.circular(16), 31 | ), 32 | dismissDirection: DismissDirection.none, 33 | margin: EdgeInsets.only( 34 | bottom: MediaQuery.of(context).size.height - 170, 35 | right: 20, 36 | left: 20, 37 | ), 38 | ), 39 | ); 40 | } 41 | }, 42 | child: Column( 43 | crossAxisAlignment: CrossAxisAlignment.end, 44 | children: [ 45 | Container( 46 | constraints: const BoxConstraints(maxWidth: 300), 47 | padding: const EdgeInsets.symmetric(horizontal: 8), 48 | child: FormattedText( 49 | message.formattedContent, 50 | softWrap: true, 51 | maxLines: null, 52 | style: Theme.of(context).textTheme.bodyLarge?.copyWith(color: foregroundColor), 53 | ), 54 | ), 55 | Row( 56 | mainAxisSize: MainAxisSize.min, 57 | mainAxisAlignment: MainAxisAlignment.end, 58 | children: [ 59 | MessageStateIndicator( 60 | message: message, 61 | foregroundColor: foregroundColor, 62 | ), 63 | ], 64 | ), 65 | ], 66 | ), 67 | ); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /lib/models/sem_ver.dart: -------------------------------------------------------------------------------- 1 | 2 | class SemVer { 3 | static final RegExp _versionMatcher = RegExp(r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"); 4 | static final RegExp _characterFilter = RegExp(r"^[a-zA-Z]+"); 5 | final int major; 6 | final int minor; 7 | final int patch; 8 | final String? label; 9 | 10 | SemVer({required this.major, required this.minor, required this.patch, this.label}); 11 | 12 | factory SemVer.fromString(String str) { 13 | str = str.replaceAll(_characterFilter, ""); 14 | final match = _versionMatcher.firstMatch(str); 15 | if (match == null || match.group(1) == null) { 16 | throw "Invalid version format"; 17 | } 18 | 19 | return SemVer( 20 | major: int.parse(match.group(1)!), 21 | minor: int.parse(match.group(2) ?? "0"), 22 | patch: int.parse(match.group(3) ?? "0"), 23 | label: match.group(4), 24 | ); 25 | } 26 | 27 | factory SemVer.zero() { 28 | return SemVer(major: 0, minor: 0, patch: 0); 29 | } 30 | 31 | factory SemVer.max() { 32 | //Chosen because it is larger than any version this app will ever see but small enough to not look bad when displayed as text 33 | const max = 999; 34 | return SemVer(major: max, minor: max, patch: max); 35 | } 36 | 37 | bool get isZero => major == 0 && minor == 0 && patch == 0; 38 | 39 | bool get isNotZero => !isZero; 40 | 41 | @override 42 | String toString() { 43 | return "$major.$minor.$patch${label == null ? "" : "-$label"}"; 44 | } 45 | 46 | @override 47 | bool operator ==(Object other) => 48 | identical(this, other) || 49 | other is SemVer && 50 | runtimeType == other.runtimeType && 51 | major == other.major && 52 | minor == other.minor && 53 | patch == other.patch && 54 | label == other.label; 55 | 56 | @override 57 | int get hashCode => major.hashCode ^ minor.hashCode ^ patch.hashCode ^ label.hashCode; 58 | 59 | bool operator >(SemVer other) { 60 | if (major > other.major || (major == other.major && minor > other.minor) || (major == other.major && minor == other.minor && patch > other.patch)) { 61 | return true; 62 | } 63 | return false; 64 | } 65 | 66 | bool operator >=(SemVer other) { 67 | if (this == other) return true; 68 | return this > other; 69 | } 70 | 71 | bool operator <(SemVer other) { 72 | return !(this > other); 73 | } 74 | 75 | bool operator <=(SemVer other) { 76 | if (this == other) return true; 77 | return this < other; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 22 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /lib/widgets/update_notifier.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/client_holder.dart'; 2 | import 'package:recon/models/sem_ver.dart'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:url_launcher/url_launcher.dart'; 5 | 6 | class UpdateNotifier extends StatelessWidget { 7 | const UpdateNotifier({required this.remoteVersion, required this.localVersion, super.key}); 8 | 9 | final SemVer remoteVersion; 10 | final SemVer localVersion; 11 | 12 | @override 13 | Widget build(BuildContext context) { 14 | return AlertDialog( 15 | title: Text("Update Available", style: Theme 16 | .of(context) 17 | .textTheme 18 | .titleLarge), 19 | content: Column( 20 | mainAxisSize: MainAxisSize.min, 21 | children: [ 22 | const Text("There is a new version available for download!"), 23 | const SizedBox(height: 8,), 24 | Row( 25 | children: [ 26 | Text("Your version: ${localVersion.toString()}"), 27 | ], 28 | ), 29 | Row( 30 | children: [ 31 | Text("New version: ${remoteVersion.toString()}"), 32 | ], 33 | ), 34 | const SizedBox(height: 24,), 35 | Row( 36 | mainAxisAlignment: MainAxisAlignment.center, 37 | mainAxisSize: MainAxisSize.min, 38 | children: [ 39 | TextButton.icon( 40 | onPressed: () { 41 | launchUrl(Uri.parse("https://github.com/Nutcake/ReCon/releases/latest"), 42 | mode: LaunchMode.externalApplication, 43 | ); 44 | }, 45 | style: TextButton.styleFrom( 46 | padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 24), 47 | foregroundColor: Theme 48 | .of(context) 49 | .colorScheme 50 | .onSecondary, 51 | backgroundColor: Theme 52 | .of(context) 53 | .colorScheme 54 | .secondary 55 | ), 56 | icon: const Icon(Icons.download), 57 | label: const Text("Get it on Github"), 58 | ), 59 | ], 60 | ), 61 | ], 62 | ), 63 | actions: [ 64 | TextButton( 65 | onPressed: () { 66 | final sClient = ClientHolder 67 | .of(context) 68 | .settingsClient; 69 | sClient.changeSettings(sClient.currentSettings.copyWith(lastDismissedVersion: remoteVersion.toString())); 70 | Navigator.of(context).pop(); 71 | }, 72 | child: const Text("I'll do it later."), 73 | ), 74 | ], 75 | ); 76 | } 77 | } -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Flutter Assemble.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 42 | 43 | 46 | 47 | 48 | 49 | 55 | 56 | 62 | 63 | 64 | 65 | 67 | 68 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /lib/widgets/messages/message_invite_request.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:recon/client_holder.dart'; 5 | import 'package:recon/models/invite_request.dart'; 6 | import 'package:recon/models/message.dart'; 7 | import 'package:recon/string_formatter.dart'; 8 | import 'package:recon/widgets/formatted_text.dart'; 9 | import 'package:recon/widgets/messages/message_state_indicator.dart'; 10 | 11 | class MessageInviteRequest extends StatelessWidget { 12 | const MessageInviteRequest({required this.message, this.foregroundColor, super.key}); 13 | 14 | final Color? foregroundColor; 15 | final Message message; 16 | @override 17 | Widget build(BuildContext context) { 18 | final inviteInfo = InviteRequest.fromMap(jsonDecode(message.content)); 19 | final bool fromSelf = message.senderId == ClientHolder.of(context).apiClient.userId; 20 | final bool selfRequest = fromSelf && inviteInfo.forSessionName == null; 21 | String text; 22 | if (selfRequest) { 23 | //if the sender is the logged in user and the session name isn't included; this is the user requesting for an invite themselves. 24 | text ='''Requested invite'''; 25 | } else if (fromSelf) { 26 | //Forwarded invite request 27 | text = '''Forwarded invite request from "${inviteInfo.usernameToInvite}" to session "${inviteInfo.forSessionName}"'''; 28 | } else if (inviteInfo.forSessionName != null) { 29 | //Another user requested an invite from you. 30 | text = '''${inviteInfo.usernameToInvite} would like to join you in "${inviteInfo.forSessionName}"'''; 31 | } else { 32 | text = '''${inviteInfo.usernameToInvite} would like to join you'''; 33 | } 34 | 35 | final formattedText = FormatNode.fromText(text); 36 | 37 | return Container( 38 | constraints: const BoxConstraints(maxWidth: 300), 39 | child: Column( 40 | crossAxisAlignment: CrossAxisAlignment.end, 41 | children: [ 42 | Container( 43 | constraints: const BoxConstraints(maxWidth: 300), 44 | padding: const EdgeInsets.symmetric(horizontal: 8), 45 | child: 46 | FormattedText( 47 | formattedText, 48 | softWrap: true, 49 | maxLines: null, 50 | style: Theme 51 | .of(context) 52 | .textTheme 53 | .bodyLarge 54 | ?.copyWith(color: foregroundColor),), 55 | ), 56 | Row( 57 | mainAxisSize: MainAxisSize.min, 58 | mainAxisAlignment: MainAxisAlignment.end, 59 | children: [ 60 | MessageStateIndicator( 61 | message: message, 62 | foregroundColor: foregroundColor, 63 | ), 64 | ], 65 | ), 66 | ], 67 | ), 68 | ); 69 | } 70 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_dynamic_calls 26 | - avoid_slow_async_io 27 | - avoid_type_to_string 28 | - literal_only_boolean_expressions 29 | - no_adjacent_strings_in_list 30 | - no_logic_in_create_state 31 | - no_self_assignments 32 | - no_wildcard_variable_uses 33 | - prefer_void_to_null 34 | - unnecessary_statements 35 | - always_declare_return_types 36 | - avoid_bool_literals_in_conditional_expressions 37 | - avoid_escaping_inner_quotes 38 | - avoid_field_initializers_in_const_classes 39 | - avoid_returning_this 40 | - avoid_types_on_closure_parameters 41 | - avoid_unused_constructor_parameters 42 | - await_only_futures 43 | - avoid_void_async 44 | - cascade_invocations 45 | - cast_nullable_to_non_nullable 46 | - directives_ordering 47 | - join_return_with_assignment 48 | - matching_super_parameters 49 | - missing_whitespace_between_adjacent_strings 50 | - no_literal_bool_comparisons 51 | - no_runtimeType_toString 52 | - noop_primitive_operations 53 | - omit_local_variable_types 54 | - one_member_abstracts 55 | - prefer_constructors_over_static_methods 56 | - prefer_final_in_for_each 57 | - prefer_final_locals 58 | - prefer_foreach 59 | - prefer_if_elements_to_conditional_expressions 60 | - prefer_null_aware_method_calls 61 | - require_trailing_commas 62 | - sized_box_shrink_expand 63 | - unawaited_futures 64 | - unnecessary_await_in_return 65 | - unnecessary_lambdas 66 | - unnecessary_parenthesis 67 | - unnecessary_raw_strings 68 | - use_colored_box 69 | - use_decorated_box 70 | - use_enums 71 | - use_if_null_to_convert_nulls_to_bools 72 | - use_is_even_rather_than_modulo 73 | - use_late_for_private_fields_and_variables 74 | - use_named_constants 75 | - use_raw_strings 76 | - use_string_buffers 77 | 78 | # Additional information about this file can be found at 79 | # https://dart.dev/guides/language/analysis-options 80 | -------------------------------------------------------------------------------- /lib/widgets/friends/expanding_input_fab.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class ExpandingInputFab extends StatefulWidget { 4 | const ExpandingInputFab({this.onExpansionChanged, this.onInputChanged, super.key}); 5 | 6 | final Function(bool expanded)? onExpansionChanged; 7 | final Function(String text)? onInputChanged; 8 | 9 | @override 10 | State createState() => _ExpandingInputFabState(); 11 | } 12 | 13 | class _ExpandingInputFabState extends State { 14 | final TextEditingController _inputController = TextEditingController(); 15 | final FocusNode _inputFocusNode = FocusNode(); 16 | bool _isExtended = false; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | final screenWidth = MediaQuery.of(context).size.width; 21 | return Padding( 22 | padding: const EdgeInsets.all(16.0), 23 | child: Row( 24 | mainAxisSize: MainAxisSize.max, 25 | mainAxisAlignment: MainAxisAlignment.end, 26 | children: [ 27 | AnimatedSize( 28 | alignment: Alignment.bottomRight, 29 | duration: const Duration(milliseconds: 200), 30 | reverseDuration: const Duration(milliseconds: 200), 31 | curve: Curves.easeInOut, 32 | child: Material( 33 | elevation: 4, 34 | borderRadius: BorderRadius.circular(16), 35 | color: Theme.of(context).colorScheme.primaryContainer, 36 | child: Row( 37 | mainAxisAlignment: MainAxisAlignment.end, 38 | mainAxisSize: MainAxisSize.min, 39 | children: [ 40 | SizedBox( 41 | width: _isExtended ? screenWidth * 0.75 : 0.0, 42 | child: _isExtended ? TextField( 43 | focusNode: _inputFocusNode, 44 | onChanged: widget.onInputChanged, 45 | controller: _inputController, 46 | decoration: const InputDecoration( 47 | border: OutlineInputBorder( 48 | borderSide: BorderSide.none, 49 | ), 50 | isDense: true, 51 | contentPadding: EdgeInsets.symmetric(vertical: 0, horizontal: 16), 52 | ), 53 | ) : null, 54 | ), 55 | Padding( 56 | padding: const EdgeInsets.all(4.0), 57 | child: IconButton( 58 | onPressed: () { 59 | setState(() { 60 | _isExtended = !_isExtended; 61 | }); 62 | if (_isExtended) _inputFocusNode.requestFocus(); 63 | _inputController.clear(); 64 | widget.onInputChanged?.call(""); 65 | widget.onExpansionChanged?.call(_isExtended); 66 | }, 67 | splashRadius: 16, 68 | iconSize: 28, 69 | icon: _isExtended ? const Icon(Icons.close) : const Icon(Icons.search), 70 | ), 71 | ) 72 | ], 73 | ), 74 | ), 75 | ), 76 | ], 77 | ), 78 | ); 79 | } 80 | } -------------------------------------------------------------------------------- /lib/widgets/homepage.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:recon/widgets/friends/friends_list.dart'; 3 | import 'package:recon/widgets/friends/friends_list_app_bar.dart'; 4 | import 'package:recon/widgets/inventory/inventory_browser.dart'; 5 | import 'package:recon/widgets/inventory/inventory_browser_app_bar.dart'; 6 | import 'package:recon/widgets/sessions/session_list.dart'; 7 | import 'package:recon/widgets/sessions/session_list_app_bar.dart'; 8 | import 'package:recon/widgets/settings_app_bar.dart'; 9 | import 'package:recon/widgets/settings_page.dart'; 10 | import 'package:recon/widgets/worlds/world_list.dart'; 11 | import 'package:recon/widgets/worlds/world_list_app_bar.dart'; 12 | 13 | class Home extends StatefulWidget { 14 | const Home({super.key}); 15 | 16 | @override 17 | State createState() => _HomeState(); 18 | } 19 | 20 | class _HomeState extends State { 21 | late final List _appBars = [ 22 | const FriendsListAppBar(), 23 | const SessionListAppBar(), 24 | WorldListAppBar( 25 | onQueryChanged: ({required needle, required sortDirection, required sortParameter}) { 26 | _worldListKey.currentState?.changeQuery( 27 | needle: needle, 28 | sortDirection: sortDirection, 29 | sortParameter: sortParameter, 30 | ); 31 | }, 32 | ), 33 | const InventoryBrowserAppBar(), 34 | const SettingsAppBar(), 35 | ]; 36 | final PageController _pageController = PageController(); 37 | final _worldListKey = GlobalKey(); 38 | 39 | int _selectedPage = 0; 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return Scaffold( 44 | backgroundColor: Theme.of(context).colorScheme.surface, 45 | appBar: PreferredSize( 46 | preferredSize: const Size.fromHeight(kToolbarHeight), 47 | child: AnimatedSwitcher( 48 | duration: const Duration(milliseconds: 200), 49 | child: _appBars[_selectedPage], 50 | ), 51 | ), 52 | body: PageView( 53 | controller: _pageController, 54 | physics: const NeverScrollableScrollPhysics(), 55 | children: [ 56 | const FriendsList(), 57 | const SessionList(), 58 | WorldList(key: _worldListKey), 59 | const InventoryBrowser(), 60 | ], 61 | ), 62 | bottomNavigationBar: NavigationBar( 63 | selectedIndex: _selectedPage, 64 | onDestinationSelected: (index) { 65 | _pageController.animateToPage( 66 | index, 67 | duration: const Duration(milliseconds: 200), 68 | curve: Curves.easeOut, 69 | ); 70 | setState(() { 71 | _selectedPage = index; 72 | }); 73 | }, 74 | destinations: const [ 75 | NavigationDestination( 76 | icon: Icon(Icons.message), 77 | label: "Chat", 78 | ), 79 | NavigationDestination( 80 | icon: Icon(Icons.groups), 81 | label: "Sessions", 82 | ), 83 | NavigationDestination( 84 | icon: Icon(Icons.public), 85 | label: "Worlds", 86 | ), 87 | NavigationDestination( 88 | icon: Icon(Icons.inventory), 89 | label: "Inventory", 90 | ), 91 | ], 92 | ), 93 | ); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "icon_40x40@2x.png", 5 | "idiom" : "iphone", 6 | "scale" : "2x", 7 | "size" : "20x20" 8 | }, 9 | { 10 | "filename" : "icon_60x60@3x.png", 11 | "idiom" : "iphone", 12 | "scale" : "3x", 13 | "size" : "20x20" 14 | }, 15 | { 16 | "filename" : "icon_58x58@2x.png", 17 | "idiom" : "iphone", 18 | "scale" : "2x", 19 | "size" : "29x29" 20 | }, 21 | { 22 | "filename" : "icon_87x87@3x.png", 23 | "idiom" : "iphone", 24 | "scale" : "3x", 25 | "size" : "29x29" 26 | }, 27 | { 28 | "filename" : "icon_80x80@2x.png", 29 | "idiom" : "iphone", 30 | "scale" : "2x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "filename" : "icon_120x120@3x.png", 35 | "idiom" : "iphone", 36 | "scale" : "3x", 37 | "size" : "40x40" 38 | }, 39 | { 40 | "filename" : "icon_60x60@2x.png", 41 | "idiom" : "iphone", 42 | "scale" : "2x", 43 | "size" : "60x60" 44 | }, 45 | { 46 | "filename" : "icon_180x180@3x.png", 47 | "idiom" : "iphone", 48 | "scale" : "3x", 49 | "size" : "60x60" 50 | }, 51 | { 52 | "filename" : "icon_40x40@2x 1.png", 53 | "idiom" : "ipad", 54 | "scale" : "2x", 55 | "size" : "20x20" 56 | }, 57 | { 58 | "filename" : "icon_58x58@2x 1.png", 59 | "idiom" : "ipad", 60 | "scale" : "2x", 61 | "size" : "29x29" 62 | }, 63 | { 64 | "filename" : "icon_80x80@2x 1.png", 65 | "idiom" : "ipad", 66 | "scale" : "2x", 67 | "size" : "40x40" 68 | }, 69 | { 70 | "filename" : "icon_76x76@2x.png", 71 | "idiom" : "ipad", 72 | "scale" : "2x", 73 | "size" : "76x76" 74 | }, 75 | { 76 | "filename" : "icon_83.5x83.5@2x.png", 77 | "idiom" : "ipad", 78 | "scale" : "2x", 79 | "size" : "83.5x83.5" 80 | }, 81 | { 82 | "filename" : "icon_1024x1024.png", 83 | "idiom" : "ios-marketing", 84 | "scale" : "1x", 85 | "size" : "1024x1024" 86 | }, 87 | { 88 | "filename" : "icon_114x114@3x.png", 89 | "idiom" : "universal", 90 | "scale" : "3x", 91 | "size" : "114x114" 92 | }, 93 | { 94 | "filename" : "icon_120x120@2x.png", 95 | "idiom" : "universal", 96 | "scale" : "2x", 97 | "size" : "120x120" 98 | }, 99 | { 100 | "filename" : "icon_128x128@2x.png", 101 | "idiom" : "universal", 102 | "scale" : "2x", 103 | "size" : "128x128" 104 | }, 105 | { 106 | "filename" : "icon_136x136@2x.png", 107 | "idiom" : "universal", 108 | "scale" : "2x", 109 | "size" : "136x136" 110 | }, 111 | { 112 | "filename" : "icon_152x152@2x.png", 113 | "idiom" : "universal", 114 | "scale" : "2x", 115 | "size" : "152x152" 116 | }, 117 | { 118 | "filename" : "icon_167x167@2x.png", 119 | "idiom" : "universal", 120 | "scale" : "2x", 121 | "size" : "167x167" 122 | }, 123 | { 124 | "filename" : "icon_192x192@3x.png", 125 | "idiom" : "universal", 126 | "scale" : "3x", 127 | "size" : "192x192" 128 | } 129 | ], 130 | "info" : { 131 | "author" : "xcode", 132 | "version" : 1 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/models/invite_request.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/models/session.dart'; 2 | 3 | class InviteRequest { 4 | final String inviteRequestId; 5 | final String userIdToInvite; 6 | final String usernameToInvite; 7 | final String requestingFromUserId; 8 | final String requestingFromUsername; 9 | final String? forSessionId; 10 | final String? forSessionName; 11 | final bool? isContactOfHost; 12 | final String? response; 13 | final Session? invite; 14 | 15 | InviteRequest({ 16 | required this.inviteRequestId, 17 | required this.userIdToInvite, 18 | required this.usernameToInvite, 19 | required this.requestingFromUserId, 20 | required this.requestingFromUsername, 21 | required this.forSessionId, 22 | required this.forSessionName, 23 | required this.isContactOfHost, 24 | required this.response, 25 | required this.invite, 26 | 27 | }); 28 | 29 | factory InviteRequest.none() { 30 | return InviteRequest( 31 | inviteRequestId: "", 32 | userIdToInvite: "", 33 | usernameToInvite: "", 34 | requestingFromUserId: "", 35 | requestingFromUsername: "", 36 | forSessionId: null, 37 | forSessionName: null, 38 | isContactOfHost: null, 39 | response: null, 40 | invite: null, 41 | ); 42 | } 43 | 44 | factory InviteRequest.fromMap(Map? map) { 45 | if (map == null) return InviteRequest.none(); 46 | return InviteRequest( 47 | inviteRequestId: map["inviteRequestId"], 48 | userIdToInvite: map["userIdToInvite"], 49 | usernameToInvite: map["usernameToInvite"], 50 | requestingFromUserId: map["requestingFromUserId"], 51 | requestingFromUsername: map["requestingFromUsername"], 52 | forSessionId: map["forSessionId"], 53 | forSessionName: map["forSessionName"], 54 | isContactOfHost: map["isContactOfHost"], 55 | response: map["response"], 56 | invite: Session.fromMap(map["invite"]), 57 | ); 58 | } 59 | 60 | Map toMap({bool shallow = false}) { 61 | return { 62 | "inviteRequestId": inviteRequestId, 63 | "userIdToInvite": userIdToInvite, 64 | "usernameToInvite": usernameToInvite, 65 | "requestingFromUserId": requestingFromUserId, 66 | "requestingFromUsername": requestingFromUsername, 67 | "forSessionId": forSessionId, 68 | "forSessionName": forSessionName, 69 | "isContactOfHost": isContactOfHost, 70 | "response": response, 71 | "invite": invite, 72 | }; 73 | } 74 | 75 | InviteRequest copyWith({ 76 | String? inviteRequestId, 77 | String? userIdToInvite, 78 | String? usernameToInvite, 79 | String? requestingFromUserId, 80 | String? requestingFromUsername, 81 | String? forSessionId, 82 | String? forSessionName, 83 | bool? isContactOfHost, 84 | String? response, 85 | Session? invite, 86 | }) { 87 | return InviteRequest( 88 | inviteRequestId: inviteRequestId ?? this.inviteRequestId, 89 | userIdToInvite: userIdToInvite ?? this.userIdToInvite, 90 | usernameToInvite: usernameToInvite ?? this.usernameToInvite, 91 | requestingFromUserId: requestingFromUserId ?? this.requestingFromUserId, 92 | requestingFromUsername: requestingFromUsername ?? this.requestingFromUsername, 93 | forSessionId: forSessionId ?? this.forSessionId, 94 | forSessionName: forSessionName ?? this.forSessionName, 95 | isContactOfHost: isContactOfHost ?? this.isContactOfHost, 96 | response: response ?? this.response, 97 | invite: invite ?? this.invite, 98 | ); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /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\\icon_256.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", "de.voidspace" "\0" 93 | VALUE "FileDescription", "recon" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "recon" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2023 de.voidspace. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "recon.exe" "\0" 98 | VALUE "ProductName", "recon" "\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/models/users/entitlement.dart: -------------------------------------------------------------------------------- 1 | import 'package:recon/auxiliary.dart'; 2 | 3 | class Entitlement { 4 | Entitlement(); 5 | 6 | factory Entitlement.fromMap(Map map) { 7 | final type = map["\$type"]; 8 | 9 | return switch (type) { 10 | "storageSpace" => StorageSpace.fromMap(map), 11 | "badge" => Badge.fromMap(map), 12 | "shoutOut" => ShoutOut.fromMap(map), 13 | "credits" => Credits.fromMap(map), 14 | _ => Entitlement(), 15 | }; 16 | } 17 | } 18 | 19 | class StorageSpace extends Entitlement { 20 | final int bytes; 21 | final StorageShareLevel maximumShareLevel; 22 | final String storageId; 23 | final String group; 24 | final DateTime startsOn; 25 | final DateTime expiresOn; 26 | final String name; 27 | final String description; 28 | 29 | StorageSpace({ 30 | required this.bytes, 31 | required this.maximumShareLevel, 32 | required this.storageId, 33 | required this.group, 34 | required this.startsOn, 35 | required this.expiresOn, 36 | required this.name, 37 | required this.description, 38 | }); 39 | 40 | factory StorageSpace.fromMap(Map map) { 41 | return StorageSpace( 42 | bytes: map["bytes"], 43 | maximumShareLevel: StorageShareLevel.fromString(map["maximumShareLevel"]), 44 | storageId: map["storageId"], 45 | group: map["group"], 46 | startsOn: DateTime.tryParse(map["startsOn"] ?? "") ?? DateTimeX.epoch, 47 | expiresOn: DateTime.tryParse(map["expiresOn"] ?? "") ?? DateTimeX.epoch, 48 | name: map["name"], 49 | description: map["description"], 50 | ); 51 | } 52 | } 53 | 54 | enum BadgeType { 55 | static2D, 56 | model 57 | } 58 | 59 | enum StorageShareLevel { 60 | none, 61 | groups, 62 | groupsAndUsers; 63 | 64 | factory StorageShareLevel.fromString(String text) { 65 | return StorageShareLevel.values.firstWhere((element) => element.name.toLowerCase() == text.toLowerCase(), 66 | orElse: () => StorageShareLevel.none, 67 | ); 68 | } 69 | } 70 | 71 | class Badge extends Entitlement { 72 | final BadgeType badgeType; 73 | final int badgeCount; 74 | final List entitlementOrigins; 75 | 76 | Badge({ 77 | required this.badgeType, 78 | required this.badgeCount, 79 | required this.entitlementOrigins, 80 | }); 81 | 82 | factory Badge.fromMap(Map map) { 83 | return Badge( 84 | badgeType: BadgeType.values.firstWhere((e) => e.name == map["badgeType"], orElse: () => BadgeType.static2D), 85 | badgeCount: map["badgeCount"], 86 | entitlementOrigins: List.from(map["entitlementOrigins"] ?? []), 87 | ); 88 | } 89 | } 90 | 91 | class ShoutOut extends Entitlement { 92 | final String shoutoutType; 93 | final List entitlementOrigins; 94 | 95 | ShoutOut({ 96 | required this.shoutoutType, 97 | required this.entitlementOrigins, 98 | }); 99 | 100 | factory ShoutOut.fromMap(Map map) { 101 | return ShoutOut( 102 | shoutoutType: map["shoutoutType"], 103 | entitlementOrigins: List.from(map["entitlementOrigins"] ?? []), 104 | ); 105 | } 106 | } 107 | 108 | enum CreditType { 109 | basic, 110 | prominent, 111 | spoken, 112 | sponsor 113 | } 114 | 115 | class Credits extends Entitlement { 116 | final CreditType creditType; 117 | final List entitlementOrigins; 118 | 119 | Credits({ 120 | required this.creditType, 121 | required this.entitlementOrigins, 122 | }); 123 | 124 | factory Credits.fromMap(Map map) { 125 | return Credits( 126 | creditType: CreditType.values.firstWhere((e) => e.name == map["creditType"], orElse: () => CreditType.basic), 127 | entitlementOrigins: List.from(map["entitlementOrigins"] ?? []), 128 | ); 129 | } 130 | } 131 | -------------------------------------------------------------------------------- /lib/widgets/friends/friends_list.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:provider/provider.dart'; 3 | import 'package:recon/clients/messaging_client.dart'; 4 | import 'package:recon/models/users/friend.dart'; 5 | import 'package:recon/widgets/default_error_widget.dart'; 6 | import 'package:recon/widgets/friends/expanding_input_fab.dart'; 7 | import 'package:recon/widgets/friends/friend_list_tile.dart'; 8 | 9 | class FriendsList extends StatefulWidget { 10 | const FriendsList({super.key}); 11 | 12 | @override 13 | State createState() => _FriendsListState(); 14 | } 15 | 16 | class _FriendsListState extends State with AutomaticKeepAliveClientMixin { 17 | String _searchFilter = ""; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | super.build(context); 22 | return Consumer( 23 | builder: (context, mClient, _) { 24 | return Stack( 25 | alignment: Alignment.topCenter, 26 | children: [ 27 | Builder( 28 | builder: (context) { 29 | if (mClient.initStatus == null) { 30 | return const LinearProgressIndicator(); 31 | } else if (mClient.initStatus!.isNotEmpty) { 32 | return Column( 33 | children: [ 34 | Expanded( 35 | child: DefaultErrorWidget( 36 | message: mClient.initStatus, 37 | onRetry: () async { 38 | mClient.resetInitStatus(); 39 | await mClient.refreshFriendsListWithErrorHandler(); 40 | }, 41 | ), 42 | ), 43 | ], 44 | ); 45 | } else { 46 | var friends = List.from(mClient.cachedFriends); // Explicit copy. 47 | if (_searchFilter.isNotEmpty) { 48 | friends = friends.where((element) => element.contactUsername.toLowerCase().contains(_searchFilter.toLowerCase())).toList() 49 | ..sort((a, b) => a.contactUsername.length.compareTo(b.contactUsername.length)); 50 | } 51 | return RefreshIndicator( 52 | onRefresh: () async { 53 | mClient.resetInitStatus(); 54 | await mClient.refreshFriendsListWithErrorHandler(); 55 | await Future.delayed(const Duration(seconds: 2)); // Just to show the refresh indicator, since we don't know how many status update events will be received. 56 | }, 57 | child: ListView.builder( 58 | itemCount: friends.length, 59 | itemBuilder: (context, index) { 60 | final friend = friends[index]; 61 | final unreads = mClient.getUnreadsForFriend(friend); 62 | return FriendListTile( 63 | friend: friend, 64 | unreads: unreads.length, 65 | ); 66 | }, 67 | ), 68 | ); 69 | } 70 | }, 71 | ), 72 | Align( 73 | alignment: Alignment.bottomCenter, 74 | child: ExpandingInputFab( 75 | onInputChanged: (text) { 76 | setState(() { 77 | _searchFilter = text; 78 | }); 79 | }, 80 | onExpansionChanged: (expanded) { 81 | if (!expanded) { 82 | setState(() { 83 | _searchFilter = ""; 84 | }); 85 | } 86 | }, 87 | ), 88 | ), 89 | ], 90 | ); 91 | }, 92 | ); 93 | } 94 | 95 | @override 96 | bool get wantKeepAlive => true; 97 | } 98 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /lib/widgets/messages/message_session_invite.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:recon/auxiliary.dart'; 4 | import 'package:recon/models/message.dart'; 5 | import 'package:recon/models/session.dart'; 6 | import 'package:recon/widgets/formatted_text.dart'; 7 | import 'package:recon/widgets/generic_avatar.dart'; 8 | import 'package:recon/widgets/messages/message_state_indicator.dart'; 9 | import 'package:recon/widgets/sessions/session_view.dart'; 10 | import 'package:flutter/material.dart'; 11 | 12 | class MessageSessionInvite extends StatelessWidget { 13 | const MessageSessionInvite({required this.message, this.foregroundColor, super.key}); 14 | 15 | final Color? foregroundColor; 16 | final Message message; 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | final sessionInfo = Session.fromMap(jsonDecode(message.content)); 21 | return Container( 22 | constraints: const BoxConstraints(maxWidth: 300), 23 | child: TextButton( 24 | onPressed: () { 25 | Navigator.of(context).push(MaterialPageRoute(builder: (context) => SessionView(session: sessionInfo))); 26 | }, 27 | style: TextButton.styleFrom(padding: EdgeInsets.zero), 28 | child: Container( 29 | padding: const EdgeInsets.only(left: 4), 30 | child: Column( 31 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 32 | mainAxisSize: MainAxisSize.min, 33 | crossAxisAlignment: CrossAxisAlignment.start, 34 | children: [ 35 | Row( 36 | mainAxisSize: MainAxisSize.max, 37 | crossAxisAlignment: CrossAxisAlignment.start, 38 | mainAxisAlignment: MainAxisAlignment.start, 39 | children: [ 40 | Padding( 41 | padding: const EdgeInsets.symmetric(horizontal: 4.0), 42 | child: Column( 43 | mainAxisSize: MainAxisSize.max, 44 | mainAxisAlignment: MainAxisAlignment.center, 45 | children: [ 46 | GenericAvatar( 47 | imageUri: Aux.resdbToHttp(sessionInfo.thumbnailUrl), 48 | placeholderIcon: Icons.no_photography, 49 | foregroundColor: foregroundColor, 50 | ), 51 | const SizedBox(height: 4,), 52 | Text("${sessionInfo.sessionUsers.length.toString().padLeft(2, "0")}/${sessionInfo.maxUsers.toString().padLeft(2, "0")}", style: Theme 53 | .of(context) 54 | .textTheme 55 | .bodyMedium 56 | ?.copyWith(color: foregroundColor),) 57 | ], 58 | ), 59 | ), 60 | Expanded( 61 | child: Padding( 62 | padding: const EdgeInsets.all(8), 63 | child: FormattedText(sessionInfo.formattedName, maxLines: null, softWrap: true, textAlign: TextAlign.start, style: Theme 64 | .of(context) 65 | .textTheme 66 | .titleMedium?.copyWith(color: foregroundColor),), 67 | ), 68 | ), 69 | ], 70 | ), 71 | const SizedBox(height: 8,), 72 | Row( 73 | mainAxisSize: MainAxisSize.max, 74 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 75 | children: [ 76 | Text("Hosted by ${sessionInfo.hostUsername}", overflow: TextOverflow.ellipsis, style: Theme 77 | .of(context) 78 | .textTheme 79 | .bodySmall 80 | ?.copyWith(color: foregroundColor?.withAlpha(150)),), 81 | MessageStateIndicator(message: message, foregroundColor: foregroundColor,), 82 | ], 83 | ) 84 | ], 85 | ), 86 | ), 87 | ), 88 | ); 89 | } 90 | } -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 43 | 49 | 50 | 51 | 52 | 53 | 63 | 65 | 71 | 72 | 73 | 74 | 80 | 82 | 88 | 89 | 90 | 91 | 93 | 94 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /lib/widgets/messages/message_asset.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | 3 | import 'package:cached_network_image/cached_network_image.dart'; 4 | import 'package:recon/auxiliary.dart'; 5 | import 'package:recon/models/photo_asset.dart'; 6 | import 'package:recon/models/message.dart'; 7 | import 'package:recon/string_formatter.dart'; 8 | import 'package:recon/widgets/formatted_text.dart'; 9 | import 'package:recon/widgets/messages/message_state_indicator.dart'; 10 | import 'package:flutter/material.dart'; 11 | import 'package:photo_view/photo_view.dart'; 12 | 13 | class MessageAsset extends StatelessWidget { 14 | const MessageAsset({required this.message, this.foregroundColor, super.key}); 15 | 16 | final Message message; 17 | final Color? foregroundColor; 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | final content = jsonDecode(message.content); 22 | final formattedName = FormatNode.fromText(content["name"]); 23 | return Container( 24 | constraints: const BoxConstraints(maxWidth: 300), 25 | child: Column( 26 | children: [ 27 | SizedBox( 28 | height: 256, 29 | width: double.infinity, 30 | child: CachedNetworkImage( 31 | imageUrl: Aux.resdbToHttp(content["thumbnailUri"]), 32 | imageBuilder: (context, image) { 33 | return InkWell( 34 | onTap: () async { 35 | PhotoAsset? photoAsset; 36 | try { 37 | photoAsset = PhotoAsset.fromTags((content["tags"] as List).map((e) => "$e").toList()); 38 | } catch (_) {} 39 | await Navigator.push( 40 | context, 41 | MaterialPageRoute( 42 | builder: (context) => Scaffold( 43 | appBar: AppBar( 44 | title: Text(formattedName.toString()), 45 | ), 46 | body: PhotoView( 47 | minScale: PhotoViewComputedScale.contained, 48 | imageProvider: photoAsset == null ? image : CachedNetworkImageProvider(Aux.resdbToHttp(photoAsset.imageUri)), 49 | heroAttributes: PhotoViewHeroAttributes(tag: message.id), 50 | ), 51 | ), 52 | ), 53 | ); 54 | }, 55 | child: Hero( 56 | tag: message.id, 57 | child: ClipRRect( 58 | borderRadius: BorderRadius.circular(16), 59 | child: Image( 60 | image: image, 61 | fit: BoxFit.cover, 62 | ), 63 | ), 64 | ), 65 | ); 66 | }, 67 | errorWidget: (context, url, error) => const Icon( 68 | Icons.broken_image, 69 | size: 64, 70 | ), 71 | placeholder: (context, uri) => const Center(child: CircularProgressIndicator()), 72 | ), 73 | ), 74 | const SizedBox( 75 | height: 8, 76 | ), 77 | Row( 78 | crossAxisAlignment: CrossAxisAlignment.end, 79 | mainAxisSize: MainAxisSize.min, 80 | children: [ 81 | Expanded( 82 | child: Padding( 83 | padding: const EdgeInsets.symmetric(horizontal: 4.0), 84 | child: FormattedText( 85 | formattedName, 86 | maxLines: null, 87 | style: Theme.of(context).textTheme.bodySmall?.copyWith(color: foregroundColor), 88 | ), 89 | ), 90 | ), 91 | MessageStateIndicator( 92 | message: message, 93 | foregroundColor: foregroundColor, 94 | ), 95 | ], 96 | ), 97 | ], 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /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, "ReCon"); 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, "ReCon"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 480, 900); 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 | --------------------------------------------------------------------------------