diff --git a/.circleci/config.yml b/.circleci/config.yml index ffeab99da..3c4365122 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,18 +2,36 @@ version: 2.1 orbs: android: circleci/android@2.5.0 - flutter: circleci/flutter@2.0.2 + flutter: circleci/flutter@2.0.4 node: circleci/node@5.2.0 advanced-checkout: vsco/advanced-checkout@1.1.0 +executors: + flutter-executor: + docker: + - image: cimg/base:stable + + commands: setup_flutter: + parameters: + version: + type: string + default: 3.24.3 + use_melos: + type: boolean + default: true + working_dir: + type: string + default: "~/project" steps: - flutter/install_sdk_and_pub: - version: 3.24.0 - - run: - name: Generate Pigeons - command: sh ./scripts/pigeon.sh + version: <> + app-dir: <> + - install_flutter_and_dart_packages: + generate_pigeons: true + use_melos: <> + working_dir: <> setup_ios: steps: # Flutter doesn't support Apple Silicon yet, so we need to install Rosetta use Flutter on M1 machines. @@ -26,7 +44,7 @@ commands: command: sudo gem install cocoapods - run: name: Install Pods - working_directory: example/ios + working_directory: packages/instabug_flutter/example/ios command: pod install --repo-update setup_captain: parameters: @@ -77,32 +95,71 @@ commands: name: Configure Captain Platform command: echo 'export CAPTAIN_PLATFORM=<>' >> $BASH_ENV # This runs `flutter pub get` and `dart pub get` if we pass parameter `generate_pigeons` to the job it also runs the following: - # - `sh ./scripts/pigeon.sh` - # - `dart run build_runner build --delete-conflicting-outputs` + # - `melos pigeon` + # - `melos generate` install_flutter_and_dart_packages: parameters: generate_pigeons: type: boolean + use_melos: + type: boolean + default: true + working_dir: + type: string steps: - - run: - name: Install Flutter Packages - command: flutter pub get - - run: - name: Install Dart Packages - command: dart pub get - description: Install Dart Packages (for dart explicit packages) - when: condition: equal: - - <> + - <> - true steps: - run: - name: Generate Pigeons - command: sh ./scripts/pigeon.sh + name: Install melos + command: dart pub global activate melos && echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> $BASH_ENV + - run: + name: Install Flutter Packages + command: melos bootstrap + - run: + name: Install Dart Packages + command: melos dart_bootstrap + description: Install Dart Packages (for dart explicit packages) + - when: + condition: + equal: + - <> + - true + steps: + - run: + name: Generate Pigeons + command: melos pigeon --no-select + - run: + name: Build Pigeons + command: melos generate --no-select + - when: + condition: + equal: + - <> + - false + steps: + - run: + name: Install Flutter Packages + command: flutter pub get - run: - name: Build Pigeons - command: dart run build_runner build --delete-conflicting-outputs + name: Install Dart Packages + command: dart pub get + description: Install Dart Packages (for dart explicit packages) + - when: + condition: + equal: + - <> + - true + steps: + - run: + name: Generate Pigeons + command: sh scripts/pigeon.sh + - run: + name: Build Pigeons + command: dart run build_runner build --delete-conflicting-outputs jobs: danger: @@ -114,7 +171,7 @@ jobs: pkg-manager: yarn override-ci-command: yarn install --frozen-lockfile --network-concurrency 1 - attach_workspace: - at: coverage + at: ~/project - run: name: Run Danger command: yarn danger ci @@ -123,20 +180,38 @@ jobs: parameters: version: type: string - docker: - - image: cirrusci/flutter:<> + default: "3.24.3" + executor: flutter-executor steps: - advanced-checkout/shallow-checkout - - install_flutter_and_dart_packages: - generate_pigeons: true - - run: flutter test --coverage - - run: - working_directory: coverage - command: lcov --remove lcov.info '*.g.dart' '*.mocks.dart' -o lcov.info + - run: sudo apt-get update&& sudo apt-get -y install lcov + - setup_flutter: + version: <> + use_melos: true + - run: melos test-coverage --no-select - persist_to_workspace: - root: coverage + root: ~/project paths: - - lcov.info + - coverage + + + test_flutter_without_melos: + parameters: + version: + type: string + default: "2.10.0" + app-dir: + type: string + executor: flutter-executor + working_directory: <> + steps: + - advanced-checkout/shallow-checkout: + path: ~/project + - setup_flutter: + version: <> + use_melos: false + working_dir: <> + - run: flutter test test_android: executor: @@ -147,7 +222,7 @@ jobs: - advanced-checkout/shallow-checkout - setup_flutter - android/run-tests: - working-directory: example/android + working-directory: packages/instabug_flutter/example/android test-command: ./gradlew test e2e_android_captain: @@ -162,9 +237,9 @@ jobs: - setup_flutter - android/start-emulator-and-run-tests: run-tests-working-directory: e2e - additional-avd-args: --device 3 + additional-avd-args: --device 25 system-image: system-images;android-33;default;x86_64 - post-emulator-launch-assemble-command: cd example && flutter build apk --debug + post-emulator-launch-assemble-command: cd packages/instabug_flutter/example && flutter build apk --debug test-command: dotnet test test_ios: @@ -178,7 +253,7 @@ jobs: - setup_ios - run: name: Build and run tests - working_directory: ~/project/example/ios + working_directory: ~/project/packages/instabug_flutter/example/ios command: | xcodebuild -allowProvisioningUpdates \ -workspace Runner.xcworkspace \ @@ -199,53 +274,72 @@ jobs: - setup_ios - run: name: Build Example App - working_directory: example + working_directory: packages/instabug_flutter/example command: flutter build ios --simulator - run: name: Run E2E Tests - no_output_timeout: 30m + no_output_timeout: 20m working_directory: e2e command: dotnet test format_flutter: - docker: - - image: cirrusci/flutter + executor: flutter-executor steps: - advanced-checkout/shallow-checkout - - install_flutter_and_dart_packages: - generate_pigeons: false + - setup_flutter - run: name: Check Format - command: dart format . --set-exit-if-changed + command: melos format lint_flutter: - docker: - - image: cirrusci/flutter + executor: flutter-executor steps: - advanced-checkout/shallow-checkout - - install_flutter_and_dart_packages: - generate_pigeons: true + - setup_flutter - run: name: Perform Static Analysis - command: flutter analyze + command: melos analyze verify_pub: - docker: - - image: cirrusci/flutter + executor: flutter-executor steps: - advanced-checkout/shallow-checkout - - install_flutter_and_dart_packages: - generate_pigeons: true + - setup_flutter - run: name: Check Package Score - command: dart run pana --no-warning --exit-code-threshold 0 - - run: flutter pub publish --dry-run + command: melos score --no-select + - run: melos dryPublish --no-select - release: + release_dio_plugin: + executor: flutter-executor + steps: + - advanced-checkout/shallow-checkout + - setup_flutter + - run: chmod +x packages/Instabug-Dio-Interceptor/release.sh + - run: ./packages/Instabug-Dio-Interceptor/release.sh + + release_http_adapter_plugin: + executor: flutter-executor + steps: + - advanced-checkout/shallow-checkout + - setup_flutter + - run: chmod +x packages/Instabug-Dart-http-Adapter/release.sh + - run: ./packages/Instabug-Dart-http-Adapter/release.sh + + release_modular_plugin: + executor: flutter-executor + steps: + - advanced-checkout/shallow-checkout + - setup_flutter + - run: chmod +x packages/instabug_flutter_modular/release.sh + - run: ./packages/instabug_flutter_modular/release.sh + + + release_instabug_flutter: macos: xcode: 15.2.0 resource_class: macos.m1.medium.gen1 - working_directory: "~" + working_directory: "~/project" steps: - advanced-checkout/shallow-checkout: path: ~/project @@ -254,7 +348,7 @@ jobs: name: Install Rosetta command: softwareupdate --install-rosetta --agree-to-license - flutter/install_sdk_and_pub: - version: 3.3.6 + version: 3.10.5 app-dir: project - run: name: Install pub packages @@ -263,7 +357,7 @@ jobs: - run: name: Generate Pigeons working_directory: project - command: sh ./scripts/pigeon.sh + command: melos pigeon --no-select - run: name: Clone Escape command: git clone git@github.com:Instabug/Escape.git @@ -288,10 +382,10 @@ workflows: - test_flutter-stable - test_flutter: name: test_flutter-stable - version: stable - - test_flutter: + - test_flutter_without_melos: name: test_flutter-2.10.5 version: 2.10.5 + app-dir: "~/project/packages/instabug_flutter/" - e2e_android_captain - test_ios - e2e_ios_captain @@ -302,7 +396,7 @@ workflows: - verify_pub: requires: - lint_flutter - - hold_release: + - hold_release_instabug_flutter: type: approval requires: - danger @@ -319,9 +413,51 @@ workflows: filters: branches: only: master - - release: + - hold_release_dio_plugin: + type: approval + requires: + - test_flutter-stable + filters: + branches: + only: master + - release_dio_plugin: + requires: + - hold_release_dio_plugin + - verify_pub + filters: + branches: + only: master + - hold_release_http_adapter_plugin: + type: approval + requires: + - test_flutter-stable + filters: + branches: + only: master + - release_http_adapter_plugin: + requires: + - hold_release_http_adapter_plugin + - verify_pub + filters: + branches: + only: master + - hold_release_modular_plugin: + type: approval + requires: + - test_flutter-stable + filters: + branches: + only: master + - release_modular_plugin: requires: - - hold_release + - hold_release_modular_plugin + - verify_pub + filters: + branches: + only: master + - release_instabug_flutter: + requires: + - hold_release_instabug_flutter filters: branches: - only: master \ No newline at end of file + only: master diff --git a/.gitignore b/.gitignore index 071964ca9..dfa529b28 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ # Generated files *.mocks.dart *.g.dart -android/**/generated/ -ios/**/Generated/ +packages/**/android/**/generated/ +packages/**/ios/**/Generated/ # Miscellaneous *.class @@ -63,6 +63,8 @@ android/gradlew.bat **/ios/**/DerivedData/ **/ios/**/Icon? **/ios/**/Pods/ +**/ios/**/Pods/ + **/ios/**/.symlinks/ **/ios/**/profile **/ios/**/xcuserdata @@ -84,3 +86,4 @@ android/gradlew.bat !**/ios/**/default.pbxuser !**/ios/**/default.perspectivev3 !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +/packages/**/lib/src/generated/ diff --git a/README.md b/README.md index 88080febd..4a260d8d2 100644 --- a/README.md +++ b/README.md @@ -1,116 +1,39 @@ -# Instabug for Flutter + -## Available Features +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. -| Feature | Status | -|:---------------------------------------------------------:|:-------:| -| [Bug Reporting](https://docs.instabug.com/docs/flutter-bug-reporting) | ✅ | -| [Crash Reporting](https://docs.instabug.com/docs/flutter-crash-reporting) | ✅ | -| [App Performance Monitoring](https://docs.instabug.com/docs/flutter-apm) | ✅ | -| [In-App Replies](https://docs.instabug.com/docs/flutter-in-app-replies) | ✅ | -| [In-App Surveys](https://docs.instabug.com/docs/flutter-in-app-surveys) | ✅ | -| [Feature Requests](https://docs.instabug.com/docs/flutter-in-app-feature-requests) | ✅ | +## Features -* ✅ Stable -* ⚙️ Under active development +TODO: List what your package can do. Maybe include images, gifs, or videos. -## Integration +## Getting started -### Installation +TODO: List prerequisites and provide or point to information on how to +start using the package. -1. Add Instabug to your `pubspec.yaml` file. +## Usage -```yaml -dependencies: - instabug_flutter: -``` - -2. Install the package by running the following command. - -```bash -flutter packages get -``` - -### Initializing Instabug - -Initialize the SDK in your `main` function. This starts the SDK with the default behavior and sets it to be shown when the device is shaken. +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. ```dart -import 'package:instabug_flutter/instabug_flutter.dart'; - -void main() { - WidgetsFlutterBinding.ensureInitialized(); - - Instabug.init( - token: 'APP_TOKEN', - invocationEvents: [InvocationEvent.shake], - ); - - runApp(MyApp()); -} +const like = 'sample'; ``` -> :warning: If you're updating the SDK from versions prior to v11, please check our [migration guide](https://docs.instabug.com/docs/flutter-migration-guide). - -## Crash reporting - -Instabug automatically captures every crash of your app and sends relevant details to the crashes page of your dashboard. - -⚠️ **Crashes will only be reported in release mode and not in debug mode.** - -```dart -void main() { - runZonedGuarded( - () { - WidgetsFlutterBinding.ensureInitialized(); - - Instabug.init( - token: 'APP_TOKEN', - invocationEvents: [InvocationEvent.shake], - ); - - FlutterError.onError = (FlutterErrorDetails details) { - Zone.current.handleUncaughtError(details.exception, details.stack!); - }; - - runApp(MyApp()); - }, - CrashReporting.reportCrash, - ); -} -``` - -## Repro Steps -Repro Steps list all of the actions an app user took before reporting a bug or crash, grouped by the screens they visited in your app. - - To enable this feature, you need to add `InstabugNavigatorObserver` to the `navigatorObservers` : - ``` - runApp(MaterialApp( - navigatorObservers: [InstabugNavigatorObserver()], - )); - ``` - -## Network Logging -You can choose to attach all your network requests to the reports being sent to the dashboard. To enable the feature when using the `dart:io` package `HttpClient`, please refer to the [Instabug Dart IO Http Client](https://github.com/Instabug/instabug-dart-io-http-client) repository. - -We also support the packages `http` and `dio`. For details on how to enable network logging for these external packages, refer to the [Instabug Dart Http Adapter](https://github.com/Instabug/Instabug-Dart-http-Adapter) and the [Instabug Dio Interceptor](https://github.com/Instabug/Instabug-Dio-Interceptor) repositories. - -## Microphone and Photo Library Usage Description (iOS Only) - -Instabug needs access to the microphone and photo library to be able to let users add audio and video attachments. Starting from iOS 10, apps that don’t provide a usage description for those 2 permissions would be rejected when submitted to the App Store. - -For your app not to be rejected, you’ll need to add the following 2 keys to your app’s info.plist file with text explaining to the user why those permissions are needed: - -* `NSMicrophoneUsageDescription` -* `NSPhotoLibraryUsageDescription` - -If your app doesn’t already access the microphone or photo library, we recommend using a usage description like: - -* "`` needs access to the microphone to be able to attach voice notes." -* "`` needs access to your photo library for you to be able to attach images." +## Additional information -**The permission alert for accessing the microphone/photo library will NOT appear unless users attempt to attach a voice note/photo while using Instabug.** +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/analysis_options.yaml b/analysis_options.yaml index 9e956095e..4f1f095e4 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -2,8 +2,9 @@ include: package:lint/analysis_options_package.yaml analyzer: exclude: - - "example/**" - - "**/*.g.dart" + - "packages/**/*.g.dart" + - "packages/**/example/**" + linter: rules: diff --git a/dangerfile.ts b/dangerfile.ts index 670ae0b05..ee0fb4944 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -1,5 +1,6 @@ import { danger, fail, schedule, warn } from 'danger'; -import collectCoverage, { ReportType } from '@instabug/danger-plugin-coverage'; +import collectCoverage, {ReportOptions, ReportType} from '@instabug/danger-plugin-coverage'; +import * as fs from 'fs'; const hasSourceChanges = danger.git.modified_files.some((file) => file.startsWith('lib/') @@ -20,7 +21,7 @@ async function hasDescription() { ); } - if (!danger.git.modified_files.includes('CHANGELOG.md') && !declaredTrivial) { + if (!danger.git.modified_files.includes('packages/instabug-Flutter/CHANGELOG.md') && !declaredTrivial) { warn( 'You have not included a CHANGELOG entry! \nYou can find it at [CHANGELOG.md](https://github.com/Instabug/Instabug-Flutter/blob/master/CHANGELOG.md).' ); @@ -29,9 +30,22 @@ async function hasDescription() { schedule(hasDescription()); -collectCoverage({ - label: 'Dart', - type: ReportType.LCOV, - filePath: 'coverage/lcov.info', - threshold: 80, -}); +// Function to extract the second part of the filename using '-' as a separator +const getLabelFromFilename = (filename: string): string | null => { + const parts = filename.split('-'); + return parts[1] ? parts[1].replace(/\.[^/.]+$/, '') : null; // Removes extension +}; + +console.log(JSON.stringify(getLabelFromFilename)); +const files = fs.readdirSync('coverage'); +let reportOptions: ReportOptions[] = []; +for (let file of files) { + reportOptions.push({ + label: getLabelFromFilename(file), + type: ReportType.LCOV, + filePath: "coverage/"+file, + threshold: 80, + }); +} +collectCoverage(reportOptions); + diff --git a/e2e/.gitignore b/e2e/.gitignore index a72f3ddc5..2afa2e272 100644 --- a/e2e/.gitignore +++ b/e2e/.gitignore @@ -1,454 +1,454 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# JetBrains Rider -.idea/ -*.sln.iml - -## -## Visual Studio Code -## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# JetBrains Rider +.idea/ +*.sln.iml + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json diff --git a/e2e/Utils/CaptainTest.cs b/e2e/Utils/CaptainTest.cs index 35749d727..e32255d4b 100644 --- a/e2e/Utils/CaptainTest.cs +++ b/e2e/Utils/CaptainTest.cs @@ -1,5 +1,7 @@ using System.Drawing; using Instabug.Captain; +using OpenQA.Selenium; +using OpenQA.Selenium.Appium.MultiTouch; namespace E2E.Utils; @@ -7,10 +9,11 @@ public class CaptainTest : IDisposable { private static readonly CaptainConfig _config = new() { - AndroidApp = Path.GetFullPath("../../../../example/build/app/outputs/flutter-apk/app-debug.apk"), + AndroidApp = Path.GetFullPath("../../../../packages/instabug_flutter/example/build/app/outputs/flutter-apk/app-debug.apk"), AndroidAppId = "com.instabug.flutter.example", AndroidVersion = "13", - IosApp = Path.GetFullPath("../../../../example/build/ios/iphonesimulator/Runner.app"), + + IosApp = Path.GetFullPath("../../../../packages/instabug_flutter/example/build/ios/iphonesimulator/Runner.app"), IosAppId = "com.instabug.InstabugSample", IosVersion = "17.2", IosDevice = "iPhone 15 Pro Max" @@ -28,28 +31,5 @@ public void Dispose() captain.RestartApp(); } - protected void ScrollDown() - { - captain.Swipe( - start: new Point(captain.Window.Size.Width / 2, captain.Window.Size.Height - 200), - end: new Point(captain.Window.Size.Width / 2, 250) - ); - } - - protected void ScrollDownLittle() - { - captain.Swipe( - start: new Point(captain.Window.Size.Width / 2, captain.Window.Size.Height - 200), - end: new Point(captain.Window.Size.Width / 2, captain.Window.Size.Height - 220) - ); - } - - protected void ScrollUp() - { - captain.Swipe( - start: new Point(captain.Window.Size.Width / 2, 250), - end: new Point(captain.Window.Size.Width / 2, captain.Window.Size.Height - 200) - ); - } } diff --git a/melos.yaml b/melos.yaml new file mode 100644 index 000000000..b96ab7100 --- /dev/null +++ b/melos.yaml @@ -0,0 +1,82 @@ +name: instabug_flutter_mono + +packages: + - packages/* + - packages/*/** +scripts: + dart_bootstrap: + run: dart pub get + analyze: + run: dart analyze . + format: + run: dart format . --set-exit-if-changed + exec: + concurrency: 1 + failFast: true + orderDependents: true + pigeon: + run: sh scripts/pigeon.sh + exec: + concurrency: 1 + failFast: true + orderDependents: true + packageFilters: + fileExists: 'scripts/pigeon.sh' + generate: + run: dart run build_runner build -d + description: Build all generated files for Dart & Flutter packages in this project.t + exec: + concurrency: 1 + failFast: true + orderDependents: true + packageFilters: + dependsOn: build_runner + test: + run: flutter test + description: Tests all packages. + exec: + concurrency: 1 + failFast: true + orderDependents: true + packageFilters: + dependsOn: flutter_test + test-coverage: + run: flutter test --coverage && cd coverage && lcov --ignore-errors unused --remove lcov.info '*.g.dart' '*.mocks.dart' -o lcov.info && sh ../../../scripts/move_coverage_files.sh + description: Tests all packages. + exec: + concurrency: 1 + failFast: true + orderDependents: true + select-package: + dir-exists: + - test + packageFilters: + dependsOn: flutter_test + dirExists: test + dryPublish: + run: flutter pub publish --dry-run + description: Tests publishing (dry run). + exec: + concurrency: 1 + orderDependents: true + packageFilters: + flutter: true + dependsOn: pana + private: false + pods: + run: cd ios && pod install --repo-update + description: running pod install + exec: + concurrency: 1 + orderDependents: true + packageFilters: + fileExists: 'ios/PodFile' + score: + run: dart run pana --no-warning --exit-code-threshold 0 + exec: + concurrency: 1 + orderDependents: true + packageFilters: + dependsOn: pana + private: false + diff --git a/packages/instabug_dio_interceptor/CHANGELOG.md b/packages/instabug_dio_interceptor/CHANGELOG.md new file mode 100644 index 000000000..4fd938e6f --- /dev/null +++ b/packages/instabug_dio_interceptor/CHANGELOG.md @@ -0,0 +1,55 @@ +# Changelog + +## [2.5.0] (2025-07-17) + +### Added +- supports Instabug SDK above 3.0.0 ([#33](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/33)). + +## [2.4.1] (2025-04-21) + +### Added +- supports Dart versions above 3.0.0 ([#32](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/32)). + +## [2.4.0] (2024-11-18) + +### Added + +- Add support for tracing network requests from Instabug to services like Datadog and New Relic ([#30](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/30)). + +## [2.3.0] - (2024-05-07) + +### Added + +- Add support for Instabug Flutter SDK v13 ([#28](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/28)). +- Add support for Instabug Flutter SDK v12 ([#26](https://github.com/Instabug/Instabug-Dio-Interceptor/pull/26)), closes [#25](https://github.com/Instabug/Instabug-Dio-Interceptor/issues/25). + +## v2.2.0 (2022-03-14) + +- Adds support for Dio v5 +- Relaxes dependencies version constraints + +## v2.1.1 (2022-08-01) + +- Bumps [instabug_flutter](https://pub.dev/packages/instabug_flutter) to v11 + +## v2.1.0 (2022-01-06) + +- Fixes network log compilation error. +- Adds payload size for network log. + +## v2.0.1 (2021-09-29) + +- Fixes an issue with APM network logger not reporting to the dashboard + +## v2.0.0 (2021-09-20) + +- Adds support for Dio v4.0 +- Upgrades to null safety + +## v1.0.0 (2019-07-29) + +- Updates instabug_flutter dependency name + +## v0.0.1 (2019-07-22) + +- Initial release diff --git a/packages/instabug_dio_interceptor/LICENSE b/packages/instabug_dio_interceptor/LICENSE new file mode 100644 index 000000000..e4ca5a0ed --- /dev/null +++ b/packages/instabug_dio_interceptor/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Instabug + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/instabug_dio_interceptor/README.md b/packages/instabug_dio_interceptor/README.md new file mode 100644 index 000000000..4fc3ec30d --- /dev/null +++ b/packages/instabug_dio_interceptor/README.md @@ -0,0 +1,17 @@ +# Instabug Dio Interceptor + +[![CircleCI](https://circleci.com/gh/Instabug/Instabug-Dio-Interceptor.svg?style=svg)](https://circleci.com/gh/Instabug/Instabug-Dio-Interceptor) +[![pub package](https://img.shields.io/pub/v/instabug_dio_interceptor.svg)](https://pub.dev/packages/instabug_dio_interceptor) + +This package is an add on to [Instabug-Flutter](https://github.com/Instabug/Instabug-Flutter). + +It intercepts any requests performed with `Dio` Package and sends them to the report that will be sent to the dashboard. + +## Integration + +To enable network logging, simply add the `InstabugDioInterceptor` to the dio object interceptors as follows: + +```dart +var dio = new Dio(); +dio.interceptors.add(InstabugDioInterceptor()); +``` diff --git a/packages/instabug_dio_interceptor/example/.metadata b/packages/instabug_dio_interceptor/example/.metadata new file mode 100644 index 000000000..5a023280a --- /dev/null +++ b/packages/instabug_dio_interceptor/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 7e9793dee1b85a243edd0e06cb1658e98b077561 + channel: stable + +project_type: app diff --git a/packages/instabug_dio_interceptor/example/README.md b/packages/instabug_dio_interceptor/example/README.md new file mode 100644 index 000000000..a13562602 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/instabug_dio_interceptor/example/android/.gitignore b/packages/instabug_dio_interceptor/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/instabug_dio_interceptor/example/android/app/build.gradle b/packages/instabug_dio_interceptor/example/android/app/build.gradle new file mode 100644 index 000000000..86b077f53 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/build.gradle @@ -0,0 +1,56 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + +android { + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } + + defaultConfig { + applicationId "com.example.example" + minSdkVersion 21 + targetSdkVersion 34 + versionCode flutter.versionCode + versionName flutter.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.debug + } + } + namespace = "com.example.example" + + configurations.all { + resolutionStrategy.force 'org.hamcrest:hamcrest-core:1.3' + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20" + implementation 'com.android.support:multidex:1.0.3' + implementation 'org.mockito:mockito-core:1.10.19' + testImplementation 'junit:junit:4.12' + testImplementation 'org.mockito:mockito-core:1.10.19' +} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/packages/instabug_dio_interceptor/example/android/app/src/debug/AndroidManifest.xml similarity index 100% rename from example/android/app/src/debug/AndroidManifest.xml rename to packages/instabug_dio_interceptor/example/android/app/src/debug/AndroidManifest.xml diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/AndroidManifest.xml b/packages/instabug_dio_interceptor/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..bed9771bc --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/packages/instabug_dio_interceptor/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 000000000..752fc185d --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/instabug_dio_interceptor/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 000000000..e793a000d --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/instabug_dio_interceptor/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/example/android/app/src/main/res/drawable/launch_background.xml b/packages/instabug_dio_interceptor/example/android/app/src/main/res/drawable/launch_background.xml similarity index 100% rename from example/android/app/src/main/res/drawable/launch_background.xml rename to packages/instabug_dio_interceptor/example/android/app/src/main/res/drawable/launch_background.xml diff --git a/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png rename to packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png rename to packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png rename to packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to packages/instabug_dio_interceptor/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/res/values-night/styles.xml b/packages/instabug_dio_interceptor/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..3db14bb53 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/res/values/styles.xml b/packages/instabug_dio_interceptor/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..d460d1e92 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/instabug_dio_interceptor/example/android/app/src/main/res/xml/network_security_config.xml b/packages/instabug_dio_interceptor/example/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 000000000..be9989192 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,13 @@ + + + + localhost + api.instabug.com + + + + + + + + diff --git a/example/android/app/src/profile/AndroidManifest.xml b/packages/instabug_dio_interceptor/example/android/app/src/profile/AndroidManifest.xml similarity index 100% rename from example/android/app/src/profile/AndroidManifest.xml rename to packages/instabug_dio_interceptor/example/android/app/src/profile/AndroidManifest.xml diff --git a/example/android/build.gradle b/packages/instabug_dio_interceptor/example/android/build.gradle similarity index 100% rename from example/android/build.gradle rename to packages/instabug_dio_interceptor/example/android/build.gradle diff --git a/example/android/gradle.properties b/packages/instabug_dio_interceptor/example/android/gradle.properties similarity index 100% rename from example/android/gradle.properties rename to packages/instabug_dio_interceptor/example/android/gradle.properties diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/instabug_dio_interceptor/example/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.properties rename to packages/instabug_dio_interceptor/example/android/gradle/wrapper/gradle-wrapper.properties diff --git a/example/android/settings.gradle b/packages/instabug_dio_interceptor/example/android/settings.gradle similarity index 100% rename from example/android/settings.gradle rename to packages/instabug_dio_interceptor/example/android/settings.gradle diff --git a/packages/instabug_dio_interceptor/example/ios/.gitignore b/packages/instabug_dio_interceptor/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/instabug_dio_interceptor/example/ios/Flutter/AppFrameworkInfo.plist b/packages/instabug_dio_interceptor/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..7c5696400 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/instabug_dio_interceptor/example/ios/Flutter/Debug.xcconfig b/packages/instabug_dio_interceptor/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/instabug_dio_interceptor/example/ios/Flutter/Release.xcconfig b/packages/instabug_dio_interceptor/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/instabug_dio_interceptor/example/ios/Podfile b/packages/instabug_dio_interceptor/example/ios/Podfile new file mode 100644 index 000000000..ba26ef371 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '14.4' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.pbxproj b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..43b09ccb5 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,555 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + AD44C4DB39F7C3968B8C56EB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18B300F826F2074CB5E450C4 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 18B300F826F2074CB5E450C4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3E0436312822B722E186D653 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 90FF03378459C589A4D9DA6E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DE25EB3DE5B281AB8980A728 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AD44C4DB39F7C3968B8C56EB /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3456E8E25F114A239880D241 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 18B300F826F2074CB5E450C4 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4955E253C000584F8EA1A042 /* Pods */ = { + isa = PBXGroup; + children = ( + 90FF03378459C589A4D9DA6E /* Pods-Runner.debug.xcconfig */, + 3E0436312822B722E186D653 /* Pods-Runner.release.xcconfig */, + DE25EB3DE5B281AB8980A728 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 4955E253C000584F8EA1A042 /* Pods */, + 3456E8E25F114A239880D241 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + F412A5213E8CA6290AF8A003 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 9BDEDB79123E51897883C720 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + 9BDEDB79123E51897883C720 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + F412A5213E8CA6290AF8A003 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = XNK224R4SF; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = XNK224R4SF; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = XNK224R4SF; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..5e31d3d34 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/instabug_dio_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata similarity index 100% rename from example/ios/Runner.xcworkspace/contents.xcworkspacedata rename to packages/instabug_dio_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata diff --git a/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_dio_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to packages/instabug_dio_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_dio_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to packages/instabug_dio_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/packages/instabug_dio_interceptor/example/ios/Runner/AppDelegate.swift b/packages/instabug_dio_interceptor/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..b63630348 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png diff --git a/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png diff --git a/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md similarity index 100% rename from example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md rename to packages/instabug_dio_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md diff --git a/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/instabug_dio_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from example/ios/Runner/Base.lproj/LaunchScreen.storyboard rename to packages/instabug_dio_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard diff --git a/example/ios/Runner/Base.lproj/Main.storyboard b/packages/instabug_dio_interceptor/example/ios/Runner/Base.lproj/Main.storyboard similarity index 100% rename from example/ios/Runner/Base.lproj/Main.storyboard rename to packages/instabug_dio_interceptor/example/ios/Runner/Base.lproj/Main.storyboard diff --git a/packages/instabug_dio_interceptor/example/ios/Runner/Info.plist b/packages/instabug_dio_interceptor/example/ios/Runner/Info.plist new file mode 100644 index 000000000..7f553465b --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/instabug_dio_interceptor/example/ios/Runner/Runner-Bridging-Header.h b/packages/instabug_dio_interceptor/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/instabug_dio_interceptor/example/lib/main.dart b/packages/instabug_dio_interceptor/example/lib/main.dart new file mode 100644 index 000000000..fcd29a3cb --- /dev/null +++ b/packages/instabug_dio_interceptor/example/lib/main.dart @@ -0,0 +1,78 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:instabug_dio_interceptor/instabug_dio_interceptor.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; + +Future main() async { + runApp(const MyApp()); + + Instabug.init( + token: 'ed6f659591566da19b67857e1b9d40ab', + invocationEvents: [InvocationEvent.floatingButton], + ); + + final dio = Dio()..interceptors.add(InstabugDioInterceptor()); + final response = await dio.get('https://google.com'); + debugPrint(response.data); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({Key? key, required this.title}) : super(key: key); + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/example/pubspec.lock b/packages/instabug_dio_interceptor/example/pubspec.lock similarity index 83% rename from example/pubspec.lock rename to packages/instabug_dio_interceptor/example/pubspec.lock index 99e8f9d56..7c9abf86c 100644 --- a/example/pubspec.lock +++ b/packages/instabug_dio_interceptor/example/pubspec.lock @@ -41,32 +41,43 @@ packages: url: "https://pub.dev" source: hosted version: "1.19.0" - fake_async: + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + dio: + dependency: "direct main" + description: + name: dio + sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 + url: "https://pub.dev" + source: hosted + version: "5.9.0" + dio_web_adapter: dependency: transitive description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + name: dio_web_adapter + sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" url: "https://pub.dev" source: hosted - version: "1.3.1" - file: + version: "2.1.1" + fake_async: dependency: transitive description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - flutter_driver: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" flutter_lints: dependency: "direct dev" description: @@ -80,19 +91,6 @@ packages: description: flutter source: sdk version: "0.0.0" - fuchsia_remote_debug_protocol: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - http: - dependency: "direct main" - description: - name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" - url: "https://pub.dev" - source: hosted - version: "0.13.6" http_parser: dependency: transitive description: @@ -101,21 +99,20 @@ packages: url: "https://pub.dev" source: hosted version: "4.0.2" - instabug_flutter: + instabug_dio_interceptor: dependency: "direct main" description: path: ".." relative: true source: path - version: "15.0.2" - instabug_http_client: - dependency: "direct main" + version: "2.5.0" + instabug_flutter: + dependency: "direct overridden" description: - name: instabug_http_client - sha256: "7d52803c0dd639f6dddbe07333418eb251ae02f3f9f4d30402517533ca692784" - url: "https://pub.dev" - source: hosted - version: "2.4.0" + path: "../../instabug_flutter" + relative: true + source: path + version: "16.0.0" leak_tracker: dependency: transitive description: @@ -172,30 +169,22 @@ packages: url: "https://pub.dev" source: hosted version: "1.15.0" - path: - dependency: transitive - description: - name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.dev" - source: hosted - version: "1.9.0" - platform: + mime: dependency: transitive description: - name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "3.1.5" - process: + version: "2.0.0" + path: dependency: transitive description: - name: process - sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "5.0.2" + version: "1.9.0" sky_engine: dependency: transitive description: flutter @@ -233,14 +222,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" - sync_http: - dependency: transitive - description: - name: sync_http - sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.dev" - source: hosted - version: "0.3.1" term_glyph: dependency: transitive description: @@ -281,14 +262,14 @@ packages: url: "https://pub.dev" source: hosted version: "14.3.0" - webdriver: + web: dependency: transitive description: - name: webdriver - sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" url: "https://pub.dev" source: hosted - version: "3.0.4" + version: "1.1.1" sdks: dart: ">=3.5.0 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_dio_interceptor/example/pubspec.yaml b/packages/instabug_dio_interceptor/example/pubspec.yaml new file mode 100644 index 000000000..a2dbaf01b --- /dev/null +++ b/packages/instabug_dio_interceptor/example/pubspec.yaml @@ -0,0 +1,25 @@ +name: instabug_dio_interceptor_example +description: Demonstrates how to use the instabug_dio_interceptor package. + +publish_to: "none" + +version: 1.0.0+1 + +environment: + sdk: ">=2.12.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.2 + dio: ^5.0.0 + instabug_dio_interceptor: + path: ../ + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 + +flutter: + uses-material-design: true diff --git a/packages/instabug_dio_interceptor/example/pubspec_overrides.yaml b/packages/instabug_dio_interceptor/example/pubspec_overrides.yaml new file mode 100644 index 000000000..b7e298895 --- /dev/null +++ b/packages/instabug_dio_interceptor/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: instabug_dio_interceptor,instabug_flutter +dependency_overrides: + instabug_dio_interceptor: + path: .. + instabug_flutter: + path: ../../instabug_flutter diff --git a/packages/instabug_dio_interceptor/lib/instabug_dio_interceptor.dart b/packages/instabug_dio_interceptor/lib/instabug_dio_interceptor.dart new file mode 100644 index 000000000..37182fea0 --- /dev/null +++ b/packages/instabug_dio_interceptor/lib/instabug_dio_interceptor.dart @@ -0,0 +1,108 @@ +import 'package:dio/dio.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; + +class InstabugDioInterceptor extends Interceptor { + static final Map _requests = {}; + static final NetworkLogger _networklogger = NetworkLogger(); + + @override + Future onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) async { + final headers = options.headers; + final startTime = DateTime.now(); + // ignore: invalid_use_of_internal_member + final w3Header = await _networklogger.getW3CHeader( + headers, + startTime.millisecondsSinceEpoch, + ); + if (w3Header?.isW3cHeaderFound == false && + w3Header?.w3CGeneratedHeader != null) { + headers['traceparent'] = w3Header?.w3CGeneratedHeader; + } + options.headers = headers; + final data = NetworkData( + startTime: startTime, + url: options.uri.toString(), + w3cHeader: w3Header, + method: options.method, + ); + _requests[options.hashCode] = data; + handler.next(options); + } + + @override + void onResponse( + Response response, + ResponseInterceptorHandler handler, + ) { + final data = _map(response); + _networklogger.networkLog(data); + handler.next(response); + } + + @override + // Keep `DioError` instead of `DioException` for backward-compatibility, for now. + // ignore: deprecated_member_use + void onError(DioError err, ErrorInterceptorHandler handler) { + if (err.response != null) { + final data = _map(err.response!); + _networklogger.networkLog(data); + } + + handler.next(err); + } + + static NetworkData _getRequestData(int requestHashCode) { + final data = _requests[requestHashCode]!; + _requests.remove(requestHashCode); + return data; + } + + NetworkData _map(Response response) { + final data = _getRequestData(response.requestOptions.hashCode); + final responseHeaders = {}; + final endTime = DateTime.now(); + + response.headers + .forEach((String name, dynamic value) => responseHeaders[name] = value); + + var responseContentType = ''; + if (responseHeaders.containsKey('content-type')) { + responseContentType = responseHeaders['content-type'].toString(); + } + + var requestBodySize = 0; + if (response.requestOptions.headers.containsKey('content-length')) { + requestBodySize = + int.parse(response.requestOptions.headers['content-length'] ?? '0'); + } else if (response.requestOptions.data != null) { + requestBodySize = response.requestOptions.data.toString().length; + } + + var responseBodySize = 0; + if (responseHeaders.containsKey('content-length')) { + // ignore: avoid_dynamic_calls + responseBodySize = int.parse(responseHeaders['content-length'][0] ?? '0'); + } else if (response.data != null) { + responseBodySize = response.data.toString().length; + } + + return data.copyWith( + endTime: endTime, + duration: endTime.difference(data.startTime).inMicroseconds, + url: response.requestOptions.uri.toString(), + method: response.requestOptions.method, + requestBody: response.requestOptions.data.toString(), + requestHeaders: response.requestOptions.headers, + requestContentType: response.requestOptions.contentType, + requestBodySize: requestBodySize, + status: response.statusCode, + responseBody: response.data.toString(), + responseHeaders: responseHeaders, + responseContentType: responseContentType, + responseBodySize: responseBodySize, + ); + } +} diff --git a/packages/instabug_dio_interceptor/pubspec.lock b/packages/instabug_dio_interceptor/pubspec.lock new file mode 100644 index 000000000..50e33bd59 --- /dev/null +++ b/packages/instabug_dio_interceptor/pubspec.lock @@ -0,0 +1,737 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + url: "https://pub.dev" + source: hosted + version: "76.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + url: "https://pub.dev" + source: hosted + version: "6.11.0" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + url: "https://pub.dev" + source: hosted + version: "2.4.13" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + url: "https://pub.dev" + source: hosted + version: "7.3.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + url: "https://pub.dev" + source: hosted + version: "8.9.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "802bd084fb82e55df091ec8ad1553a7331b61c08251eef19a508b6f3f3a9858d" + url: "https://pub.dev" + source: hosted + version: "1.13.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" + source: hosted + version: "2.3.7" + dio: + dependency: "direct main" + description: + name: dio + sha256: "5598aa796bbf4699afd5c67c0f5f6e2ed542afc956884b9cd58c306966efc260" + url: "https://pub.dev" + source: hosted + version: "5.7.0" + dio_web_adapter: + dependency: transitive + description: + name: dio_web_adapter + sha256: "33259a9276d6cea88774a0000cfae0d861003497755969c92faa223108620dc8" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + html: + dependency: transitive + description: + name: html + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" + url: "https://pub.dev" + source: hosted + version: "0.15.6" + http: + dependency: transitive + description: + name: http + sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 + url: "https://pub.dev" + source: hosted + version: "1.5.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + instabug_flutter: + dependency: "direct main" + description: + path: "../instabug_flutter" + relative: true + source: path + version: "16.0.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" + source: hosted + version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + url: "https://pub.dev" + source: hosted + version: "0.1.3-main.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1" + url: "https://pub.dev" + source: hosted + version: "7.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: "direct dev" + description: + name: mockito + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + url: "https://pub.dev" + source: hosted + version: "5.4.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + pana: + dependency: "direct dev" + description: + name: pana + sha256: "3fc3fe8e7a9fd4827fa4d625a423eec95d305b2bc3538a3adf7fd6c49217af97" + url: "https://pub.dev" + source: hosted + version: "0.21.45" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + safe_url_check: + dependency: transitive + description: + name: safe_url_check + sha256: "49a3e060a7869cbafc8f4845ca1ecbbaaa53179980a32f4fdfeab1607e90f41d" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + tar: + dependency: transitive + description: + name: tar + sha256: "22f67e2d77b51050436620b2a5de521c58ca6f0b75af1d9ab3c8cae2eae58fcd" + url: "https://pub.dev" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: transitive + description: + name: test + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" + url: "https://pub.dev" + source: hosted + version: "1.25.8" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + test_core: + dependency: transitive + description: + name: test_core + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_dio_interceptor/pubspec.yaml b/packages/instabug_dio_interceptor/pubspec.yaml new file mode 100644 index 000000000..cadd6616d --- /dev/null +++ b/packages/instabug_dio_interceptor/pubspec.yaml @@ -0,0 +1,60 @@ +name: instabug_dio_interceptor +description: + This package is an add on to instabug_flutter. It intercepts any requests performed + with Dio Package and sends them to the report that will be sent to the dashboard. +version: 2.5.0 +homepage: https://github.com/Instabug/Instabug-Flutter#readme +repository: https://github.com/Instabug/Instabug-Flutter/tree/refactor/monorepo/packages/instabug_dio_interceptor + +environment: + sdk: '>=2.12.0 <4.0.0' + +dependencies: + dio: '>=4.0.0 <6.0.0' + flutter: + sdk: flutter + instabug_flutter: '>=14.0.0 <17.0.0' + + +dev_dependencies: + build_runner: ^2.0.3 + flutter_test: + sdk: flutter + mockito: ^5.0.10 + pana: ^0.21.0 +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # To add assets to your package, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/assets-and-images/#from-packages + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # To add custom fonts to your package, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts in packages, see + # https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/instabug_dio_interceptor/pubspec_overrides.yaml b/packages/instabug_dio_interceptor/pubspec_overrides.yaml new file mode 100644 index 000000000..1f0beaf62 --- /dev/null +++ b/packages/instabug_dio_interceptor/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: instabug_flutter +dependency_overrides: + instabug_flutter: + path: ../instabug_flutter diff --git a/packages/instabug_dio_interceptor/release.sh b/packages/instabug_dio_interceptor/release.sh new file mode 100755 index 000000000..6b211fe17 --- /dev/null +++ b/packages/instabug_dio_interceptor/release.sh @@ -0,0 +1,13 @@ +#!/bin/sh +VERSION=$(egrep -o "version: ([0-9]-*.*)+[0-9]" pubspec.yaml | cut -d ":" -f 2) +if [ ! "${VERSION}" ] || [ -z "${VERSION}" ];then + echo "Instabug: err: Version Number not found." + exit 1 +else + mkdir -p .pub-cache + cat < $HOME/.pub-cache/credentials.json + ${PUB_CREDENTIALS} + +EOF + flutter packages pub publish -f +fi \ No newline at end of file diff --git a/packages/instabug_dio_interceptor/test/instabug_dio_interceptor_test.dart b/packages/instabug_dio_interceptor/test/instabug_dio_interceptor_test.dart new file mode 100644 index 000000000..2940dcc83 --- /dev/null +++ b/packages/instabug_dio_interceptor/test/instabug_dio_interceptor_test.dart @@ -0,0 +1,116 @@ +import 'package:dio/dio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:instabug_dio_interceptor/instabug_dio_interceptor.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/generated/instabug.api.g.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; + +import 'instabug_dio_interceptor_test.mocks.dart'; +import 'mock_adapter.dart'; + +class MyInterceptor extends InstabugDioInterceptor { + int requestCount = 0; + int resposneCount = 0; + int errorCount = 0; + + @override + Future onRequest( + RequestOptions options, + RequestInterceptorHandler handler, + ) async { + requestCount++; + super.onRequest(options, handler); + } + + @override + void onResponse( + Response response, + ResponseInterceptorHandler handler, + ) { + resposneCount++; + super.onResponse(response, handler); + } + + @override + // ignore: deprecated_member_use + void onError(DioError err, ErrorInterceptorHandler handler) { + errorCount++; + super.onError(err, handler); + } +} + +@GenerateMocks([ + InstabugHostApi, +]) +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + WidgetsFlutterBinding.ensureInitialized(); + + final mHost = MockInstabugHostApi(); + + late Dio dio; + late MyInterceptor instabugDioInterceptor; + const appToken = '068ba9a8c3615035e163dc5f829c73be'; + + setUpAll(() { + Instabug.$setHostApi(mHost); + NetworkLogger.$setHostApi(mHost); + when(mHost.isW3CFeatureFlagsEnabled()).thenAnswer( + (_) => Future>.value({ + 'isW3cCaughtHeaderEnabled': true, + 'isW3cExternalGeneratedHeaderEnabled': true, + 'isW3cExternalTraceIDEnabled': true, + }), + ); + }); + + setUp(() { + dio = Dio(); + dio.options.baseUrl = MockAdapter.mockBase; + dio.httpClientAdapter = MockAdapter(); + final events = []; + instabugDioInterceptor = MyInterceptor(); + dio.interceptors.add(instabugDioInterceptor); + Instabug.init(token: appToken, invocationEvents: events); + }); + + test('onResponse Test', () async { + try { + await dio.get('/test'); + // ignore: deprecated_member_use + } on DioError { + // ignor + } + + expect(instabugDioInterceptor.requestCount, 1); + expect(instabugDioInterceptor.resposneCount, 1); + expect(instabugDioInterceptor.errorCount, 0); + }); + + test('onError Test', () async { + try { + await dio.get('/test-error'); + // ignore: deprecated_member_use + } on DioError { + // ignor + } + + expect(instabugDioInterceptor.requestCount, 1); + expect(instabugDioInterceptor.resposneCount, 0); + expect(instabugDioInterceptor.errorCount, 1); + }); + + test('Stress Test', () async { + for (var i = 0; i < 1000; i++) { + try { + await dio.get('/test'); + // ignore: deprecated_member_use + } on DioError { + // ignor + } + } + expect(instabugDioInterceptor.requestCount, 1000); + }); +} diff --git a/packages/instabug_dio_interceptor/test/mock_adapter.dart b/packages/instabug_dio_interceptor/test/mock_adapter.dart new file mode 100644 index 000000000..934acfb0a --- /dev/null +++ b/packages/instabug_dio_interceptor/test/mock_adapter.dart @@ -0,0 +1,43 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:typed_data'; + +import 'package:dio/dio.dart'; +import 'package:dio/io.dart'; + +class MockAdapter implements HttpClientAdapter { + static const String mockHost = 'mockserver'; + static const String mockBase = 'http://$mockHost'; + final IOHttpClientAdapter _adapter = IOHttpClientAdapter(); + + @override + Future fetch( + RequestOptions options, + Stream? requestStream, + Future? cancelFuture, + ) async { + final uri = options.uri; + + if (uri.host == mockHost) { + switch (uri.path) { + case '/test': + return ResponseBody.fromString( + jsonEncode({ + 'errCode': 0, + 'data': {'path': uri.path}, + }), + 200, + ); + + default: + return ResponseBody.fromString('', 404); + } + } + return _adapter.fetch(options, requestStream, cancelFuture); + } + + @override + void close({bool force = false}) { + _adapter.close(force: force); + } +} diff --git a/.metadata b/packages/instabug_flutter/.metadata similarity index 100% rename from .metadata rename to packages/instabug_flutter/.metadata diff --git a/.pubignore b/packages/instabug_flutter/.pubignore similarity index 100% rename from .pubignore rename to packages/instabug_flutter/.pubignore diff --git a/CHANGELOG.md b/packages/instabug_flutter/CHANGELOG.md similarity index 97% rename from CHANGELOG.md rename to packages/instabug_flutter/CHANGELOG.md index 0555125f6..d745fffd3 100644 --- a/CHANGELOG.md +++ b/packages/instabug_flutter/CHANGELOG.md @@ -5,13 +5,21 @@ ### Added - Add support for Advanced UI customization with comprehensive theming capabilities ([#599](https://github.com/Instabug/Instabug-Flutter/pull/599)) -- + +- Add support for private views and automasking ([#519](https://github.com/Instabug/Instabug-Flutter/pull/519)) + +- Add support for user steps ([#519](https://github.com/Instabug/Instabug-Flutter/pull/519)) + - Add support for App variant. ([#585](https://github.com/Instabug/Instabug-Flutter/pull/585)) ### Changed - **BREAKING** Remove deprecated APIs ([#614](https://github.com/Instabug/Instabug-Flutter/pull/614)). See migration guide for more details. +- Bump Instabug iOS SDK to v16.0.2 ([#620](https://github.com/Instabug/Instabug-Flutter/pull/620)). [See release notes](https://github.com/Instabug/Instabug-iOS/releases/tag/16.0.1). + +- Bump Instabug Android SDK to v16.0.0 ([#620](https://github.com/Instabug/Instabug-Flutter/pull/620)). [See release notes](https://github.com/Instabug/Instabug-Android/releases/tag/v16.0.0). + ## [15.0.2](https://github.com/Instabug/Instabug-Flutter/compare/v14.3.0...15.0.2) (Jul 7, 2025) diff --git a/packages/instabug_flutter/Gemfile b/packages/instabug_flutter/Gemfile new file mode 100644 index 000000000..19b2c91d4 --- /dev/null +++ b/packages/instabug_flutter/Gemfile @@ -0,0 +1 @@ +source "https://rubygems.org" diff --git a/packages/instabug_flutter/Gemfile.lock b/packages/instabug_flutter/Gemfile.lock new file mode 100644 index 000000000..3c10ae234 --- /dev/null +++ b/packages/instabug_flutter/Gemfile.lock @@ -0,0 +1,11 @@ +GEM + remote: https://rubygems.org/ + specs: + +PLATFORMS + ruby + +DEPENDENCIES + +BUNDLED WITH + 1.17.2 diff --git a/LICENSE b/packages/instabug_flutter/LICENSE similarity index 100% rename from LICENSE rename to packages/instabug_flutter/LICENSE diff --git a/packages/instabug_flutter/README.md b/packages/instabug_flutter/README.md new file mode 100644 index 000000000..88080febd --- /dev/null +++ b/packages/instabug_flutter/README.md @@ -0,0 +1,116 @@ +# Instabug for Flutter + +[![pub package](https://img.shields.io/pub/v/instabug_flutter.svg)](https://pub.dev/packages/instabug_flutter) + +A Flutter plugin for [Instabug](https://instabug.com/). + +## Available Features + +| Feature | Status | +|:---------------------------------------------------------:|:-------:| +| [Bug Reporting](https://docs.instabug.com/docs/flutter-bug-reporting) | ✅ | +| [Crash Reporting](https://docs.instabug.com/docs/flutter-crash-reporting) | ✅ | +| [App Performance Monitoring](https://docs.instabug.com/docs/flutter-apm) | ✅ | +| [In-App Replies](https://docs.instabug.com/docs/flutter-in-app-replies) | ✅ | +| [In-App Surveys](https://docs.instabug.com/docs/flutter-in-app-surveys) | ✅ | +| [Feature Requests](https://docs.instabug.com/docs/flutter-in-app-feature-requests) | ✅ | + +* ✅ Stable +* ⚙️ Under active development + +## Integration + +### Installation + +1. Add Instabug to your `pubspec.yaml` file. + +```yaml +dependencies: + instabug_flutter: +``` + +2. Install the package by running the following command. + +```bash +flutter packages get +``` + +### Initializing Instabug + +Initialize the SDK in your `main` function. This starts the SDK with the default behavior and sets it to be shown when the device is shaken. + +```dart +import 'package:instabug_flutter/instabug_flutter.dart'; + +void main() { + WidgetsFlutterBinding.ensureInitialized(); + + Instabug.init( + token: 'APP_TOKEN', + invocationEvents: [InvocationEvent.shake], + ); + + runApp(MyApp()); +} +``` + +> :warning: If you're updating the SDK from versions prior to v11, please check our [migration guide](https://docs.instabug.com/docs/flutter-migration-guide). + +## Crash reporting + +Instabug automatically captures every crash of your app and sends relevant details to the crashes page of your dashboard. + +⚠️ **Crashes will only be reported in release mode and not in debug mode.** + +```dart +void main() { + runZonedGuarded( + () { + WidgetsFlutterBinding.ensureInitialized(); + + Instabug.init( + token: 'APP_TOKEN', + invocationEvents: [InvocationEvent.shake], + ); + + FlutterError.onError = (FlutterErrorDetails details) { + Zone.current.handleUncaughtError(details.exception, details.stack!); + }; + + runApp(MyApp()); + }, + CrashReporting.reportCrash, + ); +} +``` + +## Repro Steps +Repro Steps list all of the actions an app user took before reporting a bug or crash, grouped by the screens they visited in your app. + + To enable this feature, you need to add `InstabugNavigatorObserver` to the `navigatorObservers` : + ``` + runApp(MaterialApp( + navigatorObservers: [InstabugNavigatorObserver()], + )); + ``` + +## Network Logging +You can choose to attach all your network requests to the reports being sent to the dashboard. To enable the feature when using the `dart:io` package `HttpClient`, please refer to the [Instabug Dart IO Http Client](https://github.com/Instabug/instabug-dart-io-http-client) repository. + +We also support the packages `http` and `dio`. For details on how to enable network logging for these external packages, refer to the [Instabug Dart Http Adapter](https://github.com/Instabug/Instabug-Dart-http-Adapter) and the [Instabug Dio Interceptor](https://github.com/Instabug/Instabug-Dio-Interceptor) repositories. + +## Microphone and Photo Library Usage Description (iOS Only) + +Instabug needs access to the microphone and photo library to be able to let users add audio and video attachments. Starting from iOS 10, apps that don’t provide a usage description for those 2 permissions would be rejected when submitted to the App Store. + +For your app not to be rejected, you’ll need to add the following 2 keys to your app’s info.plist file with text explaining to the user why those permissions are needed: + +* `NSMicrophoneUsageDescription` +* `NSPhotoLibraryUsageDescription` + +If your app doesn’t already access the microphone or photo library, we recommend using a usage description like: + +* "`` needs access to the microphone to be able to attach voice notes." +* "`` needs access to your photo library for you to be able to attach images." + +**The permission alert for accessing the microphone/photo library will NOT appear unless users attempt to attach a voice note/photo while using Instabug.** diff --git a/android/.gitignore b/packages/instabug_flutter/android/.gitignore similarity index 100% rename from android/.gitignore rename to packages/instabug_flutter/android/.gitignore diff --git a/android/build.gradle b/packages/instabug_flutter/android/build.gradle similarity index 91% rename from android/build.gradle rename to packages/instabug_flutter/android/build.gradle index 0f1d8b852..1b072dc72 100644 --- a/android/build.gradle +++ b/packages/instabug_flutter/android/build.gradle @@ -1,5 +1,5 @@ group 'com.instabug.flutter' -version '15.0.2' +version '16.0.0' buildscript { repositories { @@ -47,11 +47,11 @@ android { } dependencies { - api 'com.instabug.library:instabug:15.0.2' + api 'com.instabug.library:instabug:16.0.0' testImplementation 'junit:junit:4.13.2' testImplementation "org.mockito:mockito-inline:3.12.1" testImplementation "io.mockk:mockk:1.13.13" - + testImplementation "org.robolectric:robolectric:4.12.2" } // add upload_symbols task diff --git a/android/gradle.properties b/packages/instabug_flutter/android/gradle.properties similarity index 100% rename from android/gradle.properties rename to packages/instabug_flutter/android/gradle.properties diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/packages/instabug_flutter/android/gradle/wrapper/gradle-wrapper.properties similarity index 100% rename from android/gradle/wrapper/gradle-wrapper.properties rename to packages/instabug_flutter/android/gradle/wrapper/gradle-wrapper.properties diff --git a/android/proguard-rules.txt b/packages/instabug_flutter/android/proguard-rules.txt similarity index 100% rename from android/proguard-rules.txt rename to packages/instabug_flutter/android/proguard-rules.txt diff --git a/android/settings.gradle b/packages/instabug_flutter/android/settings.gradle similarity index 100% rename from android/settings.gradle rename to packages/instabug_flutter/android/settings.gradle diff --git a/android/src/main/AndroidManifest.xml b/packages/instabug_flutter/android/src/main/AndroidManifest.xml similarity index 100% rename from android/src/main/AndroidManifest.xml rename to packages/instabug_flutter/android/src/main/AndroidManifest.xml diff --git a/android/src/main/java/com/instabug/flutter/InstabugFlutterPlugin.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/InstabugFlutterPlugin.java similarity index 78% rename from android/src/main/java/com/instabug/flutter/InstabugFlutterPlugin.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/InstabugFlutterPlugin.java index bb3b043fa..39089fffe 100644 --- a/android/src/main/java/com/instabug/flutter/InstabugFlutterPlugin.java +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/InstabugFlutterPlugin.java @@ -10,15 +10,20 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; +import com.instabug.flutter.generated.InstabugPrivateViewPigeon; import com.instabug.flutter.modules.ApmApi; import com.instabug.flutter.modules.BugReportingApi; import com.instabug.flutter.modules.CrashReportingApi; import com.instabug.flutter.modules.FeatureRequestsApi; import com.instabug.flutter.modules.InstabugApi; import com.instabug.flutter.modules.InstabugLogApi; +import com.instabug.flutter.modules.InstabugPrivateView; +import com.instabug.flutter.modules.PrivateViewManager; import com.instabug.flutter.modules.RepliesApi; import com.instabug.flutter.modules.SessionReplayApi; import com.instabug.flutter.modules.SurveysApi; +import com.instabug.flutter.modules.capturing.BoundryCaptureManager; +import com.instabug.flutter.modules.capturing.PixelCopyCaptureManager; import java.util.concurrent.Callable; @@ -35,6 +40,10 @@ public class InstabugFlutterPlugin implements FlutterPlugin, ActivityAware { private static Activity activity; + private static PrivateViewManager privateViewManager; + + + @Override public void onAttachedToEngine(@NonNull FlutterPluginBinding binding) { register(binding.getApplicationContext(), binding.getBinaryMessenger(), (FlutterRenderer) binding.getTextureRegistry()); @@ -48,21 +57,31 @@ public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { @Override public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { activity = binding.getActivity(); + if (privateViewManager != null) { + privateViewManager.setActivity(activity); + } } @Override public void onDetachedFromActivityForConfigChanges() { activity = null; + privateViewManager.setActivity(null); + } @Override public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { activity = binding.getActivity(); + if (privateViewManager != null) { + privateViewManager.setActivity(activity); + } } @Override public void onDetachedFromActivity() { activity = null; + privateViewManager.setActivity(null); + } private static void register(Context context, BinaryMessenger messenger, FlutterRenderer renderer) { @@ -73,6 +92,9 @@ public Bitmap call() { } }; + privateViewManager = new PrivateViewManager(new InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi(messenger), new PixelCopyCaptureManager(), new BoundryCaptureManager(renderer)); + InstabugPrivateView.init(messenger, privateViewManager); + ApmApi.init(messenger); BugReportingApi.init(messenger); CrashReportingApi.init(messenger); @@ -82,6 +104,7 @@ public Bitmap call() { RepliesApi.init(messenger); SessionReplayApi.init(messenger); SurveysApi.init(messenger); + } @Nullable diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/model/ScreenshotResult.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/model/ScreenshotResult.java new file mode 100644 index 000000000..66a3c51cb --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/model/ScreenshotResult.java @@ -0,0 +1,21 @@ +package com.instabug.flutter.model; + +import android.graphics.Bitmap; + +public class ScreenshotResult { + private final float pixelRatio; + private final Bitmap screenshot; + + public ScreenshotResult(float pixelRatio, Bitmap screenshot) { + this.pixelRatio = pixelRatio; + this.screenshot = screenshot; + } + + public Bitmap getScreenshot() { + return screenshot; + } + + public float getPixelRatio() { + return pixelRatio; + } +} diff --git a/android/src/main/java/com/instabug/flutter/modules/ApmApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/ApmApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/ApmApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/ApmApi.java diff --git a/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/BugReportingApi.java diff --git a/android/src/main/java/com/instabug/flutter/modules/CrashReportingApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/CrashReportingApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/CrashReportingApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/CrashReportingApi.java diff --git a/android/src/main/java/com/instabug/flutter/modules/FeatureRequestsApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/FeatureRequestsApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/FeatureRequestsApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/FeatureRequestsApi.java diff --git a/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java similarity index 89% rename from android/src/main/java/com/instabug/flutter/modules/InstabugApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java index 0afbbd975..3530cc99c 100644 --- a/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugApi.java @@ -21,6 +21,7 @@ import com.instabug.library.internal.crossplatform.CoreFeaturesState; import com.instabug.library.internal.crossplatform.FeaturesStateListener; import com.instabug.library.internal.crossplatform.InternalCore; +import com.instabug.flutter.util.privateViews.ScreenshotCaptor; import com.instabug.library.Feature; import com.instabug.library.Instabug; import com.instabug.library.InstabugColorTheme; @@ -29,9 +30,11 @@ import com.instabug.library.Platform; import com.instabug.library.ReproConfigurations; import com.instabug.library.featuresflags.model.IBGFeatureFlag; +import com.instabug.library.internal.crossplatform.InternalCore; import com.instabug.library.internal.module.InstabugLocale; import com.instabug.library.invocation.InstabugInvocationEvent; import com.instabug.library.model.NetworkLog; +import com.instabug.library.screenshot.instacapture.ScreenshotRequest; import com.instabug.library.ui.onboarding.WelcomeMessage; import io.flutter.FlutterInjector; @@ -46,6 +49,8 @@ import java.io.InputStream; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -133,6 +138,26 @@ public void init(@NonNull String token, @NonNull List invocationEvents, builder.build(); Instabug.setScreenshotProvider(screenshotProvider); + try { + Class myClass = Class.forName("com.instabug.library.Instabug"); + // Enable/Disable native user steps capturing + Method method = myClass.getDeclaredMethod("shouldDisableNativeUserStepsCapturing", boolean.class); + method.setAccessible(true); + method.invoke(null, true); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override + public void enableAutoMasking(@NonNull List autoMasking) { + int[] autoMaskingArray = new int[autoMasking.size()]; + for (int i = 0; i < autoMasking.size(); i++) { + String key = autoMasking.get(i); + autoMaskingArray[i] = ArgsRegistry.autoMasking.get(key); + } + + Instabug.setAutoMaskScreenshotsTypes(Arrays.copyOf(autoMaskingArray, autoMaskingArray.length)); } @Override @@ -177,6 +202,33 @@ public void logOut() { Instabug.logoutUser(); } + @Override + public void setEnableUserSteps(@NonNull Boolean isEnabled) { + Instabug.setTrackingUserStepsState(isEnabled ? Feature.State.ENABLED : Feature.State.DISABLED); + } + + @Override + + public void logUserSteps(@NonNull String gestureType, @NonNull String message, @Nullable String viewName) { + try { + final String stepType = ArgsRegistry.gestureStepType.get(gestureType); + final long timeStamp = System.currentTimeMillis(); + String view = ""; + + Method method = Reflection.getMethod(Class.forName("com.instabug.library.Instabug"), "addUserStep", + long.class, String.class, String.class, String.class, String.class); + if (method != null) { + if (viewName != null) { + view = viewName; + } + + method.invoke(null, timeStamp, stepType, message, null, view); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + @Override public void setLocale(@NonNull String locale) { final InstabugLocale resolvedLocale = ArgsRegistry.locales.get(locale); @@ -195,9 +247,6 @@ public void setWelcomeMessageMode(@NonNull String mode) { Instabug.setWelcomeMessageState(resolvedMode); } - @Override - public void setPrimaryColor(@NonNull Long color) { - } @Override public void setSessionProfilerEnabled(@NonNull Boolean enabled) { @@ -507,6 +556,24 @@ public void willRedirectToStore() { Instabug.willRedirectToStore(); } + public static void setScreenshotCaptor(ScreenshotCaptor screenshotCaptor, InternalCore internalCore) { + internalCore._setScreenshotCaptor(new com.instabug.library.screenshot.ScreenshotCaptor() { + @Override + public void capture(@NonNull ScreenshotRequest screenshotRequest) { + screenshotCaptor.capture(new ScreenshotCaptor.CapturingCallback() { + @Override + public void onCapturingFailure(Throwable throwable) { + screenshotRequest.getListener().onCapturingFailure(throwable); + } + + @Override + public void onCapturingSuccess(Bitmap bitmap) { + screenshotRequest.getListener().onCapturingSuccess(bitmap); + } + }); + } + }); + } @Override public void setNetworkLogBodyEnabled(@NonNull Boolean isEnabled) { diff --git a/android/src/main/java/com/instabug/flutter/modules/InstabugLogApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugLogApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/InstabugLogApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugLogApi.java diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugPrivateView.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugPrivateView.java new file mode 100644 index 000000000..53ed0ac23 --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/InstabugPrivateView.java @@ -0,0 +1,47 @@ +package com.instabug.flutter.modules; + +import android.os.Handler; +import android.os.Looper; + +import com.instabug.flutter.generated.InstabugPrivateViewPigeon; +import com.instabug.flutter.util.privateViews.ScreenshotCaptor; +import com.instabug.library.internal.crossplatform.InternalCore; + +import io.flutter.plugin.common.BinaryMessenger; + +public class InstabugPrivateView implements InstabugPrivateViewPigeon.InstabugPrivateViewHostApi { + PrivateViewManager privateViewManager; + + public static void init(BinaryMessenger messenger, PrivateViewManager privateViewManager) { + final InstabugPrivateView api = new InstabugPrivateView(messenger, privateViewManager); + InstabugPrivateViewPigeon.InstabugPrivateViewHostApi.setup(messenger, api); + } + + public InstabugPrivateView(BinaryMessenger messenger, PrivateViewManager privateViewManager) { + this.privateViewManager = privateViewManager; + InstabugPrivateViewPigeon.InstabugPrivateViewHostApi.setup(messenger, this); + init(); + } + + static long time = System.currentTimeMillis(); + + @Override + public void init() { + InstabugApi.setScreenshotCaptor(new ScreenshotCaptor() { + @Override + public void capture(CapturingCallback listener) { + + (new Handler(Looper.getMainLooper())).postDelayed(new Runnable() { + @Override + public void run() { + time = System.currentTimeMillis(); + privateViewManager.mask(listener); + + } + }, 300); + + + } + }, InternalCore.INSTANCE); + } +} diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/PrivateViewManager.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/PrivateViewManager.java new file mode 100644 index 000000000..fd105be5a --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/PrivateViewManager.java @@ -0,0 +1,147 @@ +package com.instabug.flutter.modules; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.os.Build; + +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; + +import com.instabug.flutter.generated.InstabugPrivateViewPigeon; +import com.instabug.flutter.model.ScreenshotResult; +import com.instabug.flutter.modules.capturing.CaptureManager; +import com.instabug.flutter.modules.capturing.ScreenshotResultCallback; +import com.instabug.flutter.util.ThreadManager; +import com.instabug.flutter.util.privateViews.ScreenshotCaptor; + +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicReference; + +public class PrivateViewManager { + private static final String THREAD_NAME = "IBG-Flutter-Screenshot"; + public static final String EXCEPTION_MESSAGE = "IBG-Flutter-Screenshot: error capturing screenshot"; + + private final ExecutorService screenshotExecutor = Executors.newSingleThreadExecutor(runnable -> { + Thread thread = new Thread(runnable); + thread.setName(THREAD_NAME); + return thread; + }); + + private final InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi instabugPrivateViewApi; + private Activity activity; + final CaptureManager pixelCopyScreenshotCaptor; + final CaptureManager boundryScreenshotCaptor; + + public PrivateViewManager(@NonNull InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi instabugPrivateViewApi, CaptureManager pixelCopyCaptureManager, CaptureManager boundryCaptureManager) { + this.instabugPrivateViewApi = instabugPrivateViewApi; + this.pixelCopyScreenshotCaptor = pixelCopyCaptureManager; + this.boundryScreenshotCaptor = boundryCaptureManager; + + + } + + public void setActivity(Activity activity) { + this.activity = activity; + } + + + public void mask(ScreenshotCaptor.CapturingCallback capturingCallback) { + if (activity != null) { + CountDownLatch latch = new CountDownLatch(1); + AtomicReference> privateViews = new AtomicReference<>(); + final ScreenshotResultCallback boundryScreenshotResult = new ScreenshotResultCallback() { + + @Override + public void onScreenshotResult(ScreenshotResult screenshotResult) { + processScreenshot(screenshotResult, privateViews, latch, capturingCallback); + + } + + @Override + public void onError() { + capturingCallback.onCapturingFailure(new Exception(EXCEPTION_MESSAGE)); + } + }; + + try { + ThreadManager.runOnMainThread(new Runnable() { + @Override + public void run() { + instabugPrivateViewApi.getPrivateViews(result -> { + privateViews.set(result); + latch.countDown(); + }); + } + }); + + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + pixelCopyScreenshotCaptor.capture(activity, new ScreenshotResultCallback() { + @Override + public void onScreenshotResult(ScreenshotResult result) { + processScreenshot(result, privateViews, latch, capturingCallback); + + } + + @Override + public void onError() { + boundryScreenshotCaptor.capture(activity, boundryScreenshotResult); + + } + }); + } else { + boundryScreenshotCaptor.capture(activity, boundryScreenshotResult); + } + + } catch (Exception e) { + capturingCallback.onCapturingFailure(e); + } + } else { + capturingCallback.onCapturingFailure(new Exception(EXCEPTION_MESSAGE)); + } + } + + + private void processScreenshot(ScreenshotResult result, AtomicReference> privateViews, CountDownLatch latch, ScreenshotCaptor.CapturingCallback capturingCallback) { + screenshotExecutor.execute(() -> { + try { + latch.await(); // Wait + Bitmap bitmap = result.getScreenshot(); + maskPrivateViews(result, privateViews.get()); + capturingCallback.onCapturingSuccess(bitmap); + long lastTime = System.currentTimeMillis(); + System.out.println("Time:" + (lastTime - InstabugPrivateView.time)); + + } catch (InterruptedException e) { + capturingCallback.onCapturingFailure(e); + } + }); + } + + @VisibleForTesting + public void maskPrivateViews(ScreenshotResult result, List privateViews) { + try { + if (privateViews == null || privateViews.isEmpty()) return; + + Bitmap bitmap = result.getScreenshot(); + float pixelRatio = result.getPixelRatio(); + Canvas canvas = new Canvas(bitmap); + Paint paint = new Paint(); // Default color is black + + for (int i = 0; i < privateViews.size(); i += 4) { + float left = privateViews.get(i).floatValue() * pixelRatio; + float top = privateViews.get(i + 1).floatValue() * pixelRatio; + float right = privateViews.get(i + 2).floatValue() * pixelRatio; + float bottom = privateViews.get(i + 3).floatValue() * pixelRatio; + canvas.drawRect(left, top, right, bottom, paint); // Mask private view + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/android/src/main/java/com/instabug/flutter/modules/RepliesApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/RepliesApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/RepliesApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/RepliesApi.java diff --git a/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/SessionReplayApi.java diff --git a/android/src/main/java/com/instabug/flutter/modules/SurveysApi.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/SurveysApi.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/modules/SurveysApi.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/SurveysApi.java diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/BoundryCaptureManager.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/BoundryCaptureManager.java new file mode 100644 index 000000000..6f8409749 --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/BoundryCaptureManager.java @@ -0,0 +1,43 @@ +package com.instabug.flutter.modules.capturing; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.util.DisplayMetrics; +import android.view.View; + +import com.instabug.flutter.model.ScreenshotResult; +import com.instabug.flutter.util.ThreadManager; + +import io.flutter.embedding.engine.renderer.FlutterRenderer; + +public class BoundryCaptureManager implements CaptureManager { + FlutterRenderer renderer; + + public BoundryCaptureManager(FlutterRenderer renderer) { + this.renderer = renderer; + } + + @Override + public void capture(Activity activity, ScreenshotResultCallback screenshotResultCallback) { + ThreadManager.runOnMainThread(new Runnable() { + @Override + public void run() { + try { + if (activity == null) { + screenshotResultCallback.onError(); + return; + } + View rootView = activity.getWindow().getDecorView().getRootView(); + rootView.setDrawingCacheEnabled(true); + Bitmap bitmap = renderer.getBitmap(); + rootView.setDrawingCacheEnabled(false); + DisplayMetrics displayMetrics = activity.getResources().getDisplayMetrics(); + screenshotResultCallback.onScreenshotResult(new ScreenshotResult(displayMetrics.density, bitmap)); + + } catch (Exception e) { + screenshotResultCallback.onError(); + } + } + }); + } +} diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/CaptureManager.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/CaptureManager.java new file mode 100644 index 000000000..f15aa4780 --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/CaptureManager.java @@ -0,0 +1,7 @@ +package com.instabug.flutter.modules.capturing; + +import android.app.Activity; + +public interface CaptureManager { + void capture(Activity activity, ScreenshotResultCallback screenshotResultCallback); +} diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/PixelCopyCaptureManager.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/PixelCopyCaptureManager.java new file mode 100644 index 000000000..be19f1ca6 --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/PixelCopyCaptureManager.java @@ -0,0 +1,86 @@ +package com.instabug.flutter.modules.capturing; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.os.Build; +import android.os.Handler; +import android.os.Looper; +import android.util.DisplayMetrics; +import android.view.PixelCopy; +import android.view.SurfaceView; + +import androidx.annotation.RequiresApi; + +import com.instabug.flutter.model.ScreenshotResult; +import com.instabug.library.util.memory.MemoryUtils; + +import io.flutter.embedding.android.FlutterActivity; +import io.flutter.embedding.android.FlutterFragment; +import io.flutter.embedding.android.FlutterView; + +public class PixelCopyCaptureManager implements CaptureManager { + + @RequiresApi(api = Build.VERSION_CODES.N) + @Override + public void capture(Activity activity, ScreenshotResultCallback screenshotResultCallback) { + FlutterView flutterView = getFlutterView(activity); + if (flutterView == null || !isValidFlutterView(flutterView)) { + screenshotResultCallback.onError(); + return; + } + + SurfaceView surfaceView = (SurfaceView) flutterView.getChildAt(0); + Bitmap bitmap = createBitmapFromSurface(surfaceView); + + if (bitmap == null) { + screenshotResultCallback.onError(); + return; + } + + PixelCopy.request(surfaceView, bitmap, copyResult -> { + if (copyResult == PixelCopy.SUCCESS) { + DisplayMetrics displayMetrics = activity.getResources().getDisplayMetrics(); + screenshotResultCallback.onScreenshotResult(new ScreenshotResult(displayMetrics.density, bitmap)); + } else { + screenshotResultCallback.onError(); + } + }, new Handler(Looper.getMainLooper())); + } + + private FlutterView getFlutterView(Activity activity) { + FlutterView flutterViewInActivity = activity.findViewById(FlutterActivity.FLUTTER_VIEW_ID); + FlutterView flutterViewInFragment = activity.findViewById(FlutterFragment.FLUTTER_VIEW_ID); + return flutterViewInActivity != null ? flutterViewInActivity : flutterViewInFragment; + } + + private boolean isValidFlutterView(FlutterView flutterView) { + boolean hasChildren = flutterView.getChildCount() > 0; + boolean isSurfaceView = flutterView.getChildAt(0) instanceof SurfaceView; + return hasChildren && isSurfaceView; + } + + private Bitmap createBitmapFromSurface(SurfaceView surfaceView) { + int width = surfaceView.getWidth(); + int height = surfaceView.getHeight(); + + if (width <= 0 || height <= 0) { + return null; + } + Bitmap bitmap; + try { + if (((long) width * height * 4) < MemoryUtils.getFreeMemory(surfaceView.getContext())) { + // ARGB_8888 store each pixel in 4 bytes + bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); + } else { + // RGB_565 store each pixel in 2 bytes + bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); + } + + } catch (IllegalArgumentException | OutOfMemoryError e) { + bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565); + } + + + return bitmap; + } +} diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/ScreenshotResultCallback.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/ScreenshotResultCallback.java new file mode 100644 index 000000000..e01b9b95d --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/modules/capturing/ScreenshotResultCallback.java @@ -0,0 +1,9 @@ +package com.instabug.flutter.modules.capturing; + + +import com.instabug.flutter.model.ScreenshotResult; + +public interface ScreenshotResultCallback { + void onScreenshotResult(ScreenshotResult screenshotResult); + void onError(); +} diff --git a/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java similarity index 94% rename from android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java index c38028707..db41068da 100644 --- a/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/ArgsRegistry.java @@ -9,6 +9,7 @@ import com.instabug.featuresrequest.ActionType; import com.instabug.library.InstabugColorTheme; import com.instabug.library.InstabugCustomTextPlaceHolder.Key; +import com.instabug.library.MaskingType; import com.instabug.library.OnSdkDismissCallback.DismissType; import com.instabug.library.ReproMode; import com.instabug.library.extendedbugreport.ExtendedBugReport; @@ -16,6 +17,7 @@ import com.instabug.library.invocation.InstabugInvocationEvent; import com.instabug.library.invocation.util.InstabugFloatingButtonEdge; import com.instabug.library.invocation.util.InstabugVideoRecordingButtonPosition; +import com.instabug.library.model.StepType; import com.instabug.library.ui.onboarding.WelcomeMessage; import java.util.HashMap; @@ -57,6 +59,14 @@ public T get(Object key) { put("ColorTheme.light", InstabugColorTheme.InstabugColorThemeLight); put("ColorTheme.dark", InstabugColorTheme.InstabugColorThemeDark); }}; + + public static final ArgsMap autoMasking = new ArgsMap() {{ + put("AutoMasking.labels", MaskingType.LABELS); + put("AutoMasking.textInputs", MaskingType.TEXT_INPUTS); + put("AutoMasking.media", MaskingType.MEDIA); + put("AutoMasking.none", MaskingType.MASK_NOTHING); + }}; + public static ArgsMap nonFatalExceptionLevel = new ArgsMap() {{ put("NonFatalExceptionLevel.critical", IBGNonFatalException.Level.CRITICAL); put("NonFatalExceptionLevel.error", IBGNonFatalException.Level.ERROR); @@ -212,4 +222,13 @@ public T get(Object key) { put("CustomTextPlaceHolderKey.messagesNotificationAndOthers", Key.CHATS_MULTIPLE_MESSAGE_NOTIFICATION); put("CustomTextPlaceHolderKey.insufficientContentMessage", Key.COMMENT_FIELD_INSUFFICIENT_CONTENT); }}; + + public static final ArgsMap gestureStepType = new ArgsMap() {{ + put("GestureType.swipe", StepType.SWIPE); + put("GestureType.scroll", StepType.SCROLL); + put("GestureType.tap", StepType.TAP); + put("GestureType.pinch", StepType.PINCH); + put("GestureType.longPress", StepType.LONG_PRESS); + put("GestureType.doubleTap", StepType.DOUBLE_TAP); + }}; } diff --git a/android/src/main/java/com/instabug/flutter/util/Reflection.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/Reflection.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/util/Reflection.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/Reflection.java diff --git a/android/src/main/java/com/instabug/flutter/util/ThreadManager.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/ThreadManager.java similarity index 100% rename from android/src/main/java/com/instabug/flutter/util/ThreadManager.java rename to packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/ThreadManager.java diff --git a/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/privateViews/ScreenshotCaptor.java b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/privateViews/ScreenshotCaptor.java new file mode 100644 index 000000000..86eb40007 --- /dev/null +++ b/packages/instabug_flutter/android/src/main/java/com/instabug/flutter/util/privateViews/ScreenshotCaptor.java @@ -0,0 +1,13 @@ +package com.instabug.flutter.util.privateViews; + +import android.graphics.Bitmap; + +public interface ScreenshotCaptor { + public void capture(CapturingCallback listener); + + public interface CapturingCallback { + public void onCapturingFailure(Throwable throwable); + + public void onCapturingSuccess(Bitmap bitmap); + } +} \ No newline at end of file diff --git a/android/src/test/java/com/instabug/flutter/ApmApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/ApmApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/ApmApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/ApmApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/ArgsRegistryTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/ArgsRegistryTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/ArgsRegistryTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/ArgsRegistryTest.java diff --git a/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/BugReportingApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/BugReportingApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/CrashReportingApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/CrashReportingApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/CrashReportingApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/CrashReportingApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/FeatureRequestsApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/FeatureRequestsApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/FeatureRequestsApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/FeatureRequestsApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/InstabugApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/InstabugApiTest.java similarity index 90% rename from android/src/test/java/com/instabug/flutter/InstabugApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/InstabugApiTest.java index 8e9999e52..00c529fd3 100644 --- a/android/src/test/java/com/instabug/flutter/InstabugApiTest.java +++ b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/InstabugApiTest.java @@ -6,8 +6,10 @@ import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mockConstruction; @@ -30,6 +32,7 @@ import com.instabug.bug.BugReporting; import com.instabug.flutter.generated.InstabugPigeon; import com.instabug.flutter.modules.InstabugApi; +import com.instabug.flutter.util.ArgsRegistry; import com.instabug.flutter.util.GlobalMocks; import com.instabug.flutter.util.MockReflected; import com.instabug.library.Feature; @@ -38,6 +41,7 @@ import com.instabug.library.InstabugCustomTextPlaceHolder; import com.instabug.library.IssueType; import com.instabug.library.LogLevel; +import com.instabug.library.MaskingType; import com.instabug.library.Platform; import com.instabug.library.ReproConfigurations; import com.instabug.library.ReproMode; @@ -46,8 +50,14 @@ import com.instabug.library.internal.crossplatform.FeaturesStateListener; import com.instabug.library.internal.crossplatform.InternalCore; import com.instabug.library.featuresflags.model.IBGFeatureFlag; +import com.instabug.library.internal.crossplatform.CoreFeature; +import com.instabug.library.internal.crossplatform.FeaturesStateListener; +import com.instabug.library.internal.crossplatform.InternalCore; +import com.instabug.library.featuresflags.model.IBGFeatureFlag; +import com.instabug.library.internal.crossplatform.InternalCore; import com.instabug.library.invocation.InstabugInvocationEvent; import com.instabug.library.model.NetworkLog; +import com.instabug.library.screenshot.ScreenshotCaptor; import com.instabug.library.ui.onboarding.WelcomeMessage; import com.instabug.survey.Surveys; import com.instabug.survey.callbacks.OnShowCallback; @@ -78,10 +88,18 @@ import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; import org.mockito.verification.VerificationMode; + +import kotlin.jvm.functions.Function1; + +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; +import org.mockito.stubbing.Answer; import org.mockito.verification.VerificationMode; import android.graphics.Typeface; +import android.graphics.Typeface; + public class InstabugApiTest { private final Callable screenshotProvider = () -> mock(Bitmap.class); private final Application mContext = mock(Application.class); @@ -709,5 +727,56 @@ public void testSetFullscreenDisabled() { mInstabug.verify(() -> Instabug.setFullscreen(isEnabled)); } + @Test + public void testSetScreenshotCaptor() { + InternalCore internalCore = spy(InternalCore.INSTANCE); + + InstabugApi.setScreenshotCaptor(any(), internalCore); + verify(internalCore)._setScreenshotCaptor(any(ScreenshotCaptor.class)); + } + + @Test + public void testSetUserStepsEnabledGivenTrue() { + boolean isEnabled = true; + + api.setEnableUserSteps(isEnabled); + + mInstabug.verify(() -> Instabug.setTrackingUserStepsState(Feature.State.ENABLED)); + } + + @Test + public void testSetUserStepsEnabledGivenFalse() { + boolean isEnabled = false; + + api.setEnableUserSteps(isEnabled); + + mInstabug.verify(() -> Instabug.setTrackingUserStepsState(Feature.State.DISABLED)); + } + + @Test + public void testLogUserSteps() { + + final String gestureType = "GestureType.tap"; + final String message = "message"; + final String view = "view"; + + api.logUserSteps(gestureType, message,view); + + reflected.verify(() -> MockReflected.addUserStep(anyLong(), eq(ArgsRegistry.gestureStepType.get(gestureType)), eq(message), isNull(), eq(view))); + + } + + @Test + public void testAutoMasking() { + String maskLabel = "AutoMasking.labels"; + String maskTextInputs = "AutoMasking.textInputs"; + String maskMedia = "AutoMasking.media"; + String maskNone = "AutoMasking.none"; + + + api.enableAutoMasking(List.of(maskLabel, maskMedia, maskTextInputs,maskNone)); + + mInstabug.verify(() -> Instabug.setAutoMaskScreenshotsTypes(MaskingType.LABELS,MaskingType.MEDIA,MaskingType.TEXT_INPUTS,MaskingType.MASK_NOTHING)); + } } diff --git a/android/src/test/java/com/instabug/flutter/InstabugLogApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/InstabugLogApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/InstabugLogApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/InstabugLogApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/RepliesApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/RepliesApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/RepliesApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/RepliesApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/SessionReplayApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/SurveysApiTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/SurveysApiTest.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/SurveysApiTest.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/SurveysApiTest.java diff --git a/android/src/test/java/com/instabug/flutter/util/Callback.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/Callback.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/util/Callback.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/Callback.java diff --git a/android/src/test/java/com/instabug/flutter/util/GlobalMocks.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/GlobalMocks.java similarity index 93% rename from android/src/test/java/com/instabug/flutter/util/GlobalMocks.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/GlobalMocks.java index 9ab7802ec..797921341 100644 --- a/android/src/test/java/com/instabug/flutter/util/GlobalMocks.java +++ b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/GlobalMocks.java @@ -113,6 +113,14 @@ public static void setUp() throws NoSuchMethodException { Method mEndScreenLoadingCP = MockReflected.class.getDeclaredMethod("endScreenLoadingCP", Long.class, Long.class); mEndScreenLoadingCP.setAccessible(true); reflection.when(() -> Reflection.getMethod(Class.forName("com.instabug.apm.APM"), "endScreenLoadingCP", Long.class, Long.class)).thenReturn(mEndScreenLoadingCP); + + + Method mAddUserStepCp = MockReflected.class.getDeclaredMethod("addUserStep", + long.class, String.class, String.class, String.class, String.class); + mAddUserStepCp.setAccessible(true); + reflection.when(() -> Reflection.getMethod(Class.forName("com.instabug.library.Instabug"), "addUserStep", + long.class, String.class, String.class, String.class, String.class)).thenReturn(mAddUserStepCp);; + } public static void close() { diff --git a/android/src/test/java/com/instabug/flutter/util/MockReflected.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/MockReflected.java similarity index 92% rename from android/src/test/java/com/instabug/flutter/util/MockReflected.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/MockReflected.java index 9bf03cc53..74249675a 100644 --- a/android/src/test/java/com/instabug/flutter/util/MockReflected.java +++ b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/MockReflected.java @@ -5,6 +5,7 @@ import com.instabug.apm.networkinterception.cp.APMCPNetworkLog; import com.instabug.crash.models.IBGNonFatalException; +import com.instabug.library.model.StepType; import org.json.JSONObject; @@ -53,4 +54,6 @@ public static void startUiTraceCP(String screenName, Long microTimeStamp, Long t public static void reportScreenLoadingCP(Long startTimeStampMicro, Long durationMicro, Long uiTraceId) {} public static void endScreenLoadingCP(Long timeStampMicro, Long uiTraceId) {} + public static void addUserStep(long timestamp, @StepType String stepType, String message, String label, String viewType) { + } } diff --git a/android/src/test/java/com/instabug/flutter/util/MockResult.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/MockResult.java similarity index 100% rename from android/src/test/java/com/instabug/flutter/util/MockResult.java rename to packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/MockResult.java diff --git a/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/BoundryScreenshotCaptorTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/BoundryScreenshotCaptorTest.java new file mode 100644 index 000000000..a555345e0 --- /dev/null +++ b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/BoundryScreenshotCaptorTest.java @@ -0,0 +1,77 @@ +package com.instabug.flutter.util.private_views; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.robolectric.Shadows.shadowOf; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.os.Looper; + +import com.instabug.flutter.model.ScreenshotResult; +import com.instabug.flutter.modules.capturing.BoundryCaptureManager; +import com.instabug.flutter.modules.capturing.CaptureManager; +import com.instabug.flutter.modules.capturing.ScreenshotResultCallback; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentMatcher; +import org.robolectric.Robolectric; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.annotation.Config; + +import io.flutter.embedding.engine.renderer.FlutterRenderer; + +@RunWith(RobolectricTestRunner.class) +@Config(sdk = {28}, manifest = Config.NONE) +public class BoundryScreenshotCaptorTest { + private Activity activityMock; + private Bitmap bitmap; + private CaptureManager captureManager; + + @Before + public void setUp() { + FlutterRenderer rendererMock = mock(FlutterRenderer.class); + activityMock = spy(Robolectric.buildActivity(Activity.class).setup().create().start().resume().get()); + bitmap = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888); + when(rendererMock.getBitmap()).thenReturn(bitmap); + captureManager = new BoundryCaptureManager(rendererMock); + } + + @Test + public void testCaptureGivenEmptyActivity() { + ScreenshotResultCallback mockCallback = mock(ScreenshotResultCallback.class); + + captureManager.capture(null, mockCallback); + shadowOf(Looper.getMainLooper()).idle(); + + verify(mockCallback).onError(); + verify(mockCallback, never()).onScreenshotResult(any(ScreenshotResult.class)); + + } + + @Test + public void testCapture() { + ScreenshotResultCallback mockCallback = mock(ScreenshotResultCallback.class); + captureManager.capture(activityMock, mockCallback); + shadowOf(Looper.getMainLooper()).idle(); + + verify(mockCallback, never()).onError(); + verify(mockCallback).onScreenshotResult(argThat(new ArgumentMatcher() { + @Override + public boolean matches(ScreenshotResult argument) { + return (Math.abs(activityMock.getResources().getDisplayMetrics().density - argument.getPixelRatio()) < 0.01)&& + bitmap == argument.getScreenshot(); + + } + })); + } + + +} diff --git a/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/PixelCopyScreenshotCaptorTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/PixelCopyScreenshotCaptorTest.java new file mode 100644 index 000000000..868712312 --- /dev/null +++ b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/PixelCopyScreenshotCaptorTest.java @@ -0,0 +1,91 @@ +package com.instabug.flutter.util.private_views; + +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.robolectric.Shadows.shadowOf; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.os.Looper; +import android.view.SurfaceView; + +import com.instabug.flutter.model.ScreenshotResult; +import com.instabug.flutter.modules.capturing.CaptureManager; +import com.instabug.flutter.modules.capturing.PixelCopyCaptureManager; +import com.instabug.flutter.modules.capturing.ScreenshotResultCallback; +import com.instabug.library.util.memory.MemoryUtils; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.MockedStatic; +import org.robolectric.Robolectric; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.annotation.Config; + +import io.flutter.embedding.android.FlutterActivity; +import io.flutter.embedding.android.FlutterView; +import io.flutter.embedding.engine.renderer.FlutterRenderer; + +@RunWith(RobolectricTestRunner.class) +@Config(sdk = {28}, manifest = Config.NONE) +public class PixelCopyScreenshotCaptorTest { + private Activity activityMock; + private Bitmap bitmap; + private CaptureManager captureManager; + + @Before + public void setUp() { + FlutterRenderer rendererMock = mock(FlutterRenderer.class); + activityMock = spy(Robolectric.buildActivity(Activity.class).setup().create().start().resume().get()); + bitmap = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888); + when(rendererMock.getBitmap()).thenReturn(bitmap); + captureManager = new PixelCopyCaptureManager(); + } + + @Test + public void testCaptureWithPixelCopyGivenEmptyView() { + + ScreenshotResultCallback mockScreenshotResultCallback = mock(ScreenshotResultCallback.class); + when(activityMock.findViewById(FlutterActivity.FLUTTER_VIEW_ID)).thenReturn(null); + captureManager.capture(activityMock,mockScreenshotResultCallback); + + verify(mockScreenshotResultCallback).onError(); + } + + @Test + public void testCaptureWithPixelCopy() { + try (MockedStatic mockedStatic = mockStatic(MemoryUtils.class)) { + mockedStatic.when(() -> MemoryUtils.getFreeMemory(any())).thenReturn(Long.MAX_VALUE); + + mockFlutterViewInPixelCopy(); + + ScreenshotResultCallback mockScreenshotResultCallback = mock(ScreenshotResultCallback.class); + + + captureManager.capture(activityMock, mockScreenshotResultCallback); + shadowOf(Looper.getMainLooper()).idle(); + + verify(mockScreenshotResultCallback, timeout(1000)).onScreenshotResult(any(ScreenshotResult.class)); // PixelCopy success + + } + } + + + private void mockFlutterViewInPixelCopy() { + + SurfaceView mockSurfaceView = mock(SurfaceView.class); + FlutterView flutterView = mock(FlutterView.class); + when(flutterView.getChildAt(0)).thenReturn(mockSurfaceView); + when(flutterView.getChildCount()).thenReturn(1); + + when(activityMock.findViewById(FlutterActivity.FLUTTER_VIEW_ID)).thenReturn(flutterView); + when(mockSurfaceView.getWidth()).thenReturn(100); + when(mockSurfaceView.getHeight()).thenReturn(100); + } +} diff --git a/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/PrivateViewManagerTest.java b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/PrivateViewManagerTest.java new file mode 100644 index 000000000..a996fb8a2 --- /dev/null +++ b/packages/instabug_flutter/android/src/test/java/com/instabug/flutter/util/private_views/PrivateViewManagerTest.java @@ -0,0 +1,146 @@ +package com.instabug.flutter.util.private_views; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.timeout; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.robolectric.Shadows.shadowOf; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.os.Build; +import android.os.Looper; +import android.view.SurfaceView; + +import com.instabug.flutter.generated.InstabugPrivateViewPigeon; +import com.instabug.flutter.model.ScreenshotResult; +import com.instabug.flutter.modules.PrivateViewManager; +import com.instabug.flutter.modules.capturing.BoundryCaptureManager; +import com.instabug.flutter.modules.capturing.CaptureManager; +import com.instabug.flutter.modules.capturing.PixelCopyCaptureManager; +import com.instabug.flutter.util.privateViews.ScreenshotCaptor; + +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.robolectric.Robolectric; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.annotation.Config; + +import java.util.Arrays; +import java.util.List; + +import io.flutter.embedding.android.FlutterActivity; +import io.flutter.embedding.android.FlutterView; +import io.flutter.embedding.engine.renderer.FlutterRenderer; + +@RunWith(RobolectricTestRunner.class) +@Config(sdk = {28}, manifest = Config.NONE) +public class PrivateViewManagerTest { + + private PrivateViewManager privateViewManager; + private InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi InstabugPrivateViewFlutterApiMock; + private Activity activityMock; + private Bitmap bitmap; + private CaptureManager pixelCopyScreenCaptor, boundryScreenCaptor; + + @Before + public void setUp() { + InstabugPrivateViewFlutterApiMock = mock(InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi.class); + FlutterRenderer rendererMock = mock(FlutterRenderer.class); + activityMock = spy(Robolectric.buildActivity(Activity.class).setup().create().start().resume().get()); + bitmap = Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888); + when(rendererMock.getBitmap()).thenReturn(bitmap); + pixelCopyScreenCaptor = spy(new PixelCopyCaptureManager()); + boundryScreenCaptor = spy(new BoundryCaptureManager(rendererMock)); + privateViewManager = spy(new PrivateViewManager(InstabugPrivateViewFlutterApiMock, pixelCopyScreenCaptor, boundryScreenCaptor)); + privateViewManager.setActivity(activityMock); + + } + + + @Test + public void testMaskGivenEmptyActivity() { + com.instabug.flutter.util.privateViews.ScreenshotCaptor.CapturingCallback capturingCallbackMock = mock(ScreenshotCaptor.CapturingCallback.class); + privateViewManager.setActivity(null); + privateViewManager.mask(capturingCallbackMock); + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(Throwable.class); + verify(capturingCallbackMock).onCapturingFailure(argumentCaptor.capture()); + assertEquals( PrivateViewManager.EXCEPTION_MESSAGE, argumentCaptor.getValue().getMessage()); + } + + @Test + public void testMask() throws InterruptedException { + com.instabug.flutter.util.privateViews.ScreenshotCaptor.CapturingCallback capturingCallbackMock = mock(com.instabug.flutter.util.privateViews.ScreenshotCaptor.CapturingCallback.class); + doAnswer(invocation -> { + InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi.Reply> callback = invocation.getArgument(0); // Get the callback + callback.reply(Arrays.asList(10.0, 20.0, 100.0, 200.0)); // Trigger the success callback + return null; + }).when(InstabugPrivateViewFlutterApiMock).getPrivateViews(any(InstabugPrivateViewPigeon.InstabugPrivateViewFlutterApi.Reply.class)); // Mock the method call + + + // Trigger the mask operation + privateViewManager.mask(capturingCallbackMock); + // Mock that latch.await() has been called + shadowOf(Looper.getMainLooper()).idle(); + + // Simulate a successful bitmap capture + verify(capturingCallbackMock, timeout(1000)).onCapturingSuccess(bitmap); + } + + + private void mockFlutterViewInPixelCopy() { + SurfaceView mockSurfaceView = mock(SurfaceView.class); + FlutterView flutterView = mock(FlutterView.class); + when(flutterView.getChildAt(0)).thenReturn(mockSurfaceView); + when(flutterView.getChildCount()).thenReturn(1); + + when(activityMock.findViewById(FlutterActivity.FLUTTER_VIEW_ID)).thenReturn(flutterView); + when(mockSurfaceView.getWidth()).thenReturn(100); + when(mockSurfaceView.getHeight()).thenReturn(100); + } + + + @Test + public void testMaskPrivateViews() { + ScreenshotResult mockResult = mock(ScreenshotResult.class); + when(mockResult.getScreenshot()).thenReturn(Bitmap.createBitmap(200, 200, Bitmap.Config.ARGB_8888)); + when(mockResult.getPixelRatio()).thenReturn(2.0f); + + List privateViews = Arrays.asList(10.0, 20.0, 100.0, 200.0); + + privateViewManager.maskPrivateViews(mockResult, privateViews); + + assertNotNull(mockResult.getScreenshot()); + } + + @Test + @Config(sdk = {Build.VERSION_CODES.M}) + public void testMaskShouldGetScreenshotWhenAPIVersionLessThan28() { + ScreenshotCaptor.CapturingCallback capturingCallbackMock = mock(ScreenshotCaptor.CapturingCallback.class); + privateViewManager.mask(capturingCallbackMock); + shadowOf(Looper.getMainLooper()).idle(); + + verify(boundryScreenCaptor).capture(any(), any()); + + } + + @Test + public void testMaskShouldCallPixelCopyWhenAPIVersionMoreThan28() { + com.instabug.flutter.util.privateViews.ScreenshotCaptor.CapturingCallback capturingCallbackMock = mock(com.instabug.flutter.util.privateViews.ScreenshotCaptor.CapturingCallback.class); + mockFlutterViewInPixelCopy(); + privateViewManager.mask(capturingCallbackMock); + shadowOf(Looper.getMainLooper()).idle(); + verify(boundryScreenCaptor, never()).capture(any(), any()); + verify(pixelCopyScreenCaptor).capture(any(), any()); + + + } +} \ No newline at end of file diff --git a/android/upload_symbols.gradle b/packages/instabug_flutter/android/upload_symbols.gradle similarity index 100% rename from android/upload_symbols.gradle rename to packages/instabug_flutter/android/upload_symbols.gradle diff --git a/packages/instabug_flutter/dangerfile.ts b/packages/instabug_flutter/dangerfile.ts new file mode 100644 index 000000000..670ae0b05 --- /dev/null +++ b/packages/instabug_flutter/dangerfile.ts @@ -0,0 +1,37 @@ +import { danger, fail, schedule, warn } from 'danger'; +import collectCoverage, { ReportType } from '@instabug/danger-plugin-coverage'; + +const hasSourceChanges = danger.git.modified_files.some((file) => + file.startsWith('lib/') +); +const declaredTrivial = + !hasSourceChanges || + danger.github.issue.labels.some((label) => label.name === 'trivial'); + +// Make sure PR has a description. +async function hasDescription() { + const linesOfCode = (await danger.git.linesOfCode()) ?? 0; + const hasNoDescription = danger.github.pr.body.includes( + '> Description goes here' + ); + if (hasNoDescription && linesOfCode > 10) { + fail( + 'Please provide a summary of the changes in the pull request description.' + ); + } + + if (!danger.git.modified_files.includes('CHANGELOG.md') && !declaredTrivial) { + warn( + 'You have not included a CHANGELOG entry! \nYou can find it at [CHANGELOG.md](https://github.com/Instabug/Instabug-Flutter/blob/master/CHANGELOG.md).' + ); + } +} + +schedule(hasDescription()); + +collectCoverage({ + label: 'Dart', + type: ReportType.LCOV, + filePath: 'coverage/lcov.info', + threshold: 80, +}); diff --git a/example/.gitignore b/packages/instabug_flutter/example/.gitignore similarity index 100% rename from example/.gitignore rename to packages/instabug_flutter/example/.gitignore diff --git a/example/.metadata b/packages/instabug_flutter/example/.metadata similarity index 100% rename from example/.metadata rename to packages/instabug_flutter/example/.metadata diff --git a/example/README.md b/packages/instabug_flutter/example/README.md similarity index 100% rename from example/README.md rename to packages/instabug_flutter/example/README.md diff --git a/example/android/.gitignore b/packages/instabug_flutter/example/android/.gitignore similarity index 100% rename from example/android/.gitignore rename to packages/instabug_flutter/example/android/.gitignore diff --git a/example/android/app/build.gradle b/packages/instabug_flutter/example/android/app/build.gradle similarity index 99% rename from example/android/app/build.gradle rename to packages/instabug_flutter/example/android/app/build.gradle index 8e777d514..f29331c1f 100644 --- a/example/android/app/build.gradle +++ b/packages/instabug_flutter/example/android/app/build.gradle @@ -1,3 +1,4 @@ + plugins { id "com.android.application" id "kotlin-android" diff --git a/packages/instabug_flutter/example/android/app/src/debug/AndroidManifest.xml b/packages/instabug_flutter/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..f880684a6 --- /dev/null +++ b/packages/instabug_flutter/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/example/android/app/src/main/AndroidManifest.xml b/packages/instabug_flutter/example/android/app/src/main/AndroidManifest.xml similarity index 100% rename from example/android/app/src/main/AndroidManifest.xml rename to packages/instabug_flutter/example/android/app/src/main/AndroidManifest.xml diff --git a/example/android/app/src/main/kotlin/com/example/InstabugSample/InstabugExampleMethodCallHandler.kt b/packages/instabug_flutter/example/android/app/src/main/kotlin/com/example/InstabugSample/InstabugExampleMethodCallHandler.kt similarity index 100% rename from example/android/app/src/main/kotlin/com/example/InstabugSample/InstabugExampleMethodCallHandler.kt rename to packages/instabug_flutter/example/android/app/src/main/kotlin/com/example/InstabugSample/InstabugExampleMethodCallHandler.kt diff --git a/example/android/app/src/main/kotlin/com/example/InstabugSample/MainActivity.kt b/packages/instabug_flutter/example/android/app/src/main/kotlin/com/example/InstabugSample/MainActivity.kt similarity index 100% rename from example/android/app/src/main/kotlin/com/example/InstabugSample/MainActivity.kt rename to packages/instabug_flutter/example/android/app/src/main/kotlin/com/example/InstabugSample/MainActivity.kt diff --git a/packages/instabug_flutter/example/android/app/src/main/res/drawable/launch_background.xml b/packages/instabug_flutter/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/instabug_flutter/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/instabug_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/packages/instabug_flutter/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/example/android/app/src/main/res/values/styles.xml b/packages/instabug_flutter/example/android/app/src/main/res/values/styles.xml similarity index 100% rename from example/android/app/src/main/res/values/styles.xml rename to packages/instabug_flutter/example/android/app/src/main/res/values/styles.xml diff --git a/example/android/app/src/main/res/xml/network_security_config.xml b/packages/instabug_flutter/example/android/app/src/main/res/xml/network_security_config.xml similarity index 100% rename from example/android/app/src/main/res/xml/network_security_config.xml rename to packages/instabug_flutter/example/android/app/src/main/res/xml/network_security_config.xml diff --git a/packages/instabug_flutter/example/android/app/src/profile/AndroidManifest.xml b/packages/instabug_flutter/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..f880684a6 --- /dev/null +++ b/packages/instabug_flutter/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/packages/instabug_flutter/example/android/build.gradle b/packages/instabug_flutter/example/android/build.gradle new file mode 100644 index 000000000..6cc62edd7 --- /dev/null +++ b/packages/instabug_flutter/example/android/build.gradle @@ -0,0 +1,21 @@ +rootProject.buildDir = '../build' + +//android { +// namespace 'com.instabug.flutter.example' +//} +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') + tasks.withType(Test) { + // Prevent tests in moduleA from running + if (project.name == 'video_player_android') { + exclude '**/*' + } + } +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/instabug_flutter/example/android/gradle.properties b/packages/instabug_flutter/example/android/gradle.properties new file mode 100644 index 000000000..b9a9a2464 --- /dev/null +++ b/packages/instabug_flutter/example/android/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/example/android/gradle/wrapper/gradle-wrapper.jar b/packages/instabug_flutter/example/android/gradle/wrapper/gradle-wrapper.jar similarity index 100% rename from example/android/gradle/wrapper/gradle-wrapper.jar rename to packages/instabug_flutter/example/android/gradle/wrapper/gradle-wrapper.jar diff --git a/packages/instabug_flutter/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/instabug_flutter/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..4cf0c849a --- /dev/null +++ b/packages/instabug_flutter/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip diff --git a/example/android/gradlew b/packages/instabug_flutter/example/android/gradlew similarity index 100% rename from example/android/gradlew rename to packages/instabug_flutter/example/android/gradlew diff --git a/example/android/gradlew.bat b/packages/instabug_flutter/example/android/gradlew.bat similarity index 96% rename from example/android/gradlew.bat rename to packages/instabug_flutter/example/android/gradlew.bat index aec99730b..8a0b282aa 100644 --- a/example/android/gradlew.bat +++ b/packages/instabug_flutter/example/android/gradlew.bat @@ -1,90 +1,90 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/packages/instabug_flutter/example/android/settings.gradle b/packages/instabug_flutter/example/android/settings.gradle new file mode 100644 index 000000000..32cfc43dc --- /dev/null +++ b/packages/instabug_flutter/example/android/settings.gradle @@ -0,0 +1,27 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url 'https://storage.googleapis.com/flutter-plugins' } + + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.1.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false +} + +include ":app" diff --git a/example/android/settings_aar.gradle b/packages/instabug_flutter/example/android/settings_aar.gradle similarity index 100% rename from example/android/settings_aar.gradle rename to packages/instabug_flutter/example/android/settings_aar.gradle diff --git a/packages/instabug_flutter/example/assets/img.png b/packages/instabug_flutter/example/assets/img.png new file mode 100644 index 000000000..fff04770f Binary files /dev/null and b/packages/instabug_flutter/example/assets/img.png differ diff --git a/example/ios/.gitignore b/packages/instabug_flutter/example/ios/.gitignore similarity index 100% rename from example/ios/.gitignore rename to packages/instabug_flutter/example/ios/.gitignore diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/packages/instabug_flutter/example/ios/Flutter/AppFrameworkInfo.plist similarity index 100% rename from example/ios/Flutter/AppFrameworkInfo.plist rename to packages/instabug_flutter/example/ios/Flutter/AppFrameworkInfo.plist diff --git a/example/ios/Flutter/Debug.xcconfig b/packages/instabug_flutter/example/ios/Flutter/Debug.xcconfig similarity index 100% rename from example/ios/Flutter/Debug.xcconfig rename to packages/instabug_flutter/example/ios/Flutter/Debug.xcconfig diff --git a/example/ios/Flutter/Release.xcconfig b/packages/instabug_flutter/example/ios/Flutter/Release.xcconfig similarity index 100% rename from example/ios/Flutter/Release.xcconfig rename to packages/instabug_flutter/example/ios/Flutter/Release.xcconfig diff --git a/example/ios/InstabugTests/ApmApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/ApmApiTests.m similarity index 100% rename from example/ios/InstabugTests/ApmApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/ApmApiTests.m diff --git a/example/ios/InstabugTests/ArgsRegistryTests.m b/packages/instabug_flutter/example/ios/InstabugTests/ArgsRegistryTests.m similarity index 100% rename from example/ios/InstabugTests/ArgsRegistryTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/ArgsRegistryTests.m diff --git a/example/ios/InstabugTests/BugReportingApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/BugReportingApiTests.m similarity index 100% rename from example/ios/InstabugTests/BugReportingApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/BugReportingApiTests.m diff --git a/example/ios/InstabugTests/CrashReportingApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/CrashReportingApiTests.m similarity index 100% rename from example/ios/InstabugTests/CrashReportingApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/CrashReportingApiTests.m diff --git a/example/ios/InstabugTests/FeatureRequestsApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/FeatureRequestsApiTests.m similarity index 100% rename from example/ios/InstabugTests/FeatureRequestsApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/FeatureRequestsApiTests.m diff --git a/example/ios/InstabugTests/Info.plist b/packages/instabug_flutter/example/ios/InstabugTests/Info.plist similarity index 100% rename from example/ios/InstabugTests/Info.plist rename to packages/instabug_flutter/example/ios/InstabugTests/Info.plist diff --git a/example/ios/InstabugTests/InstabugApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/InstabugApiTests.m similarity index 95% rename from example/ios/InstabugTests/InstabugApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/InstabugApiTests.m index 3e1abf332..e156199db 100644 --- a/example/ios/InstabugTests/InstabugApiTests.m +++ b/packages/instabug_flutter/example/ios/InstabugTests/InstabugApiTests.m @@ -137,14 +137,6 @@ - (void)testSetWelcomeMessageMode { OCMVerify([self.mInstabug setWelcomeMessageMode:IBGWelcomeMessageModeBeta]); } -- (void)testSetPrimaryColor { - NSNumber *color = @0xFF0000; - FlutterError *error; - - [self.api setPrimaryColorColor:color error:&error]; - - OCMVerify([self.mInstabug setTintColor:[OCMArg isKindOfClass:[UIColor class]]]); -} - (void)testSetSessionProfilerEnabled { NSNumber *isEnabled = @1; @@ -630,5 +622,32 @@ - (void)testSetFullscreen { // Since this is an empty implementation, we just verify the method can be called without error XCTAssertNil(error); } +- (void)testSetEnableUserStepsIsEnabled{ + NSNumber *isEnabled = @1; + FlutterError *error; + + [self.api setEnableUserStepsIsEnabled:isEnabled error:&error]; + + OCMVerify([self.mInstabug setTrackUserSteps:YES]); + +} +- (void)testLogUserStepsGestureType{ + NSString* message = @"message"; + NSString* view = @"viewName"; + FlutterError *error; + + [self.api logUserStepsGestureType:@"GestureType.tap" message:message viewName:view error: &error]; + + XCTAssertNil(error, @"Error should be nil"); + +} +- (void)testAutoMasking { + NSArray *autoMaskingTypes = @[@"AutoMasking.labels", @"AutoMasking.textInputs",@"AutoMasking.media",@"AutoMasking.none"]; + FlutterError *error; + + [self.api enableAutoMaskingAutoMasking:autoMaskingTypes error:&error]; + + OCMVerify([self.mInstabug setAutoMaskScreenshots: (IBGAutoMaskScreenshotOptionMaskNothing | IBGAutoMaskScreenshotOptionTextInputs | IBGAutoMaskScreenshotOptionLabels | IBGAutoMaskScreenshotOptionMedia)]); +} @end diff --git a/example/ios/InstabugTests/InstabugLogApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/InstabugLogApiTests.m similarity index 100% rename from example/ios/InstabugTests/InstabugLogApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/InstabugLogApiTests.m diff --git a/packages/instabug_flutter/example/ios/InstabugTests/PrivateViewApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/PrivateViewApiTests.m new file mode 100644 index 000000000..ac3f17efc --- /dev/null +++ b/packages/instabug_flutter/example/ios/InstabugTests/PrivateViewApiTests.m @@ -0,0 +1,191 @@ +#import +#import +#import +#import +#import "FlutterPluginRegistrar+FlutterEngine.h" + + +@interface MockFlutterPluginRegistrar : NSObject +@end + +@implementation MockFlutterPluginRegistrar + +@end + + +@interface PrivateViewApiTests : XCTestCase +@property (nonatomic, strong) PrivateViewApi *api; +@property (nonatomic, strong) id mockFlutterApi; +@property (nonatomic, strong) id mockRegistrar; +@property (nonatomic, strong) id mockFlutterViewController; +@property (nonatomic, strong) id mockEngine; + +@end + +@implementation PrivateViewApiTests + +#pragma mark - Setup / Teardown + +- (void)setUp { + [super setUp]; + + + self.mockFlutterApi = OCMClassMock([InstabugPrivateViewFlutterApi class]); + + + MockFlutterPluginRegistrar *mockRegistrar = [[MockFlutterPluginRegistrar alloc] init]; + + self.mockRegistrar = OCMPartialMock(mockRegistrar); + + self.mockEngine = OCMClassMock([FlutterEngine class]); + OCMStub([self.mockRegistrar flutterEngine]).andReturn(self.mockEngine); + + self.mockFlutterViewController = OCMClassMock([UIViewController class]); + + OCMStub([self.mockEngine viewController]).andReturn(_mockFlutterViewController); + + self.api = OCMPartialMock([[PrivateViewApi alloc] initWithFlutterApi:self.mockFlutterApi registrar: self.mockRegistrar]); +} + +- (void)tearDown { + [self.mockFlutterApi stopMocking]; + [self.mockRegistrar stopMocking]; + [self.mockFlutterViewController stopMocking]; + [self.mockEngine stopMocking]; + + self.api = nil; + + [super tearDown]; +} + +#pragma mark - Tests + +- (void)testMask_Success { + XCTestExpectation *expectation = [self expectationWithDescription:@"Mask method success"]; + + CGSize imageSize = CGSizeMake(100, 100); // 100x100 pixels + + // Step 2: Create the image using UIGraphicsImageRenderer + UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:imageSize]; + + UIImage *screenshot = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) { + // Draw a red rectangle as an example + [[UIColor redColor] setFill]; + CGRect rect = CGRectMake(0, 0, imageSize.width, imageSize.height); + UIRectFill(rect); + }]; + + NSArray *rectangles = @[@10, @20, @30, @40]; + UIView *mockView = [[UIView alloc] initWithFrame:CGRectMake(10, 20, 30, 40)]; + + OCMStub([self.mockFlutterApi getPrivateViewsWithCompletion:([OCMArg invokeBlockWithArgs:rectangles, [NSNull null], nil])]); + + + + OCMStub([self.mockFlutterViewController view]).andReturn(mockView); + + + [self.api mask:screenshot completion:^(UIImage *result) { + XCTAssertNotNil(result, @"Masked image should be returned."); + [expectation fulfill]; + }]; + + [self waitForExpectationsWithTimeout:1 handler:nil]; +} + + +- (void)testGetFlutterViewOrigin_ValidView { + UIView *mockView = [[UIView alloc] initWithFrame:CGRectMake(10, 20, 100, 100)]; + + OCMStub([self.mockFlutterViewController view]).andReturn(mockView); + + UIWindow* testWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + [testWindow addSubview:mockView]; + + CGPoint origin = [self.api getFlutterViewOrigin]; + + XCTAssertEqual(origin.x, 10); + XCTAssertEqual(origin.y, 20); +} + +- (void)testGetFlutterViewOrigin_NilView { + + OCMStub([self.mockFlutterViewController view]).andReturn(nil); +// + CGPoint origin = [self.api getFlutterViewOrigin]; + + XCTAssertEqual(origin.x, 0); + XCTAssertEqual(origin.y, 0); +} + +- (void)testDrawMaskedImage { + CGSize size = CGSizeMake(100, 100); + UIGraphicsBeginImageContext(size); + UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + + NSArray *privateViews = @[ + [NSValue valueWithCGRect:CGRectMake(10, 10, 20, 20)], + [NSValue valueWithCGRect:CGRectMake(30, 30, 10, 10)] + ]; + + UIImage *result = [self.api drawMaskedImage:screenshot withPrivateViews:privateViews]; + + XCTAssertNotNil(result); + XCTAssertEqual(result.size.width, 100); + XCTAssertEqual(result.size.height, 100); +} + +- (void)testConvertToRectangles_ValidInput { + NSArray *rectangles = @[@10, @20, @30, @40]; + UIView *mockView = [[UIView alloc] initWithFrame:CGRectMake(5, 5, 100, 100)]; + OCMStub([self.mockFlutterViewController view]).andReturn(mockView); + + + NSArray *converted = [self.api convertToRectangles:rectangles]; + + XCTAssertEqual(converted.count, 1); + CGRect rect = [converted[0] CGRectValue]; + XCTAssertTrue(CGRectEqualToRect(rect, CGRectMake(10, 20, 21, 21))); +} + +- (void)testConcurrentMaskCalls { + XCTestExpectation *expectation = [self expectationWithDescription:@"Handle concurrent calls"]; + + CGSize imageSize = CGSizeMake(100, 100); // 100x100 pixels + + // Step 2: Create the image using UIGraphicsImageRenderer + UIGraphicsImageRenderer *renderer = [[UIGraphicsImageRenderer alloc] initWithSize:imageSize]; + + UIImage *screenshot = [renderer imageWithActions:^(UIGraphicsImageRendererContext * _Nonnull rendererContext) { + // Draw a red rectangle as an example + [[UIColor redColor] setFill]; + CGRect rect = CGRectMake(0, 0, imageSize.width, imageSize.height); + UIRectFill(rect); + }]; + + NSArray *rectangles = @[@10, @20, @30, @40]; + + + OCMStub([self.mockFlutterApi getPrivateViewsWithCompletion:([OCMArg invokeBlockWithArgs:rectangles, [NSNull null], nil])]); + + + dispatch_group_t group = dispatch_group_create(); + + for (int i = 0; i < 5; i++) { + dispatch_group_enter(group); + + [self.api mask:screenshot completion:^(UIImage *result) { + XCTAssertNotNil(result, @"Each call should return a valid image."); + dispatch_group_leave(group); + }]; + } + + dispatch_group_notify(group, dispatch_get_main_queue(), ^{ + [expectation fulfill]; + }); + + [self waitForExpectationsWithTimeout:2 handler:nil]; +} + +@end diff --git a/packages/instabug_flutter/example/ios/InstabugTests/PrivateViewHostApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/PrivateViewHostApiTests.m new file mode 100644 index 000000000..27b2599ec --- /dev/null +++ b/packages/instabug_flutter/example/ios/InstabugTests/PrivateViewHostApiTests.m @@ -0,0 +1,57 @@ +#import +#import +#import +#import "PrivateViewApi.h" +#import "InstabugApi.h" +#import "PrivateViewHostApi.h" + +@interface PrivateViewHostApiTests : XCTestCase + +@property (nonatomic, strong) PrivateViewHostApi *api; +@property (nonatomic, strong) id privateViewApiMock; + +@end + +@implementation PrivateViewHostApiTests + +- (void)setUp { + [super setUp]; + + // Set up a mock for PrivateViewApi + self.privateViewApiMock = OCMClassMock([PrivateViewApi class]); + + // Initialize the PrivateViewHostApi instance + self.api = [[PrivateViewHostApi alloc] init]; + self.api.privateViewApi = self.privateViewApiMock; +} + +- (void)tearDown { + self.api = nil; + self.privateViewApiMock = nil; + [super tearDown]; +} + +- (void)testInitWithError_setsScreenshotMaskingHandler { + // Define an expectation for the screenshot masking handler + UIImage *mockScreenshot = [[UIImage alloc] init]; + UIImage *mockMaskedImage = [[UIImage alloc] init]; + FlutterError *error = nil; + + + + OCMStub([self.privateViewApiMock mask:mockScreenshot completion:([OCMArg invokeBlockWithArgs:mockMaskedImage, nil])]); + + + // Call initWithError and set up the screenshot masking handler + [self.api initWithError:&error]; + + // Invoke the screenshot masking handler + void (^completionHandler)(UIImage * _Nullable) = ^(UIImage * _Nullable maskedImage) { + XCTAssertEqual(maskedImage, mockMaskedImage, @"The masked image should be returned by the completion handler."); + }; + [InstabugApi setScreenshotMaskingHandler:^(UIImage * _Nonnull screenshot, void (^ _Nonnull completion)(UIImage * _Nullable)) { + completionHandler(screenshot); + }]; +} + +@end diff --git a/example/ios/InstabugTests/RepliesApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/RepliesApiTests.m similarity index 100% rename from example/ios/InstabugTests/RepliesApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/RepliesApiTests.m diff --git a/example/ios/InstabugTests/SessionReplayApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/SessionReplayApiTests.m similarity index 100% rename from example/ios/InstabugTests/SessionReplayApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/SessionReplayApiTests.m diff --git a/example/ios/InstabugTests/SurveysApiTests.m b/packages/instabug_flutter/example/ios/InstabugTests/SurveysApiTests.m similarity index 100% rename from example/ios/InstabugTests/SurveysApiTests.m rename to packages/instabug_flutter/example/ios/InstabugTests/SurveysApiTests.m diff --git a/example/ios/InstabugTests/Util/Apm+Test.h b/packages/instabug_flutter/example/ios/InstabugTests/Util/Apm+Test.h similarity index 100% rename from example/ios/InstabugTests/Util/Apm+Test.h rename to packages/instabug_flutter/example/ios/InstabugTests/Util/Apm+Test.h diff --git a/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h b/packages/instabug_flutter/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h similarity index 100% rename from example/ios/InstabugTests/Util/IBGCrashReporting+CP.h rename to packages/instabug_flutter/example/ios/InstabugTests/Util/IBGCrashReporting+CP.h diff --git a/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h b/packages/instabug_flutter/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h similarity index 100% rename from example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h rename to packages/instabug_flutter/example/ios/InstabugTests/Util/IBGNetworkLogger+Test.h diff --git a/example/ios/InstabugTests/Util/IBGSurvey+Test.h b/packages/instabug_flutter/example/ios/InstabugTests/Util/IBGSurvey+Test.h similarity index 100% rename from example/ios/InstabugTests/Util/IBGSurvey+Test.h rename to packages/instabug_flutter/example/ios/InstabugTests/Util/IBGSurvey+Test.h diff --git a/example/ios/InstabugTests/Util/Instabug+Test.h b/packages/instabug_flutter/example/ios/InstabugTests/Util/Instabug+Test.h similarity index 100% rename from example/ios/InstabugTests/Util/Instabug+Test.h rename to packages/instabug_flutter/example/ios/InstabugTests/Util/Instabug+Test.h diff --git a/example/ios/Podfile b/packages/instabug_flutter/example/ios/Podfile similarity index 100% rename from example/ios/Podfile rename to packages/instabug_flutter/example/ios/Podfile diff --git a/packages/instabug_flutter/example/ios/Podfile.lock b/packages/instabug_flutter/example/ios/Podfile.lock new file mode 100644 index 000000000..fa6ff6432 --- /dev/null +++ b/packages/instabug_flutter/example/ios/Podfile.lock @@ -0,0 +1,40 @@ +PODS: + - Flutter (1.0.0) + - Instabug (16.0.2) + - instabug_flutter (16.0.0): + - Flutter + - Instabug (= 16.0.2) + - OCMock (3.6) + - video_player_avfoundation (0.0.1): + - Flutter + - FlutterMacOS + +DEPENDENCIES: + - Flutter (from `Flutter`) + - instabug_flutter (from `.symlinks/plugins/instabug_flutter/ios`) + - OCMock (= 3.6) + - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`) + +SPEC REPOS: + trunk: + - Instabug + - OCMock + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + instabug_flutter: + :path: ".symlinks/plugins/instabug_flutter/ios" + video_player_avfoundation: + :path: ".symlinks/plugins/video_player_avfoundation/darwin" + +SPEC CHECKSUMS: + Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 + Instabug: 125f729dea4e4a43e815ae06f9db0332e2a5fd60 + instabug_flutter: 156a51054e7e5dc9378fac1a8f6867b26968bfee + OCMock: 5ea90566be239f179ba766fd9fbae5885040b992 + video_player_avfoundation: 2cef49524dd1f16c5300b9cd6efd9611ce03639b + +PODFILE CHECKSUM: 986d650b5bc8e230d8a9612663af4b3b1a9d6236 + +COCOAPODS: 1.16.2 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.pbxproj similarity index 100% rename from example/ios/Runner.xcodeproj/project.pbxproj rename to packages/instabug_flutter/example/ios/Runner.xcodeproj/project.pbxproj diff --git a/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/instabug_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme similarity index 100% rename from example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme rename to packages/instabug_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme diff --git a/packages/instabug_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/instabug_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/instabug_flutter/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_flutter/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/instabug_flutter/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_flutter/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/example/ios/Runner/AppDelegate.swift b/packages/instabug_flutter/example/ios/Runner/AppDelegate.swift similarity index 100% rename from example/ios/Runner/AppDelegate.swift rename to packages/instabug_flutter/example/ios/Runner/AppDelegate.swift diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..dc9ada472 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..28c6bf030 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..f091b6b0b Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cde12118 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..d0ef06e7e Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..dcdc2306c Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..c8f9ed8f5 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..75b2d164a Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..c4df70d39 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..6a84f41e1 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..d0e1f5853 Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/instabug_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/instabug_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_flutter/example/ios/Runner/Base.lproj/Main.storyboard b/packages/instabug_flutter/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/instabug_flutter/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/ios/Runner/Info.plist b/packages/instabug_flutter/example/ios/Runner/Info.plist similarity index 100% rename from example/ios/Runner/Info.plist rename to packages/instabug_flutter/example/ios/Runner/Info.plist diff --git a/example/ios/Runner/InstabugExampleMethodCallHandler.h b/packages/instabug_flutter/example/ios/Runner/InstabugExampleMethodCallHandler.h similarity index 100% rename from example/ios/Runner/InstabugExampleMethodCallHandler.h rename to packages/instabug_flutter/example/ios/Runner/InstabugExampleMethodCallHandler.h diff --git a/example/ios/Runner/InstabugExampleMethodCallHandler.m b/packages/instabug_flutter/example/ios/Runner/InstabugExampleMethodCallHandler.m similarity index 100% rename from example/ios/Runner/InstabugExampleMethodCallHandler.m rename to packages/instabug_flutter/example/ios/Runner/InstabugExampleMethodCallHandler.m diff --git a/example/ios/Runner/Runner-Bridging-Header.h b/packages/instabug_flutter/example/ios/Runner/Runner-Bridging-Header.h similarity index 100% rename from example/ios/Runner/Runner-Bridging-Header.h rename to packages/instabug_flutter/example/ios/Runner/Runner-Bridging-Header.h diff --git a/example/lib/main.dart b/packages/instabug_flutter/example/lib/main.dart similarity index 85% rename from example/lib/main.dart rename to packages/instabug_flutter/example/lib/main.dart index bccdbfc68..fa81b0b9f 100644 --- a/example/lib/main.dart +++ b/packages/instabug_flutter/example/lib/main.dart @@ -6,6 +6,8 @@ import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:instabug_flutter/instabug_flutter.dart'; import 'package:instabug_flutter_example/src/components/apm_switch.dart'; +import 'package:instabug_flutter_example/src/components/apm_switch.dart'; +import 'package:instabug_flutter_example/src/screens/private_view_page.dart'; import 'package:instabug_http_client/instabug_http_client.dart'; import 'package:instabug_flutter_example/src/app_routes.dart'; import 'package:instabug_flutter_example/src/widget/nested_view.dart'; @@ -19,6 +21,7 @@ import 'package:instabug_flutter/src/utils/screen_loading/screen_loading_manager import 'src/widget/section_title.dart'; part 'src/screens/crashes_page.dart'; +part 'src/screens/user_steps_page.dart'; part 'src/screens/complex_page.dart'; @@ -55,7 +58,13 @@ void main() { Zone.current.handleUncaughtError(details.exception, details.stack!); }; - runApp(const MyApp()); + runApp( + const InstabugWidget(automasking: [ + AutoMasking.labels, + AutoMasking.textInputs, + AutoMasking.media + ], child: MyApp()), + ); }, CrashReporting.reportCrash, ); diff --git a/example/lib/src/app_routes.dart b/packages/instabug_flutter/example/lib/src/app_routes.dart similarity index 100% rename from example/lib/src/app_routes.dart rename to packages/instabug_flutter/example/lib/src/app_routes.dart diff --git a/example/lib/src/components/apm_switch.dart b/packages/instabug_flutter/example/lib/src/components/apm_switch.dart similarity index 100% rename from example/lib/src/components/apm_switch.dart rename to packages/instabug_flutter/example/lib/src/components/apm_switch.dart diff --git a/example/lib/src/components/fatal_crashes_content.dart b/packages/instabug_flutter/example/lib/src/components/fatal_crashes_content.dart similarity index 100% rename from example/lib/src/components/fatal_crashes_content.dart rename to packages/instabug_flutter/example/lib/src/components/fatal_crashes_content.dart diff --git a/example/lib/src/components/flows_content.dart b/packages/instabug_flutter/example/lib/src/components/flows_content.dart similarity index 100% rename from example/lib/src/components/flows_content.dart rename to packages/instabug_flutter/example/lib/src/components/flows_content.dart diff --git a/example/lib/src/components/network_content.dart b/packages/instabug_flutter/example/lib/src/components/network_content.dart similarity index 89% rename from example/lib/src/components/network_content.dart rename to packages/instabug_flutter/example/lib/src/components/network_content.dart index 23eaa4dd2..d531e17bd 100644 --- a/example/lib/src/components/network_content.dart +++ b/packages/instabug_flutter/example/lib/src/components/network_content.dart @@ -18,15 +18,17 @@ class _NetworkContentState extends State { Widget build(BuildContext context) { return Column( children: [ - InstabugClipboardInput( - label: 'Endpoint Url', - controller: endpointUrlController, + InstabugPrivateView( + child: InstabugClipboardInput( + label: 'Endpoint Url', + controller: endpointUrlController, + ), ), InstabugButton( text: 'Send Request To Url', onPressed: () => _sendRequestToUrl(endpointUrlController.text), ), - const Text("W3C Header Section"), + Text("W3C Header Section"), InstabugButton( text: 'Send Request With Custom traceparent header', onPressed: () => _sendRequestToUrl(endpointUrlController.text, diff --git a/example/lib/src/components/non_fatal_crashes_content.dart b/packages/instabug_flutter/example/lib/src/components/non_fatal_crashes_content.dart similarity index 100% rename from example/lib/src/components/non_fatal_crashes_content.dart rename to packages/instabug_flutter/example/lib/src/components/non_fatal_crashes_content.dart diff --git a/example/lib/src/components/page.dart b/packages/instabug_flutter/example/lib/src/components/page.dart similarity index 100% rename from example/lib/src/components/page.dart rename to packages/instabug_flutter/example/lib/src/components/page.dart diff --git a/example/lib/src/native/instabug_flutter_example_method_channel.dart b/packages/instabug_flutter/example/lib/src/native/instabug_flutter_example_method_channel.dart similarity index 100% rename from example/lib/src/native/instabug_flutter_example_method_channel.dart rename to packages/instabug_flutter/example/lib/src/native/instabug_flutter_example_method_channel.dart diff --git a/example/lib/src/screens/apm_page.dart b/packages/instabug_flutter/example/lib/src/screens/apm_page.dart similarity index 100% rename from example/lib/src/screens/apm_page.dart rename to packages/instabug_flutter/example/lib/src/screens/apm_page.dart diff --git a/example/lib/src/screens/complex_page.dart b/packages/instabug_flutter/example/lib/src/screens/complex_page.dart similarity index 100% rename from example/lib/src/screens/complex_page.dart rename to packages/instabug_flutter/example/lib/src/screens/complex_page.dart diff --git a/example/lib/src/screens/crashes_page.dart b/packages/instabug_flutter/example/lib/src/screens/crashes_page.dart similarity index 100% rename from example/lib/src/screens/crashes_page.dart rename to packages/instabug_flutter/example/lib/src/screens/crashes_page.dart diff --git a/example/lib/src/screens/my_home_page.dart b/packages/instabug_flutter/example/lib/src/screens/my_home_page.dart similarity index 91% rename from example/lib/src/screens/my_home_page.dart rename to packages/instabug_flutter/example/lib/src/screens/my_home_page.dart index 5f7d50a88..f0fc1d14b 100644 --- a/example/lib/src/screens/my_home_page.dart +++ b/packages/instabug_flutter/example/lib/src/screens/my_home_page.dart @@ -35,6 +35,10 @@ class _MyHomePageState extends State { BugReporting.setInvocationEvents([InvocationEvent.floatingButton]); } + void disableInstabug() { + Instabug.setEnabled(false); + } + void setOnDismissCallback() { BugReporting.setOnDismissCallback((dismissType, reportType) { showDialog( @@ -161,6 +165,26 @@ class _MyHomePageState extends State { ); } + void _navigateToPrivateViewPage() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const PrivateViewPage(), + settings: const RouteSettings(name: PrivateViewPage.screenName), + ), + ); + } + + void _navigateToUserStepsPage() { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => const UserStepsPage(), + settings: const RouteSettings(name: UserStepsPage.screenName), + ), + ); + } + @override Widget build(BuildContext context) { return Page( @@ -178,6 +202,10 @@ class _MyHomePageState extends State { onPressed: restartInstabug, text: 'Restart Instabug', ), + InstabugButton( + onPressed: disableInstabug, + text: 'Disable Instabug', + ), const SectionTitle('Primary Color'), InstabugTextField( controller: primaryColorController, @@ -290,9 +318,11 @@ class _MyHomePageState extends State { onPressed: showManualSurvey, text: 'Show Multiple Questions Survey', ), - InstabugButton( - onPressed: showFeatureRequests, - text: 'Show Feature Requests', + InstabugPrivateView( + child: InstabugButton( + onPressed: showFeatureRequests, + text: 'Show Feature Requests', + ), ), InstabugButton( onPressed: _navigateToCrashes, @@ -306,6 +336,10 @@ class _MyHomePageState extends State { onPressed: _navigateToComplex, text: 'Complex', ), + InstabugButton( + onPressed: _navigateToPrivateViewPage, + text: 'Private views', + ), const SectionTitle('Sessions Replay'), InstabugButton( onPressed: getCurrentSessionReplaylink, @@ -334,6 +368,10 @@ class _MyHomePageState extends State { ), ], ), + InstabugButton( + text: 'User Steps', + onPressed: _navigateToUserStepsPage, + ), SectionTitle('FeatureFlags'), InstabugTextField( controller: featureFlagsController, diff --git a/packages/instabug_flutter/example/lib/src/screens/private_view_page.dart b/packages/instabug_flutter/example/lib/src/screens/private_view_page.dart new file mode 100644 index 000000000..5b7829e65 --- /dev/null +++ b/packages/instabug_flutter/example/lib/src/screens/private_view_page.dart @@ -0,0 +1,258 @@ +import 'package:flutter/material.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter_example/src/widget/section_title.dart'; +import 'package:video_player/video_player.dart'; + +class PrivateViewPage extends StatefulWidget { + static const screenName = 'private'; + + const PrivateViewPage({Key? key}) : super(key: key); + + @override + _PrivateViewPageState createState() => _PrivateViewPageState(); +} + +class _PrivateViewPageState extends State { + late VideoPlayerController _controller; + double _currentSliderValue = 20.0; + + RangeValues _currentRangeValues = const RangeValues(40, 80); + + String? _sliderStatus; + + bool? isChecked = true; + + int? _selectedValue = 1; + + bool light = true; + double _scale = 1.0; // Initial scale of the image + + TextEditingController _controller2 = TextEditingController(); + + String _currentValue = ''; + List _items = List.generate(20, (index) => 'Item ${index + 1}'); + + @override + void initState() { + super.initState(); + _controller = VideoPlayerController.networkUrl( + Uri.parse( + 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4'), + )..initialize().then((_) { + setState(() {}); + }); + _controller2.addListener(() { + setState(() { + _currentValue = _controller2.text; + }); + }); + } + + @override + void dispose() { + _controller.dispose(); + super.dispose(); + } + + void _handleRadioValueChanged(int? value) { + setState(() { + _selectedValue = value; + }); + } + + int count = 200; + final list = List.generate( + 20, + (_) => InstabugPrivateView( + child: Container( + margin: const EdgeInsets.all(2), + width: 4, + height: 4, + color: Colors.red, + ), + )); + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text("Private Views page")), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const SizedBox(height: 16), + const InstabugPrivateView( + child: Text( + 'Private TextView', + style: TextStyle(fontSize: 18), + textAlign: TextAlign.center, + ), + ), + const SizedBox(height: 16), + Wrap( + children: list, + ), + const SizedBox(height: 16), + InstabugPrivateView( + child: ElevatedButton( + onPressed: () { + const snackBar = SnackBar( + content: Text('Hello, you clicked on a private button'), + ); + ScaffoldMessenger.of(context).showSnackBar(snackBar); + }, + child: const Text('I am a private button'), + ), + ), + const SizedBox(height: 16), + const BackButton(), + const SectionTitle('TextInput'), + Column( + children: [ + Padding( + padding: const EdgeInsets.all(16.0), + // Set the padding value + child: Column( + children: [ + TextField( + key: const Key('text_field'), + controller: _controller2, + // Bind the controller to the TextField + decoration: const InputDecoration( + labelText: + "Type something in a text field with key", + border: OutlineInputBorder(), + ), + ), + InstabugPrivateView( + child: TextField( + controller: _controller2, + // Bind the controller to the TextField + decoration: const InputDecoration( + labelText: "Private view", + border: OutlineInputBorder(), + ), + ), + ), + InstabugPrivateView( + child: TextField( + controller: _controller2, + // Bind the controller to the TextField + obscureText: true, + decoration: const InputDecoration( + border: OutlineInputBorder(), + labelText: 'Password', + ), + ), + ), + TextFormField( + obscureText: true, + controller: _controller2, + // Bind the controller to the TextField + decoration: const InputDecoration( + icon: Icon(Icons.person), + hintText: 'What do people call you?', + labelText: 'Name *', + ), + onSaved: (String? value) { + // This optional block of code can be used to run + // code when the user saves the form. + }, + validator: (String? value) { + return (value != null && value.contains('@')) + ? 'Do not use the @ char.' + : null; + }, + ), + ], + ), + ), + ], + ), + InstabugPrivateView( + child: Image.asset( + 'assets/img.png', + // Add this image to your assets folder + height: 100, + ), + ), + const SizedBox(height: 33), + const InstabugPrivateView( + child: TextField( + obscureText: true, + decoration: InputDecoration( + hintText: 'password', + labelText: 'Password', + border: OutlineInputBorder(), + ), + ), + ), + const SizedBox(height: 16), + const TextField( + keyboardType: TextInputType.emailAddress, + decoration: InputDecoration( + hintText: 'Email', + labelText: 'Email', + border: OutlineInputBorder(), + ), + ), + const SizedBox(height: 16), + const Column( + children: [ + InstabugPrivateView( + child: Text( + 'Private TextView in column', + style: TextStyle(fontSize: 18), + textAlign: TextAlign.center, + ), + ), + SizedBox( + height: 10, + ), + Text( + 'TextView in column', + style: TextStyle(fontSize: 18), + textAlign: TextAlign.center, + ), + ], + ), + const SizedBox(height: 24), + Container( + height: 300, + child: _controller.value.isInitialized + ? AspectRatio( + aspectRatio: _controller.value.aspectRatio, + child: VideoPlayer(_controller), + ) + : const Center(child: CircularProgressIndicator()), + ), + const SizedBox(height: 24), + const SizedBox(height: 24), + const SizedBox(height: 24), + SizedBox( + height: 200, + child: CustomScrollView( + slivers: [ + InstabugSliverPrivateView( + sliver: SliverToBoxAdapter( + child: Container( + color: Colors.red, + child: const Text( + "Private Sliver Widget", + style: TextStyle(fontSize: 18), + textAlign: TextAlign.center, + ), + ), + ), + ) + ], + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/example/lib/src/screens/screen_capture_premature_extension_page.dart b/packages/instabug_flutter/example/lib/src/screens/screen_capture_premature_extension_page.dart similarity index 100% rename from example/lib/src/screens/screen_capture_premature_extension_page.dart rename to packages/instabug_flutter/example/lib/src/screens/screen_capture_premature_extension_page.dart diff --git a/example/lib/src/screens/screen_loading_page.dart b/packages/instabug_flutter/example/lib/src/screens/screen_loading_page.dart similarity index 100% rename from example/lib/src/screens/screen_loading_page.dart rename to packages/instabug_flutter/example/lib/src/screens/screen_loading_page.dart diff --git a/packages/instabug_flutter/example/lib/src/screens/user_steps_page.dart b/packages/instabug_flutter/example/lib/src/screens/user_steps_page.dart new file mode 100644 index 000000000..f97cfacc2 --- /dev/null +++ b/packages/instabug_flutter/example/lib/src/screens/user_steps_page.dart @@ -0,0 +1,262 @@ +part of '../../main.dart'; + +class UserStepsPage extends StatefulWidget { + static const screenName = 'user_steps'; + + const UserStepsPage({Key? key}) : super(key: key); + + @override + _UserStepsPageState createState() => _UserStepsPageState(); +} + +class _UserStepsPageState extends State { + double _currentSliderValue = 20.0; + + RangeValues _currentRangeValues = const RangeValues(40, 80); + + String? _sliderStatus; + + bool? isChecked = true; + + int? _selectedValue = 1; + + bool light = true; + double _scale = 1.0; // Initial scale of the image + + TextEditingController _controller = TextEditingController(); + + String _currentValue = ''; + List _items = List.generate(20, (index) => 'Item ${index + 1}'); + + @override + void initState() { + super.initState(); + + _controller.addListener(() { + setState(() { + _currentValue = _controller.text; + }); + }); + } + + void _handleRadioValueChanged(int? value) { + setState(() { + _selectedValue = value; + }); + } + + @override + Widget build(BuildContext context) { + return Page( + title: 'User Steps', + children: [ + BackButton(), + NotificationListener( + onNotification: (ScrollNotification notification) { + return false; + }, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: List.generate( + 100, + (_) => InkWell( + onTap: () {}, + child: Container( + width: 100, + height: 100, + color: Colors.red, + margin: EdgeInsets.all(8), + ), + ), + ), + ), + ), + ), + SectionTitle('Sliders'), + Slider( + value: _currentSliderValue, + max: 100, + divisions: 5, + label: _currentSliderValue.round().toString(), + onChanged: (double value) { + setState(() { + _currentSliderValue = value; + }); + }, + ), + RangeSlider( + values: _currentRangeValues, + max: 100, + divisions: 5, + labels: RangeLabels( + _currentRangeValues.start.round().toString(), + _currentRangeValues.end.round().toString(), + ), + onChanged: (RangeValues values) { + setState(() { + _currentRangeValues = values; + }); + }, + ), + SectionTitle('Images'), + Row( + children: [ + Image.asset( + 'assets/img.png', + height: 100, + ), + Image.network( + "https://t3.ftcdn.net/jpg/00/50/07/64/360_F_50076454_TCvZEw37VyB5ZhcwEjkJHddtuV1cFmKY.jpg", + height: 100, + ), + ], + ), + InstabugButton(text: "I'm a button"), + ElevatedButton(onPressed: () {}, child: Text("data")), + SectionTitle('Toggles'), + Row( + children: [ + Checkbox( + tristate: true, + value: isChecked, + onChanged: (bool? value) { + setState(() { + isChecked = value; + }); + }, + ), + Radio( + value: 0, + groupValue: _selectedValue, + onChanged: _handleRadioValueChanged, + ), + Switch( + value: light, + activeColor: Colors.red, + onChanged: (bool value) { + setState(() { + light = value; + }); + }, + ), + ], + ), + GestureDetector( + onScaleUpdate: (details) { + setState(() { + _scale = details.scale; + _scale = _scale.clamp(1.0, + 3.0); // Limit zoom between 1x and 3x// Update scale based on pinch gesture + }); + }, + onScaleEnd: (details) { + // You can add logic to reset or clamp the scale if needed + if (_scale < 1.0) { + _scale = 1.0; // Prevent shrinking below original size + } + }, + child: Transform.scale( + scale: _scale, // Apply the scale transformation + child: Image.asset( + "assets/img.png", + height: 300, + ), + ), + ), + SectionTitle('TextInput'), + Column( + children: [ + Padding( + padding: EdgeInsets.all(16.0), // Set the padding value + child: Column( + children: [ + TextField( + key: Key('text_field'), + controller: _controller, + // Bind the controller to the TextField + decoration: InputDecoration( + labelText: "Type something in a text field with key", + border: OutlineInputBorder(), + ), + ), + TextField( + controller: _controller, + // Bind the controller to the TextField + decoration: InputDecoration( + labelText: "Private view", + border: OutlineInputBorder(), + ), + ), + TextField( + controller: _controller, + // Bind the controller to the TextField + obscureText: true, + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: 'Password', + ), + ), + TextFormField( + obscureText: true, + controller: _controller, + // Bind the controller to the TextField + decoration: const InputDecoration( + icon: Icon(Icons.person), + hintText: 'What do people call you?', + labelText: 'Name *', + ), + onSaved: (String? value) { + // This optional block of code can be used to run + // code when the user saves the form. + }, + validator: (String? value) { + return (value != null && value.contains('@')) + ? 'Do not use the @ char.' + : null; + }, + ), + ], + ), + ), + ListView.builder( + itemCount: _items.length, + shrinkWrap: true, + itemBuilder: (context, index) { + return Dismissible( + key: Key(_items[index]), + // Unique key for each item + onDismissed: (direction) { + // Remove the item from the list + setState(() { + _items.removeAt(index); + }); + + // Show a snackbar or other UI feedback on dismissal + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text('Item dismissed')), + ); + }, + background: Container(color: Colors.red), + // Background color when swiped + direction: DismissDirection.endToStart, + // Swipe direction (left to right) + child: ListTile( + title: Text(_items[index]), + ), + ); + }, + ), + ], + ), + ], + ); + } + + @override + void dispose() { + _controller + .dispose(); // Dispose of the controller when the widget is destroyed + super.dispose(); + } +} diff --git a/example/lib/src/utils/show_messages.dart b/packages/instabug_flutter/example/lib/src/utils/show_messages.dart similarity index 100% rename from example/lib/src/utils/show_messages.dart rename to packages/instabug_flutter/example/lib/src/utils/show_messages.dart diff --git a/example/lib/src/widget/instabug_button.dart b/packages/instabug_flutter/example/lib/src/widget/instabug_button.dart similarity index 100% rename from example/lib/src/widget/instabug_button.dart rename to packages/instabug_flutter/example/lib/src/widget/instabug_button.dart diff --git a/example/lib/src/widget/instabug_clipboard_icon_button.dart b/packages/instabug_flutter/example/lib/src/widget/instabug_clipboard_icon_button.dart similarity index 100% rename from example/lib/src/widget/instabug_clipboard_icon_button.dart rename to packages/instabug_flutter/example/lib/src/widget/instabug_clipboard_icon_button.dart diff --git a/example/lib/src/widget/instabug_clipboard_input.dart b/packages/instabug_flutter/example/lib/src/widget/instabug_clipboard_input.dart similarity index 100% rename from example/lib/src/widget/instabug_clipboard_input.dart rename to packages/instabug_flutter/example/lib/src/widget/instabug_clipboard_input.dart diff --git a/example/lib/src/widget/instabug_text_field.dart b/packages/instabug_flutter/example/lib/src/widget/instabug_text_field.dart similarity index 100% rename from example/lib/src/widget/instabug_text_field.dart rename to packages/instabug_flutter/example/lib/src/widget/instabug_text_field.dart diff --git a/example/lib/src/widget/nested_view.dart b/packages/instabug_flutter/example/lib/src/widget/nested_view.dart similarity index 77% rename from example/lib/src/widget/nested_view.dart rename to packages/instabug_flutter/example/lib/src/widget/nested_view.dart index e61099f8c..8ef9e46ad 100644 --- a/example/lib/src/widget/nested_view.dart +++ b/packages/instabug_flutter/example/lib/src/widget/nested_view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; import 'package:instabug_flutter_example/main.dart'; class NestedView extends StatelessWidget { @@ -31,10 +32,12 @@ class NestedView extends StatelessWidget { Row( children: List.generate( breadth, - (index) => NestedView( - depth: depth - 1, - breadth: breadth, - child: child, + (index) => InstabugPrivateView( + child: NestedView( + depth: depth - 1, + breadth: breadth, + child: child, + ), ), ), ), diff --git a/example/lib/src/widget/section_title.dart b/packages/instabug_flutter/example/lib/src/widget/section_title.dart similarity index 100% rename from example/lib/src/widget/section_title.dart rename to packages/instabug_flutter/example/lib/src/widget/section_title.dart diff --git a/packages/instabug_flutter/example/pubspec.lock b/packages/instabug_flutter/example/pubspec.lock new file mode 100644 index 000000000..b520eba0d --- /dev/null +++ b/packages/instabug_flutter/example/pubspec.lock @@ -0,0 +1,370 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_driver: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + url: "https://pub.dev" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + fuchsia_remote_debug_protocol: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + html: + dependency: transitive + description: + name: html + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" + url: "https://pub.dev" + source: hosted + version: "0.15.6" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + instabug_flutter: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "16.0.0" + instabug_http_client: + dependency: "direct main" + description: + path: "../../instabug_http_client" + relative: true + source: path + version: "2.6.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + platform: + dependency: transitive + description: + name: platform + sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + url: "https://pub.dev" + source: hosted + version: "3.1.5" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" + url: "https://pub.dev" + source: hosted + version: "2.1.8" + process: + dependency: transitive + description: + name: process + sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" + url: "https://pub.dev" + source: hosted + version: "5.0.2" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + sync_http: + dependency: transitive + description: + name: sync_http + sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + video_player: + dependency: "direct main" + description: + name: video_player + sha256: "0d55b1f1a31e5ad4c4967bfaa8ade0240b07d20ee4af1dfef5f531056512961a" + url: "https://pub.dev" + source: hosted + version: "2.10.0" + video_player_android: + dependency: transitive + description: + name: video_player_android + sha256: "28dcc4122079f40f93a0965b3679aff1a5f4251cf79611bd8011f937eb6b69de" + url: "https://pub.dev" + source: hosted + version: "2.8.4" + video_player_avfoundation: + dependency: transitive + description: + name: video_player_avfoundation + sha256: f52261d11f97bf14c43e8ed5714f71d8ce4538552b8cc87f45e5d87d3c205e41 + url: "https://pub.dev" + source: hosted + version: "2.8.3" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + sha256: cf2a1d29a284db648fd66cbd18aacc157f9862d77d2cc790f6f9678a46c1db5a + url: "https://pub.dev" + source: hosted + version: "6.4.0" + video_player_web: + dependency: transitive + description: + name: video_player_web + sha256: "9f3c00be2ef9b76a95d94ac5119fb843dca6f2c69e6c9968f6f2b6c9e7afbdeb" + url: "https://pub.dev" + source: hosted + version: "2.4.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + webdriver: + dependency: transitive + description: + name: webdriver + sha256: "3d773670966f02a646319410766d3b5e1037efb7f07cc68f844d5e06cd4d61c8" + url: "https://pub.dev" + source: hosted + version: "3.0.4" +sdks: + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.27.0" diff --git a/example/pubspec.yaml b/packages/instabug_flutter/example/pubspec.yaml similarity index 99% rename from example/pubspec.yaml rename to packages/instabug_flutter/example/pubspec.yaml index dfd49f2aa..2f766b535 100644 --- a/example/pubspec.yaml +++ b/packages/instabug_flutter/example/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: instabug_flutter: path: ../ instabug_http_client: ^2.4.0 - + video_player: dev_dependencies: flutter_driver: sdk: flutter diff --git a/packages/instabug_flutter/example/pubspec_overrides.yaml b/packages/instabug_flutter/example/pubspec_overrides.yaml new file mode 100644 index 000000000..c41d20248 --- /dev/null +++ b/packages/instabug_flutter/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: instabug_flutter,instabug_http_client +dependency_overrides: + instabug_flutter: + path: ../ + instabug_http_client: + path: ../../instabug_http_client diff --git a/example/test_driver/example.dart b/packages/instabug_flutter/example/test_driver/example.dart similarity index 100% rename from example/test_driver/example.dart rename to packages/instabug_flutter/example/test_driver/example.dart diff --git a/ios/.gitignore b/packages/instabug_flutter/ios/.gitignore similarity index 100% rename from ios/.gitignore rename to packages/instabug_flutter/ios/.gitignore diff --git a/ios/Assets/.gitkeep b/packages/instabug_flutter/ios/Assets/.gitkeep similarity index 100% rename from ios/Assets/.gitkeep rename to packages/instabug_flutter/ios/Assets/.gitkeep diff --git a/ios/Classes/InstabugFlutterPlugin.h b/packages/instabug_flutter/ios/Classes/InstabugFlutterPlugin.h similarity index 100% rename from ios/Classes/InstabugFlutterPlugin.h rename to packages/instabug_flutter/ios/Classes/InstabugFlutterPlugin.h diff --git a/ios/Classes/InstabugFlutterPlugin.m b/packages/instabug_flutter/ios/Classes/InstabugFlutterPlugin.m similarity index 74% rename from ios/Classes/InstabugFlutterPlugin.m rename to packages/instabug_flutter/ios/Classes/InstabugFlutterPlugin.m index 9b9182ae7..12ab5a58b 100644 --- a/ios/Classes/InstabugFlutterPlugin.m +++ b/packages/instabug_flutter/ios/Classes/InstabugFlutterPlugin.m @@ -9,6 +9,8 @@ #import "RepliesApi.h" #import "SessionReplayApi.h" #import "SurveysApi.h" +#import "PrivateViewApi.h" +#import "PrivateViewHostApi.h" @implementation InstabugFlutterPlugin @@ -22,6 +24,9 @@ + (void)registerWithRegistrar:(NSObject *)registrar { InitRepliesApi([registrar messenger]); InitSessionReplayApi([registrar messenger]); InitSurveysApi([registrar messenger]); + PrivateViewApi* privateViewApi = InitPrivateViewApi([registrar messenger],registrar); + InitPrivateViewApi([registrar messenger], registrar); + InitPrivateViewHostApi([registrar messenger], privateViewApi); } @end diff --git a/ios/Classes/Modules/ApmApi.h b/packages/instabug_flutter/ios/Classes/Modules/ApmApi.h similarity index 100% rename from ios/Classes/Modules/ApmApi.h rename to packages/instabug_flutter/ios/Classes/Modules/ApmApi.h diff --git a/ios/Classes/Modules/ApmApi.m b/packages/instabug_flutter/ios/Classes/Modules/ApmApi.m similarity index 100% rename from ios/Classes/Modules/ApmApi.m rename to packages/instabug_flutter/ios/Classes/Modules/ApmApi.m diff --git a/ios/Classes/Modules/BugReportingApi.h b/packages/instabug_flutter/ios/Classes/Modules/BugReportingApi.h similarity index 100% rename from ios/Classes/Modules/BugReportingApi.h rename to packages/instabug_flutter/ios/Classes/Modules/BugReportingApi.h diff --git a/ios/Classes/Modules/BugReportingApi.m b/packages/instabug_flutter/ios/Classes/Modules/BugReportingApi.m similarity index 100% rename from ios/Classes/Modules/BugReportingApi.m rename to packages/instabug_flutter/ios/Classes/Modules/BugReportingApi.m diff --git a/ios/Classes/Modules/CrashReportingApi.h b/packages/instabug_flutter/ios/Classes/Modules/CrashReportingApi.h similarity index 100% rename from ios/Classes/Modules/CrashReportingApi.h rename to packages/instabug_flutter/ios/Classes/Modules/CrashReportingApi.h diff --git a/ios/Classes/Modules/CrashReportingApi.m b/packages/instabug_flutter/ios/Classes/Modules/CrashReportingApi.m similarity index 100% rename from ios/Classes/Modules/CrashReportingApi.m rename to packages/instabug_flutter/ios/Classes/Modules/CrashReportingApi.m diff --git a/ios/Classes/Modules/FeatureRequestsApi.h b/packages/instabug_flutter/ios/Classes/Modules/FeatureRequestsApi.h similarity index 100% rename from ios/Classes/Modules/FeatureRequestsApi.h rename to packages/instabug_flutter/ios/Classes/Modules/FeatureRequestsApi.h diff --git a/ios/Classes/Modules/FeatureRequestsApi.m b/packages/instabug_flutter/ios/Classes/Modules/FeatureRequestsApi.m similarity index 100% rename from ios/Classes/Modules/FeatureRequestsApi.m rename to packages/instabug_flutter/ios/Classes/Modules/FeatureRequestsApi.m diff --git a/ios/Classes/Modules/InstabugApi.h b/packages/instabug_flutter/ios/Classes/Modules/InstabugApi.h similarity index 70% rename from ios/Classes/Modules/InstabugApi.h rename to packages/instabug_flutter/ios/Classes/Modules/InstabugApi.h index 7030617c9..777013ee0 100644 --- a/ios/Classes/Modules/InstabugApi.h +++ b/packages/instabug_flutter/ios/Classes/Modules/InstabugApi.h @@ -6,5 +6,6 @@ extern void InitInstabugApi(id messenger); - (UIImage *)getImageForAsset:(NSString *)assetName; - (UIFont *)getFontForAsset:(NSString *)assetName error:(FlutterError *_Nullable *_Nonnull)error; ++ (void)setScreenshotMaskingHandler:(nullable void (^)(UIImage *_Nonnull, void (^_Nonnull)(UIImage *_Nonnull)))maskingHandler; @end diff --git a/ios/Classes/Modules/InstabugApi.m b/packages/instabug_flutter/ios/Classes/Modules/InstabugApi.m similarity index 93% rename from ios/Classes/Modules/InstabugApi.m rename to packages/instabug_flutter/ios/Classes/Modules/InstabugApi.m index 84f574b58..7e5ea5ba3 100644 --- a/ios/Classes/Modules/InstabugApi.m +++ b/packages/instabug_flutter/ios/Classes/Modules/InstabugApi.m @@ -7,6 +7,7 @@ #import "ArgsRegistry.h" #import "../Util/IBGAPM+PrivateAPIs.h" +#import "../Util/Instabug+CP.h" #define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:((float)((rgbValue & 0xFF000000) >> 24)) / 255.0]; extern void InitInstabugApi(id messenger) { @@ -63,6 +64,7 @@ - (void)initToken:(nonnull NSString *)token invocationEvents:(nonnull NSArray *)autoMasking error:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { + IBGAutoMaskScreenshotOption resolvedEvents = 0; + + for (NSString *event in autoMasking) { + resolvedEvents |= (ArgsRegistry.autoMasking[event]).integerValue; + } + + [Instabug setAutoMaskScreenshots: resolvedEvents]; + +} ++ (void)setScreenshotMaskingHandler:(nullable void (^)(UIImage * _Nonnull __strong, void (^ _Nonnull __strong)(UIImage * _Nonnull __strong)))maskingHandler { + [Instabug setScreenshotMaskingHandler:maskingHandler]; +} + +- (void)setNetworkLogBodyEnabledIsEnabled:(NSNumber *)isEnabled error:(FlutterError *_Nullable *_Nonnull)error { IBGNetworkLogger.logBodyEnabled = [isEnabled boolValue]; } diff --git a/ios/Classes/Modules/InstabugLogApi.h b/packages/instabug_flutter/ios/Classes/Modules/InstabugLogApi.h similarity index 100% rename from ios/Classes/Modules/InstabugLogApi.h rename to packages/instabug_flutter/ios/Classes/Modules/InstabugLogApi.h diff --git a/ios/Classes/Modules/InstabugLogApi.m b/packages/instabug_flutter/ios/Classes/Modules/InstabugLogApi.m similarity index 100% rename from ios/Classes/Modules/InstabugLogApi.m rename to packages/instabug_flutter/ios/Classes/Modules/InstabugLogApi.m diff --git a/packages/instabug_flutter/ios/Classes/Modules/PrivateViewApi.h b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewApi.h new file mode 100644 index 000000000..80aa0bd36 --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewApi.h @@ -0,0 +1,34 @@ +#import +#import "InstabugPrivateViewPigeon.h" +#import + + +@interface PrivateViewApi : NSObject + +@property (nonatomic, strong) InstabugPrivateViewFlutterApi *flutterApi; +@property (nonatomic, strong) NSObject * flutterEngineRegistrar; + +- (instancetype)initWithFlutterApi:(InstabugPrivateViewFlutterApi *)api + registrar:(NSObject *)registrar; + +- (void)mask:(UIImage *)screenshot + completion:(void (^)(UIImage *maskedImage))completion; +- (void)handlePrivateViewsResult:(NSArray *)rectangles + error:(FlutterError *)error + screenshot:(UIImage *)screenshot + completion:(void (^)(UIImage *))completion; +- (NSArray *)convertToRectangles:(NSArray *)rectangles; + +- (UIImage *)drawMaskedImage:(UIImage *)screenshot withPrivateViews:(NSArray *)privateViews; +- (CGPoint)getFlutterViewOrigin; + +- (void)logError:(FlutterError *)error; + +@end + +// Extern function to initialize PrivateViewApi +extern PrivateViewApi* InitPrivateViewApi( + id messenger, + NSObject *flutterEngineRegistrar +); + diff --git a/packages/instabug_flutter/ios/Classes/Modules/PrivateViewApi.m b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewApi.m new file mode 100644 index 000000000..be3e988a4 --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewApi.m @@ -0,0 +1,144 @@ +#import "PrivateViewApi.h" +#import "../Util/FlutterPluginRegistrar+FlutterEngine.h" + +extern PrivateViewApi* InitPrivateViewApi( + id messenger, + NSObject *flutterEngineRegistrar +) { + InstabugPrivateViewFlutterApi *flutterApi = [[InstabugPrivateViewFlutterApi alloc] initWithBinaryMessenger:messenger]; + return [[PrivateViewApi alloc] initWithFlutterApi:flutterApi registrar:flutterEngineRegistrar]; +} + +@implementation PrivateViewApi + +// Initializer with proper memory management +- (instancetype)initWithFlutterApi:(InstabugPrivateViewFlutterApi *)api + registrar:( NSObject *) registrar { + if ((self = [super init])) { + _flutterApi = api; + _flutterEngineRegistrar = registrar; + } + return self; +} + +static long long currentTimeMillis; + + +- (void)mask:(UIImage *)screenshot + completion:(void (^)(UIImage *))completion { + + __weak typeof(self) weakSelf = self; + // Wait for the Cupertino animation to complete + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ + [self.flutterApi getPrivateViewsWithCompletion:^(NSArray *rectangles, FlutterError *error) { + UIImage *capturedScreenshot = [self captureScreenshot]; + [weakSelf handlePrivateViewsResult:rectangles + error:error + screenshot:capturedScreenshot + completion:completion]; + }]; + }); +} + +#pragma mark - Private Methods + +// Method to capture a screenshot of the app's main window +- (UIImage *)captureScreenshot { + CGSize imageSize = UIScreen.mainScreen.bounds.size; + UIGraphicsBeginImageContextWithOptions(imageSize, NO, UIScreen.mainScreen.scale); + + // Iterate over all windows, including the keyboard window + for (UIWindow *window in UIApplication.sharedApplication.windows) { + [window drawViewHierarchyInRect:window.bounds afterScreenUpdates:YES]; + } + + UIImage *screenshot = UIGraphicsGetImageFromCurrentImageContext(); + UIGraphicsEndImageContext(); + return screenshot; +} + +// Handle the result of fetching private views +- (void)handlePrivateViewsResult:(NSArray *)rectangles + error:(FlutterError *)error + screenshot:(UIImage *)screenshot + completion:(void (^)(UIImage *))completion { + if (error) { + [self logError:error]; + completion(screenshot); + return; + } + + NSArray *privateViews = [self convertToRectangles:rectangles]; + UIImage *maskedScreenshot = [self drawMaskedImage:screenshot withPrivateViews:privateViews]; + static long long currentTimeMillis2; + currentTimeMillis2 = (long long)([[NSDate date] timeIntervalSince1970] * 1000); + + long long timeDifference = currentTimeMillis2 - currentTimeMillis; + + completion(maskedScreenshot); + NSLog(@"Time Difference: %lld ms (Last: %lld, Current: %lld)", timeDifference, currentTimeMillis2, currentTimeMillis); + + +} + +// Convert the raw rectangles array into CGRect values +- (NSArray *)convertToRectangles:(NSArray *)rectangles { + + NSMutableArray *privateViews = [NSMutableArray arrayWithCapacity:rectangles.count / 4]; + CGPoint flutterOrigin = [self getFlutterViewOrigin]; + + for (NSUInteger i = 0; i < rectangles.count; i += 4) { + CGFloat left = rectangles[i].doubleValue; + CGFloat top = rectangles[i + 1].doubleValue; + CGFloat right = rectangles[i + 2].doubleValue; + CGFloat bottom = rectangles[i + 3].doubleValue; + + CGRect rect = CGRectMake(flutterOrigin.x + left, + flutterOrigin.y + top, + right - left + 1, + bottom - top + 1); + [privateViews addObject:[NSValue valueWithCGRect:rect]]; + } + return privateViews; +} + +// Draw the masked image by filling private views with black rectangles +- (UIImage *)drawMaskedImage:(UIImage *)screenshot withPrivateViews:(NSArray *)privateViews { + UIGraphicsBeginImageContextWithOptions(screenshot.size, NO, 0); + CGContextRef context = UIGraphicsGetCurrentContext(); + + @try { + [screenshot drawAtPoint:CGPointZero]; + CGContextSetFillColorWithColor(context, UIColor.blackColor.CGColor); + + for (NSValue *value in privateViews) { + CGContextFillRect(context, value.CGRectValue); + } + + return UIGraphicsGetImageFromCurrentImageContext(); + } @finally { + UIGraphicsEndImageContext(); + } +} + +// Retrieve the origin point of the Flutter view +- (CGPoint)getFlutterViewOrigin { + FlutterViewController *flutterVC = (FlutterViewController *)self.flutterEngineRegistrar.flutterEngine.viewController; + + UIView *flutterView = flutterVC.view; + if(!flutterView) + return CGPointZero; + UIWindow *window = flutterView.window; + CGRect globalFrame = [flutterView convertRect:flutterView.bounds toView:window]; + + return globalFrame.origin ; +} + + +// Log error details +- (void)logError:(FlutterError *)error { + NSLog(@"IBG-Flutter: Error getting private views: %@", error.message); +} + + +@end diff --git a/packages/instabug_flutter/ios/Classes/Modules/PrivateViewHostApi.h b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewHostApi.h new file mode 100644 index 000000000..54ced156c --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewHostApi.h @@ -0,0 +1,7 @@ +#import "PrivateViewApi.h" +#import "InstabugPrivateViewPigeon.h" +extern void InitPrivateViewHostApi(id _Nonnull messenger, PrivateViewApi * _Nonnull api); + +@interface PrivateViewHostApi : NSObject +@property (nonatomic, strong) PrivateViewApi* _Nonnull privateViewApi; +@end diff --git a/packages/instabug_flutter/ios/Classes/Modules/PrivateViewHostApi.m b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewHostApi.m new file mode 100644 index 000000000..e7dbea5cf --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Modules/PrivateViewHostApi.m @@ -0,0 +1,33 @@ +// +// PrivateViewHostApi.m +// instabug_flutter +// +// Created by Ahmed alaa on 02/11/2024. +// + +#import "PrivateViewHostApi.h" +#import "instabug_flutter/InstabugApi.h" + +extern void InitPrivateViewHostApi(id _Nonnull messenger, PrivateViewApi * _Nonnull privateViewApi) { + PrivateViewHostApi *api = [[PrivateViewHostApi alloc] init]; + api.privateViewApi = privateViewApi; + InstabugPrivateViewHostApiSetup(messenger, api); +} + +@implementation PrivateViewHostApi + + +- (void)initWithError:(FlutterError * _Nullable __autoreleasing * _Nonnull)error { + [InstabugApi setScreenshotMaskingHandler:^(UIImage * _Nonnull screenshot, void (^ _Nonnull completion)(UIImage * _Nullable)) { + + + + [self.privateViewApi mask:screenshot completion:^(UIImage * _Nonnull maskedImage) { + if (maskedImage != nil) { + completion(maskedImage); + } + }]; + }]; +} + +@end diff --git a/ios/Classes/Modules/RepliesApi.h b/packages/instabug_flutter/ios/Classes/Modules/RepliesApi.h similarity index 100% rename from ios/Classes/Modules/RepliesApi.h rename to packages/instabug_flutter/ios/Classes/Modules/RepliesApi.h diff --git a/ios/Classes/Modules/RepliesApi.m b/packages/instabug_flutter/ios/Classes/Modules/RepliesApi.m similarity index 100% rename from ios/Classes/Modules/RepliesApi.m rename to packages/instabug_flutter/ios/Classes/Modules/RepliesApi.m diff --git a/ios/Classes/Modules/SessionReplayApi.h b/packages/instabug_flutter/ios/Classes/Modules/SessionReplayApi.h similarity index 100% rename from ios/Classes/Modules/SessionReplayApi.h rename to packages/instabug_flutter/ios/Classes/Modules/SessionReplayApi.h diff --git a/ios/Classes/Modules/SessionReplayApi.m b/packages/instabug_flutter/ios/Classes/Modules/SessionReplayApi.m similarity index 100% rename from ios/Classes/Modules/SessionReplayApi.m rename to packages/instabug_flutter/ios/Classes/Modules/SessionReplayApi.m diff --git a/ios/Classes/Modules/SurveysApi.h b/packages/instabug_flutter/ios/Classes/Modules/SurveysApi.h similarity index 100% rename from ios/Classes/Modules/SurveysApi.h rename to packages/instabug_flutter/ios/Classes/Modules/SurveysApi.h diff --git a/ios/Classes/Modules/SurveysApi.m b/packages/instabug_flutter/ios/Classes/Modules/SurveysApi.m similarity index 100% rename from ios/Classes/Modules/SurveysApi.m rename to packages/instabug_flutter/ios/Classes/Modules/SurveysApi.m diff --git a/ios/Classes/Util/ArgsRegistry.h b/packages/instabug_flutter/ios/Classes/Util/ArgsRegistry.h similarity index 91% rename from ios/Classes/Util/ArgsRegistry.h rename to packages/instabug_flutter/ios/Classes/Util/ArgsRegistry.h index 28e8ecefd..a0eec42e6 100644 --- a/ios/Classes/Util/ArgsRegistry.h +++ b/packages/instabug_flutter/ios/Classes/Util/ArgsRegistry.h @@ -18,8 +18,11 @@ typedef NSDictionary ArgsDictionary; + (ArgsDictionary *)extendedBugReportStates; + (ArgsDictionary *)reproModes; + (ArgsDictionary *)nonFatalExceptionLevel; ++ (ArgsDictionary *)autoMasking; + (ArgsDictionary *)locales; ++ (ArgsDictionary *)userStepsGesture; + + (NSDictionary *)placeholders; + (ArgsDictionary *) userConsentActionTypes; diff --git a/ios/Classes/Util/ArgsRegistry.m b/packages/instabug_flutter/ios/Classes/Util/ArgsRegistry.m similarity index 93% rename from ios/Classes/Util/ArgsRegistry.m rename to packages/instabug_flutter/ios/Classes/Util/ArgsRegistry.m index c4732550e..99ec591ed 100644 --- a/ios/Classes/Util/ArgsRegistry.m +++ b/packages/instabug_flutter/ios/Classes/Util/ArgsRegistry.m @@ -44,6 +44,18 @@ + (ArgsDictionary *)floatingButtonEdges { }; } ++ (ArgsDictionary *)autoMasking { + return @{ + @"AutoMasking.labels" : @(IBGAutoMaskScreenshotOptionLabels), + @"AutoMasking.textInputs" : @(IBGAutoMaskScreenshotOptionTextInputs), + @"AutoMasking.media" : @(IBGAutoMaskScreenshotOptionMedia), + @"AutoMasking.none" : @(IBGAutoMaskScreenshotOptionMaskNothing +), + + }; +} + + + (ArgsDictionary *)recordButtonPositions { return @{ @"Position.topLeft" : @(IBGPositionTopLeft), @@ -218,4 +230,15 @@ + (ArgsDictionary *) userConsentActionTypes { @"UserConsentActionType.noChat": @(IBGActionTypeNoChat) }; } + ++ (ArgsDictionary *) userStepsGesture { + return @{ + @"GestureType.swipe" : @(IBGUIEventTypeSwipe), + @"GestureType.scroll" : @(IBGUIEventTypeScroll), + @"GestureType.tap" : @(IBGUIEventTypeTap), + @"GestureType.pinch" : @(IBGUIEventTypePinch), + @"GestureType.longPress" : @(IBGUIEventTypeLongPress), + @"GestureType.doubleTap" : @(IBGUIEventTypeDoubleTap), + }; +} @end diff --git a/packages/instabug_flutter/ios/Classes/Util/FlutterPluginRegistrar+FlutterEngine.h b/packages/instabug_flutter/ios/Classes/Util/FlutterPluginRegistrar+FlutterEngine.h new file mode 100644 index 000000000..ae31cbcd4 --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Util/FlutterPluginRegistrar+FlutterEngine.h @@ -0,0 +1,8 @@ +#import + +@interface NSObject (FlutterEngineAccess) + +// Method to access FlutterEngine +- (FlutterEngine *)flutterEngine; + +@end diff --git a/packages/instabug_flutter/ios/Classes/Util/FlutterPluginRegistrar+FlutterEngine.m b/packages/instabug_flutter/ios/Classes/Util/FlutterPluginRegistrar+FlutterEngine.m new file mode 100644 index 000000000..4e5109d3a --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Util/FlutterPluginRegistrar+FlutterEngine.m @@ -0,0 +1,13 @@ + +#import "FlutterPluginRegistrar+FlutterEngine.h" + +@implementation NSObject (FlutterEngineAccess) + +- (FlutterEngine *)flutterEngine { + if ([self respondsToSelector:@selector(engine)]) { + return (FlutterEngine *)[self performSelector:@selector(engine)]; + } + return nil; +} + +@end diff --git a/ios/Classes/Util/IBGAPM+PrivateAPIs.h b/packages/instabug_flutter/ios/Classes/Util/IBGAPM+PrivateAPIs.h similarity index 100% rename from ios/Classes/Util/IBGAPM+PrivateAPIs.h rename to packages/instabug_flutter/ios/Classes/Util/IBGAPM+PrivateAPIs.h diff --git a/ios/Classes/Util/IBGCrashReporting+CP.h b/packages/instabug_flutter/ios/Classes/Util/IBGCrashReporting+CP.h similarity index 100% rename from ios/Classes/Util/IBGCrashReporting+CP.h rename to packages/instabug_flutter/ios/Classes/Util/IBGCrashReporting+CP.h diff --git a/ios/Classes/Util/IBGNetworkLogger+CP.h b/packages/instabug_flutter/ios/Classes/Util/IBGNetworkLogger+CP.h similarity index 100% rename from ios/Classes/Util/IBGNetworkLogger+CP.h rename to packages/instabug_flutter/ios/Classes/Util/IBGNetworkLogger+CP.h diff --git a/packages/instabug_flutter/ios/Classes/Util/Instabug+CP.h b/packages/instabug_flutter/ios/Classes/Util/Instabug+CP.h new file mode 100644 index 000000000..5e1ef85bb --- /dev/null +++ b/packages/instabug_flutter/ios/Classes/Util/Instabug+CP.h @@ -0,0 +1,9 @@ + +#import + +@interface Instabug (CP) + ++ (void)setScreenshotMaskingHandler:(nullable void (^)(UIImage *, void (^)(UIImage *)))maskingHandler; +@property(nonatomic, assign, class) BOOL sendEventsSwizzling; + +@end diff --git a/ios/Classes/Util/NativeUtils/IBGTimeIntervalUnits.h b/packages/instabug_flutter/ios/Classes/Util/NativeUtils/IBGTimeIntervalUnits.h similarity index 100% rename from ios/Classes/Util/NativeUtils/IBGTimeIntervalUnits.h rename to packages/instabug_flutter/ios/Classes/Util/NativeUtils/IBGTimeIntervalUnits.h diff --git a/ios/instabug_flutter.podspec b/packages/instabug_flutter/ios/instabug_flutter.podspec similarity index 92% rename from ios/instabug_flutter.podspec rename to packages/instabug_flutter/ios/instabug_flutter.podspec index 785f1c07b..1478297af 100644 --- a/ios/instabug_flutter.podspec +++ b/packages/instabug_flutter/ios/instabug_flutter.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'instabug_flutter' - s.version = '15.0.2' + s.version = '16.0.0' s.summary = 'Flutter plugin for integrating the Instabug SDK.' s.author = 'Instabug' s.homepage = 'https://www.instabug.com/platforms/flutter' @@ -17,6 +17,6 @@ Pod::Spec.new do |s| s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-framework "Flutter" -framework "InstabugSDK"'} s.dependency 'Flutter' - s.dependency 'Instabug', '15.1.1' + s.dependency 'Instabug', '16.0.2' end diff --git a/lib/instabug_flutter.dart b/packages/instabug_flutter/lib/instabug_flutter.dart similarity index 74% rename from lib/instabug_flutter.dart rename to packages/instabug_flutter/lib/instabug_flutter.dart index 2cc2e8eca..7911163a7 100644 --- a/lib/instabug_flutter.dart +++ b/packages/instabug_flutter/lib/instabug_flutter.dart @@ -19,6 +19,11 @@ export 'src/modules/session_replay.dart'; export 'src/modules/surveys.dart'; // Utils export 'src/utils/instabug_navigator_observer.dart'; +export 'src/utils/instabug_widget.dart'; +export 'src/utils/private_views/instabug_private_view.dart'; +export 'src/utils/private_views/instabug_sliver_private_view.dart'; +export 'src/utils/private_views/private_views_manager.dart' show AutoMasking; export 'src/utils/screen_loading/instabug_capture_screen_loading.dart'; export 'src/utils/screen_loading/route_matcher.dart'; export 'src/utils/screen_name_masker.dart' show ScreenNameMaskingCallback; +export 'src/utils/user_steps/instabug_user_steps.dart'; diff --git a/lib/src/models/crash_data.dart b/packages/instabug_flutter/lib/src/models/crash_data.dart similarity index 100% rename from lib/src/models/crash_data.dart rename to packages/instabug_flutter/lib/src/models/crash_data.dart diff --git a/lib/src/models/exception_data.dart b/packages/instabug_flutter/lib/src/models/exception_data.dart similarity index 100% rename from lib/src/models/exception_data.dart rename to packages/instabug_flutter/lib/src/models/exception_data.dart diff --git a/lib/src/models/feature_flag.dart b/packages/instabug_flutter/lib/src/models/feature_flag.dart similarity index 100% rename from lib/src/models/feature_flag.dart rename to packages/instabug_flutter/lib/src/models/feature_flag.dart diff --git a/lib/src/models/generated_w3c_header.dart b/packages/instabug_flutter/lib/src/models/generated_w3c_header.dart similarity index 100% rename from lib/src/models/generated_w3c_header.dart rename to packages/instabug_flutter/lib/src/models/generated_w3c_header.dart diff --git a/lib/src/models/instabug_route.dart b/packages/instabug_flutter/lib/src/models/instabug_route.dart similarity index 100% rename from lib/src/models/instabug_route.dart rename to packages/instabug_flutter/lib/src/models/instabug_route.dart diff --git a/lib/src/models/network_data.dart b/packages/instabug_flutter/lib/src/models/network_data.dart similarity index 100% rename from lib/src/models/network_data.dart rename to packages/instabug_flutter/lib/src/models/network_data.dart diff --git a/lib/src/models/theme_config.dart b/packages/instabug_flutter/lib/src/models/theme_config.dart similarity index 100% rename from lib/src/models/theme_config.dart rename to packages/instabug_flutter/lib/src/models/theme_config.dart diff --git a/lib/src/models/trace_partial_id.dart b/packages/instabug_flutter/lib/src/models/trace_partial_id.dart similarity index 100% rename from lib/src/models/trace_partial_id.dart rename to packages/instabug_flutter/lib/src/models/trace_partial_id.dart diff --git a/lib/src/models/w3c_feature_flags.dart b/packages/instabug_flutter/lib/src/models/w3c_feature_flags.dart similarity index 100% rename from lib/src/models/w3c_feature_flags.dart rename to packages/instabug_flutter/lib/src/models/w3c_feature_flags.dart diff --git a/lib/src/models/w3c_header.dart b/packages/instabug_flutter/lib/src/models/w3c_header.dart similarity index 100% rename from lib/src/models/w3c_header.dart rename to packages/instabug_flutter/lib/src/models/w3c_header.dart diff --git a/lib/src/modules/apm.dart b/packages/instabug_flutter/lib/src/modules/apm.dart similarity index 100% rename from lib/src/modules/apm.dart rename to packages/instabug_flutter/lib/src/modules/apm.dart diff --git a/lib/src/modules/bug_reporting.dart b/packages/instabug_flutter/lib/src/modules/bug_reporting.dart similarity index 99% rename from lib/src/modules/bug_reporting.dart rename to packages/instabug_flutter/lib/src/modules/bug_reporting.dart index b19147d3d..3bbd80d39 100644 --- a/lib/src/modules/bug_reporting.dart +++ b/packages/instabug_flutter/lib/src/modules/bug_reporting.dart @@ -258,7 +258,7 @@ class BugReporting implements BugReportingFlutterApi { ]) async { return _host.setCommentMinimumCharacterCount( limit, - reportTypes?.mapToString(), + reportTypes.mapToString(), ); } diff --git a/lib/src/modules/crash_reporting.dart b/packages/instabug_flutter/lib/src/modules/crash_reporting.dart similarity index 100% rename from lib/src/modules/crash_reporting.dart rename to packages/instabug_flutter/lib/src/modules/crash_reporting.dart diff --git a/lib/src/modules/feature_requests.dart b/packages/instabug_flutter/lib/src/modules/feature_requests.dart similarity index 100% rename from lib/src/modules/feature_requests.dart rename to packages/instabug_flutter/lib/src/modules/feature_requests.dart diff --git a/lib/src/modules/instabug.dart b/packages/instabug_flutter/lib/src/modules/instabug.dart similarity index 96% rename from lib/src/modules/instabug.dart rename to packages/instabug_flutter/lib/src/modules/instabug.dart index b0073b42a..185f763f7 100644 --- a/lib/src/modules/instabug.dart +++ b/packages/instabug_flutter/lib/src/modules/instabug.dart @@ -22,6 +22,7 @@ import 'package:instabug_flutter/src/utils/feature_flags_manager.dart'; import 'package:instabug_flutter/src/utils/ibg_build_info.dart'; import 'package:instabug_flutter/src/utils/instabug_logger.dart'; import 'package:instabug_flutter/src/utils/screen_name_masker.dart'; +import 'package:instabug_flutter/src/utils/user_steps/user_step_details.dart'; import 'package:meta/meta.dart'; enum InvocationEvent { @@ -467,6 +468,18 @@ class Instabug { return _host.willRedirectToStore(); } + /// Sets the fullscreen mode for Instabug UI. + /// + /// [isFullscreen] - Whether to enable fullscreen mode or not. + /// + /// Example: + /// ```dart + /// Instabug.setFullscreen(true); + /// ``` + static Future setFullscreen(bool isEnabled) async { + return _host.setFullscreen(isEnabled); + } + /// This property sets the `appVariant` string to be included in all network requests. /// It should be set before calling [init] method. /// [appVariant] used to set current App variant name @@ -502,15 +515,19 @@ class Instabug { return _host.setTheme(themeConfig.toMap()); } - /// Sets the fullscreen mode for Instabug UI. - /// - /// [isFullscreen] - Whether to enable fullscreen mode or not. - /// - /// Example: - /// ```dart - /// Instabug.setFullscreen(true); - /// ``` - static Future setFullscreen(bool isEnabled) async { - return _host.setFullscreen(isEnabled); + /// Enables and disables user interaction steps. + /// [boolean] isEnabled + static Future enableUserSteps(bool isEnabled) async { + return _host.setEnableUserSteps(isEnabled); + } + + /// Enables and disables manual invocation and prompt options for bug and feedback. + /// [boolean] isEnabled + static Future logUserSteps( + GestureType gestureType, + String message, + String? viewName, + ) async { + return _host.logUserSteps(gestureType.toString(), message, viewName); } } diff --git a/lib/src/modules/instabug_log.dart b/packages/instabug_flutter/lib/src/modules/instabug_log.dart similarity index 100% rename from lib/src/modules/instabug_log.dart rename to packages/instabug_flutter/lib/src/modules/instabug_log.dart diff --git a/lib/src/modules/network_logger.dart b/packages/instabug_flutter/lib/src/modules/network_logger.dart similarity index 100% rename from lib/src/modules/network_logger.dart rename to packages/instabug_flutter/lib/src/modules/network_logger.dart diff --git a/lib/src/modules/replies.dart b/packages/instabug_flutter/lib/src/modules/replies.dart similarity index 100% rename from lib/src/modules/replies.dart rename to packages/instabug_flutter/lib/src/modules/replies.dart diff --git a/lib/src/modules/session_replay.dart b/packages/instabug_flutter/lib/src/modules/session_replay.dart similarity index 100% rename from lib/src/modules/session_replay.dart rename to packages/instabug_flutter/lib/src/modules/session_replay.dart diff --git a/lib/src/modules/surveys.dart b/packages/instabug_flutter/lib/src/modules/surveys.dart similarity index 100% rename from lib/src/modules/surveys.dart rename to packages/instabug_flutter/lib/src/modules/surveys.dart diff --git a/lib/src/utils/enum_converter.dart b/packages/instabug_flutter/lib/src/utils/enum_converter.dart similarity index 100% rename from lib/src/utils/enum_converter.dart rename to packages/instabug_flutter/lib/src/utils/enum_converter.dart diff --git a/lib/src/utils/feature_flags_manager.dart b/packages/instabug_flutter/lib/src/utils/feature_flags_manager.dart similarity index 100% rename from lib/src/utils/feature_flags_manager.dart rename to packages/instabug_flutter/lib/src/utils/feature_flags_manager.dart diff --git a/lib/src/utils/ibg_build_info.dart b/packages/instabug_flutter/lib/src/utils/ibg_build_info.dart similarity index 100% rename from lib/src/utils/ibg_build_info.dart rename to packages/instabug_flutter/lib/src/utils/ibg_build_info.dart diff --git a/lib/src/utils/ibg_date_time.dart b/packages/instabug_flutter/lib/src/utils/ibg_date_time.dart similarity index 100% rename from lib/src/utils/ibg_date_time.dart rename to packages/instabug_flutter/lib/src/utils/ibg_date_time.dart diff --git a/lib/src/utils/instabug_logger.dart b/packages/instabug_flutter/lib/src/utils/instabug_logger.dart similarity index 100% rename from lib/src/utils/instabug_logger.dart rename to packages/instabug_flutter/lib/src/utils/instabug_logger.dart diff --git a/lib/src/utils/instabug_montonic_clock.dart b/packages/instabug_flutter/lib/src/utils/instabug_montonic_clock.dart similarity index 100% rename from lib/src/utils/instabug_montonic_clock.dart rename to packages/instabug_flutter/lib/src/utils/instabug_montonic_clock.dart diff --git a/lib/src/utils/instabug_navigator_observer.dart b/packages/instabug_flutter/lib/src/utils/instabug_navigator_observer.dart similarity index 66% rename from lib/src/utils/instabug_navigator_observer.dart rename to packages/instabug_flutter/lib/src/utils/instabug_navigator_observer.dart index d9d6b02db..ccf2cf38b 100644 --- a/lib/src/utils/instabug_navigator_observer.dart +++ b/packages/instabug_flutter/lib/src/utils/instabug_navigator_observer.dart @@ -22,22 +22,23 @@ class InstabugNavigatorObserver extends NavigatorObserver { route: newRoute, name: maskedScreenName, ); + //ignore: invalid_null_aware_operator + WidgetsBinding.instance?.addPostFrameCallback((_) async { + // Starts a the new UI trace which is exclusive to screen loading + ScreenLoadingManager.I.startUiTrace(maskedScreenName, screenName); + // If there is a step that hasn't been pushed yet + if (_steps.isNotEmpty) { + await reportScreenChange(_steps.last.name); + // Report the last step and remove it from the list + _steps.removeLast(); + } + + // Add the new step to the list + _steps.add(route); - // Starts a the new UI trace which is exclusive to screen loading - ScreenLoadingManager.I.startUiTrace(maskedScreenName, screenName); - // If there is a step that hasn't been pushed yet - if (_steps.isNotEmpty) { - // Report the last step and remove it from the list - Instabug.reportScreenChange(_steps.last.name); - _steps.removeLast(); - } - - // Add the new step to the list - _steps.add(route); - Future.delayed(const Duration(milliseconds: 1000), () { // If this route is in the array, report it and remove it from the list if (_steps.contains(route)) { - Instabug.reportScreenChange(route.name); + await reportScreenChange(route.name); _steps.remove(route); } }); @@ -47,6 +48,13 @@ class InstabugNavigatorObserver extends NavigatorObserver { } } + Future reportScreenChange(String name) async { + // Wait for the animation to complete + await Future.delayed(const Duration(milliseconds: 100)); + + Instabug.reportScreenChange(name); + } + @override void didPop(Route route, Route? previousRoute) { if (previousRoute != null) { diff --git a/packages/instabug_flutter/lib/src/utils/instabug_widget.dart b/packages/instabug_flutter/lib/src/utils/instabug_widget.dart new file mode 100644 index 000000000..f63ca8776 --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/instabug_widget.dart @@ -0,0 +1,60 @@ +import 'package:flutter/material.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/generated/instabug_private_view.api.g.dart'; +import 'package:instabug_flutter/src/utils/private_views/private_views_manager.dart'; +import 'package:meta/meta.dart'; + +@internal +final instabugWidgetKey = GlobalKey(debugLabel: 'instabug_screenshot_widget'); + +class InstabugWidget extends StatefulWidget { + final Widget child; + final bool enablePrivateViews; + final bool enableUserSteps; + final List? automasking; + + const InstabugWidget({ + Key? key, + required this.child, + this.enableUserSteps = true, + this.enablePrivateViews = true, + this.automasking, + }) : super(key: key); + + @override + State createState() => _InstabugWidgetState(); +} + +class _InstabugWidgetState extends State { + @override + void initState() { + if (widget.enablePrivateViews) { + _enableInstabugMaskingPrivateViews(); + } + if (widget.automasking != null) { + PrivateViewsManager.I.addAutoMasking(widget.automasking!); + } + super.initState(); + } + + @override + Widget build(BuildContext context) { + final child = widget.enableUserSteps + ? InstabugUserSteps(child: widget.child) + : widget.child; + + if (widget.enablePrivateViews) { + return RepaintBoundary( + key: instabugWidgetKey, + child: child, + ); + } + return child; + } +} + +void _enableInstabugMaskingPrivateViews() { + final api = InstabugPrivateViewHostApi(); + api.init(); + InstabugPrivateViewFlutterApi.setup(PrivateViewsManager.I); +} diff --git a/lib/src/utils/iterable_ext.dart b/packages/instabug_flutter/lib/src/utils/iterable_ext.dart similarity index 100% rename from lib/src/utils/iterable_ext.dart rename to packages/instabug_flutter/lib/src/utils/iterable_ext.dart diff --git a/lib/src/utils/network_manager.dart b/packages/instabug_flutter/lib/src/utils/network_manager.dart similarity index 100% rename from lib/src/utils/network_manager.dart rename to packages/instabug_flutter/lib/src/utils/network_manager.dart diff --git a/packages/instabug_flutter/lib/src/utils/private_views/instabug_private_view.dart b/packages/instabug_flutter/lib/src/utils/private_views/instabug_private_view.dart new file mode 100644 index 000000000..6903bd47b --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/private_views/instabug_private_view.dart @@ -0,0 +1,12 @@ +import 'package:flutter/material.dart'; + +class InstabugPrivateView extends StatelessWidget { + final Widget child; + + const InstabugPrivateView({required this.child, Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return child; + } +} diff --git a/packages/instabug_flutter/lib/src/utils/private_views/instabug_sliver_private_view.dart b/packages/instabug_flutter/lib/src/utils/private_views/instabug_sliver_private_view.dart new file mode 100644 index 000000000..1ea626f5a --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/private_views/instabug_sliver_private_view.dart @@ -0,0 +1,14 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class InstabugSliverPrivateView extends StatelessWidget { + final Widget sliver; + + const InstabugSliverPrivateView({required this.sliver, Key? key}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return sliver; + } +} diff --git a/packages/instabug_flutter/lib/src/utils/private_views/private_views_manager.dart b/packages/instabug_flutter/lib/src/utils/private_views/private_views_manager.dart new file mode 100644 index 000000000..c6a8b1da6 --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/private_views/private_views_manager.dart @@ -0,0 +1,180 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/generated/instabug.api.g.dart'; +import 'package:instabug_flutter/src/generated/instabug_private_view.api.g.dart'; +import 'package:instabug_flutter/src/utils/enum_converter.dart'; +import 'package:instabug_flutter/src/utils/user_steps/widget_utils.dart'; + +enum AutoMasking { labels, textInputs, media, none } + +extension ValidationMethod on AutoMasking { + bool Function(Widget) hides() { + switch (this) { + case AutoMasking.labels: + return isTextWidget; + case AutoMasking.textInputs: + return isTextInputWidget; + case AutoMasking.media: + return isMedia; + case AutoMasking.none: + return (_) => false; + } + } +} + +/// responsible for masking views +/// before they are sent to the native SDKs. +class PrivateViewsManager implements InstabugPrivateViewFlutterApi { + PrivateViewsManager._() { + _viewChecks = List.of([isPrivateWidget]); + } + + static PrivateViewsManager _instance = PrivateViewsManager._(); + + static PrivateViewsManager get instance => _instance; + static final _host = InstabugHostApi(); + + /// Shorthand for [instance] + static PrivateViewsManager get I => instance; + + @visibleForTesting + // ignore: use_setters_to_change_properties + static void setInstance(PrivateViewsManager instance) { + _instance = instance; + } + + static bool isPrivateWidget(Widget widget) { + final isPrivate = (widget.runtimeType == InstabugPrivateView) || + (widget.runtimeType == InstabugSliverPrivateView); + + return isPrivate; + } + + late List _viewChecks; + + void addAutoMasking(List masking) { + _viewChecks = List.of([isPrivateWidget]); + if (!(masking.contains(AutoMasking.none) && masking.length == 1)) { + _viewChecks.addAll(masking.map((e) => e.hides()).toList()); + } + _host.enableAutoMasking(masking.mapToString()); + } + + Rect? getLayoutRectInfoFromRenderObject(RenderObject? renderObject) { + if (renderObject == null || !renderObject.attached) { + return null; + } + + final globalOffset = _getRenderGlobalOffset(renderObject); + + // Case 1: RenderBox (e.g. Container, Text, etc.) + if (renderObject is RenderBox) { + return renderObject.paintBounds.shift(globalOffset); + } + + // Case 2: RenderSliver (e.g. SliverList, SliverToBoxAdapter, etc.) + if (renderObject is RenderSliver) { + final geometry = renderObject.geometry; + if (geometry == null) { + return null; + } + + final crossAxisExtent = renderObject.constraints.crossAxisExtent; + final paintExtent = geometry.paintExtent; + + return Rect.fromLTWH( + globalOffset.dx, + globalOffset.dy, + // assume vertical scroll by default + crossAxisExtent, + paintExtent, + ); + } + + return null; + } + + // The is the same implementation used in RenderBox.localToGlobal (a subclass of RenderObject) + Offset _getRenderGlobalOffset(RenderObject renderObject) { + // Find the nearest RenderBox ancestor to calculate global position + RenderObject? current = renderObject; + while (current != null && current is! RenderBox) { + final parentNode = current.parent; + if (parentNode is RenderObject) { + current = parentNode; + } else { + current = null; + } + } + + if (current is RenderBox) { + // Get transform from this object to screen root + final transform = renderObject.getTransformTo(null); + return MatrixUtils.transformPoint(transform, Offset.zero); + } + + // fallback: treat as zero offset (shouldn't happen if widget is mounted in tree) + return Offset.zero; + } + + List getRectsOfPrivateViews() { + final context = instabugWidgetKey.currentContext; + if (context == null) return []; + + final rootRenderObject = + context.findRenderObject() as RenderRepaintBoundary?; + if (rootRenderObject is! RenderBox) return []; + + final bounds = Offset.zero & rootRenderObject!.size; + + final rects = []; + + void findPrivateViews(Element element) { + final widget = element.widget; + final isPrivate = _viewChecks.any((e) => e.call(widget)); + if (isPrivate) { + final renderObject = element.findRenderObject(); + if ((renderObject is RenderBox || renderObject is RenderSliver) && + renderObject?.attached == true) { + final isElementInCurrentScreen = isElementInCurrentRoute(element); + final rect = getLayoutRectInfoFromRenderObject(renderObject); + if (rect != null && + rect.overlaps(bounds) && + isElementInCurrentScreen) { + rects.add(rect); + } + } + } else { + element.visitChildElements(findPrivateViews); + } + } + + rects.clear(); + context.visitChildElements(findPrivateViews); + + return rects; + } + + bool isElementInCurrentRoute(Element element) { + final modalRoute = ModalRoute.of(element); + return modalRoute?.isCurrent ?? false; + } + + @override + List getPrivateViews() { + final rects = getRectsOfPrivateViews(); + final result = []; + + for (final rect in rects) { + result.addAll([ + rect.left, + rect.top, + rect.right, + rect.bottom, + ]); + } + + return result; + } +} diff --git a/lib/src/utils/repro_steps_constants.dart b/packages/instabug_flutter/lib/src/utils/repro_steps_constants.dart similarity index 100% rename from lib/src/utils/repro_steps_constants.dart rename to packages/instabug_flutter/lib/src/utils/repro_steps_constants.dart diff --git a/lib/src/utils/screen_loading/flags_config.dart b/packages/instabug_flutter/lib/src/utils/screen_loading/flags_config.dart similarity index 100% rename from lib/src/utils/screen_loading/flags_config.dart rename to packages/instabug_flutter/lib/src/utils/screen_loading/flags_config.dart diff --git a/lib/src/utils/screen_loading/instabug_capture_screen_loading.dart b/packages/instabug_flutter/lib/src/utils/screen_loading/instabug_capture_screen_loading.dart similarity index 100% rename from lib/src/utils/screen_loading/instabug_capture_screen_loading.dart rename to packages/instabug_flutter/lib/src/utils/screen_loading/instabug_capture_screen_loading.dart diff --git a/lib/src/utils/screen_loading/route_matcher.dart b/packages/instabug_flutter/lib/src/utils/screen_loading/route_matcher.dart similarity index 100% rename from lib/src/utils/screen_loading/route_matcher.dart rename to packages/instabug_flutter/lib/src/utils/screen_loading/route_matcher.dart diff --git a/lib/src/utils/screen_loading/screen_loading_manager.dart b/packages/instabug_flutter/lib/src/utils/screen_loading/screen_loading_manager.dart similarity index 100% rename from lib/src/utils/screen_loading/screen_loading_manager.dart rename to packages/instabug_flutter/lib/src/utils/screen_loading/screen_loading_manager.dart diff --git a/lib/src/utils/screen_loading/screen_loading_trace.dart b/packages/instabug_flutter/lib/src/utils/screen_loading/screen_loading_trace.dart similarity index 100% rename from lib/src/utils/screen_loading/screen_loading_trace.dart rename to packages/instabug_flutter/lib/src/utils/screen_loading/screen_loading_trace.dart diff --git a/lib/src/utils/screen_loading/ui_trace.dart b/packages/instabug_flutter/lib/src/utils/screen_loading/ui_trace.dart similarity index 100% rename from lib/src/utils/screen_loading/ui_trace.dart rename to packages/instabug_flutter/lib/src/utils/screen_loading/ui_trace.dart diff --git a/lib/src/utils/screen_name_masker.dart b/packages/instabug_flutter/lib/src/utils/screen_name_masker.dart similarity index 100% rename from lib/src/utils/screen_name_masker.dart rename to packages/instabug_flutter/lib/src/utils/screen_name_masker.dart diff --git a/packages/instabug_flutter/lib/src/utils/user_steps/instabug_user_steps.dart b/packages/instabug_flutter/lib/src/utils/user_steps/instabug_user_steps.dart new file mode 100644 index 000000000..891cd78e2 --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/user_steps/instabug_user_steps.dart @@ -0,0 +1,261 @@ +import 'dart:async'; +import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/utils/user_steps/user_step_details.dart'; +import 'package:instabug_flutter/src/utils/user_steps/widget_utils.dart'; + +Element? _clickTrackerElement; + +class InstabugUserSteps extends StatefulWidget { + final Widget child; + + const InstabugUserSteps({Key? key, required this.child}) : super(key: key); + + @override + InstabugUserStepsState createState() => InstabugUserStepsState(); + + @override + StatefulElement createElement() { + final element = super.createElement(); + _clickTrackerElement = element; + return element; + } +} + +class InstabugUserStepsState extends State { + static const double _doubleTapThreshold = 300.0; // milliseconds + static const double _pinchSensitivity = 20.0; + static const double _swipeSensitivity = 50.0; + static const double _scrollSensitivity = 50.0; + static const double _tapSensitivity = 20 * 20; + + Timer? _longPressTimer; + Offset? _pointerDownLocation; + GestureType? _gestureType; + String? _gestureMetaData; + DateTime? _lastTapTime; + double _pinchDistance = 0.0; + int _pointerCount = 0; + double? _previousOffset; + + void _onPointerDown(PointerDownEvent event) { + _resetGestureTracking(); + _pointerDownLocation = event.localPosition; + _pointerCount += event.buttons; + _longPressTimer = Timer(const Duration(milliseconds: 500), () { + _gestureType = GestureType.longPress; + }); + } + + void _onPointerUp(PointerUpEvent event, BuildContext context) { + _longPressTimer?.cancel(); + + final gestureType = _detectGestureType(event.localPosition); + if (_gestureType != GestureType.longPress) { + _gestureType = gestureType; + } + + _pointerCount = 0; + + if (_gestureType == null) { + return; + } + final tappedWidget = + _getWidgetDetails(event.localPosition, context, _gestureType!); + if (tappedWidget != null) { + final userStepDetails = tappedWidget.copyWith( + gestureType: _gestureType, + gestureMetaData: _gestureMetaData, + ); + if (userStepDetails.gestureType == null || + userStepDetails.message == null) { + return; + } + + Instabug.logUserSteps( + userStepDetails.gestureType!, + userStepDetails.message!, + userStepDetails.widgetName, + ); + } + } + + GestureType? _detectGestureType(Offset upLocation) { + final delta = upLocation - (_pointerDownLocation ?? Offset.zero); + + if (_pointerCount == 1) { + if (_isTap(delta)) return _detectTapType(); + if (_isSwipe(delta)) return GestureType.swipe; + } else if (_pointerCount == 2 && _isPinch()) { + return GestureType.pinch; + } + + return null; + } + + bool _isTap(Offset delta) => delta.distanceSquared < _tapSensitivity; + + GestureType? _detectTapType() { + final now = DateTime.now(); + final isDoubleTap = _lastTapTime != null && + now.difference(_lastTapTime!).inMilliseconds <= _doubleTapThreshold; + + _lastTapTime = now; + return isDoubleTap ? GestureType.doubleTap : GestureType.tap; + } + + bool _isSwipe(Offset delta) { + final isHorizontal = delta.dx.abs() > delta.dy.abs(); + + if (isHorizontal && delta.dx.abs() > _swipeSensitivity) { + _gestureMetaData = delta.dx > 0 ? "Right" : "Left"; + return true; + } + + if (!isHorizontal && delta.dy.abs() > _swipeSensitivity) { + _gestureMetaData = delta.dy > 0 ? "Down" : "Up"; + return true; + } + + return false; + } + + bool _isPinch() => _pinchDistance.abs() > _pinchSensitivity; + + void _resetGestureTracking() { + _gestureType = null; + _gestureMetaData = null; + _longPressTimer?.cancel(); + } + + UserStepDetails? _getWidgetDetails( + Offset location, + BuildContext context, + GestureType gestureType, + ) { + Element? tappedElement; + var isPrivate = false; + + final rootElement = _clickTrackerElement; + if (rootElement == null || rootElement.widget != widget) return null; + + final hitTestResult = BoxHitTestResult(); + final renderBox = context.findRenderObject()! as RenderBox; + + renderBox.hitTest(hitTestResult, position: _pointerDownLocation!); + + final targets = hitTestResult.path + .where((e) => e.target is RenderBox) + .map((e) => e.target) + .toList(); + + void visitor(Element visitedElement) { + final renderObject = visitedElement.renderObject; + if (renderObject == null) return; + + if (targets.contains(renderObject)) { + final transform = renderObject.getTransformTo(rootElement.renderObject); + final paintBounds = + MatrixUtils.transformRect(transform, renderObject.paintBounds); + + if (paintBounds.contains(_pointerDownLocation!)) { + final widget = visitedElement.widget; + if (!isPrivate) { + isPrivate = widget.runtimeType.toString() == + 'InstabugPrivateView' || + widget.runtimeType.toString() == 'InstabugSliverPrivateView'; + } + if (_isTargetWidget(widget, gestureType)) { + tappedElement = visitedElement; + return; + } + } + } + if (tappedElement == null) { + visitedElement.visitChildElements(visitor); + } + } + + rootElement.visitChildElements(visitor); + if (tappedElement == null) return null; + return UserStepDetails(element: tappedElement, isPrivate: isPrivate); + } + + bool _isTargetWidget(Widget? widget, GestureType type) { + if (widget == null) return false; + switch (type) { + case GestureType.swipe: + return isSwipedWidget(widget); + case GestureType.tap: + case GestureType.longPress: + case GestureType.doubleTap: + return isTappedWidget(widget); + case GestureType.pinch: + return isPinchWidget(widget); + case GestureType.scroll: + return false; + } + } + + void _detectScrollDirection(double currentOffset, Axis direction) { + if (_previousOffset == null) return; + + final delta = (currentOffset - _previousOffset!).abs(); + if (delta < _scrollSensitivity) return; + final String swipeDirection; + if (direction == Axis.horizontal) { + swipeDirection = currentOffset > _previousOffset! ? "Left" : "Right"; + } else { + swipeDirection = currentOffset > _previousOffset! ? "Down" : "Up"; + } + + final userStepDetails = UserStepDetails( + element: null, + isPrivate: false, + gestureMetaData: swipeDirection, + gestureType: GestureType.scroll, + ); + + if (userStepDetails.gestureType == null || + userStepDetails.message == null) { + return; + } + Instabug.logUserSteps( + userStepDetails.gestureType!, + userStepDetails.message!, + "ListView", + ); + } + + @override + Widget build(BuildContext context) { + return Listener( + behavior: HitTestBehavior.translucent, + onPointerDown: _onPointerDown, + onPointerMove: (event) { + if (_pointerCount == 2) { + _pinchDistance = + (event.localPosition - (_pointerDownLocation ?? Offset.zero)) + .distance; + } + }, + onPointerUp: (event) => _onPointerUp(event, context), + child: NotificationListener( + onNotification: (notification) { + if (notification is ScrollStartNotification) { + _previousOffset = notification.metrics.pixels; + } else if (notification is ScrollEndNotification) { + _detectScrollDirection( + notification.metrics.pixels, // Vertical position + notification.metrics.axis, + ); + } + + return true; + }, + child: widget.child, + ), + ); + } +} diff --git a/packages/instabug_flutter/lib/src/utils/user_steps/user_step_details.dart b/packages/instabug_flutter/lib/src/utils/user_steps/user_step_details.dart new file mode 100644 index 000000000..590758eeb --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/user_steps/user_step_details.dart @@ -0,0 +1,122 @@ +import 'package:flutter/material.dart'; +import 'package:instabug_flutter/src/utils/user_steps/widget_utils.dart'; + +enum GestureType { swipe, scroll, tap, pinch, longPress, doubleTap } + +extension GestureTypeText on GestureType { + String get text { + switch (this) { + case GestureType.swipe: + return "Swiped"; + case GestureType.scroll: + return "Scrolled"; + case GestureType.tap: + return "Tapped"; + case GestureType.pinch: + return "Pinched"; + case GestureType.longPress: + return "Long Pressed"; + case GestureType.doubleTap: + return "Double Tapped"; + } + } +} + +class UserStepDetails { + final Element? element; + final bool isPrivate; + final GestureType? gestureType; + final String? gestureMetaData; + final Widget? widget; + + UserStepDetails({ + required this.element, + required this.isPrivate, + this.gestureType, + this.gestureMetaData, + }) : widget = element?.widget; + + String? get key => widget == null ? null : keyToStringValue(widget!.key); + + String? get widgetName { + if (widget == null) return null; + if (widget is InkWell) { + final inkWell = widget! as InkWell; + if (inkWell.child == null) { + return widget.runtimeType.toString(); + } + return "${inkWell.child.runtimeType} Wrapped with ${widget.runtimeType}"; + } else if (widget is GestureDetector) { + final gestureDetector = widget! as GestureDetector; + + if (gestureDetector.child == null) { + return widget.runtimeType.toString(); + } + return "${gestureDetector.child.runtimeType} Wrapped with ${widget.runtimeType}"; + } + return widget.runtimeType.toString(); + } + + String? get message { + if (gestureType == null) return null; + if (gestureType == GestureType.pinch) { + return gestureType?.text; + } + var baseMessage = ""; + + if (gestureType == GestureType.scroll || gestureType == GestureType.swipe) { + baseMessage += + gestureMetaData?.isNotEmpty == true ? '$gestureMetaData ' : ''; + } + + if (widgetName != null) baseMessage += " $widgetName "; + + if (!isPrivate && widget != null) { + final additionalInfo = _getWidgetSpecificDetails(); + if (additionalInfo != null) baseMessage += additionalInfo; + } + + if (key != null) baseMessage += " with key '$key' "; + + return baseMessage.trimRight(); + } + + String? _getWidgetSpecificDetails() { + if (isSliderWidget(widget!)) { + final value = getSliderValue(widget!); + if (value?.isNotEmpty == true) { + return " to '$value'"; + } + } else if (isTextWidget(widget!) || isButtonWidget(widget!)) { + final label = getLabelRecursively(element!); + if (label?.isNotEmpty == true) { + return "'$label'"; + } + } else if (isToggleableWidget(widget!)) { + final value = getToggleValue(widget!); + if (value?.isNotEmpty == true) { + return " ('$value')"; + } + } else if (isTextInputWidget(widget!)) { + final value = getTextInputValue(widget!); + final hint = getTextHintValue(widget!); + if (value?.isNotEmpty == true) return " '$value'"; + if (hint?.isNotEmpty == true) return "(placeholder:'$hint')"; + } + return null; + } + + UserStepDetails copyWith({ + Element? element, + bool? isPrivate, + GestureType? gestureType, + String? gestureMetaData, + }) { + return UserStepDetails( + element: element ?? this.element, + isPrivate: isPrivate ?? this.isPrivate, + gestureType: gestureType ?? this.gestureType, + gestureMetaData: gestureMetaData ?? this.gestureMetaData, + ); + } +} diff --git a/packages/instabug_flutter/lib/src/utils/user_steps/widget_utils.dart b/packages/instabug_flutter/lib/src/utils/user_steps/widget_utils.dart new file mode 100644 index 000000000..939aa4660 --- /dev/null +++ b/packages/instabug_flutter/lib/src/utils/user_steps/widget_utils.dart @@ -0,0 +1,223 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +/// Converts a [Key] into a string representation, supporting various key types. +String? keyToStringValue(Key? key) { + if (key == null) return null; + + if (key is ValueKey) { + return key.value?.toString(); + } else if (key is GlobalObjectKey) { + return key.value.toString(); + } else if (key is ObjectKey) { + return key.value?.toString(); + } + + return key.toString(); +} + +/// Checks if a widget is a button or button-like component. +bool isButtonWidget(Widget widget) { + if (widget is ButtonStyleButton) return widget.enabled; + if (widget is MaterialButton) return widget.enabled; + if (widget is CupertinoButton) return widget.enabled; + if (widget is IconButton) return widget.onPressed != null; + if (widget is FloatingActionButton) return widget.onPressed != null; + if (widget is BackButton) return widget.onPressed != null; + if (widget is PopupMenuButton) return widget.enabled; + if (widget is DropdownButton) return widget.onTap != null; + + if (widget is GestureDetector) { + return widget.onTap != null || + widget.onLongPress != null || + widget.onDoubleTap != null || + widget.onTapDown != null; + } + + if (widget is InkWell) { + return widget.onTap != null || + widget.onLongPress != null || + widget.onDoubleTap != null || + widget.onTapDown != null; + } + + return false; +} + +/// Checks if a widget can respond to tap-related gestures. +bool isTappedWidget(Widget? widget) { + if (widget == null) return false; + + return isButtonWidget(widget) || + isToggleableWidget(widget) || + isSliderWidget(widget) || + isTextInputWidget(widget); +} + +/// Checks if a widget supports swipe gestures. +bool isSwipedWidget(Widget? widget) { + return widget is Slider || + widget is CupertinoSlider || + widget is RangeSlider || + widget is Dismissible; +} + +/// Determines if a widget supports pinch gestures (defaulting to those not tappable or swipeable). +bool isPinchWidget(Widget? widget) { + return !isSwipedWidget(widget); +} + +/// Checks if a widget is primarily for displaying text. +bool isTextWidget(Widget widget) { + return widget is Text || + widget is RichText || + widget is SelectableText || + widget is TextSpan || + widget is Placeholder || + widget is TextStyle; +} + +/// Checks if a widget is a slider. +bool isSliderWidget(Widget widget) { + return widget is Slider || widget is CupertinoSlider || widget is RangeSlider; +} + +/// Checks if a widget is an image or image-like. +bool isImageWidget(Widget? widget) { + if (widget == null) { + return false; + } + final isDefaultImage = widget is Image || + widget is FadeInImage || + widget is NetworkImage || + widget is AssetImage || + widget is Icon || + widget is FileImage || + widget is MemoryImage || + widget is ImageProvider; + + if (isDefaultImage) { + return true; + } + final imageWidgetTypes = { + 'CachedNetworkImage', // From cached_network_image package + 'SvgPicture', // flutter_svg package + 'OctoImage', // octo_image package + }; + + return imageWidgetTypes.contains(widget.runtimeType.toString()); +} + +bool isVideoPlayerWidget(Widget widget) { + final videoPlayerTypes = { + 'VideoPlayer', // flutter_video_player + 'Chewie', // chewie video player + 'BetterPlayer', // better_player package + 'YoutubePlayer', // youtube_player_flutter + 'VlcPlayer', // flutter_vlc_player + 'FlickVideoPlayer', // flick_video_player + }; + + return videoPlayerTypes.contains(widget.runtimeType.toString()); +} + +bool isMedia(Widget widget) { + return isImageWidget(widget) || isVideoPlayerWidget(widget); +} + +/// Checks if a widget is toggleable (e.g., switch, checkbox, etc.). +bool isToggleableWidget(Widget widget) { + return widget is Checkbox || + widget is CheckboxListTile || + widget is Radio || + widget is RadioListTile || + widget is Switch || + widget is SwitchListTile || + widget is CupertinoSwitch || + widget is ToggleButtons; +} + +/// Checks if a widget is a text input field. +bool isTextInputWidget(Widget widget) { + return widget is TextField || + widget is CupertinoTextField || + widget is EditableText; +} + +/// Retrieves the label of a widget if available. +String? getLabel(Widget widget) { + if (widget is Text) return widget.data; + if (widget is Semantics) return widget.properties.label; + if (widget is Icon) return widget.semanticLabel; + if (widget is Tooltip) return widget.message; + + return null; +} + +/// Retrieves the value of a toggleable widget. +String? getToggleValue(Widget widget) { + bool? value; + if (widget is Checkbox) value = widget.value; + if (widget is Radio) return widget.groupValue.toString(); + if (widget is RadioListTile) return widget.groupValue.toString(); + if (widget is Switch) value = widget.value; + if (widget is SwitchListTile) value = widget.value; + if (widget is CupertinoSwitch) value = widget.value; + if (widget is ToggleButtons) return widget.isSelected.toString(); + + if (value == false || value == null) { + return "UnSelected"; + } else if (value) { + return "Selected"; + } + return null; +} + +/// Retrieves the value entered in a text input field. +String? getTextInputValue(Widget widget) { + if (widget is TextField && !widget.obscureText) { + return widget.controller?.text; + } else if (widget is CupertinoTextField && !widget.obscureText) { + return widget.controller?.text; + } else if (widget is EditableText && !widget.obscureText) { + return widget.controller.text; + } + + return null; +} + +/// Retrieves the hint value of a text input widget. +String? getTextHintValue(Widget widget) { + if (widget is TextField && !widget.obscureText) { + return widget.decoration?.hintText ?? widget.decoration?.labelText; + } else if (widget is CupertinoTextField && !widget.obscureText) { + return widget.placeholder; + } + + return null; +} + +/// Retrieves the current value of a slider widget. +String? getSliderValue(Widget widget) { + if (widget is Slider) return widget.value.toString(); + if (widget is CupertinoSlider) return widget.value.toString(); + if (widget is RangeSlider) { + return "(${widget.values.start},${widget.values.end})"; + } + + return null; +} + +/// Recursively searches for a label within a widget hierarchy. +String? getLabelRecursively(Element element) { + String? label; + + void visitor(Element e) { + label ??= getLabel(e.widget); + if (label == null) e.visitChildren(visitor); + } + + visitor(element); + + return label; +} diff --git a/lib/src/utils/w3c_header_utils.dart b/packages/instabug_flutter/lib/src/utils/w3c_header_utils.dart similarity index 100% rename from lib/src/utils/w3c_header_utils.dart rename to packages/instabug_flutter/lib/src/utils/w3c_header_utils.dart diff --git a/packages/instabug_flutter/package.json b/packages/instabug_flutter/package.json new file mode 100644 index 000000000..52b3a844e --- /dev/null +++ b/packages/instabug_flutter/package.json @@ -0,0 +1,9 @@ +{ + "name": "Instabug-Flutter", + "version": "0.0.0", + "devDependencies": { + "@instabug/danger-plugin-coverage": "Instabug/danger-plugin-coverage", + "danger": "^11.2.5", + "typescript": "^5.0.4" + } +} diff --git a/pigeons/apm.api.dart b/packages/instabug_flutter/pigeons/apm.api.dart similarity index 100% rename from pigeons/apm.api.dart rename to packages/instabug_flutter/pigeons/apm.api.dart diff --git a/pigeons/bug_reporting.api.dart b/packages/instabug_flutter/pigeons/bug_reporting.api.dart similarity index 100% rename from pigeons/bug_reporting.api.dart rename to packages/instabug_flutter/pigeons/bug_reporting.api.dart diff --git a/pigeons/crash_reporting.api.dart b/packages/instabug_flutter/pigeons/crash_reporting.api.dart similarity index 100% rename from pigeons/crash_reporting.api.dart rename to packages/instabug_flutter/pigeons/crash_reporting.api.dart diff --git a/pigeons/feature_requests.api.dart b/packages/instabug_flutter/pigeons/feature_requests.api.dart similarity index 100% rename from pigeons/feature_requests.api.dart rename to packages/instabug_flutter/pigeons/feature_requests.api.dart diff --git a/pigeons/instabug.api.dart b/packages/instabug_flutter/pigeons/instabug.api.dart similarity index 91% rename from pigeons/instabug.api.dart rename to packages/instabug_flutter/pigeons/instabug.api.dart index aa91aec11..575b40a2b 100644 --- a/pigeons/instabug.api.dart +++ b/packages/instabug_flutter/pigeons/instabug.api.dart @@ -24,6 +24,8 @@ abstract class InstabugHostApi { String? appVariant, ); + void enableAutoMasking(List autoMasking); + void show(); void showWelcomeMessageWithMode(String mode); @@ -38,14 +40,20 @@ abstract class InstabugHostApi { void logOut(); + void setEnableUserSteps(bool isEnabled); + + void logUserSteps( + String gestureType, + String message, + String? viewName, + ); + void setLocale(String locale); void setColorTheme(String theme); void setWelcomeMessageMode(String mode); - void setPrimaryColor(int color); - void setSessionProfilerEnabled(bool enabled); void setValueForStringWithKey(String value, String key); diff --git a/pigeons/instabug_log.api.dart b/packages/instabug_flutter/pigeons/instabug_log.api.dart similarity index 100% rename from pigeons/instabug_log.api.dart rename to packages/instabug_flutter/pigeons/instabug_log.api.dart diff --git a/packages/instabug_flutter/pigeons/instabug_private_view.api.dart b/packages/instabug_flutter/pigeons/instabug_private_view.api.dart new file mode 100644 index 000000000..9a84a63f3 --- /dev/null +++ b/packages/instabug_flutter/pigeons/instabug_private_view.api.dart @@ -0,0 +1,11 @@ +import 'package:pigeon/pigeon.dart'; + +@FlutterApi() +abstract class InstabugPrivateViewFlutterApi { + List getPrivateViews(); +} + +@HostApi() +abstract class InstabugPrivateViewHostApi { + void init(); +} diff --git a/pigeons/replies.api.dart b/packages/instabug_flutter/pigeons/replies.api.dart similarity index 100% rename from pigeons/replies.api.dart rename to packages/instabug_flutter/pigeons/replies.api.dart diff --git a/pigeons/session_replay.api.dart b/packages/instabug_flutter/pigeons/session_replay.api.dart similarity index 100% rename from pigeons/session_replay.api.dart rename to packages/instabug_flutter/pigeons/session_replay.api.dart diff --git a/pigeons/surveys.api.dart b/packages/instabug_flutter/pigeons/surveys.api.dart similarity index 100% rename from pigeons/surveys.api.dart rename to packages/instabug_flutter/pigeons/surveys.api.dart diff --git a/packages/instabug_flutter/pubspec.lock b/packages/instabug_flutter/pubspec.lock new file mode 100644 index 000000000..5adceef62 --- /dev/null +++ b/packages/instabug_flutter/pubspec.lock @@ -0,0 +1,717 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + args: + dependency: transitive + description: + name: args + sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 + url: "https://pub.dev" + source: hosted + version: "2.7.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: "4ae2de3e1e67ea270081eaee972e1bd8f027d459f249e0f1186730784c2e7e33" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "8e928697a82be082206edb0b9c99c5a4ad6bc31c9e9b8b2f291ae65cd4a25daa" + url: "https://pub.dev" + source: hosted + version: "4.0.4" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + url: "https://pub.dev" + source: hosted + version: "2.4.13" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + url: "https://pub.dev" + source: hosted + version: "7.3.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: ba95c961bafcd8686d1cf63be864eb59447e795e124d98d6a27d91fcd13602fb + url: "https://pub.dev" + source: hosted + version: "8.11.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_config: + dependency: transitive + description: + name: cli_config + sha256: ac20a183a07002b700f0c25e61b7ee46b23c309d76ab7b7640a028f18e4d99ec + url: "https://pub.dev" + source: hosted + version: "0.2.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "5da775aa218eaf2151c721b16c01c7676fbfdd99cebba2bf64e8b807a28ff94d" + url: "https://pub.dev" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + fake_async: + dependency: "direct dev" + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: c3f1ee72c96f8f78935e18aa8cecced9ab132419e8625dc187e1c2408efc20de + url: "https://pub.dev" + source: hosted + version: "2.1.3" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + html: + dependency: transitive + description: + name: html + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" + url: "https://pub.dev" + source: hosted + version: "0.15.6" + http: + dependency: transitive + description: + name: http + sha256: "2c11f3f94c687ee9bad77c171151672986360b2b001d109814ee7140b2cf261b" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: aa6199f908078bb1c5efb8d8638d4ae191aac11b311132c3ef48ce352fb52ef8 + url: "https://pub.dev" + source: hosted + version: "3.2.2" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" + url: "https://pub.dev" + source: hosted + version: "4.1.2" + io: + dependency: transitive + description: + name: io + sha256: dfd5a80599cf0165756e3181807ed3e77daf6dd4137caaad72d0b7931597650b + url: "https://pub.dev" + source: hosted + version: "1.0.5" + js: + dependency: transitive + description: + name: js + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" + source: hosted + version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lint: + dependency: "direct dev" + description: + name: lint + sha256: "4a539aa34ec5721a2c7574ae2ca0336738ea4adc2a34887d54b7596310b33c85" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + lints: + dependency: transitive + description: + name: lints + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1" + url: "https://pub.dev" + source: hosted + version: "7.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: "direct main" + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: "direct dev" + description: + name: mockito + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + url: "https://pub.dev" + source: hosted + version: "5.4.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: f096c55ebb7deb7e384101542bfba8c52696c1b56fca2eb62827989ef2353bbc + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pana: + dependency: "direct dev" + description: + name: pana + sha256: "3fc3fe8e7a9fd4827fa4d625a423eec95d305b2bc3538a3adf7fd6c49217af97" + url: "https://pub.dev" + source: hosted + version: "0.21.45" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + pigeon: + dependency: "direct dev" + description: + name: pigeon + sha256: "6eb9702acc25d5ec340bd1b751e511e2982189dfc40c12e2d69db6e05bab03be" + url: "https://pub.dev" + source: hosted + version: "10.1.5" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "5bfcf68ca79ef689f8990d1160781b4bad40a3bd5e5218ad4076ddb7f4081585" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + safe_url_check: + dependency: transitive + description: + name: safe_url_check + sha256: "49a3e060a7869cbafc8f4845ca1ecbbaaa53179980a32f4fdfeab1607e90f41d" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf: + dependency: transitive + description: + name: shelf + sha256: e7dd780a7ffb623c57850b33f43309312fc863fb6aa3d276a754bb299839ef12 + url: "https://pub.dev" + source: hosted + version: "1.4.2" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "190222579a448b03896e0ca6eca5998fa810fda630c1d65e2f78b3f638f54812" + url: "https://pub.dev" + source: hosted + version: "0.10.13" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: "direct main" + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 + url: "https://pub.dev" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + tar: + dependency: transitive + description: + name: tar + sha256: "22f67e2d77b51050436620b2a5de521c58ca6f0b75af1d9ab3c8cae2eae58fcd" + url: "https://pub.dev" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: transitive + description: + name: test + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" + url: "https://pub.dev" + source: hosted + version: "1.25.8" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + test_core: + dependency: transitive + description: + name: test_core + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + timing: + dependency: transitive + description: + name: timing + sha256: "62ee18aca144e4a9f29d212f5a4c6a053be252b895ab14b5821996cff4ed90fe" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + web: + dependency: transitive + description: + name: web + sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" + url: "https://pub.dev" + source: hosted + version: "1.1.1" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "34d64019aa8e36bf9842ac014bb5d2f5586ca73df5e4d9bf5c936975cae6982c" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d645757fb0f4773d602444000a8131ff5d48c9e47adfe9772652dd1a4f2d45c8 + url: "https://pub.dev" + source: hosted + version: "3.0.3" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: b9da305ac7c39faa3f030eccd175340f968459dae4af175130b3fc47e40d76ce + url: "https://pub.dev" + source: hosted + version: "3.1.3" +sdks: + dart: ">=3.6.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_flutter/pubspec.yaml b/packages/instabug_flutter/pubspec.yaml new file mode 100644 index 000000000..27801e5bc --- /dev/null +++ b/packages/instabug_flutter/pubspec.yaml @@ -0,0 +1,39 @@ +name: instabug_flutter +version: 16.0.0 +description: >- + Instabug empowers mobile teams to monitor, prioritize, and debug + performance and stability issues throughout the app development lifecycle. +homepage: https://www.instabug.com/platforms/flutter +repository: https://github.com/Instabug/Instabug-Flutter +documentation: https://docs.instabug.com/docs/flutter-overview + +dependencies: + flutter: + sdk: flutter + meta: ^1.3.0 + stack_trace: ^1.10.0 + +dev_dependencies: + build_runner: ^2.0.3 + fake_async: ">=1.2.0 <1.4.0" + flutter_test: + sdk: flutter + lint: ^1.0.0 + # mockito v5.2.0 is needed for running Flutter 2 tests on CI + mockito: ">=5.2.0 <5.5.0" + pana: ^0.21.0 + # pigeon v3.0.0 is needed for running Flutter 2 tests on CI + pigeon: ">=3.0.0 <=10.1.5" + +flutter: + plugin: + platforms: + android: + package: com.instabug.flutter + pluginClass: InstabugFlutterPlugin + ios: + pluginClass: InstabugFlutterPlugin + +environment: + sdk: ">=2.14.0 <4.0.0" + flutter: ">=1.17.0" diff --git a/scripts/pigeon.sh b/packages/instabug_flutter/scripts/pigeon.sh similarity index 100% rename from scripts/pigeon.sh rename to packages/instabug_flutter/scripts/pigeon.sh diff --git a/test/apm_test.dart b/packages/instabug_flutter/test/apm_test.dart similarity index 100% rename from test/apm_test.dart rename to packages/instabug_flutter/test/apm_test.dart diff --git a/test/bug_reporting_test.dart b/packages/instabug_flutter/test/bug_reporting_test.dart similarity index 100% rename from test/bug_reporting_test.dart rename to packages/instabug_flutter/test/bug_reporting_test.dart diff --git a/test/crash_reporting_test.dart b/packages/instabug_flutter/test/crash_reporting_test.dart similarity index 100% rename from test/crash_reporting_test.dart rename to packages/instabug_flutter/test/crash_reporting_test.dart diff --git a/test/feature_flags_manager_test.dart b/packages/instabug_flutter/test/feature_flags_manager_test.dart similarity index 100% rename from test/feature_flags_manager_test.dart rename to packages/instabug_flutter/test/feature_flags_manager_test.dart diff --git a/test/feature_requests_test.dart b/packages/instabug_flutter/test/feature_requests_test.dart similarity index 100% rename from test/feature_requests_test.dart rename to packages/instabug_flutter/test/feature_requests_test.dart diff --git a/test/instabug_log_test.dart b/packages/instabug_flutter/test/instabug_log_test.dart similarity index 100% rename from test/instabug_log_test.dart rename to packages/instabug_flutter/test/instabug_log_test.dart diff --git a/test/instabug_test.dart b/packages/instabug_flutter/test/instabug_test.dart similarity index 100% rename from test/instabug_test.dart rename to packages/instabug_flutter/test/instabug_test.dart diff --git a/test/network_data_test.dart b/packages/instabug_flutter/test/network_data_test.dart similarity index 100% rename from test/network_data_test.dart rename to packages/instabug_flutter/test/network_data_test.dart diff --git a/test/network_logger_test.dart b/packages/instabug_flutter/test/network_logger_test.dart similarity index 100% rename from test/network_logger_test.dart rename to packages/instabug_flutter/test/network_logger_test.dart diff --git a/test/network_manager_test.dart b/packages/instabug_flutter/test/network_manager_test.dart similarity index 100% rename from test/network_manager_test.dart rename to packages/instabug_flutter/test/network_manager_test.dart diff --git a/test/replies_test.dart b/packages/instabug_flutter/test/replies_test.dart similarity index 100% rename from test/replies_test.dart rename to packages/instabug_flutter/test/replies_test.dart diff --git a/test/route_matcher_test.dart b/packages/instabug_flutter/test/route_matcher_test.dart similarity index 100% rename from test/route_matcher_test.dart rename to packages/instabug_flutter/test/route_matcher_test.dart diff --git a/test/session_replay_test.dart b/packages/instabug_flutter/test/session_replay_test.dart similarity index 100% rename from test/session_replay_test.dart rename to packages/instabug_flutter/test/session_replay_test.dart diff --git a/test/surveys_test.dart b/packages/instabug_flutter/test/surveys_test.dart similarity index 100% rename from test/surveys_test.dart rename to packages/instabug_flutter/test/surveys_test.dart diff --git a/test/utils/instabug_navigator_observer_test.dart b/packages/instabug_flutter/test/utils/instabug_navigator_observer_test.dart similarity index 82% rename from test/utils/instabug_navigator_observer_test.dart rename to packages/instabug_flutter/test/utils/instabug_navigator_observer_test.dart index ebf541137..5f138ac8f 100644 --- a/test/utils/instabug_navigator_observer_test.dart +++ b/packages/instabug_flutter/test/utils/instabug_navigator_observer_test.dart @@ -1,3 +1,5 @@ +// ignore_for_file: invalid_null_aware_operator + import 'package:fake_async/fake_async.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; @@ -43,8 +45,9 @@ void main() { test('should report screen change when a route is pushed', () { fakeAsync((async) { observer.didPush(route, previousRoute); - - async.elapse(const Duration(milliseconds: 1000)); + WidgetsBinding.instance?.handleBeginFrame(Duration.zero); + WidgetsBinding.instance?.handleDrawFrame(); + async.elapse(const Duration(milliseconds: 2000)); verify( mScreenLoadingManager.startUiTrace(screen, screen), @@ -61,7 +64,8 @@ void main() { () { fakeAsync((async) { observer.didPop(route, previousRoute); - + WidgetsBinding.instance?.handleBeginFrame(Duration.zero); + WidgetsBinding.instance?.handleDrawFrame(); async.elapse(const Duration(milliseconds: 1000)); verify( @@ -79,7 +83,8 @@ void main() { () { fakeAsync((async) { observer.didPop(route, null); - + WidgetsBinding.instance?.handleBeginFrame(Duration.zero); + WidgetsBinding.instance?.handleDrawFrame(); async.elapse(const Duration(milliseconds: 1000)); verifyNever( @@ -98,7 +103,8 @@ void main() { const fallback = 'N/A'; observer.didPush(route, previousRoute); - + WidgetsBinding.instance?.handleBeginFrame(Duration.zero); + WidgetsBinding.instance?.handleDrawFrame(); async.elapse(const Duration(milliseconds: 1000)); verify( @@ -118,8 +124,9 @@ void main() { fakeAsync((async) { observer.didPush(route, previousRoute); - - async.elapse(const Duration(milliseconds: 1000)); + WidgetsBinding.instance?.handleBeginFrame(Duration.zero); + WidgetsBinding.instance?.handleDrawFrame(); + async.elapse(const Duration(milliseconds: 2000)); verify( mScreenLoadingManager.startUiTrace(maskedScreen, screen), diff --git a/packages/instabug_flutter/test/utils/private_views/private_views_manager_test.dart b/packages/instabug_flutter/test/utils/private_views/private_views_manager_test.dart new file mode 100644 index 000000000..ba9b1d5d7 --- /dev/null +++ b/packages/instabug_flutter/test/utils/private_views/private_views_manager_test.dart @@ -0,0 +1,161 @@ +import 'dart:typed_data'; +import 'dart:ui' as ui; + +import 'package:flutter/foundation.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/utils/private_views/private_views_manager.dart'; + +Future createTestImage() async { + // Create an empty 1x1 image + final recorder = ui.PictureRecorder(); + final canvas = Canvas(recorder); + final paint = Paint()..color = const Color(0xFFFF0000); // Red pixel + canvas.drawRect(const Rect.fromLTWH(0, 0, 1, 1), paint); + + final img = await recorder.endRecording().toImage(1, 1); + final byteData = await img.toByteData(format: ui.ImageByteFormat.png); + return byteData!.buffer.asUint8List(); +} + +void main() { + TestWidgetsFlutterBinding.ensureInitialized(); + WidgetsFlutterBinding.ensureInitialized(); + + group('PrivateViewsManager Tests', () { + late PrivateViewsManager manager; + + setUp(() { + manager = PrivateViewsManager.instance; + }); + + test('isPrivateWidget detects InstabugPrivateView', () { + final widget = InstabugPrivateView(child: Container()); + expect(PrivateViewsManager.isPrivateWidget(widget), isTrue); + }); + + test('isPrivateWidget detects InstabugSliverPrivateView', () { + final widget = InstabugSliverPrivateView(sliver: Container()); + expect(PrivateViewsManager.isPrivateWidget(widget), isTrue); + }); + + test('isPrivateWidget returns false for other widgets', () { + expect(PrivateViewsManager.isPrivateWidget(Container()), isFalse); + expect(PrivateViewsManager.isPrivateWidget(const Text('Hello')), isFalse); + }); + + testWidgets('getRectsOfPrivateViews detects masked views', (tester) async { + await tester.pumpWidget( + InstabugWidget( + child: MaterialApp( + home: Scaffold( + body: ListView( + children: const [ + SizedBox(width: 100, height: 100), + InstabugPrivateView(child: TextField()), + ], + ), + ), + ), + ), + ); + + final rects = manager.getRectsOfPrivateViews(); + expect(rects.length, 1); + }); + + testWidgets('getRectsOfPrivateViews detects masked labels', (tester) async { + await tester.pumpWidget( + InstabugWidget( + automasking: const [AutoMasking.labels], + child: MaterialApp( + home: Scaffold( + body: ListView( + children: const [ + SizedBox(width: 100, height: 100), + Text("Test 1"), + Text("Test 2"), + ], + ), + ), + ), + ), + ); + + final rects = manager.getRectsOfPrivateViews(); + expect(rects.length, 2); + }); + + testWidgets( + 'getPrivateViews returns correct list of masked view coordinates', + (tester) async { + await tester.pumpWidget( + MaterialApp( + home: Scaffold( + body: ListView( + children: const [ + InstabugPrivateView( + child: SizedBox(width: 50, height: 50), + ), + ], + ), + ), + ), + ); + + final privateViews = manager.getPrivateViews(); + expect( + privateViews.length % 4, + 0, + ); // Ensure coordinates come in sets of four + }); + + testWidgets('getRectsOfPrivateViews detects masked Media', (tester) async { + final validImage = await tester.runAsync(() => createTestImage()); + + await tester.pumpWidget( + InstabugWidget( + automasking: const [AutoMasking.media], + child: MaterialApp( + home: Scaffold( + body: Column( + children: [ + const SizedBox(width: 100, height: 100), + Image.memory( + validImage!, + ), + ], + ), + ), + ), + ), + ); + + final rects = manager.getRectsOfPrivateViews(); + expect(rects.length, 1); + }); + + testWidgets('getRectsOfPrivateViews detects masked textInputs', + (tester) async { + await tester.pumpWidget( + InstabugWidget( + automasking: const [AutoMasking.textInputs], + child: MaterialApp( + home: Scaffold( + body: ListView( + children: const [ + SizedBox(width: 100, height: 100), + TextField(), + ], + ), + ), + ), + ), + ); + + final rects = manager.getRectsOfPrivateViews(); + expect(rects.length, 1); + }); + }); +} diff --git a/test/utils/screen_loading/instabug_capture_screen_loading_test.dart b/packages/instabug_flutter/test/utils/screen_loading/instabug_capture_screen_loading_test.dart similarity index 100% rename from test/utils/screen_loading/instabug_capture_screen_loading_test.dart rename to packages/instabug_flutter/test/utils/screen_loading/instabug_capture_screen_loading_test.dart diff --git a/test/utils/screen_loading/screen_loading_manager_test.dart b/packages/instabug_flutter/test/utils/screen_loading/screen_loading_manager_test.dart similarity index 100% rename from test/utils/screen_loading/screen_loading_manager_test.dart rename to packages/instabug_flutter/test/utils/screen_loading/screen_loading_manager_test.dart diff --git a/test/utils/screen_loading/screen_loading_trace_test.dart b/packages/instabug_flutter/test/utils/screen_loading/screen_loading_trace_test.dart similarity index 100% rename from test/utils/screen_loading/screen_loading_trace_test.dart rename to packages/instabug_flutter/test/utils/screen_loading/screen_loading_trace_test.dart diff --git a/test/utils/screen_loading/ui_trace_test.dart b/packages/instabug_flutter/test/utils/screen_loading/ui_trace_test.dart similarity index 100% rename from test/utils/screen_loading/ui_trace_test.dart rename to packages/instabug_flutter/test/utils/screen_loading/ui_trace_test.dart diff --git a/test/utils/screen_name_masker_test.dart b/packages/instabug_flutter/test/utils/screen_name_masker_test.dart similarity index 100% rename from test/utils/screen_name_masker_test.dart rename to packages/instabug_flutter/test/utils/screen_name_masker_test.dart diff --git a/packages/instabug_flutter/test/utils/user_steps/instabug_user_steps_test.dart b/packages/instabug_flutter/test/utils/user_steps/instabug_user_steps_test.dart new file mode 100644 index 000000000..9ac05e4cb --- /dev/null +++ b/packages/instabug_flutter/test/utils/user_steps/instabug_user_steps_test.dart @@ -0,0 +1,298 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/utils/user_steps/user_step_details.dart'; +import 'package:mockito/mockito.dart'; + +import '../../instabug_test.mocks.dart'; + +void main() { + late MockInstabugHostApi mockInstabugHostApi; + + setUp(() { + mockInstabugHostApi = MockInstabugHostApi(); + Instabug.$setHostApi(mockInstabugHostApi); + }); + + Widget buildTestWidget(Widget child) { + return MaterialApp(home: InstabugUserSteps(child: child)); + } + + group('InstabugUserSteps Widget', () { + testWidgets('builds child widget correctly', (tester) async { + await tester.pumpWidget(buildTestWidget(const Text('Test Widget'))); + expect(find.text('Test Widget'), findsOneWidget); + }); + + testWidgets('detects tap gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + GestureDetector(onTap: () {}, child: const Text('Tap Me')), + ), + ); + + await tester.tap(find.text('Tap Me')); + await tester.pumpAndSettle(); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.tap.toString(), + any, + any, + ), + ).called(1); + }); + + testWidgets('detects long press gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + GestureDetector( + onLongPress: () {}, + child: const Text('Long Press Me'), + ), + ), + ); + + final gesture = await tester + .startGesture(tester.getCenter(find.text('Long Press Me'))); + await tester + .pump(const Duration(seconds: 2)); // Simulate long press duration + await gesture.up(); + + await tester.pump(); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.longPress.toString(), + any, + any, + ), + ).called(1); + }); + + group('Swipe Gestures', () { + const scrollOffset = Offset(0, -200); + const smallScrollOffset = Offset(0, -20); + + testWidgets('detects scroll gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + ListView(children: List.generate(50, (i) => Text('Item $i'))), + ), + ); + + await tester.fling(find.byType(ListView), scrollOffset, 1000); + await tester.pumpAndSettle(); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.scroll.toString(), + any, + any, + ), + ).called(1); + }); + + testWidgets('ignores small swipe gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + ListView(children: List.generate(50, (i) => Text('Item $i'))), + ), + ); + + await tester.fling(find.byType(ListView), smallScrollOffset, 1000); + await tester.pumpAndSettle(); + + verifyNever( + mockInstabugHostApi.logUserSteps( + GestureType.scroll.toString(), + any, + any, + ), + ); + }); + + testWidgets('detects horizontal scroll', (tester) async { + await tester.pumpWidget( + buildTestWidget( + ListView( + scrollDirection: Axis.horizontal, + children: List.generate(20, (i) => Text('Item $i')), + ), + ), + ); + + await tester.drag(find.byType(ListView), const Offset(-300, 0)); + await tester.pumpAndSettle(); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.scroll.toString(), + argThat(contains('Left')), + "ListView", + ), + ).called(1); + }); + + testWidgets('detects vertical scroll direction', (tester) async { + await tester.pumpWidget( + buildTestWidget( + ListView(children: List.generate(20, (i) => Text('Item $i'))), + ), + ); + + await tester.drag(find.byType(ListView), const Offset(0, -300)); + await tester.pumpAndSettle(); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.scroll.toString(), + argThat(contains('Down')), + "ListView", + ), + ).called(1); + }); + + testWidgets('does not log small scroll gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + ListView(children: List.generate(20, (i) => Text('Item $i'))), + ), + ); + + await tester.drag(find.byType(ListView), const Offset(0, -10)); + await tester.pumpAndSettle(); + + verifyNever( + mockInstabugHostApi.logUserSteps( + GestureType.scroll.toString(), + argThat(contains('Down')), + "ListView", + ), + ); + }); + }); + + group('Pinch Gestures', () { + testWidgets('handles pinch gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + Transform.scale( + scale: 1.0, + child: const Icon(Icons.add, size: 300), + ), + ), + ); + + final iconFinder = find.byIcon(Icons.add); + final pinchStart = tester.getCenter(iconFinder); + + final gesture1 = await tester.startGesture(pinchStart); + final gesture2 = + await tester.startGesture(pinchStart + const Offset(100.0, 0.0)); + + await tester.pump(); + await gesture1.moveTo(pinchStart + const Offset(150.0, 0.0)); + await gesture2.moveTo(pinchStart + const Offset(70.0, 0.0)); + + await gesture1.up(); + await gesture2.up(); + + await tester.pump(const Duration(seconds: 1)); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.pinch.toString(), + any, + any, + ), + ).called(1); + }); + + testWidgets('ignores small pinch gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + Transform.scale( + scale: 1.0, + child: const Icon(Icons.add, size: 300), + ), + ), + ); + + final iconFinder = find.byIcon(Icons.add); + final pinchStart = tester.getCenter(iconFinder); + + final gesture1 = await tester.startGesture(pinchStart); + final gesture2 = + await tester.startGesture(pinchStart + const Offset(100.0, 0.0)); + + await tester.pump(); + await gesture1.moveTo(pinchStart + const Offset(10.0, 0.0)); + await gesture2.moveTo(pinchStart + const Offset(110.0, 0.0)); + + await gesture1.up(); + await gesture2.up(); + + await tester.pump(const Duration(seconds: 1)); + + verifyNever( + mockInstabugHostApi.logUserSteps( + GestureType.pinch.toString(), + any, + any, + ), + ); + }); + }); + + group('Double Tap Gestures', () { + testWidgets('logs double tap gestures', (tester) async { + await tester.pumpWidget( + buildTestWidget( + GestureDetector( + onDoubleTap: () {}, + child: const Text('Double Tap Me'), + ), + ), + ); + + final doubleTapFinder = find.text('Double Tap Me'); + await tester.tap(doubleTapFinder); + await tester.pump(const Duration(milliseconds: 50)); + await tester.tap(doubleTapFinder); + await tester.pumpAndSettle(); + + verify( + mockInstabugHostApi.logUserSteps( + GestureType.doubleTap.toString(), + any, + any, + ), + ).called(1); + }); + + testWidgets('does not log single taps as double taps', (tester) async { + await tester.pumpWidget( + buildTestWidget( + GestureDetector( + onDoubleTap: () {}, + child: const Text('Double Tap Me'), + ), + ), + ); + + final doubleTapFinder = find.text('Double Tap Me'); + await tester.tap(doubleTapFinder); + await tester.pump(const Duration(milliseconds: 50)); + + verifyNever( + mockInstabugHostApi.logUserSteps( + GestureType.doubleTap.toString(), + any, + any, + ), + ); + }); + }); + }); +} diff --git a/packages/instabug_flutter/test/utils/user_steps/user_step_details_test.dart b/packages/instabug_flutter/test/utils/user_steps/user_step_details_test.dart new file mode 100644 index 000000000..0d992755f --- /dev/null +++ b/packages/instabug_flutter/test/utils/user_steps/user_step_details_test.dart @@ -0,0 +1,130 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:instabug_flutter/src/utils/user_steps/user_step_details.dart'; + +void main() { + group('GestureTypeText Extension', () { + test('GestureType.text returns correct text', () { + expect(GestureType.swipe.text, 'Swiped'); + expect(GestureType.scroll.text, 'Scrolled'); + expect(GestureType.tap.text, 'Tapped'); + expect(GestureType.pinch.text, 'Pinched'); + expect(GestureType.longPress.text, 'Long Pressed'); + expect(GestureType.doubleTap.text, 'Double Tapped'); + }); + }); + + group('UserStepDetails', () { + test('key returns correct value', () { + final widget = Container(key: const ValueKey('testKey')); + final element = widget.createElement(); + final details = UserStepDetails( + element: element, + isPrivate: false, + ); + + expect(details.key, 'testKey'); + }); + + test('widgetName identifies widget types correctly', () { + const inkWell = InkWell( + child: Text('Child'), + ); + final detailsInkWell = UserStepDetails( + element: inkWell.createElement(), + isPrivate: false, + ); + expect(detailsInkWell.widgetName, "Text Wrapped with InkWell"); + + final gestureDetector = GestureDetector( + child: const Icon(Icons.add), + ); + final detailsGestureDetector = UserStepDetails( + element: gestureDetector.createElement(), + isPrivate: false, + ); + expect( + detailsGestureDetector.widgetName, + "Icon Wrapped with GestureDetector", + ); + }); + + test('message constructs correctly with gestureType', () { + final widget = Container(key: const ValueKey('testKey')); + final element = widget.createElement(); + + final details = UserStepDetails( + element: element, + isPrivate: false, + gestureType: GestureType.tap, + ); + + expect( + details.message, + " Container with key 'testKey'", + ); + }); + + test('_getWidgetSpecificDetails handles slider widgets', () { + final slider = Slider(value: 0.5, onChanged: (_) {}); + final element = slider.createElement(); + + final details = UserStepDetails( + element: element, + isPrivate: false, + gestureType: GestureType.tap, + ); + + expect( + details.message, + contains(" Slider to '0.5'"), + ); + }); + + test('_getWidgetSpecificDetails handles null widget gracefully', () { + final details = UserStepDetails( + element: null, + isPrivate: false, + ); + + expect(details.message, isNull); + }); + + test('widgetName handles null child gracefully in InkWell', () { + const inkWell = InkWell(); + final details = UserStepDetails( + element: inkWell.createElement(), + isPrivate: false, + ); + expect(details.widgetName, "InkWell"); + }); + + test('message includes additional metadata when gestureMetaData is empty', + () { + final widget = Container(key: const ValueKey('testKey')); + final element = widget.createElement(); + + final details = UserStepDetails( + element: element, + isPrivate: false, + gestureType: GestureType.tap, + gestureMetaData: '', + ); + + expect( + details.message, + " Container with key 'testKey'", + ); + }); + + test('widgetName handles GestureDetector without child', () { + final gestureDetector = GestureDetector(); + final details = UserStepDetails( + element: gestureDetector.createElement(), + isPrivate: false, + ); + expect(details.widgetName, "GestureDetector"); + }); + }); +// }); +} diff --git a/packages/instabug_flutter/test/utils/user_steps/widget_utils_test.dart b/packages/instabug_flutter/test/utils/user_steps/widget_utils_test.dart new file mode 100644 index 000000000..631d49c61 --- /dev/null +++ b/packages/instabug_flutter/test/utils/user_steps/widget_utils_test.dart @@ -0,0 +1,111 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:instabug_flutter/src/utils/user_steps/widget_utils.dart'; + +void main() { + group('keyToStringValue', () { + test('returns null for null key', () { + expect(keyToStringValue(null), isNull); + }); + + test('returns value for ValueKey', () { + expect(keyToStringValue(const ValueKey('test')), 'test'); + }); + + test('returns value for GlobalObjectKey', () { + const globalKey = GlobalObjectKey('globalKey'); + expect(keyToStringValue(globalKey), 'globalKey'); + }); + + test('returns value for ObjectKey', () { + expect(keyToStringValue(const ObjectKey('objectKey')), 'objectKey'); + }); + + test('returns toString for unknown key type', () { + const customKey = Key('customKey'); + expect(keyToStringValue(customKey), 'customKey'); + }); + }); + + group('isButtonWidget', () { + test('detects ButtonStyleButton', () { + final button = + ElevatedButton(onPressed: () {}, child: const Text('Button')); + expect(isButtonWidget(button), true); + }); + + test('detects disabled MaterialButton', () { + const button = MaterialButton(onPressed: null); + expect(isButtonWidget(button), false); + }); + + test('detects IconButton with onPressed', () { + final button = IconButton(onPressed: () {}, icon: const Icon(Icons.add)); + expect(isButtonWidget(button), true); + }); + + test('returns false for non-button widget', () { + const widget = Text('Not a button'); + expect(isButtonWidget(widget), false); + }); + }); + + group('isTappedWidget', () { + test('detects button widget', () { + final button = + ElevatedButton(onPressed: () {}, child: const Text('Button')); + expect(isTappedWidget(button), true); + }); + + test('returns false for null widget', () { + expect(isTappedWidget(null), false); + }); + }); + + group('isTextWidget', () { + test('detects Text widget', () { + const widget = Text('Hello'); + expect(isTextWidget(widget), true); + }); + + test('returns false for non-text widget', () { + const widget = Icon(Icons.add); + expect(isTextWidget(widget), false); + }); + }); + + group('getLabel', () { + test('returns label from Text widget', () { + const widget = Text('Label'); + expect(getLabel(widget), 'Label'); + }); + + test('returns label from Tooltip', () { + const widget = Tooltip(message: 'Tooltip message', child: Text('Child')); + expect(getLabel(widget), 'Tooltip message'); + }); + + test('returns null for unlabeled widget', () { + const widget = Icon(Icons.add); + expect(getLabel(widget), isNull); + }); + }); + + group('getSliderValue', () { + test('returns value from Slider', () { + final widget = Slider(value: 0.5, onChanged: (_) {}); + expect(getSliderValue(widget), '0.5'); + }); + + test('returns value from RangeSlider', () { + final widget = + RangeSlider(values: const RangeValues(0.2, 0.8), onChanged: (_) {}); + expect(getSliderValue(widget), '(0.2,0.8)'); + }); + + test('returns null for non-slider widget', () { + const widget = Text('Not a slider'); + expect(getSliderValue(widget), isNull); + }); + }); +} diff --git a/test/w3_header_utils_test.dart b/packages/instabug_flutter/test/w3_header_utils_test.dart similarity index 100% rename from test/w3_header_utils_test.dart rename to packages/instabug_flutter/test/w3_header_utils_test.dart diff --git a/packages/instabug_flutter/yarn.lock b/packages/instabug_flutter/yarn.lock new file mode 100644 index 000000000..d86ee57b3 --- /dev/null +++ b/packages/instabug_flutter/yarn.lock @@ -0,0 +1,960 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@gitbeaker/core@^21.7.0": + version "21.7.0" + resolved "https://registry.yarnpkg.com/@gitbeaker/core/-/core-21.7.0.tgz#fcf7a12915d39f416e3f316d0a447a814179b8e5" + integrity sha512-cw72rE7tA27wc6JJe1WqeAj9v/6w0S7XJcEji+bRNjTlUfE1zgfW0Gf1mbGUi7F37SOABGCosQLfg9Qe63aIqA== + dependencies: + "@gitbeaker/requester-utils" "^21.7.0" + form-data "^3.0.0" + li "^1.3.0" + xcase "^2.0.1" + +"@gitbeaker/node@^21.3.0": + version "21.7.0" + resolved "https://registry.yarnpkg.com/@gitbeaker/node/-/node-21.7.0.tgz#2c19613f44ee497a8808c555abec614ebd2dfcad" + integrity sha512-OdM3VcTKYYqboOsnbiPcO0XimXXpYK4gTjARBZ6BWc+1LQXKmqo+OH6oUbyxOoaFu9hHECafIt3WZU3NM4sZTg== + dependencies: + "@gitbeaker/core" "^21.7.0" + "@gitbeaker/requester-utils" "^21.7.0" + form-data "^3.0.0" + got "^11.1.4" + xcase "^2.0.1" + +"@gitbeaker/requester-utils@^21.7.0": + version "21.7.0" + resolved "https://registry.yarnpkg.com/@gitbeaker/requester-utils/-/requester-utils-21.7.0.tgz#e9a9cfaf268d2a99eb7bbdc930943240a5f88878" + integrity sha512-eLTaVXlBnh8Qimj6QuMMA06mu/mLcJm3dy8nqhhn/Vm/D25sPrvpGwmbfFyvzj6QujPqtHvFfsCHtyZddL01qA== + dependencies: + form-data "^3.0.0" + query-string "^6.12.1" + xcase "^2.0.1" + +"@instabug/danger-plugin-coverage@Instabug/danger-plugin-coverage": + version "0.0.0-development" + resolved "git+ssh://git@github.com/Instabug/danger-plugin-coverage.git#a3941bd25421b0978ec636648a557b2280d0c9e6" + dependencies: + fast-xml-parser "^4.2.0" + +"@octokit/auth-token@^2.4.4": + version "2.5.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" + integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== + dependencies: + "@octokit/types" "^6.0.3" + +"@octokit/core@^3.5.1": + version "3.6.0" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.6.0.tgz#3376cb9f3008d9b3d110370d90e0a1fcd5fe6085" + integrity sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q== + dependencies: + "@octokit/auth-token" "^2.4.4" + "@octokit/graphql" "^4.5.8" + "@octokit/request" "^5.6.3" + "@octokit/request-error" "^2.0.5" + "@octokit/types" "^6.0.3" + before-after-hook "^2.2.0" + universal-user-agent "^6.0.0" + +"@octokit/endpoint@^6.0.1": + version "6.0.12" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" + integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== + dependencies: + "@octokit/types" "^6.0.3" + is-plain-object "^5.0.0" + universal-user-agent "^6.0.0" + +"@octokit/graphql@^4.5.8": + version "4.8.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" + integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== + dependencies: + "@octokit/request" "^5.6.0" + "@octokit/types" "^6.0.3" + universal-user-agent "^6.0.0" + +"@octokit/openapi-types@^12.11.0": + version "12.11.0" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.11.0.tgz#da5638d64f2b919bca89ce6602d059f1b52d3ef0" + integrity sha512-VsXyi8peyRq9PqIz/tpqiL2w3w80OgVMwBHltTml3LmVvXiphgeqmY9mvBw9Wu7e0QWk/fqD37ux8yP5uVekyQ== + +"@octokit/plugin-paginate-rest@^2.16.8": + version "2.21.3" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.21.3.tgz#7f12532797775640dbb8224da577da7dc210c87e" + integrity sha512-aCZTEf0y2h3OLbrgKkrfFdjRL6eSOo8komneVQJnYecAxIej7Bafor2xhuDJOIFau4pk0i/P28/XgtbyPF0ZHw== + dependencies: + "@octokit/types" "^6.40.0" + +"@octokit/plugin-request-log@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" + integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== + +"@octokit/plugin-rest-endpoint-methods@^5.12.0": + version "5.16.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.16.2.tgz#7ee8bf586df97dd6868cf68f641354e908c25342" + integrity sha512-8QFz29Fg5jDuTPXVtey05BLm7OB+M8fnvE64RNegzX7U+5NUXcOcnpTIK0YfSHBg8gYd0oxIq3IZTe9SfPZiRw== + dependencies: + "@octokit/types" "^6.39.0" + deprecation "^2.3.1" + +"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" + integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== + dependencies: + "@octokit/types" "^6.0.3" + deprecation "^2.0.0" + once "^1.4.0" + +"@octokit/request@^5.6.0", "@octokit/request@^5.6.3": + version "5.6.3" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.3.tgz#19a022515a5bba965ac06c9d1334514eb50c48b0" + integrity sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A== + dependencies: + "@octokit/endpoint" "^6.0.1" + "@octokit/request-error" "^2.1.0" + "@octokit/types" "^6.16.1" + is-plain-object "^5.0.0" + node-fetch "^2.6.7" + universal-user-agent "^6.0.0" + +"@octokit/rest@^16.43.0 || ^17.11.0 || ^18.12.0", "@octokit/rest@^18.12.0": + version "18.12.0" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" + integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== + dependencies: + "@octokit/core" "^3.5.1" + "@octokit/plugin-paginate-rest" "^2.16.8" + "@octokit/plugin-request-log" "^1.0.4" + "@octokit/plugin-rest-endpoint-methods" "^5.12.0" + +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": + version "6.41.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.41.0.tgz#e58ef78d78596d2fb7df9c6259802464b5f84a04" + integrity sha512-eJ2jbzjdijiL3B4PrSQaSjuF2sPEQPVCPzBvTHJD9Nz+9dw2SGH4K4xeQJ77YfTq5bRQ+bD8wT11JbeDPmxmGg== + dependencies: + "@octokit/openapi-types" "^12.11.0" + +"@sindresorhus/is@^4.0.0": + version "4.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" + integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== + +"@szmarczak/http-timer@^4.0.5": + version "4.0.6" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.6.tgz#b4a914bb62e7c272d4e5989fe4440f812ab1d807" + integrity sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w== + dependencies: + defer-to-connect "^2.0.0" + +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + +"@types/cacheable-request@^6.0.1": + version "6.0.3" + resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.3.tgz#a430b3260466ca7b5ca5bfd735693b36e7a9d183" + integrity sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw== + dependencies: + "@types/http-cache-semantics" "*" + "@types/keyv" "^3.1.4" + "@types/node" "*" + "@types/responselike" "^1.0.0" + +"@types/http-cache-semantics@*": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" + integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== + +"@types/keyv@^3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.4.tgz#3ccdb1c6751b0c7e52300bcdacd5bcbf8faa75b6" + integrity sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg== + dependencies: + "@types/node" "*" + +"@types/node@*": + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== + +"@types/responselike@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" + integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== + dependencies: + "@types/node" "*" + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +async-retry@1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/async-retry/-/async-retry-1.2.3.tgz#a6521f338358d322b1a0012b79030c6f411d1ce0" + integrity sha512-tfDb02Th6CE6pJUF2gjW5ZVjsgwlucVXOEQMvEX9JgSJMs9gAX+Nz3xRuJBKuUYjTSYORqvDBORdAQ3LU59g7Q== + dependencies: + retry "0.12.0" + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +before-after-hook@^2.2.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" + integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA== + +cacheable-lookup@^5.0.3: + version "5.0.4" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" + integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== + +cacheable-request@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.2.tgz#ea0d0b889364a25854757301ca12b2da77f91d27" + integrity sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew== + dependencies: + clone-response "^1.0.2" + get-stream "^5.1.0" + http-cache-semantics "^4.0.0" + keyv "^4.0.0" + lowercase-keys "^2.0.0" + normalize-url "^6.0.1" + responselike "^2.0.0" + +chalk@^2.3.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +clone-response@^1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.3.tgz#af2032aa47816399cf5f0a1d0db902f517abb8c3" + integrity sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA== + dependencies: + mimic-response "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +colors@1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +commander@^2.18.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +core-js@^3.8.2: + version "3.30.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.30.0.tgz#64ac6f83bc7a49fd42807327051701d4b1478dea" + integrity sha512-hQotSSARoNh1mYPi9O2YaWeiq/cEB95kOrFb4NCrO4RIFt1qqNpKsaE+vy/L3oiqvND5cThqXzUU3r9F7Efztg== + +danger@^11.2.5: + version "11.2.5" + resolved "https://registry.yarnpkg.com/danger/-/danger-11.2.5.tgz#e0f20fbbc35dedff83a67595a684425c5711606a" + integrity sha512-t3M20P0TsslkEkakha1PJHLyD+KxbHHdlhsauC/a53GQgQFO3aKz3Zg5YCHJ+javp0gVkPcUgFrgc7voW1Qp6g== + dependencies: + "@gitbeaker/node" "^21.3.0" + "@octokit/rest" "^18.12.0" + async-retry "1.2.3" + chalk "^2.3.0" + commander "^2.18.0" + core-js "^3.8.2" + debug "^4.1.1" + fast-json-patch "^3.0.0-1" + get-stdin "^6.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" + hyperlinker "^1.0.0" + json5 "^2.1.0" + jsonpointer "^5.0.0" + jsonwebtoken "^9.0.0" + lodash.find "^4.6.0" + lodash.includes "^4.3.0" + lodash.isobject "^3.0.2" + lodash.keys "^4.0.8" + lodash.mapvalues "^4.6.0" + lodash.memoize "^4.1.2" + memfs-or-file-map-to-github-branch "^1.2.1" + micromatch "^4.0.4" + node-cleanup "^2.1.2" + node-fetch "^2.6.7" + override-require "^1.1.1" + p-limit "^2.1.0" + parse-diff "^0.7.0" + parse-git-config "^2.0.3" + parse-github-url "^1.0.2" + parse-link-header "^2.0.0" + pinpoint "^1.1.0" + prettyjson "^1.2.1" + readline-sync "^1.4.9" + regenerator-runtime "^0.13.9" + require-from-string "^2.0.2" + supports-hyperlinks "^1.0.1" + +debug@4, debug@^4.1.1: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +decode-uri-component@^0.2.0: + version "0.2.2" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" + integrity sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ== + +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +defer-to-connect@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" + integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +deprecation@^2.0.0, deprecation@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/deprecation/-/deprecation-2.3.1.tgz#6368cbdb40abf3373b525ac87e4a260c3a700919" + integrity sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ== + +ecdsa-sig-formatter@1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" + integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== + dependencies: + safe-buffer "^5.0.1" + +end-of-stream@^1.1.0: + version "1.4.4" + resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" + integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== + dependencies: + once "^1.4.0" + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +expand-tilde@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/expand-tilde/-/expand-tilde-2.0.2.tgz#97e801aa052df02454de46b02bf621642cdc8502" + integrity sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw== + dependencies: + homedir-polyfill "^1.0.1" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug== + dependencies: + is-extendable "^0.1.0" + +fast-json-patch@^3.0.0-1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/fast-json-patch/-/fast-json-patch-3.1.1.tgz#85064ea1b1ebf97a3f7ad01e23f9337e72c66947" + integrity sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ== + +fast-xml-parser@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/fast-xml-parser/-/fast-xml-parser-4.2.0.tgz#6db2ba33b95b8b4af93f94fe024d4b4d02a50855" + integrity sha512-+zVQv4aVTO+o8oRUyRL7PjgeVo1J6oP8Cw2+a8UTZQcj5V0yUK5T63gTN0ldgiHDPghUjKc4OpT6SwMTwnOQug== + dependencies: + strnum "^1.0.5" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +filter-obj@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" + integrity sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ== + +form-data@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" + integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +fs-exists-sync@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/fs-exists-sync/-/fs-exists-sync-0.1.0.tgz#982d6893af918e72d08dec9e8673ff2b5a8d6add" + integrity sha512-cR/vflFyPZtrN6b38ZyWxpWdhlXrzZEBawlpBQMq7033xVY7/kg0GDMBK5jg8lDYQckdJ5x/YC88lM3C7VMsLg== + +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + +get-stream@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" + integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== + dependencies: + pump "^3.0.0" + +git-config-path@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/git-config-path/-/git-config-path-1.0.1.tgz#6d33f7ed63db0d0e118131503bab3aca47d54664" + integrity sha512-KcJ2dlrrP5DbBnYIZ2nlikALfRhKzNSX0stvv3ImJ+fvC4hXKoV+U+74SV0upg+jlQZbrtQzc0bu6/Zh+7aQbg== + dependencies: + extend-shallow "^2.0.1" + fs-exists-sync "^0.1.0" + homedir-polyfill "^1.0.0" + +got@^11.1.4: + version "11.8.6" + resolved "https://registry.yarnpkg.com/got/-/got-11.8.6.tgz#276e827ead8772eddbcfc97170590b841823233a" + integrity sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g== + dependencies: + "@sindresorhus/is" "^4.0.0" + "@szmarczak/http-timer" "^4.0.5" + "@types/cacheable-request" "^6.0.1" + "@types/responselike" "^1.0.0" + cacheable-lookup "^5.0.3" + cacheable-request "^7.0.2" + decompress-response "^6.0.0" + http2-wrapper "^1.0.0-beta.5.2" + lowercase-keys "^2.0.0" + p-cancelable "^2.0.0" + responselike "^2.0.0" + +has-flag@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-2.0.0.tgz#e8207af1cc7b30d446cc70b734b5e8be18f88d51" + integrity sha512-P+1n3MnwjR/Epg9BBo1KT8qbye2g2Ou4sFumihwt6I4tsUX7jnLcX4BTOSKg/B1ZrIYMN9FcEnG4x5a7NB8Eng== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +homedir-polyfill@^1.0.0, homedir-polyfill@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz#743298cef4e5af3e194161fbadcc2151d3a058e8" + integrity sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA== + dependencies: + parse-passwd "^1.0.0" + +http-cache-semantics@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" + integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== + +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +http2-wrapper@^1.0.0-beta.5.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-1.0.3.tgz#b8f55e0c1f25d4ebd08b3b0c2c079f9590800b3d" + integrity sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.0.0" + +https-proxy-agent@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + +hyperlinker@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/hyperlinker/-/hyperlinker-1.0.0.tgz#23dc9e38a206b208ee49bc2d6c8ef47027df0c0e" + integrity sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ== + +ini@^1.3.5: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + +is-extendable@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-object@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" + integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== + +json-buffer@3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.1.tgz#9338802a30d3b6605fbe0613e094008ca8c05a13" + integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== + +json5@^2.1.0: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +jsonpointer@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" + integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== + +jsonwebtoken@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz#d0faf9ba1cc3a56255fe49c0961a67e520c1926d" + integrity sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw== + dependencies: + jws "^3.2.2" + lodash "^4.17.21" + ms "^2.1.1" + semver "^7.3.8" + +jwa@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-1.4.1.tgz#743c32985cb9e98655530d53641b66c8645b039a" + integrity sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA== + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.11" + safe-buffer "^5.0.1" + +jws@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/jws/-/jws-3.2.2.tgz#001099f3639468c9414000e99995fa52fb478304" + integrity sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA== + dependencies: + jwa "^1.4.1" + safe-buffer "^5.0.1" + +keyv@^4.0.0: + version "4.5.2" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.2.tgz#0e310ce73bf7851ec702f2eaf46ec4e3805cce56" + integrity sha512-5MHbFaKn8cNSmVW7BYnijeAVlE4cYA/SVkifVgrh7yotnfhKmjuXpDKjrABLnT0SfHWV21P8ow07OGfRrNDg8g== + dependencies: + json-buffer "3.0.1" + +li@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/li/-/li-1.3.0.tgz#22c59bcaefaa9a8ef359cf759784e4bf106aea1b" + integrity sha512-z34TU6GlMram52Tss5mt1m//ifRIpKH5Dqm7yUVOdHI+BQCs9qGPHFaCUTIzsWX7edN30aa2WrPwR7IO10FHaw== + +lodash.find@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.find/-/lodash.find-4.6.0.tgz#cb0704d47ab71789ffa0de8b97dd926fb88b13b1" + integrity sha512-yaRZoAV3Xq28F1iafWN1+a0rflOej93l1DQUejs3SZ41h2O9UJBoS9aueGjPDgAl4B6tPC0NuuchLKaDQQ3Isg== + +lodash.includes@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" + integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== + +lodash.isobject@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-3.0.2.tgz#3c8fb8d5b5bf4bf90ae06e14f2a530a4ed935e1d" + integrity sha512-3/Qptq2vr7WeJbB4KHUSKlq8Pl7ASXi3UG6CMbBm8WRtXi8+GHm7mKaU3urfpSEzWe2wCIChs6/sdocUsTKJiA== + +lodash.keys@^4.0.8: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-4.2.0.tgz#a08602ac12e4fb83f91fc1fb7a360a4d9ba35205" + integrity sha512-J79MkJcp7Df5mizHiVNpjoHXLi4HLjh9VLS/M7lQSGoQ+0oQ+lWEigREkqKyizPB1IawvQLLKY8mzEcm1tkyxQ== + +lodash.mapvalues@^4.6.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz#1bafa5005de9dd6f4f26668c30ca37230cc9689c" + integrity sha512-JPFqXFeZQ7BfS00H58kClY7SPVeHertPE0lNuCyZ26/XlN8TvakYD7b9bGyNmXbT/D3BbtPAAmq90gPWqLkxlQ== + +lodash.memoize@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" + integrity sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag== + +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +lowercase-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" + integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +memfs-or-file-map-to-github-branch@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/memfs-or-file-map-to-github-branch/-/memfs-or-file-map-to-github-branch-1.2.1.tgz#fdb9a85408262316a9bd5567409bf89be7d72f96" + integrity sha512-I/hQzJ2a/pCGR8fkSQ9l5Yx+FQ4e7X6blNHyWBm2ojeFLT3GVzGkTj7xnyWpdclrr7Nq4dmx3xrvu70m3ypzAQ== + dependencies: + "@octokit/rest" "^16.43.0 || ^17.11.0 || ^18.12.0" + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mimic-response@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b" + integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ== + +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + +minimist@^1.2.0: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +node-cleanup@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/node-cleanup/-/node-cleanup-2.1.2.tgz#7ac19abd297e09a7f72a71545d951b517e4dde2c" + integrity sha512-qN8v/s2PAJwGUtr1/hYTpNKlD6Y9rc4p8KSmJXyGdYGZsDGKXrGThikLFP9OCHFeLeEpQzPwiAtdIvBLqm//Hw== + +node-fetch@^2.6.7: + version "2.6.9" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.9.tgz#7c7f744b5cc6eb5fd404e0c7a9fec630a55657e6" + integrity sha512-DJm/CJkZkRjKKj4Zi4BsKVZh3ValV5IR5s7LVZnW+6YMh0W1BfNA8XSs6DLMGYlId5F3KnA70uu2qepcR08Qqg== + dependencies: + whatwg-url "^5.0.0" + +normalize-url@^6.0.1: + version "6.1.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" + integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== + +once@^1.3.1, once@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +override-require@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/override-require/-/override-require-1.1.1.tgz#6ae22fadeb1f850ffb0cf4c20ff7b87e5eb650df" + integrity sha512-eoJ9YWxFcXbrn2U8FKT6RV+/Kj7fiGAB1VvHzbYKt8xM5ZuKZgCGvnHzDxmreEjcBH28ejg5MiOH4iyY1mQnkg== + +p-cancelable@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" + integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== + +p-limit@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-diff@^0.7.0: + version "0.7.1" + resolved "https://registry.yarnpkg.com/parse-diff/-/parse-diff-0.7.1.tgz#9b7a2451c3725baf2c87c831ba192d40ee2237d4" + integrity sha512-1j3l8IKcy4yRK2W4o9EYvJLSzpAVwz4DXqCewYyx2vEwk2gcf3DBPqc8Fj4XV3K33OYJ08A8fWwyu/ykD/HUSg== + +parse-git-config@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-2.0.3.tgz#6fb840d4a956e28b971c97b33a5deb73a6d5b6bb" + integrity sha512-Js7ueMZOVSZ3tP8C7E3KZiHv6QQl7lnJ+OkbxoaFazzSa2KyEHqApfGbU3XboUgUnq4ZuUmskUpYKTNx01fm5A== + dependencies: + expand-tilde "^2.0.2" + git-config-path "^1.0.1" + ini "^1.3.5" + +parse-github-url@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395" + integrity sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw== + +parse-link-header@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/parse-link-header/-/parse-link-header-2.0.0.tgz#949353e284f8aa01f2ac857a98f692b57733f6b7" + integrity sha512-xjU87V0VyHZybn2RrCX5TIFGxTVZE6zqqZWMPlIKiSKuWh/X5WZdt+w1Ki1nXB+8L/KtL+nZ4iq+sfI6MrhhMw== + dependencies: + xtend "~4.0.1" + +parse-passwd@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-passwd/-/parse-passwd-1.0.0.tgz#6d5b934a456993b23d37f40a382d6f1666a8e5c6" + integrity sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pinpoint@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pinpoint/-/pinpoint-1.1.0.tgz#0cf7757a6977f1bf7f6a32207b709e377388e874" + integrity sha512-+04FTD9x7Cls2rihLlo57QDCcHoLBGn5Dk51SwtFBWkUWLxZaBXyNVpCw1S+atvE7GmnFjeaRZ0WLq3UYuqAdg== + +prettyjson@^1.2.1: + version "1.2.5" + resolved "https://registry.yarnpkg.com/prettyjson/-/prettyjson-1.2.5.tgz#ef3cfffcc70505c032abc59785884b4027031835" + integrity sha512-rksPWtoZb2ZpT5OVgtmy0KHVM+Dca3iVwWY9ifwhcexfjebtgjg3wmrUt9PvJ59XIYBcknQeYHD8IAnVlh9lAw== + dependencies: + colors "1.4.0" + minimist "^1.2.0" + +pump@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" + integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== + dependencies: + end-of-stream "^1.1.0" + once "^1.3.1" + +query-string@^6.12.1: + version "6.14.1" + resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" + integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== + dependencies: + decode-uri-component "^0.2.0" + filter-obj "^1.1.0" + split-on-first "^1.0.0" + strict-uri-encode "^2.0.0" + +quick-lru@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-5.1.1.tgz#366493e6b3e42a3a6885e2e99d18f80fb7a8c932" + integrity sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA== + +readline-sync@^1.4.9: + version "1.4.10" + resolved "https://registry.yarnpkg.com/readline-sync/-/readline-sync-1.4.10.tgz#41df7fbb4b6312d673011594145705bf56d8873b" + integrity sha512-gNva8/6UAe8QYepIQH/jQ2qn91Qj0B9sYjMBBs3QOB8F2CXcKgLxQaJRP76sWVRQt+QU+8fAkCbCvjjMFu7Ycw== + +regenerator-runtime@^0.13.9: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + +resolve-alpn@^1.0.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" + integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== + +responselike@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.1.tgz#9a0bc8fdc252f3fb1cca68b016591059ba1422bc" + integrity sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw== + dependencies: + lowercase-keys "^2.0.0" + +retry@0.12.0: + version "0.12.0" + resolved "https://registry.yarnpkg.com/retry/-/retry-0.12.0.tgz#1b42a6266a21f07421d1b0b54b7dc167b01c013b" + integrity sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow== + +safe-buffer@^5.0.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +semver@^7.3.8: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + +split-on-first@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" + integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== + +strict-uri-encode@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" + integrity sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ== + +strnum@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/strnum/-/strnum-1.0.5.tgz#5c4e829fe15ad4ff0d20c3db5ac97b73c9b072db" + integrity sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA== + +supports-color@^5.0.0, supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-hyperlinks@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz#71daedf36cc1060ac5100c351bb3da48c29c0ef7" + integrity sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw== + dependencies: + has-flag "^2.0.0" + supports-color "^5.0.0" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tr46@~0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== + +typescript@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== + +universal-user-agent@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-6.0.0.tgz#3381f8503b251c0d9cd21bc1de939ec9df5480ee" + integrity sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w== + +webidl-conversions@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== + +whatwg-url@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== + dependencies: + tr46 "~0.0.3" + webidl-conversions "^3.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +xcase@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/xcase/-/xcase-2.0.1.tgz#c7fa72caa0f440db78fd5673432038ac984450b9" + integrity sha512-UmFXIPU+9Eg3E9m/728Bii0lAIuoc+6nbrNUKaRPJOFp91ih44qqGlWtxMB6kXFrRD6po+86ksHM5XHCfk6iPw== + +xtend@~4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== diff --git a/packages/instabug_flutter_modular/.metadata b/packages/instabug_flutter_modular/.metadata new file mode 100644 index 000000000..e5c802c48 --- /dev/null +++ b/packages/instabug_flutter_modular/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "367f9ea16bfae1ca451b9cc27c1366870b187ae2" + channel: "stable" + +project_type: package diff --git a/packages/instabug_flutter_modular/CHANGELOG.md b/packages/instabug_flutter_modular/CHANGELOG.md new file mode 100644 index 000000000..b968a85f9 --- /dev/null +++ b/packages/instabug_flutter_modular/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +## [v1.0.0](https://github.com/Instabug/instabug_flutter_modular/commits/v1.0.0/) (July 7, 2024) + +### Added + +- Add support for capturing screen loading time in Flutter Modular v5 ([#477](https://github.com/Instabug/Instabug-Flutter/pull/477)). diff --git a/packages/instabug_flutter_modular/LICENSE b/packages/instabug_flutter_modular/LICENSE new file mode 100644 index 000000000..80d729766 --- /dev/null +++ b/packages/instabug_flutter_modular/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Instabug + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/instabug_flutter_modular/README.md b/packages/instabug_flutter_modular/README.md new file mode 100644 index 000000000..6e907fc90 --- /dev/null +++ b/packages/instabug_flutter_modular/README.md @@ -0,0 +1,55 @@ +# Instabug Flutter Modular + +[![Pub](https://img.shields.io/pub/v/instabug_flutter_modular.svg)](https://pub.dev/packages/instabug_flutter_modular) +[![Twitter](https://img.shields.io/badge/twitter-@Instabug-blue.svg)](https://twitter.com/Instabug) + +An add-on for the [Instabug Flutter SDK](https://github.com/Instabug/Instabug-Flutter) that provides screen loading support for [Flutter Modular](https://pub.dev/packages/flutter_modular) v5. + +## Installation + +1. Add `instabug_flutter_modular` to your `pubspec.yaml` file. + +```yaml +dependencies: + instabug_flutter_modular: +``` + +2. Install the package by running the following command. + +```sh +flutter pub get +``` + +## Usage + +1. Wrap your `AppParentModule` inside `InstabugModule`: + + +```dart + +void main() { + //... + + runApp( + ModularApp( + module: InstabugModule(AppModule()), + child: const MyApp(), + ), + ); +} +``` + +2. Add `InstabugNavigatorObserver` to your navigation observers list: + +```dart +@override +Widget build(BuildContext context) { + return MaterialApp.router( + routeInformationParser: Modular.routeInformationParser, + routerDelegate: Modular.routerDelegate + ..setObservers([InstabugNavigatorObserver()]), + + // ... + ); +} +``` \ No newline at end of file diff --git a/packages/instabug_flutter_modular/example/.gitignore b/packages/instabug_flutter_modular/example/.gitignore new file mode 100644 index 000000000..c2b055ffd --- /dev/null +++ b/packages/instabug_flutter_modular/example/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.metadata +.pub-cache/ +.pub/ +/build/ + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release diff --git a/packages/instabug_flutter_modular/example/android/.gitignore b/packages/instabug_flutter_modular/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/instabug_flutter_modular/example/android/app/build.gradle b/packages/instabug_flutter_modular/example/android/app/build.gradle new file mode 100644 index 000000000..b64cbfae0 --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/build.gradle @@ -0,0 +1,67 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +android { + namespace "com.example.flutter_modular_demo_app" + compileSdk flutter.compileSdkVersion + ndkVersion flutter.ndkVersion + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = '1.8' + } + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.flutter_modular_demo_app" + // You can update the following values to match your application needs. + // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. + minSdkVersion flutter.minSdkVersion + targetSdkVersion flutter.targetSdkVersion + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies {} diff --git a/packages/instabug_flutter_modular/example/android/app/src/debug/AndroidManifest.xml b/packages/instabug_flutter_modular/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/AndroidManifest.xml b/packages/instabug_flutter_modular/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..82cb28a05 --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/packages/instabug_flutter_modular/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 000000000..752fc185d --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,25 @@ +// Generated file. +// +// If you wish to remove Flutter's multidex support, delete this entire file. +// +// Modifications to this file should be done in a copy under a different name +// as this file may be regenerated. + +package io.flutter.app; + +import android.app.Application; +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link android.app.Application}, adding multidex support. + */ +public class FlutterMultiDexApplication extends Application { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/kotlin/com/example/flutter_modular_demo_app/MainActivity.kt b/packages/instabug_flutter_modular/example/android/app/src/main/kotlin/com/example/flutter_modular_demo_app/MainActivity.kt new file mode 100644 index 000000000..79f585c2c --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/kotlin/com/example/flutter_modular_demo_app/MainActivity.kt @@ -0,0 +1,5 @@ +package com.example.flutter_modular_demo_app + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/instabug_flutter_modular/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/drawable/launch_background.xml b/packages/instabug_flutter_modular/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/packages/instabug_flutter_modular/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/values-night/styles.xml b/packages/instabug_flutter_modular/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..06952be74 --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/values/styles.xml b/packages/instabug_flutter_modular/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..cb1ef8805 --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/main/res/xml/network_security_config.xml b/packages/instabug_flutter_modular/example/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 000000000..9db612408 --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,12 @@ + + + + localhost + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/android/app/src/profile/AndroidManifest.xml b/packages/instabug_flutter_modular/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..399f6981d --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/instabug_flutter_modular/example/android/build.gradle b/packages/instabug_flutter_modular/example/android/build.gradle new file mode 100644 index 000000000..bc157bd1a --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/build.gradle @@ -0,0 +1,18 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/instabug_flutter_modular/example/android/gradle.properties b/packages/instabug_flutter_modular/example/android/gradle.properties new file mode 100644 index 000000000..73c3168eb --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.jvmargs=-Xmx4G +android.useAndroidX=true +android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/packages/instabug_flutter_modular/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/instabug_flutter_modular/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..e1ca574ef --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip diff --git a/packages/instabug_flutter_modular/example/android/settings.gradle b/packages/instabug_flutter_modular/example/android/settings.gradle new file mode 100644 index 000000000..1d6d19b7f --- /dev/null +++ b/packages/instabug_flutter_modular/example/android/settings.gradle @@ -0,0 +1,26 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + } + settings.ext.flutterSdkPath = flutterSdkPath() + + includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "7.3.0" apply false + id "org.jetbrains.kotlin.android" version "1.7.10" apply false +} + +include ":app" diff --git a/packages/instabug_flutter_modular/example/ios/.gitignore b/packages/instabug_flutter_modular/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/instabug_flutter_modular/example/ios/Flutter/AppFrameworkInfo.plist b/packages/instabug_flutter_modular/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..7c5696400 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/instabug_flutter_modular/example/ios/Flutter/Debug.xcconfig b/packages/instabug_flutter_modular/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/instabug_flutter_modular/example/ios/Flutter/Release.xcconfig b/packages/instabug_flutter_modular/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/instabug_flutter_modular/example/ios/Podfile b/packages/instabug_flutter_modular/example/ios/Podfile new file mode 100644 index 000000000..d97f17e22 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Podfile @@ -0,0 +1,44 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '12.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) + target 'RunnerTests' do + inherit! :search_paths + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/example/ios/Podfile.lock b/packages/instabug_flutter_modular/example/ios/Podfile.lock similarity index 100% rename from example/ios/Podfile.lock rename to packages/instabug_flutter_modular/example/ios/Podfile.lock diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.pbxproj b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..99206dfba --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,728 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 327E711B528735FED991BFC4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2943C6CA26DB2D8358EBC2D7 /* Pods_Runner.framework */; }; + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 6D2169967115A81725A63418 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9C96F9B3DD34FEEAF2EB522D /* Pods_RunnerTests.framework */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = 97C146ED1CF9000F007C117D; + remoteInfo = Runner; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 22D0234AF76181345ADA0C95 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 2943C6CA26DB2D8358EBC2D7 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; + 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 42617FCCD3CC7E9232CA19EF /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; + 4B1FAE53C830CB656B3306A8 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; + 7046D924EA334C9701656E63 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 849846FA37D5C84AC76BC5B8 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9C96F9B3DD34FEEAF2EB522D /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 9D23D5A15863072900ABD324 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8B88E0EF1C0B1FCD941F5841 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 6D2169967115A81725A63418 /* Pods_RunnerTests.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 327E711B528735FED991BFC4 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 25EC9C0EE1DF0FD1150948F4 /* Pods */ = { + isa = PBXGroup; + children = ( + 22D0234AF76181345ADA0C95 /* Pods-Runner.debug.xcconfig */, + 9D23D5A15863072900ABD324 /* Pods-Runner.release.xcconfig */, + 7046D924EA334C9701656E63 /* Pods-Runner.profile.xcconfig */, + 4B1FAE53C830CB656B3306A8 /* Pods-RunnerTests.debug.xcconfig */, + 849846FA37D5C84AC76BC5B8 /* Pods-RunnerTests.release.xcconfig */, + 42617FCCD3CC7E9232CA19EF /* Pods-RunnerTests.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 331C8082294A63A400263BE5 /* RunnerTests */ = { + isa = PBXGroup; + children = ( + 331C807B294A618700263BE5 /* RunnerTests.swift */, + ); + path = RunnerTests; + sourceTree = ""; + }; + 94671C5E18FAC8DD353CE05B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 2943C6CA26DB2D8358EBC2D7 /* Pods_Runner.framework */, + 9C96F9B3DD34FEEAF2EB522D /* Pods_RunnerTests.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 331C8082294A63A400263BE5 /* RunnerTests */, + 25EC9C0EE1DF0FD1150948F4 /* Pods */, + 94671C5E18FAC8DD353CE05B /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 331C8080294A63A400263BE5 /* RunnerTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; + buildPhases = ( + 354470C9D30A896FFCE8DEA0 /* [CP] Check Pods Manifest.lock */, + 331C807D294A63A400263BE5 /* Sources */, + 331C807F294A63A400263BE5 /* Resources */, + 8B88E0EF1C0B1FCD941F5841 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + 331C8086294A63A400263BE5 /* PBXTargetDependency */, + ); + name = RunnerTests; + productName = RunnerTests; + productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 48A7DA0DEA99D4A15D3FE66A /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + FB8A21F1FDFF0427C21277F5 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 331C8080294A63A400263BE5 = { + CreatedOnToolsVersion = 14.0; + TestTargetID = 97C146ED1CF9000F007C117D; + }; + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + 331C8080294A63A400263BE5 /* RunnerTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 331C807F294A63A400263BE5 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 354470C9D30A896FFCE8DEA0 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 48A7DA0DEA99D4A15D3FE66A /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + FB8A21F1FDFF0427C21277F5 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 331C807D294A63A400263BE5 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 97C146ED1CF9000F007C117D /* Runner */; + targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterModularDemoApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 331C8088294A63A400263BE5 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 4B1FAE53C830CB656B3306A8 /* Pods-RunnerTests.debug.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterModularDemoApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Debug; + }; + 331C8089294A63A400263BE5 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 849846FA37D5C84AC76BC5B8 /* Pods-RunnerTests.release.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterModularDemoApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Release; + }; + 331C808A294A63A400263BE5 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 42617FCCD3CC7E9232CA19EF /* Pods-RunnerTests.profile.xcconfig */; + buildSettings = { + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + GENERATE_INFOPLIST_FILE = YES; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterModularDemoApp.RunnerTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterModularDemoApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterModularDemoApp; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 331C8088294A63A400263BE5 /* Debug */, + 331C8089294A63A400263BE5 /* Release */, + 331C808A294A63A400263BE5 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..8e3ca5dfe --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,98 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner/AppDelegate.swift b/packages/instabug_flutter_modular/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..70693e4a8 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..dc9ada472 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..7353c41ec Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..6ed2d933e Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cd7b0099 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..fe730945a Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..321773cd8 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..797d452e4 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..502f463a9 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..0ec303439 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..e9f5fea27 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..84ac32ae7 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..8953cba09 Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..0467bf12a Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/instabug_flutter_modular/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Base.lproj/Main.storyboard b/packages/instabug_flutter_modular/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Info.plist b/packages/instabug_flutter_modular/example/ios/Runner/Info.plist new file mode 100644 index 000000000..929983c33 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Info.plist @@ -0,0 +1,49 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Flutter Modular Demo App + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + flutter_modular_demo_app + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/instabug_flutter_modular/example/ios/Runner/Runner-Bridging-Header.h b/packages/instabug_flutter_modular/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/instabug_flutter_modular/example/ios/RunnerTests/RunnerTests.swift b/packages/instabug_flutter_modular/example/ios/RunnerTests/RunnerTests.swift new file mode 100644 index 000000000..86a7c3b1b --- /dev/null +++ b/packages/instabug_flutter_modular/example/ios/RunnerTests/RunnerTests.swift @@ -0,0 +1,12 @@ +import Flutter +import UIKit +import XCTest + +class RunnerTests: XCTestCase { + + func testExample() { + // If you add code to the Runner application, consider adding tests here. + // See https://developer.apple.com/documentation/xctest for more information about using XCTest. + } + +} diff --git a/packages/instabug_flutter_modular/example/lib/main.dart b/packages/instabug_flutter_modular/example/lib/main.dart new file mode 100644 index 000000000..d2c1c6100 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/main.dart @@ -0,0 +1,54 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:flutter_modular_demo_app/modules.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter_modular/instabug_flutter_modular.dart'; + +void main() { + runZonedGuarded( + () { + WidgetsFlutterBinding.ensureInitialized(); + + Instabug.init( + token: '6b41bc30dd42aac50794ef3ec8f74a74', + invocationEvents: [InvocationEvent.floatingButton], + debugLogsLevel: LogLevel.verbose, + ); + + FlutterError.onError = (FlutterErrorDetails details) { + Zone.current.handleUncaughtError(details.exception, details.stack!); + }; + runApp( + ModularApp( + module: InstabugModule(AppModule()), + child: const MyApp(), + ), + ); + }, + CrashReporting.reportCrash, + ); +} + +class MyApp extends StatefulWidget { + const MyApp({super.key}); + + @override + State createState() => _MyAppState(); +} + +class _MyAppState extends State { + @override + Widget build(BuildContext context) { + return MaterialApp.router( + routeInformationParser: Modular.routeInformationParser, + routerDelegate: Modular.routerDelegate + ..setObservers([InstabugNavigatorObserver()]), + title: 'Flutter Modular Demo', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/modules.dart b/packages/instabug_flutter_modular/example/lib/modules.dart new file mode 100644 index 000000000..f01d3d5f3 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/modules.dart @@ -0,0 +1,9 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:flutter_modular_demo_app/screens.dart'; + +part 'modules/app_module.dart'; + +part 'modules/second_module.dart'; + +part 'modules/third_module.dart'; diff --git a/packages/instabug_flutter_modular/example/lib/modules/app_module.dart b/packages/instabug_flutter_modular/example/lib/modules/app_module.dart new file mode 100644 index 000000000..f68cf08b5 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/modules/app_module.dart @@ -0,0 +1,20 @@ +part of '../modules.dart'; + +class AppModule extends Module { + @override + final List binds = [Bind.singleton((i) => Counter())]; + + @override + final List routes = [ + ChildRoute('/', child: (_, args) => const HomePage()), + ChildRoute('/simplePage', child: (_, args) => const SimplePage()), + ChildRoute('/complexPage', child: (_, args) => const ComplexPage()), + ChildRoute('/bindsPage', child: (_, args) => const ThirdModuleHomePage()), + WildcardRoute( + child: (p0, p1) => const NotFoundPage(), + ), + RedirectRoute('/redirect', to: '/simplePage?name=redirected'), + ModuleRoute('/secondModule', module: SecondModule()), + ModuleRoute('/thirdModule', module: ThirdModule()), + ]; +} diff --git a/packages/instabug_flutter_modular/example/lib/modules/second_module.dart b/packages/instabug_flutter_modular/example/lib/modules/second_module.dart new file mode 100644 index 000000000..b178f36be --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/modules/second_module.dart @@ -0,0 +1,31 @@ +part of '../modules.dart'; + +class SecondModule extends Module { + @override + final List binds = []; + + @override + List get routes => [ + ChildRoute( + '/', + child: (context, args) => const SecondModuleHomePage(), + children: [ + ChildRoute( + '/page1', + child: (context, args) => + const InternalPage(title: 'page 1', color: Colors.red), + ), + ChildRoute( + '/page2', + child: (context, args) => + const InternalPage(title: 'page 2', color: Colors.amber), + ), + ChildRoute( + '/page3', + child: (context, args) => + const InternalPage(title: 'page 3', color: Colors.green), + ), + ], + ), + ]; +} diff --git a/packages/instabug_flutter_modular/example/lib/modules/third_module.dart b/packages/instabug_flutter_modular/example/lib/modules/third_module.dart new file mode 100644 index 000000000..e14d83be0 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/modules/third_module.dart @@ -0,0 +1,21 @@ +part of '../modules.dart'; + +class ThirdModule extends Module { + @override + final List binds = []; + + @override + final List routes = [ + ChildRoute('/', child: (_, args) => const ThirdModuleHomePage()), + ]; +} + +class Counter { + int _number = 0; + + int get number => _number; + + void increment() => _number++; + + void decrement() => _number--; +} diff --git a/packages/instabug_flutter_modular/example/lib/screens.dart b/packages/instabug_flutter_modular/example/lib/screens.dart new file mode 100644 index 000000000..a067eb93b --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:flutter_modular_demo_app/modules.dart'; +import 'package:flutter_modular_demo_app/widgets.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; + +part 'screens/home_page.dart'; + +part 'screens/second_module_home_page.dart'; + +part 'screens/simple_page.dart'; + +part 'screens/third_module_home_page.dart'; + +part 'screens/not_found_page.dart'; + +part 'screens/complex_page.dart'; diff --git a/packages/instabug_flutter_modular/example/lib/screens/complex_page.dart b/packages/instabug_flutter_modular/example/lib/screens/complex_page.dart new file mode 100644 index 000000000..cac14c0d9 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens/complex_page.dart @@ -0,0 +1,95 @@ +part of '../screens.dart'; + +class ComplexPage extends StatelessWidget { + const ComplexPage({super.key}); + + @override + Widget build(BuildContext context) { + int numberOfWidgets = 100; + return Scaffold( + floatingActionButton: FloatingActionButton( + onPressed: () {}, + child: const Icon(Icons.add), + ), + appBar: AppBar( + title: const Text("Complex Page"), + ), + body: SafeArea( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Padding( + padding: EdgeInsets.all(16.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + CustomCard( + width: 40, + height: 40, + ), + SizedBox(width: 8), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CustomCard( + height: 10, + width: 150, + ), + SizedBox(height: 8), + CustomCard( + height: 10, + width: 200, + ), + ], + ), + ], + ), + ), + SizedBox( + height: 80, + child: ListView.separated( + itemBuilder: (_, __) => const CustomCard( + width: 80, + ), + separatorBuilder: (_, __) => const SizedBox(width: 8), + itemCount: numberOfWidgets, + scrollDirection: Axis.horizontal, + ), + ), + const SizedBox(height: 16), + Expanded( + child: ListView.separated( + padding: const EdgeInsets.all(16), + itemBuilder: (_, __) => const CustomCard( + height: 100, + ), + separatorBuilder: (_, __) => const SizedBox(height: 8), + itemCount: numberOfWidgets, + ), + ), + ], + ), + ), + ); + } +} + +class CustomCard extends StatelessWidget { + const CustomCard({super.key, this.width, this.height}); + + final double? width, height; + + @override + Widget build(BuildContext context) { + return Container( + width: width, + height: height, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + color: Colors.black12, + ), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/screens/home_page.dart b/packages/instabug_flutter_modular/example/lib/screens/home_page.dart new file mode 100644 index 000000000..d6a29c195 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens/home_page.dart @@ -0,0 +1,109 @@ +part of '../screens.dart'; +//ignore_for_file:invalid_use_of_internal_member + +class HomePage extends StatefulWidget { + const HomePage({super.key}); + + @override + State createState() => _HomePageState(); +} + +class _HomePageState extends State { + bool _instabug = true, _apm = true, _screenLoading = true, _uiTrace = true; + + @override + void didChangeDependencies() async { + super.didChangeDependencies(); + _instabug = await Instabug.isEnabled(); + _apm = await APM.isEnabled(); + _screenLoading = await APM.isScreenLoadingEnabled(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Home Page')), + body: SingleChildScrollView( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + CustomSwitchListTile( + value: _instabug, + onChanged: (value) { + Instabug.setEnabled(value); + setState(() => _instabug = value); + }, + title: "Instabug", + ), + CustomSwitchListTile( + value: _apm, + onChanged: (value) { + APM.setEnabled(value); + setState(() => _apm = value); + }, + title: "APM", + ), + CustomSwitchListTile( + value: _screenLoading, + onChanged: (value) { + APM.setScreenLoadingEnabled(value); + setState(() => _screenLoading = value); + }, + title: "Screen Loading", + ), + CustomSwitchListTile( + value: _uiTrace, + onChanged: (value) { + APM.setAutoUITraceEnabled(value); + setState(() => _uiTrace = value); + }, + title: "UI Trace", + ), + CustomButton( + onPressed: () => Modular.to.navigate('/simplePage'), + title: 'Navigate To Simple Page', + ), + CustomButton( + onPressed: () => Modular.to.pushNamed('/complexPage'), + title: 'Navigate To Complex Page', + ), + CustomButton( + onPressed: () => Modular.to.pushNamed('/simplePage'), + title: 'Navigate To Second Page (using push)', + ), + CustomButton( + onPressed: () => + Modular.to.navigate('/simplePage?name=Inastabug'), + title: 'Navigate To Second Page (with params)', + ), + CustomButton( + onPressed: () => Modular.to.navigate('/redirect'), + title: 'Navigate Using RedirectRoute', + ), + CustomButton( + onPressed: () => Modular.to.navigate('/bindsPage'), + title: 'Navigate To Binds Page', + ), + const SizedBox( + height: 32, + ), + CustomButton( + onPressed: () => Modular.to.navigate('/secondModule/'), + title: 'Navigate To Second Module (Nested Routes)', + ), + CustomButton( + onPressed: () => Modular.to.navigate('/thirdModule/'), + title: 'Navigate To Third Module (Binds)', + ), + CustomButton( + onPressed: () => Modular.to.navigate('/asde'), + title: 'Navigation History', + ), + ], + ), + ), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/screens/not_found_page.dart b/packages/instabug_flutter_modular/example/lib/screens/not_found_page.dart new file mode 100644 index 000000000..a17ee9176 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens/not_found_page.dart @@ -0,0 +1,18 @@ +part of '../screens.dart'; + +class NotFoundPage extends StatelessWidget { + const NotFoundPage({super.key}); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Not Found Page')), + body: Center( + child: CustomButton( + onPressed: () => Modular.to.navigate('/'), + title: 'Back To Home', + ), + ), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/screens/second_module_home_page.dart b/packages/instabug_flutter_modular/example/lib/screens/second_module_home_page.dart new file mode 100644 index 000000000..7fe3c9454 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens/second_module_home_page.dart @@ -0,0 +1,66 @@ +part of '../screens.dart'; + +class SecondModuleHomePage extends StatelessWidget { + const SecondModuleHomePage({super.key}); + + @override + Widget build(BuildContext context) { + final leading = SizedBox( + width: MediaQuery.of(context).size.width * 0.3, + child: NavigationListener( + builder: (context, child) => Column( + children: [ + ListTile( + title: const Text('Page 1'), + onTap: () => Modular.to.navigate('/secondModule/page1'), + selected: Modular.to.path.endsWith('/secondModule/page1'), + ), + ListTile( + title: const Text('Page 2'), + onTap: () => Modular.to.navigate('/secondModule/page2'), + selected: Modular.to.path.endsWith('/secondModule/page2'), + ), + ListTile( + title: const Text('Page 3'), + onTap: () => Modular.to.navigate('/secondModule/page3'), + selected: Modular.to.path.endsWith('/secondModule/page3'), + ), + const Spacer(), + ListTile( + title: const Text('Back To Home'), + onTap: () => Modular.to.navigate('/'), + ), + ], + ), + ), + ); + + return Scaffold( + appBar: AppBar(title: const Text('Second Module (Nested Routes)')), + body: SafeArea( + child: Row( + children: [ + leading, + Container(width: 1, color: Colors.black26), + const Expanded(child: RouterOutlet()), + ], + ), + ), + ); + } +} + +class InternalPage extends StatelessWidget { + final String title; + final Color color; + + const InternalPage({super.key, required this.title, required this.color}); + + @override + Widget build(BuildContext context) { + return Material( + color: color, + child: Center(child: Text(title)), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/screens/simple_page.dart b/packages/instabug_flutter_modular/example/lib/screens/simple_page.dart new file mode 100644 index 000000000..5d57e5510 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens/simple_page.dart @@ -0,0 +1,58 @@ +part of '../screens.dart'; + +class SimplePage extends StatelessWidget { + const SimplePage({super.key}); + + @override + Widget build(BuildContext context) { + final canPop = Modular.to.canPop(); + const int extendedMicroseconds = 50000; + + return Scaffold( + appBar: AppBar(title: const Text('Second Page')), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + if (Modular.args.queryParams.containsKey("name")) ...[ + Text( + "Parameters: ${Modular.args.queryParams["name"]}", + textAlign: TextAlign.center, + ), + const SizedBox(height: 16), + ], + CustomButton( + onPressed: () => + _extendScreenLoading(context, extendedMicroseconds), + title: 'Extend SCL for $extendedMicroseconds μs', + ), + CustomButton( + onPressed: () { + if (canPop) { + Modular.to.pop(); + } else { + Modular.to.navigate('/'); + } + }, + title: 'Back to Home ${canPop ? "(pop)" : ""}', + ), + ], + ), + ), + ); + } + + void _extendScreenLoading(BuildContext context, int microseconds) { + ScaffoldMessenger.of(context) + .showSnackBar( + SnackBar( + content: Text("extend Screen for $microseconds microseconds"), + duration: Duration(microseconds: microseconds), + ), + ) + .closed + .then((value) => APM.endScreenLoading()); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/screens/third_module_home_page.dart b/packages/instabug_flutter_modular/example/lib/screens/third_module_home_page.dart new file mode 100644 index 000000000..1f060b1a0 --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/screens/third_module_home_page.dart @@ -0,0 +1,50 @@ +part of '../screens.dart'; + +class ThirdModuleHomePage extends StatefulWidget { + const ThirdModuleHomePage({super.key}); + + @override + State createState() => _ThirdModuleHomePageState(); +} + +class _ThirdModuleHomePageState extends State { + final counter = Modular.get(); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar(title: const Text('Third Module (Binds)')), + body: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + IconButton( + onPressed: () => setState(() => counter.increment()), + icon: const Icon(Icons.add_circle_outline_rounded)), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Text( + "Counter: ${counter.number}", + textAlign: TextAlign.center, + ), + ), + IconButton( + onPressed: () => setState(() => counter.decrement()), + icon: const Icon(Icons.remove_circle_outline_rounded)), + ], + ), + CustomButton( + onPressed: () => Modular.to.navigate('/'), + title: 'Back To Home', + ), + ], + ), + ), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/lib/widgets.dart b/packages/instabug_flutter_modular/example/lib/widgets.dart new file mode 100644 index 000000000..37b85cc1f --- /dev/null +++ b/packages/instabug_flutter_modular/example/lib/widgets.dart @@ -0,0 +1,38 @@ +import 'package:flutter/material.dart'; + +class CustomSwitchListTile extends StatelessWidget { + const CustomSwitchListTile( + {super.key, required this.value, this.onChanged, required this.title}); + + final bool value; + final void Function(bool)? onChanged; + + final String title; + + @override + Widget build(BuildContext context) { + return SwitchListTile( + value: value, + onChanged: onChanged, + title: Text(title), + ); + } +} + +class CustomButton extends StatelessWidget { + const CustomButton({super.key, required this.onPressed, required this.title}); + + final VoidCallback onPressed; + final String title; + + @override + Widget build(BuildContext context) { + return ElevatedButton( + onPressed: onPressed, + child: Text( + title, + textAlign: TextAlign.center, + ), + ); + } +} diff --git a/packages/instabug_flutter_modular/example/pubspec.lock b/packages/instabug_flutter_modular/example/pubspec.lock new file mode 100644 index 000000000..d7b40e81b --- /dev/null +++ b/packages/instabug_flutter_modular/example/pubspec.lock @@ -0,0 +1,259 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + flutter_modular: + dependency: transitive + description: + name: flutter_modular + sha256: "061f0bcc8f8c438d4c82f4ff70a9e61f109961c92b4e1eaf1bbfab75f577fe0e" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + flutter_modular_annotations: + dependency: transitive + description: + name: flutter_modular_annotations + sha256: "65971655bdd30816a6a66651c801f4ceba6c8ba265f0866cc51ad038332c9a71" + url: "https://pub.dev" + source: hosted + version: "0.0.2" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + instabug_flutter: + dependency: "direct main" + description: + path: "../../instabug_flutter" + relative: true + source: path + version: "16.0.0" + instabug_flutter_modular: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "1.0.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + url: "https://pub.dev" + source: hosted + version: "3.0.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + modular_core: + dependency: transitive + description: + name: modular_core + sha256: "84cfe65d2ab15b0265a5bdb07a7a0408b06f8d92fee6fb94a3c85e97cbc2d6af" + url: "https://pub.dev" + source: hosted + version: "2.0.3+1" + modular_interfaces: + dependency: transitive + description: + name: modular_interfaces + sha256: "89db18038048d63de80871189ddc52363814e8181615459e5d88ed0a921acc1f" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" +sdks: + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_flutter_modular/example/pubspec.yaml b/packages/instabug_flutter_modular/example/pubspec.yaml new file mode 100644 index 000000000..90d6065c0 --- /dev/null +++ b/packages/instabug_flutter_modular/example/pubspec.yaml @@ -0,0 +1,93 @@ +name: flutter_modular_demo_app +description: "Flutter Modular Demo App" +# The following line prevents the package from being accidentally published to +# pub.dev using `flutter pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# In Windows, build-name is used as the major, minor, and patch parts +# of the product and file versions while build-number is used as the build suffix. +version: 1.0.0+1 + +environment: + sdk: '>=3.3.0 <4.0.0' + +# Dependencies specify other packages that your package needs in order to work. +# To automatically upgrade your package dependencies to the latest versions +# consider running `flutter pub upgrade --major-versions`. Alternatively, +# dependencies can be manually updated by changing the version numbers below to +# the latest version available on pub.dev. To see which dependencies have newer +# versions available, run `flutter pub outdated`. +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.6 + instabug_flutter: ^13.2.0 + instabug_flutter_modular: + path: ../ + +dev_dependencies: + flutter_test: + sdk: flutter + + # The "flutter_lints" package below contains a set of recommended lints to + # encourage good coding practices. The lint set provided by the package is + # activated in the `analysis_options.yaml` file located at the root of your + # package. See that file for information about deactivating specific lint + # rules and activating additional ones. + flutter_lints: ^3.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter packages. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/instabug_flutter_modular/example/pubspec_overrides.yaml b/packages/instabug_flutter_modular/example/pubspec_overrides.yaml new file mode 100644 index 000000000..82c9b8e03 --- /dev/null +++ b/packages/instabug_flutter_modular/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: instabug_flutter,instabug_flutter_modular +dependency_overrides: + instabug_flutter: + path: ../../instabug_flutter + instabug_flutter_modular: + path: .. diff --git a/packages/instabug_flutter_modular/lib/instabug_flutter_modular.dart b/packages/instabug_flutter_modular/lib/instabug_flutter_modular.dart new file mode 100644 index 000000000..807259b68 --- /dev/null +++ b/packages/instabug_flutter_modular/lib/instabug_flutter_modular.dart @@ -0,0 +1 @@ +export 'src/instabug_module.dart'; diff --git a/packages/instabug_flutter_modular/lib/src/instabug_modular_manager.dart b/packages/instabug_flutter_modular/lib/src/instabug_modular_manager.dart new file mode 100644 index 000000000..d1f8c8ea7 --- /dev/null +++ b/packages/instabug_flutter_modular/lib/src/instabug_modular_manager.dart @@ -0,0 +1,76 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter_modular/src/instabug_module.dart'; +import 'package:meta/meta.dart'; + +class InstabugModularManager { + InstabugModularManager._(); + + static InstabugModularManager _instance = InstabugModularManager._(); + static InstabugModularManager get instance => _instance; + + /// Shorthand for [instance] + static InstabugModularManager get I => instance; + + @visibleForTesting + // ignore: use_setters_to_change_properties + static void setInstance(InstabugModularManager instance) { + _instance = instance; + } + + List wrapRoutes( + List routes, { + String parent = '/', + bool wrapModules = true, + }) { + return routes + .map( + (route) => wrapRoute( + route, + parent: parent, + wrapModules: wrapModules, + ), + ) + .toList(); + } + + ModularRoute wrapRoute( + ModularRoute route, { + String parent = '/', + bool wrapModules = true, + }) { + final fullPath = (parent + route.name).replaceFirst('//', '/'); + + if (route is ModuleRoute && route.context is Module && wrapModules) { + final module = InstabugModule( + route.context! as Module, + path: fullPath, + ); + + return route.addModule( + route.name, + module: module, + ); + } else if (route is ParallelRoute && route is! ModuleRoute) { + ModularChild? child; + + if (route.child != null) { + child = (context, args) => InstabugCaptureScreenLoading( + screenName: fullPath, + child: route.child!(context, args), + ); + } + + return route.copyWith( + child: child, + children: wrapRoutes( + route.children, + parent: fullPath, + wrapModules: wrapModules, + ), + ); + } + + return route; + } +} diff --git a/packages/instabug_flutter_modular/lib/src/instabug_module.dart b/packages/instabug_flutter_modular/lib/src/instabug_module.dart new file mode 100644 index 000000000..dc56fb171 --- /dev/null +++ b/packages/instabug_flutter_modular/lib/src/instabug_module.dart @@ -0,0 +1,28 @@ +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:instabug_flutter_modular/src/instabug_modular_manager.dart'; + +class InstabugModule extends Module { + final Module module; + final String path; + final List _routes; + + InstabugModule(this.module, {this.path = '/'}) + : _routes = InstabugModularManager.I.wrapRoutes( + module.routes, + parent: path, + ); + + @override + List get imports => module.imports; + + @override + List get binds => module.binds; + + @override + List get routes => _routes; + + // Override the runtime type to return the module's runtime type as Flutter + // Modular maps context bindings by their runtime type. + @override + Type get runtimeType => module.runtimeType; +} diff --git a/packages/instabug_flutter_modular/pubspec.lock b/packages/instabug_flutter_modular/pubspec.lock new file mode 100644 index 000000000..093917226 --- /dev/null +++ b/packages/instabug_flutter_modular/pubspec.lock @@ -0,0 +1,753 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "16e298750b6d0af7ce8a3ba7c18c69c3785d11b15ec83f6dcd0ad2a0009b3cab" + url: "https://pub.dev" + source: hosted + version: "76.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "1f14db053a8c23e260789e9b0980fa27f2680dd640932cae5e1137cce0e46e1e" + url: "https://pub.dev" + source: hosted + version: "6.11.0" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + url: "https://pub.dev" + source: hosted + version: "2.4.13" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + url: "https://pub.dev" + source: hosted + version: "7.3.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + url: "https://pub.dev" + source: hosted + version: "8.9.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + coverage: + dependency: transitive + description: + name: coverage + sha256: "4b03e11f6d5b8f6e5bb5e9f7889a56fe6c5cbe942da5378ea4d4d7f73ef9dfe5" + url: "https://pub.dev" + source: hosted + version: "1.11.0" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" + url: "https://pub.dev" + source: hosted + version: "2.3.7" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + url: "https://pub.dev" + source: hosted + version: "2.0.3" + flutter_modular: + dependency: "direct main" + description: + name: flutter_modular + sha256: "061f0bcc8f8c438d4c82f4ff70a9e61f109961c92b4e1eaf1bbfab75f577fe0e" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + flutter_modular_annotations: + dependency: transitive + description: + name: flutter_modular_annotations + sha256: "65971655bdd30816a6a66651c801f4ceba6c8ba265f0866cc51ad038332c9a71" + url: "https://pub.dev" + source: hosted + version: "0.0.2" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + html: + dependency: transitive + description: + name: html + sha256: "1fc58edeaec4307368c60d59b7e15b9d658b57d7f3125098b6294153c75337ec" + url: "https://pub.dev" + source: hosted + version: "0.15.5" + http: + dependency: transitive + description: + name: http + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + url: "https://pub.dev" + source: hosted + version: "1.2.2" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + instabug_flutter: + dependency: "direct main" + description: + path: "../instabug_flutter" + relative: true + source: path + version: "16.0.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" + source: hosted + version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + macros: + dependency: transitive + description: + name: macros + sha256: "1d9e801cd66f7ea3663c45fc708450db1fa57f988142c64289142c9b7ee80656" + url: "https://pub.dev" + source: hosted + version: "0.1.3-main.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: ef2a1298144e3f985cc736b22e0ccdaf188b5b3970648f2d9dc13efd1d9df051 + url: "https://pub.dev" + source: hosted + version: "7.2.2" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: "direct main" + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: "direct dev" + description: + name: mockito + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + url: "https://pub.dev" + source: hosted + version: "5.4.4" + modular_core: + dependency: "direct dev" + description: + name: modular_core + sha256: "84cfe65d2ab15b0265a5bdb07a7a0408b06f8d92fee6fb94a3c85e97cbc2d6af" + url: "https://pub.dev" + source: hosted + version: "2.0.3+1" + modular_interfaces: + dependency: transitive + description: + name: modular_interfaces + sha256: "89db18038048d63de80871189ddc52363814e8181615459e5d88ed0a921acc1f" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + pana: + dependency: "direct dev" + description: + name: pana + sha256: "6f4372d5d2af5fe3fc6491c18f575601743bceb8433c7f179a6fffd162ee55f1" + url: "https://pub.dev" + source: hosted + version: "0.21.39" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + safe_url_check: + dependency: transitive + description: + name: safe_url_check + sha256: "49a3e060a7869cbafc8f4845ca1ecbbaaa53179980a32f4fdfeab1607e90f41d" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: c87c3875f91262785dade62d135760c2c69cb217ac759485334c5857ad89f6e3 + url: "https://pub.dev" + source: hosted + version: "1.1.3" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: cc36c297b52866d203dbf9332263c94becc2fe0ceaa9681d07b6ef9807023b67 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: c0713a43e323c3302c2abe2a1cc89aa057a387101ebd280371d6a6c9fa68516b + url: "https://pub.dev" + source: hosted + version: "2.1.2" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + tar: + dependency: transitive + description: + name: tar + sha256: "22f67e2d77b51050436620b2a5de521c58ca6f0b75af1d9ab3c8cae2eae58fcd" + url: "https://pub.dev" + source: hosted + version: "1.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: transitive + description: + name: test + sha256: "713a8789d62f3233c46b4a90b174737b2c04cb6ae4500f2aa8b1be8f03f5e67f" + url: "https://pub.dev" + source: hosted + version: "1.25.8" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + test_core: + dependency: transitive + description: + name: test_core + sha256: "12391302411737c176b0b5d6491f466b0dd56d4763e347b6714efbaa74d7953d" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_flutter_modular/pubspec.yaml b/packages/instabug_flutter_modular/pubspec.yaml new file mode 100644 index 000000000..4015404b9 --- /dev/null +++ b/packages/instabug_flutter_modular/pubspec.yaml @@ -0,0 +1,27 @@ +name: instabug_flutter_modular +description: An add-on for the Instabug Flutter SDK that provides screen loading support for Flutter Modular v5. +version: 1.0.0 +homepage: https://www.instabug.com +repository: https://github.com/Instabug/Instabug-Flutter/tree/refactor/monorepo/packages/instabug_flutter_modular + +environment: + sdk: '>=3.1.2 <4.0.0' + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + flutter_modular: '>=5.0.0 <6.0.0' + instabug_flutter: '>=13.2.0 <14.0.0' + meta: ^1.3.0 + +dev_dependencies: + build_runner: ^2.0.3 + flutter_lints: ^2.0.0 + flutter_test: + sdk: flutter + # mockito v5.2.0 is needed for running Flutter 2 tests on CI + mockito: '>=5.2.0 <=5.4.4' + # A specific version isn't specified as we want to use the version used in flutter_modular + modular_core: + pana: ^0.21.0 diff --git a/packages/instabug_flutter_modular/pubspec_overrides.yaml b/packages/instabug_flutter_modular/pubspec_overrides.yaml new file mode 100644 index 000000000..1f0beaf62 --- /dev/null +++ b/packages/instabug_flutter_modular/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: instabug_flutter +dependency_overrides: + instabug_flutter: + path: ../instabug_flutter diff --git a/packages/instabug_flutter_modular/release.sh b/packages/instabug_flutter_modular/release.sh new file mode 100755 index 000000000..b30831736 --- /dev/null +++ b/packages/instabug_flutter_modular/release.sh @@ -0,0 +1,13 @@ +#!/bin/sh +VERSION=$(egrep -o "version: ([0-9]-*.*)+[0-9]" pubspec.yaml | cut -d ":" -f 2) +if [ ! "${VERSION}" ] || [ -z "${VERSION}" ];then + echo "Instabug: err: Version Number not found." + exit 1 +else + mkdir -p $HOME/.config/dart + cat < $HOME/.config/dart/pub-credentials.json + ${PUB_CREDENTIALS} + +EOF + flutter packages pub publish -f +fi \ No newline at end of file diff --git a/packages/instabug_flutter_modular/test/src/instabug_modular_manager_test.dart b/packages/instabug_flutter_modular/test/src/instabug_modular_manager_test.dart new file mode 100644 index 000000000..85b4aa011 --- /dev/null +++ b/packages/instabug_flutter_modular/test/src/instabug_modular_manager_test.dart @@ -0,0 +1,201 @@ +// ignore_for_file: avoid_dynamic_calls + +import 'package:flutter/widgets.dart'; +import 'package:flutter_modular/flutter_modular.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter_modular/instabug_flutter_modular.dart'; +import 'package:instabug_flutter_modular/src/instabug_modular_manager.dart'; +import 'package:mockito/annotations.dart'; +import 'package:modular_core/modular_core.dart'; + +import 'instabug_modular_manager_test.mocks.dart'; + +@GenerateNiceMocks([ + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), + MockSpec(), +]) +void main() { + late MockInstabugModule mockInstabugModule; + late MockModule mockModule; + late MockWidget mockWidget; + late MockBuildContext mockContext; + late MockModularArguments mockArgs; + + setUp(() { + mockInstabugModule = MockInstabugModule(); + mockModule = MockModule(); + mockWidget = MockWidget(); + mockContext = MockBuildContext(); + mockArgs = MockModularArguments(); + }); + + test('[wrapRoutes] with simple list', () { + // Arrange + final routes = [ + ChildRoute('/home', child: (_, __) => mockWidget), + ModuleRoute('/profile', module: mockModule), + ]; + + // Act + final wrappedRoutes = InstabugModularManager.instance.wrapRoutes(routes); + + // Assert + expect(wrappedRoutes.length, 2); + expect(wrappedRoutes[0].name, '/home'); + expect(wrappedRoutes[1].name, '/profile'); + }); + + test('[wrapRoutes] with nested route', () { + // Arrange + final routes = [ + ChildRoute( + '/users', + child: (_, __) => mockWidget, + children: [ + ModuleRoute('/list', module: mockModule), + ModuleRoute('/details', module: mockModule), + ], + ), + ]; + + // Act + final wrappedRoutes = InstabugModularManager.instance.wrapRoutes(routes); + + // Assert + expect(wrappedRoutes.length, 1); + expect(wrappedRoutes[0].name, '/users'); + expect(wrappedRoutes[0].children.length, 2); + expect(wrappedRoutes[0].children[0].name, '/list'); + expect(wrappedRoutes[0].children[1].name, '/details'); + }); + + test('[wrapRoute] with [ModuleRoute] should wrap with [InstabugModule]', () { + // Arrange + final route = ModuleRoute('/home', module: mockInstabugModule); + + // Act + final wrappedRoute = + InstabugModularManager.instance.wrapRoute(route) as dynamic; + + // Assert + expect(wrappedRoute.name, '/home'); + expect(wrappedRoute.context.module, isA()); + }); + + test( + '[wrapRoute] with [ParallelRoute] should wrap child with [InstabugCaptureScreenLoading]', + () { + // Arrange + final route = ChildRoute( + '/profile', + child: (context, args) => mockWidget, + ); + + // Act + final wrappedRoute = + InstabugModularManager.instance.wrapRoute(route) as dynamic; + + final widget = wrappedRoute.child(mockContext, mockArgs); + + // Assert + expect(wrappedRoute.name, '/profile'); + expect(widget, isA()); + }); + + test( + '[wrapRoutes] should wrap child property with [InstabugCaptureScreenLoading] and preserve the rest of its properties', + () { + // Arrange + final customTransition = MockCustomTransition(); + const duration = Duration.zero; + final guards = []; + const transition = TransitionType.downToUp; + + final homeRoute = ChildRoute( + '/home', + child: (context, args) => mockWidget, + customTransition: customTransition, + duration: duration, + guards: guards, + transition: transition, + ); + + final profileRoute = ChildRoute( + '/profile', + child: (context, args) => mockWidget, + customTransition: customTransition, + duration: duration, + guards: guards, + transition: transition, + ); + final routes = [homeRoute, profileRoute]; + + // Act + final wrappedRoutes = + InstabugModularManager.instance.wrapRoutes(routes) as List; + + for (final element in wrappedRoutes) { + final widget = element.child(mockContext, mockArgs); + + // Assert + expect(widget, isA()); + expect(element.customTransition, customTransition); + expect(element.duration, duration); + expect(element.transition, transition); + } + }); + + test('[wrapRoutes] with nested route', () { + // Arrange + final routes = [ + ChildRoute( + '/users', + child: (_, __) => mockWidget, + children: [ + ModuleRoute('/list', module: mockModule), + ModuleRoute('/details', module: mockModule), + ], + ), + ]; + + // Act + final wrappedRoutes = InstabugModularManager.instance.wrapRoutes(routes); + + // Assert + expect(wrappedRoutes.length, 1); + expect(wrappedRoutes[0].name, '/users'); + expect(wrappedRoutes[0].children.length, 2); + expect(wrappedRoutes[0].children[0].name, '/list'); + expect(wrappedRoutes[0].children[1].name, '/details'); + }); + + test('[wrapRoute] with custom parent path should add it to the path', () { + // Arrange + final route = ModuleRoute('/home', module: mockModule); + + // Act + final wrappedRoute = InstabugModularManager.instance + .wrapRoute(route, parent: '/users') as dynamic; + + // Assert + expect(wrappedRoute.context.path, '/users/home'); + }); + + test('[wrapRoute] with wrapModules set to false', () { + // Arrange + final route = ModuleRoute('/home', module: mockModule); + + // Act + final wrappedRoute = InstabugModularManager.instance + .wrapRoute(route, wrapModules: false) as dynamic; + + // Assert + expect(wrappedRoute.name, '/home'); + expect(wrappedRoute.context.module, isA()); + }); +} diff --git a/packages/instabug_http_client/CHANGELOG.md b/packages/instabug_http_client/CHANGELOG.md new file mode 100644 index 000000000..8abeafe73 --- /dev/null +++ b/packages/instabug_http_client/CHANGELOG.md @@ -0,0 +1,49 @@ +# Changelog + +## [2.6.0] (2025-07-17) + +### Added +- supports Instabug SDK above 3.0.0 ([#24](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/24)). + +## [2.5.1] - 22/04/2025 + +### Added + +- supports Dart versions above 3.0.0 ([#23](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/23)). + +## [2.5.0] - 18/11/2024 + +### Added + +- Add support for tracing network requests from Instabug to services like Datadog and New Relic ([#21](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/21)). + +## [2.4.0] - 7/05/2024 + +### Added + +- Add support for Instabug Flutter SDK v12 and v13 ([#17](https://github.com/Instabug/Instabug-Dart-http-Adapter/pull/17)). + +## [2.3.0] - 3/11/2022 + +- Adds support for MultipartRequest. + +## [2.2.1] - 2/8/2022 + +- Bumps [instabug_flutter](https://pub.dev/packages/instabug_flutter) to v11 + +## [2.2.0] - 11/4/2022 + +- Adds support for logging network requests using `send` method. + +## [2.1.0] - 5/1/2022 + +- Fixes network log compilation error. +- Adds payload size for network log. + +## [2.0.0] - 30/11/2021 + +- Upgrades to null safety. + +## [1.0.0] - 29/7/2019 + +- Adds implementation for the instabug_http_client library which supports Instabug network logging for the dart library: http. diff --git a/packages/instabug_http_client/LICENSE b/packages/instabug_http_client/LICENSE new file mode 100644 index 000000000..80d729766 --- /dev/null +++ b/packages/instabug_http_client/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Instabug + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/packages/instabug_http_client/README.md b/packages/instabug_http_client/README.md new file mode 100644 index 000000000..c367d4e8b --- /dev/null +++ b/packages/instabug_http_client/README.md @@ -0,0 +1,36 @@ +# instabug_http_client + +A dart package to support Instabug network logging for the external dart [http](https://pub.dev/packages/http) package. + +## Getting Started + +You can choose to attach all your network requests data to the Instabug reports being sent to the dashboard. See the details below on how to enable the feature for the `http` package. + +### Installation + +1. Add the dependency to your project `pubspec.yml`: + +```yaml +dependencies: + instabug_http_client: +``` + +2. Install the package by running the following command. + +```bash +flutter packages get +``` + +### Usage + +To enable logging, use the custom http client provided by Instabug: + +```dart +final client = InstabugHttpClient(); +``` + +Then proceed to use the package normally: + +```dart +final response = await client.get(Uri.parse(URL)); +``` diff --git a/packages/instabug_http_client/example/.metadata b/packages/instabug_http_client/example/.metadata new file mode 100644 index 000000000..5a023280a --- /dev/null +++ b/packages/instabug_http_client/example/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 7e9793dee1b85a243edd0e06cb1658e98b077561 + channel: stable + +project_type: app diff --git a/packages/instabug_http_client/example/README.md b/packages/instabug_http_client/example/README.md new file mode 100644 index 000000000..a13562602 --- /dev/null +++ b/packages/instabug_http_client/example/README.md @@ -0,0 +1,16 @@ +# example + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/example/analysis_options.yaml b/packages/instabug_http_client/example/analysis_options.yaml similarity index 93% rename from example/analysis_options.yaml rename to packages/instabug_http_client/example/analysis_options.yaml index 0d2902135..61b6c4de1 100644 --- a/example/analysis_options.yaml +++ b/packages/instabug_http_client/example/analysis_options.yaml @@ -13,7 +13,8 @@ linter: # The lint rules applied to this project can be customized in the # section below to disable rules from the `package:flutter_lints/flutter.yaml` # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. + # and their documentation is published at + # https://dart-lang.github.io/linter/lints/index.html. # # Instead of disabling a lint rule for the entire project in the # section below, it can also be suppressed for a single line of code diff --git a/packages/instabug_http_client/example/android/.gitignore b/packages/instabug_http_client/example/android/.gitignore new file mode 100644 index 000000000..6f568019d --- /dev/null +++ b/packages/instabug_http_client/example/android/.gitignore @@ -0,0 +1,13 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties +**/*.keystore +**/*.jks diff --git a/packages/instabug_http_client/example/android/app/build.gradle b/packages/instabug_http_client/example/android/app/build.gradle new file mode 100644 index 000000000..86b077f53 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/build.gradle @@ -0,0 +1,56 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + +android { + namespace = "com.example.example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } + + defaultConfig { + applicationId "com.example.example" + minSdkVersion 21 + targetSdkVersion 34 + versionCode flutter.versionCode + versionName flutter.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.debug + } + } + namespace = "com.example.example" + + configurations.all { + resolutionStrategy.force 'org.hamcrest:hamcrest-core:1.3' + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.7.20" + implementation 'com.android.support:multidex:1.0.3' + implementation 'org.mockito:mockito-core:1.10.19' + testImplementation 'junit:junit:4.12' + testImplementation 'org.mockito:mockito-core:1.10.19' +} diff --git a/packages/instabug_http_client/example/android/app/src/debug/AndroidManifest.xml b/packages/instabug_http_client/example/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000..f880684a6 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/packages/instabug_http_client/example/android/app/src/main/AndroidManifest.xml b/packages/instabug_http_client/example/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000..da82b5dba --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + diff --git a/packages/instabug_http_client/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java b/packages/instabug_http_client/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java new file mode 100644 index 000000000..9213f130f --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/java/io/flutter/app/FlutterMultiDexApplication.java @@ -0,0 +1,20 @@ +// Generated file. +// If you wish to remove Flutter's multidex support, delete this entire file. + +package io.flutter.app; + +import android.content.Context; +import androidx.annotation.CallSuper; +import androidx.multidex.MultiDex; + +/** + * Extension of {@link io.flutter.app.FlutterApplication}, adding multidex support. + */ +public class FlutterMultiDexApplication extends FlutterApplication { + @Override + @CallSuper + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(this); + } +} diff --git a/packages/instabug_http_client/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt b/packages/instabug_http_client/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt new file mode 100644 index 000000000..e793a000d --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.example + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/packages/instabug_http_client/example/android/app/src/main/res/drawable-v21/launch_background.xml b/packages/instabug_http_client/example/android/app/src/main/res/drawable-v21/launch_background.xml new file mode 100644 index 000000000..f74085f3f --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/res/drawable-v21/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/instabug_http_client/example/android/app/src/main/res/drawable/launch_background.xml b/packages/instabug_http_client/example/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000..304732f88 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/instabug_http_client/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000..db77bb4b7 Binary files /dev/null and b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/instabug_http_client/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000..17987b79b Binary files /dev/null and b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000..09d439148 Binary files /dev/null and b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000..d5f1c8d34 Binary files /dev/null and b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000..4d6372eeb Binary files /dev/null and b/packages/instabug_http_client/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/instabug_http_client/example/android/app/src/main/res/values-night/styles.xml b/packages/instabug_http_client/example/android/app/src/main/res/values-night/styles.xml new file mode 100644 index 000000000..3db14bb53 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/res/values-night/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/instabug_http_client/example/android/app/src/main/res/values/styles.xml b/packages/instabug_http_client/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000..d460d1e92 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/instabug_http_client/example/android/app/src/main/res/xml/network_security_config.xml b/packages/instabug_http_client/example/android/app/src/main/res/xml/network_security_config.xml new file mode 100644 index 000000000..be9989192 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/main/res/xml/network_security_config.xml @@ -0,0 +1,13 @@ + + + + localhost + api.instabug.com + + + + + + + + diff --git a/packages/instabug_http_client/example/android/app/src/profile/AndroidManifest.xml b/packages/instabug_http_client/example/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000..f880684a6 --- /dev/null +++ b/packages/instabug_http_client/example/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + diff --git a/packages/instabug_http_client/example/android/build.gradle b/packages/instabug_http_client/example/android/build.gradle new file mode 100644 index 000000000..ed40a47e2 --- /dev/null +++ b/packages/instabug_http_client/example/android/build.gradle @@ -0,0 +1,15 @@ +rootProject.buildDir = '../build' + +//android { +// namespace 'com.instabug.flutter.example' +//} +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +tasks.register("clean", Delete) { + delete rootProject.buildDir +} diff --git a/packages/instabug_http_client/example/android/gradle.properties b/packages/instabug_http_client/example/android/gradle.properties new file mode 100644 index 000000000..b9a9a2464 --- /dev/null +++ b/packages/instabug_http_client/example/android/gradle.properties @@ -0,0 +1,6 @@ +org.gradle.jvmargs=-Xmx1536M +android.useAndroidX=true +android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/packages/instabug_http_client/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/instabug_http_client/example/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000..4cf0c849a --- /dev/null +++ b/packages/instabug_http_client/example/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip diff --git a/packages/instabug_http_client/example/android/settings.gradle b/packages/instabug_http_client/example/android/settings.gradle new file mode 100644 index 000000000..32cfc43dc --- /dev/null +++ b/packages/instabug_http_client/example/android/settings.gradle @@ -0,0 +1,27 @@ +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() + + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") + + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url 'https://storage.googleapis.com/flutter-plugins' } + + } +} + +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.1.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false +} + +include ":app" diff --git a/packages/instabug_http_client/example/ios/.gitignore b/packages/instabug_http_client/example/ios/.gitignore new file mode 100644 index 000000000..7a7f9873a --- /dev/null +++ b/packages/instabug_http_client/example/ios/.gitignore @@ -0,0 +1,34 @@ +**/dgph +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/ephemeral/ +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/instabug_http_client/example/ios/Flutter/AppFrameworkInfo.plist b/packages/instabug_http_client/example/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000..7c5696400 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 12.0 + + diff --git a/packages/instabug_http_client/example/ios/Flutter/Debug.xcconfig b/packages/instabug_http_client/example/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000..ec97fc6f3 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/instabug_http_client/example/ios/Flutter/Release.xcconfig b/packages/instabug_http_client/example/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000..c4855bfe2 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/instabug_http_client/example/ios/Podfile b/packages/instabug_http_client/example/ios/Podfile new file mode 100644 index 000000000..ba26ef371 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +platform :ios, '14.4' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.pbxproj b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000..43b09ccb5 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,555 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 54; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + AD44C4DB39F7C3968B8C56EB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 18B300F826F2074CB5E450C4 /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 18B300F826F2074CB5E450C4 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 3E0436312822B722E186D653 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 90FF03378459C589A4D9DA6E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DE25EB3DE5B281AB8980A728 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + AD44C4DB39F7C3968B8C56EB /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 3456E8E25F114A239880D241 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 18B300F826F2074CB5E450C4 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 4955E253C000584F8EA1A042 /* Pods */ = { + isa = PBXGroup; + children = ( + 90FF03378459C589A4D9DA6E /* Pods-Runner.debug.xcconfig */, + 3E0436312822B722E186D653 /* Pods-Runner.release.xcconfig */, + DE25EB3DE5B281AB8980A728 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 4955E253C000584F8EA1A042 /* Pods */, + 3456E8E25F114A239880D241 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + F412A5213E8CA6290AF8A003 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 9BDEDB79123E51897883C720 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1510; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + 9BDEDB79123E51897883C720 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + F412A5213E8CA6290AF8A003 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = XNK224R4SF; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = XNK224R4SF; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = XNK224R4SF; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..919434a62 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/instabug_http_client/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/instabug_http_client/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000..5e31d3d34 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_http_client/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/instabug_http_client/example/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..21a3cc14c --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/instabug_http_client/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/instabug_http_client/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/instabug_http_client/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/instabug_http_client/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000..f9b0d7c5e --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/instabug_http_client/example/ios/Runner/AppDelegate.swift b/packages/instabug_http_client/example/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000..b63630348 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@main +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000..d36b1fab2 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000..dc9ada472 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000..28c6bf030 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000..f091b6b0b Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000..4cde12118 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000..d0ef06e7e Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000..dcdc2306c Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000..2ccbfd967 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000..c8f9ed8f5 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000..a6d6b8609 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000..75b2d164a Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000..c4df70d39 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000..6a84f41e1 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000..d0e1f5853 Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000..0bedcf2fd --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000..9da19eaca Binary files /dev/null and b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000..89c2725b7 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/instabug_http_client/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/instabug_http_client/example/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000..f2e259c7c --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_http_client/example/ios/Runner/Base.lproj/Main.storyboard b/packages/instabug_http_client/example/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000..f3c28516f --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/instabug_http_client/example/ios/Runner/Info.plist b/packages/instabug_http_client/example/ios/Runner/Info.plist new file mode 100644 index 000000000..7f553465b --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Info.plist @@ -0,0 +1,51 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Example + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + example + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + + + diff --git a/packages/instabug_http_client/example/ios/Runner/Runner-Bridging-Header.h b/packages/instabug_http_client/example/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000..308a2a560 --- /dev/null +++ b/packages/instabug_http_client/example/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/instabug_http_client/example/lib/main.dart b/packages/instabug_http_client/example/lib/main.dart new file mode 100644 index 000000000..da0018df8 --- /dev/null +++ b/packages/instabug_http_client/example/lib/main.dart @@ -0,0 +1,73 @@ +import 'package:flutter/material.dart'; +import 'package:instabug_http_client/instabug_http_client.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; + +Future main() async { + runApp(const MyApp()); + Instabug.init( + token: 'ed6f659591566da19b67857e1b9d40ab', + invocationEvents: [InvocationEvent.floatingButton]); + final client = InstabugHttpClient(); + await client.get(Uri.parse('https://google.com')); +} + +class MyApp extends StatelessWidget { + const MyApp({Key? key}) : super(key: key); + + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + primarySwatch: Colors.blue, + ), + home: const MyHomePage(title: 'Flutter Demo Home Page'), + ); + } +} + +class MyHomePage extends StatefulWidget { + const MyHomePage({Key? key, required this.title}) : super(key: key); + final String title; + + @override + State createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + int _counter = 0; + + void _incrementCounter() { + setState(() { + _counter++; + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text(widget.title), + ), + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Text( + 'You have pushed the button this many times:', + ), + Text( + '$_counter', + style: Theme.of(context).textTheme.headlineMedium, + ), + ], + ), + ), + floatingActionButton: FloatingActionButton( + onPressed: _incrementCounter, + tooltip: 'Increment', + child: const Icon(Icons.add), + ), + ); + } +} diff --git a/packages/instabug_http_client/example/pubspec.lock b/packages/instabug_http_client/example/pubspec.lock new file mode 100644 index 000000000..9939c4e7b --- /dev/null +++ b/packages/instabug_http_client/example/pubspec.lock @@ -0,0 +1,251 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 + url: "https://pub.dev" + source: hosted + version: "1.0.8" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + sha256: b543301ad291598523947dc534aaddc5aaad597b709d2426d3a0e0d44c5cb493 + url: "https://pub.dev" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: transitive + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + instabug_flutter: + dependency: "direct overridden" + description: + path: "../../instabug_flutter" + relative: true + source: path + version: "16.0.0" + instabug_http_client: + dependency: "direct main" + description: + path: ".." + relative: true + source: path + version: "2.6.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + lints: + dependency: transitive + description: + name: lints + sha256: a2c3d198cb5ea2e179926622d433331d8b58374ab8f29cdda6e863bd62fd369c + url: "https://pub.dev" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" +sdks: + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_http_client/example/pubspec.yaml b/packages/instabug_http_client/example/pubspec.yaml new file mode 100644 index 000000000..9add5fe45 --- /dev/null +++ b/packages/instabug_http_client/example/pubspec.yaml @@ -0,0 +1,24 @@ +name: http_client_example +description: Demonstrates how to use the instabug_http_client package. + +publish_to: "none" + +version: 1.0.0+1 + +environment: + sdk: ">=2.12.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + cupertino_icons: ^1.0.2 + instabug_http_client: + path: ../ + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^1.0.0 + +flutter: + uses-material-design: true diff --git a/packages/instabug_http_client/example/pubspec_overrides.yaml b/packages/instabug_http_client/example/pubspec_overrides.yaml new file mode 100644 index 000000000..3daf4fd14 --- /dev/null +++ b/packages/instabug_http_client/example/pubspec_overrides.yaml @@ -0,0 +1,6 @@ +# melos_managed_dependency_overrides: instabug_flutter,instabug_http_client +dependency_overrides: + instabug_flutter: + path: ../../instabug_flutter + instabug_http_client: + path: .. diff --git a/packages/instabug_http_client/lib/instabug_http_client.dart b/packages/instabug_http_client/lib/instabug_http_client.dart new file mode 100644 index 000000000..40529ae82 --- /dev/null +++ b/packages/instabug_http_client/lib/instabug_http_client.dart @@ -0,0 +1,177 @@ +// ignore_for_file: invalid_use_of_internal_member + +library instabug_http_client; + +import 'dart:convert'; + +// to maintain supported versions prior to Flutter 3.3 +// ignore: unnecessary_import +import 'dart:typed_data'; + +import 'package:http/http.dart' as http; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_http_client/instabug_http_logger.dart'; +import 'package:meta/meta.dart'; + +class InstabugHttpClient extends InstabugHttpLogger implements http.Client { + InstabugHttpClient() : client = http.Client() { + logger = this; + } + + final NetworkLogger _networklogger = NetworkLogger(); + @visibleForTesting + http.Client client; + + @visibleForTesting + late InstabugHttpLogger logger; + + @override + void close() => client.close(); + + @override + Future delete( + Uri url, { + Map? headers, + Object? body, + Encoding? encoding, + }) async { + final startTime = DateTime.now(); + final requestHeader = headers ?? {}; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client + .delete(url, body: body, headers: requestHeader, encoding: encoding) + .then((http.Response response) { + logger.onLogger(response, startTime: startTime, w3CHeader: w3cHeader); + return response; + }); + } + + Future getW3cHeader( + Map requestHeader, + DateTime startTime, + ) async { + final w3cHeader = await _networklogger.getW3CHeader( + requestHeader, + startTime.millisecondsSinceEpoch, + ); + if (w3cHeader?.isW3cHeaderFound == false && + w3cHeader?.w3CGeneratedHeader != null) { + requestHeader['traceparent'] = w3cHeader!.w3CGeneratedHeader!; + } + return w3cHeader; + } + + @override + Future get(Uri url, {Map? headers}) async { + final startTime = DateTime.now(); + final requestHeader = headers ?? {}; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client + .get(url, headers: requestHeader) + .then((http.Response response) { + logger.onLogger(response, startTime: startTime, w3CHeader: w3cHeader); + return response; + }); + } + + @override + Future head(Uri url, {Map? headers}) async { + final startTime = DateTime.now(); + final requestHeader = headers ?? {}; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client + .head(url, headers: requestHeader) + .then((http.Response response) { + logger.onLogger(response, startTime: startTime, w3CHeader: w3cHeader); + return response; + }); + } + + @override + Future patch( + Uri url, { + Map? headers, + Object? body, + Encoding? encoding, + }) async { + final startTime = DateTime.now(); + final requestHeader = headers ?? {}; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client + .patch(url, headers: requestHeader, body: body, encoding: encoding) + .then((http.Response response) { + logger.onLogger(response, startTime: startTime, w3CHeader: w3cHeader); + return response; + }); + } + + @override + Future post( + Uri url, { + Map? headers, + Object? body, + Encoding? encoding, + }) async { + final startTime = DateTime.now(); + final requestHeader = headers ?? {}; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client + .post(url, headers: requestHeader, body: body, encoding: encoding) + .then((http.Response response) { + logger.onLogger(response, startTime: startTime, w3CHeader: w3cHeader); + return response; + }); + } + + @override + Future put( + Uri url, { + Map? headers, + Object? body, + Encoding? encoding, + }) async { + final startTime = DateTime.now(); + final requestHeader = headers ?? {}; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client + .put(url, headers: requestHeader, body: body, encoding: encoding) + .then((http.Response response) { + logger.onLogger(response, startTime: startTime, w3CHeader: w3cHeader); + return response; + }); + } + + @override + Future read(Uri url, {Map? headers}) => + client.read(url, headers: headers); + + @override + Future readBytes(Uri url, {Map? headers}) => + client.readBytes(url, headers: headers); + + @override + Future send(http.BaseRequest request) async { + final startTime = DateTime.now(); + final requestHeader = request.headers; + final w3cHeader = await getW3cHeader(requestHeader, startTime); + return client.send(request).then( + (http.StreamedResponse streamedResponse) => + http.Response.fromStream(streamedResponse) + .then((http.Response response) { + logger.onLogger(response, + startTime: startTime, w3CHeader: w3cHeader); + // Need to return new StreamedResponse, as body only can be listened once + return http.StreamedResponse( + Stream>.value(response.bodyBytes), + response.statusCode, + contentLength: response.contentLength, + request: response.request, + headers: response.headers, + isRedirect: response.isRedirect, + persistentConnection: response.persistentConnection, + reasonPhrase: response.reasonPhrase, + ); + }), + ); + } +} diff --git a/packages/instabug_http_client/lib/instabug_http_logger.dart b/packages/instabug_http_client/lib/instabug_http_logger.dart new file mode 100644 index 000000000..fc97a831a --- /dev/null +++ b/packages/instabug_http_client/lib/instabug_http_logger.dart @@ -0,0 +1,76 @@ +import 'dart:convert'; + +import 'package:http/http.dart' as http; +import 'package:instabug_flutter/instabug_flutter.dart'; + +class InstabugHttpLogger { + void onLogger( + http.Response response, { + DateTime? startTime, + W3CHeader? w3CHeader, + }) { + final networkLogger = NetworkLogger(); + + final requestHeaders = {}; + response.request?.headers.forEach((String header, dynamic value) { + requestHeaders[header] = value; + }); + + final request = response.request; + + if (request == null) { + return; + } + final requestBody = request is http.MultipartRequest + ? json.encode(request.fields) + : request is http.Request + ? request.body + : ''; + + final requestData = NetworkData( + startTime: startTime!, + method: request.method, + url: request.url.toString(), + requestHeaders: requestHeaders, + requestBody: requestBody, + w3cHeader: w3CHeader, + ); + + final endTime = DateTime.now(); + + final responseHeaders = {}; + response.headers.forEach((String header, dynamic value) { + responseHeaders[header] = value; + }); + var requestBodySize = 0; + if (requestHeaders.containsKey('content-length')) { + requestBodySize = int.parse(responseHeaders['content-length'] ?? '0'); + } else { + requestBodySize = requestBody.length; + } + + var responseBodySize = 0; + if (responseHeaders.containsKey('content-length')) { + responseBodySize = int.parse(responseHeaders['content-length'] ?? '0'); + } else { + responseBodySize = response.body.length; + } + + networkLogger.networkLog( + requestData.copyWith( + status: response.statusCode, + duration: endTime.difference(requestData.startTime).inMicroseconds, + responseContentType: response.headers.containsKey('content-type') + ? response.headers['content-type'] + : '', + responseHeaders: responseHeaders, + responseBody: response.body, + requestBodySize: requestBodySize, + responseBodySize: responseBodySize, + requestContentType: request.headers.containsKey('content-type') + ? request.headers['content-type'] + : '', + ), + ); + } +} diff --git a/packages/instabug_http_client/pubspec.lock b/packages/instabug_http_client/pubspec.lock new file mode 100644 index 000000000..deb0402b8 --- /dev/null +++ b/packages/instabug_http_client/pubspec.lock @@ -0,0 +1,620 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + args: + dependency: transitive + description: + name: args + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 + url: "https://pub.dev" + source: hosted + version: "2.6.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "79b2aef6ac2ed00046867ed354c88778c9c0f029df8a20fe10b5436826721ef9" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" + url: "https://pub.dev" + source: hosted + version: "2.4.13" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 + url: "https://pub.dev" + source: hosted + version: "7.3.2" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: c7913a9737ee4007efedaffc968c049fd0f3d0e49109e778edc10de9426005cb + url: "https://pub.dev" + source: hosted + version: "8.9.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c + url: "https://pub.dev" + source: hosted + version: "0.4.2" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" + url: "https://pub.dev" + source: hosted + version: "4.10.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + convert: + dependency: transitive + description: + name: convert + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 + url: "https://pub.dev" + source: hosted + version: "3.1.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" + url: "https://pub.dev" + source: hosted + version: "3.0.6" + csslib: + dependency: transitive + description: + name: csslib + sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + file: + dependency: transitive + description: + name: file + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 + url: "https://pub.dev" + source: hosted + version: "7.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be + url: "https://pub.dev" + source: hosted + version: "1.1.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: f64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694 + url: "https://pub.dev" + source: hosted + version: "4.0.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: "741bbf84165310a68ff28fe9e727332eef1407342fca52759cb21ad8177bb8d0" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + html: + dependency: transitive + description: + name: html + sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" + url: "https://pub.dev" + source: hosted + version: "0.15.6" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + instabug_flutter: + dependency: "direct main" + description: + path: "../instabug_flutter" + relative: true + source: path + version: "16.0.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf + url: "https://pub.dev" + source: hosted + version: "0.7.1" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + url: "https://pub.dev" + source: hosted + version: "10.0.7" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + url: "https://pub.dev" + source: hosted + version: "3.0.8" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + logging: + dependency: transitive + description: + name: logging + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: "935e23e1ff3bc02d390bad4d4be001208ee92cc217cb5b5a6c19bc14aaa318c1" + url: "https://pub.dev" + source: hosted + version: "7.3.0" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + url: "https://pub.dev" + source: hosted + version: "0.11.1" + meta: + dependency: "direct main" + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + mime: + dependency: transitive + description: + name: mime + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mockito: + dependency: "direct dev" + description: + name: mockito + sha256: "6841eed20a7befac0ce07df8116c8b8233ed1f4486a7647c7fc5a02ae6163917" + url: "https://pub.dev" + source: hosted + version: "5.4.4" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + pana: + dependency: "direct dev" + description: + name: pana + sha256: "098eecfb7f80aecfff2395f9de1f19e31e7dc9a190708b75a1e708e6c2993c36" + url: "https://pub.dev" + source: hosted + version: "0.21.32" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + retry: + dependency: transitive + description: + name: retry + sha256: "822e118d5b3aafed083109c72d5f484c6dc66707885e07c0fbcb8b986bba7efc" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + safe_url_check: + dependency: transitive + description: + name: safe_url_check + sha256: "49a3e060a7869cbafc8f4845ca1ecbbaaa53179980a32f4fdfeab1607e90f41d" + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" + url: "https://pub.dev" + source: hosted + version: "1.12.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + tar: + dependency: transitive + description: + name: tar + sha256: "85ffd53e277f2bac8afa2885e6b195e26937e9c402424c3d88d92fd920b56de9" + url: "https://pub.dev" + source: hosted + version: "0.5.6" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 + url: "https://pub.dev" + source: hosted + version: "1.4.0" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + url: "https://pub.dev" + source: hosted + version: "14.3.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" + url: "https://pub.dev" + source: hosted + version: "0.1.6" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" + url: "https://pub.dev" + source: hosted + version: "3.0.1" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.18.0-18.0.pre.54" diff --git a/packages/instabug_http_client/pubspec.yaml b/packages/instabug_http_client/pubspec.yaml new file mode 100644 index 000000000..af206431b --- /dev/null +++ b/packages/instabug_http_client/pubspec.yaml @@ -0,0 +1,29 @@ +name: instabug_http_client +description: + This package is an add on to instabug_flutter. It intercepts any requests performed + with http Package and sends them to the report that will be sent to the dashboard. +version: 2.6.0 +homepage: https://github.com/Instabug/Instabug-Flutter#readme +documentation: https://docs.instabug.com/docs/flutter-overview +repository: https://github.com/Instabug/Instabug-Flutter/tree/refactor/monorepo/packages/instabug_http_client + +environment: + sdk: '>=2.12.0 <4.0.0' + +dependencies: + flutter: + sdk: flutter + http: ">=0.13.0 <2.0.0" + instabug_flutter: ">=14.0.0 <15.0.0" + meta: ^1.3.0 + +dev_dependencies: + build_runner: ^2.1.1 + flutter_test: + sdk: flutter + mockito: ^5.0.10 + pana: ^0.21.0 +# For information on the generic Dart part of this file, see the +# following page: https://www.dartlang.org/tools/pub/pubspec + +# The following section is specific to Flutter. diff --git a/packages/instabug_http_client/pubspec_overrides.yaml b/packages/instabug_http_client/pubspec_overrides.yaml new file mode 100644 index 000000000..1f0beaf62 --- /dev/null +++ b/packages/instabug_http_client/pubspec_overrides.yaml @@ -0,0 +1,4 @@ +# melos_managed_dependency_overrides: instabug_flutter +dependency_overrides: + instabug_flutter: + path: ../instabug_flutter diff --git a/packages/instabug_http_client/release.sh b/packages/instabug_http_client/release.sh new file mode 100644 index 000000000..39212c393 --- /dev/null +++ b/packages/instabug_http_client/release.sh @@ -0,0 +1,13 @@ +#!/bin/sh +VERSION=$(egrep -o "version: ([0-9]-*.*)+[0-9]" pubspec.yaml | cut -d ":" -f 2) +if [ ! "${VERSION}" ] || [ -z "${VERSION}" ];then + echo "Instabug: err: Version Number not found." + exit 1 +else + mkdir -p .pub-cache + cat < $HOME/.pub-cache/credentials.json + ${PUB_CREDENTIALS} + +EOF + flutter packages pub publish -f +fi \ No newline at end of file diff --git a/packages/instabug_http_client/test/instabug_http_client_test.dart b/packages/instabug_http_client/test/instabug_http_client_test.dart new file mode 100644 index 000000000..73014020b --- /dev/null +++ b/packages/instabug_http_client/test/instabug_http_client_test.dart @@ -0,0 +1,207 @@ +import 'dart:convert'; +import 'dart:io'; +// to maintain supported versions prior to Flutter 3.3 +// ignore: unnecessary_import +import 'dart:typed_data'; + +import 'package:flutter_test/flutter_test.dart'; +import 'package:http/http.dart' as http; +import 'package:http/testing.dart'; +import 'package:instabug_flutter/instabug_flutter.dart'; +import 'package:instabug_flutter/src/generated/instabug.api.g.dart'; +import 'package:instabug_http_client/instabug_http_client.dart'; +import 'package:instabug_http_client/instabug_http_logger.dart'; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; + +import 'instabug_http_client_test.mocks.dart'; + +@GenerateMocks([ + InstabugHttpLogger, + InstabugHttpClient, + InstabugHostApi, +]) +Future main() async { + TestWidgetsFlutterBinding.ensureInitialized(); + final mHost = MockInstabugHostApi(); + + setUpAll(() { + Instabug.$setHostApi(mHost); + NetworkLogger.$setHostApi(mHost); + when(mHost.isW3CFeatureFlagsEnabled()).thenAnswer( + (_) => Future>.value({ + 'isW3cCaughtHeaderEnabled': true, + 'isW3cExternalGeneratedHeaderEnabled': false, + 'isW3cExternalTraceIDEnabled': true, + }), + ); + }); + + const fakeResponse = { + 'id': '123', + 'activationCode': '111111', + }; + late Uri url; + final mockedResponse = http.Response(json.encode(fakeResponse), 200); + + late InstabugHttpClient instabugHttpClient; + + setUp(() { + url = Uri.parse('http://www.instabug.com'); + instabugHttpClient = InstabugHttpClient(); + instabugHttpClient.client = MockInstabugHttpClient(); + instabugHttpClient.logger = MockInstabugHttpLogger(); + }); + + test('expect instabug http client GET to return response', () async { + when( + instabugHttpClient.client.get(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + final result = await instabugHttpClient.get(url); + expect(result, isInstanceOf()); + expect(result, mockedResponse); + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(1); + }); + + test('expect instabug http client HEAD to return response', () async { + when( + instabugHttpClient.client.head(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + final result = await instabugHttpClient.head(url); + expect(result, isInstanceOf()); + expect(result, mockedResponse); + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(1); + }); + + test('expect instabug http client DELETE to return response', () async { + when( + instabugHttpClient.client.delete(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + final result = await instabugHttpClient.delete(url); + expect(result, isInstanceOf()); + expect(result, mockedResponse); + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(1); + }); + + test('expect instabug http client PATCH to return response', () async { + when( + instabugHttpClient.client.patch(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + final result = await instabugHttpClient.patch(url); + expect(result, isInstanceOf()); + expect(result, mockedResponse); + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(1); + }); + + test('expect instabug http client POST to return response', () async { + when( + instabugHttpClient.client.post(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + final result = await instabugHttpClient.post(url); + expect(result, isInstanceOf()); + expect(result, mockedResponse); + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(1); + }); + + test('expect instabug http client PUT to return response', () async { + when( + instabugHttpClient.client.put(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + final result = await instabugHttpClient.put(url); + expect(result, isInstanceOf()); + expect(result.body, mockedResponse.body); + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(1); + }); + + test('expect instabug http client READ to return response', () async { + const response = 'Some response string'; + when( + instabugHttpClient.client.read(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => response); + + final result = await instabugHttpClient.read(url); + expect(result, isInstanceOf()); + expect(result, response); + }); + + test('expect instabug http client READBYTES to return response', () async { + final response = Uint8List(3); + instabugHttpClient.client = + MockClient((_) async => http.Response.bytes(response, 200)); + + final result = await instabugHttpClient.readBytes(url); + expect(result, isInstanceOf()); + expect(result, response); + }); + + test('expect instabug http client SEND to return response', () async { + final response = http.StreamedResponse( + const Stream>.empty(), + 200, + contentLength: 0, + ); + final request = http.StreamedRequest('POST', url) + ..headers[HttpHeaders.contentTypeHeader] = + 'application/json; charset=utf-8' + ..headers[HttpHeaders.userAgentHeader] = 'Dart'; + when(instabugHttpClient.client.send(request)) + .thenAnswer((_) async => response); + final responseFuture = instabugHttpClient.send(request); + request + ..sink.add('{"hello": "world"}'.codeUnits) + ..sink.close(); + + final result = await responseFuture; + expect(result, isInstanceOf()); + expect(result.headers, response.headers); + expect(result.statusCode, response.statusCode); + expect(result.contentLength, response.contentLength); + expect(result.isRedirect, response.isRedirect); + expect(result.persistentConnection, response.persistentConnection); + expect(result.reasonPhrase, response.reasonPhrase); + expect(result.request, response.request); + expect( + await result.stream.bytesToString(), + await response.stream.bytesToString(), + ); + final logger = instabugHttpClient.logger as MockInstabugHttpLogger; + verify(logger.onLogger(any, startTime: anyNamed('startTime'))).called(1); + }); + + test('expect instabug http client CLOSE to be called', () async { + instabugHttpClient.close(); + + verify(instabugHttpClient.client.close()); + }); + + test('stress test for GET method', () async { + when( + instabugHttpClient.client.get(url, headers: anyNamed('headers')), + ).thenAnswer((_) async => mockedResponse); + for (var i = 0; i < 10000; i++) { + await instabugHttpClient.get(url); + } + verify( + instabugHttpClient.logger + .onLogger(mockedResponse, startTime: anyNamed('startTime')), + ).called(10000); + }); +} diff --git a/pubspec.yaml b/pubspec.yaml index 86884fb71..e31787f54 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,39 +1,11 @@ -name: instabug_flutter -version: 15.0.2 -description: >- - Instabug empowers mobile teams to monitor, prioritize, and debug - performance and stability issues throughout the app development lifecycle. -homepage: https://www.instabug.com/platforms/flutter -repository: https://github.com/Instabug/Instabug-Flutter -documentation: https://docs.instabug.com/docs/flutter-overview - -dependencies: - flutter: - sdk: flutter - meta: ^1.3.0 - stack_trace: ^1.10.0 +name: instabug_flutter_mono +publish_to: none +environment: + sdk: '>=2.19.4 <4.0.0' + flutter: ">=2.10.0" dev_dependencies: - build_runner: ^2.0.3 - fake_async: ">=1.2.0 <1.4.0" - flutter_test: - sdk: flutter - lint: ^1.0.0 - # mockito v5.2.0 is needed for running Flutter 2 tests on CI - mockito: ">=5.2.0 <5.5.0" - pana: ^0.21.0 - # pigeon v3.0.0 is needed for running Flutter 2 tests on CI - pigeon: ">=3.0.0 <=10.1.5" + lint: 2.0.0 + melos: ^6.2.0 -flutter: - plugin: - platforms: - android: - package: com.instabug.flutter - pluginClass: InstabugFlutterPlugin - ios: - pluginClass: InstabugFlutterPlugin -environment: - sdk: ">=2.14.0 <4.0.0" - flutter: ">=1.17.0" diff --git a/scripts/init.sh b/scripts/init.sh new file mode 100644 index 000000000..1191ca84f --- /dev/null +++ b/scripts/init.sh @@ -0,0 +1,47 @@ +#!/bin/bash + +if [ -d "android" ]; then + rm -rf "android" + echo "Folder android and its contents removed" +fi + +if [ -d "ios" ]; then + rm -rf "ios" + echo "Folder ios and its contents removed" +fi + + +if [ -d "build" ]; then + rm -rf "build" + echo "Folder build and its contents removed" +fi + +if [ -d "lib" ]; then + rm -rf "lib" + echo "Folder lib and its contents removed" +fi + +if [ -d "test" ]; then + rm -rf "test" + echo "Folder test and its contents removed" +fi + +if [ -d "example" ]; then + rm -rf "example" + echo "Folder example and its contents removed" +fi + +if command -v melos &> /dev/null +then + echo "Melos found" +else + echo "Melos not found" + dart pub global activate melos && echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> $BASH_ENV +fi + + +melos bootstrap +melos dart_bootstrap +melos pigeon --no-select +melos generate --no-select +melos pods --no-select diff --git a/scripts/move_coverage_files.sh b/scripts/move_coverage_files.sh new file mode 100644 index 000000000..5deea44e2 --- /dev/null +++ b/scripts/move_coverage_files.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Set source and target directories +TARGET_DIR="../../../coverage" + + + # Create the target directory if it doesn't exist + mkdir -p "$TARGET_DIR" + + mv "lcov.info" "$TARGET_DIR/lcov-${MELOS_PACKAGE_NAME}.info" + + echo "All files moved successfully." +