diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2af3ae0..80105ac 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -10,32 +10,32 @@ concurrency: jobs: analyze: timeout-minutes: 5 - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: kuhnroyal/flutter-fvm-config-action@v2 - id: fvm-config-action - - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: ${{ env.FLUTTER_CHANNEL }} - - name: Get all dependencies - run: flutter pub get - - name: analyze app - run: flutter analyze + - uses: actions/checkout@v3 + - uses: kuhnroyal/flutter-fvm-config-action@v2 + id: fvm-config-action + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: ${{ env.FLUTTER_CHANNEL }} + - name: Get all dependencies + run: flutter pub get + - name: analyze app + run: flutter analyze format: timeout-minutes: 5 - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - uses: kuhnroyal/flutter-fvm-config-action@v2 - id: fvm-config-action - - uses: subosito/flutter-action@v2 - with: - flutter-version: ${{ env.FLUTTER_VERSION }} - channel: ${{ env.FLUTTER_CHANNEL }} - - name: Get all dependencies - run: flutter pub get - - name: Check formatting - run: dart format -o none --set-exit-if-changed $(find . -name '*.dart' ! -name '*.g.dart' ! -name '*.freezed.dart' ! -path '*/generated/*' ! -path '*/gen/*') + - uses: actions/checkout@v3 + - uses: kuhnroyal/flutter-fvm-config-action@v2 + id: fvm-config-action + - uses: subosito/flutter-action@v2 + with: + flutter-version: ${{ env.FLUTTER_VERSION }} + channel: ${{ env.FLUTTER_CHANNEL }} + - name: Get all dependencies + run: flutter pub get + - name: Check formatting + run: dart format -o none --set-exit-if-changed $(find . -name '*.dart' ! -name '*.g.dart' ! -name '*.freezed.dart' ! -path '*/generated/*' ! -path '*/gen/*') diff --git a/LICENSE b/LICENSE index ba75c69..a0df58b 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1,21 @@ -TODO: Add your license here. +MIT License + +Copyright (c) 2026 Tapped + +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/lib/src/integration_test/browser_stack_api.dart b/lib/src/integration_test/browser_stack_api.dart index 59b0d9b..5ad6feb 100644 --- a/lib/src/integration_test/browser_stack_api.dart +++ b/lib/src/integration_test/browser_stack_api.dart @@ -19,29 +19,30 @@ class BrowserStackApi { stdout.writeln('Upload: $filename:\n'); int? uploadPercent; - final request = ProgressUpdateMultipartRequest( - "POST", - Uri.parse(url), - onProgress: (bytes, totalBytes) { - final remainingMbs = (bytes / 1024 / 1024); - final totalMbs = (totalBytes / 1024 / 1024); - - final percent = ((100 * remainingMbs) / totalMbs).round(); - - if (percent != uploadPercent) { - // https://stackoverflow.com/questions/72917845/how-to-remove-previous-printed-line-from-console-in-dart - // Append a \r to make sure we update the statement instead of adding a new one. - // Keep in mind to use write instead of writeln. - stdout.write( - '\ršŸš€ Uploading file: $filename... $percent% (${remainingMbs.toStringAsFixed(2)}MB / ${totalMbs.toStringAsFixed(2)}MB)', - ); - uploadPercent = percent; - } - }, - ) - ..headers[HttpHeaders.authorizationHeader] = basicAuthHeader - ..files.add(await http.MultipartFile.fromPath("file", file.path)) - ..fields.addAll(fields); + final request = + ProgressUpdateMultipartRequest( + "POST", + Uri.parse(url), + onProgress: (bytes, totalBytes) { + final remainingMbs = (bytes / 1024 / 1024); + final totalMbs = (totalBytes / 1024 / 1024); + + final percent = ((100 * remainingMbs) / totalMbs).round(); + + if (percent != uploadPercent) { + // https://stackoverflow.com/questions/72917845/how-to-remove-previous-printed-line-from-console-in-dart + // Append a \r to make sure we update the statement instead of adding a new one. + // Keep in mind to use write instead of writeln. + stdout.write( + '\ršŸš€ Uploading file: $filename... $percent% (${remainingMbs.toStringAsFixed(2)}MB / ${totalMbs.toStringAsFixed(2)}MB)', + ); + uploadPercent = percent; + } + }, + ) + ..headers[HttpHeaders.authorizationHeader] = basicAuthHeader + ..files.add(await http.MultipartFile.fromPath("file", file.path)) + ..fields.addAll(fields); final response = await http.Response.fromStream(await request.send());