Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 1166df3
Author: Amos <[email protected]>
Date:   Sat Oct 19 16:15:32 2024 +0800

    Refactor: Replace Platform (dart:io) with TargetPlatform (#269)

    ## Description

    Support WASM.

    ![image](https://github.com/user-attachments/assets/590e28bc-133d-4810-a4fd-54f4228b9e65)

    ## Summary (check all that apply)

    - [x] Modified / added code
    - [x] Modified / added tests
    - [x] Modified / added examples
    - [ ] Modified / added others (pubspec.yaml, workflows, etc...)
    - [ ] Updated README
    - [ ] Contains breaking changes
      - [ ] Created / updated migration guide
    - [ ] Incremented version number
      - [ ] Updated CHANGELOG

commit b731d88
Author: Daichi Fujita <[email protected]>
Date:   Thu Oct 10 00:06:47 2024 +0900

    Migrate to Android Studio Ladybug (#262)

    Updated the Gradle and AGP versions in the example project to migrate to
    the latest version of Android Studio (Ladybug).
  • Loading branch information
fujidaiti committed Oct 19, 2024
1 parent c67d757 commit 298c97b
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 331 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,5 @@ fabric.properties
# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
# Caches
.idea/caches/
318 changes: 0 additions & 318 deletions .idea/caches/deviceStreaming.xml

This file was deleted.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
2 changes: 1 addition & 1 deletion example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "com.android.application" version '7.4.2' apply false
}

include ":app"
5 changes: 3 additions & 2 deletions example/lib/showcase/ai_playlist_generator.dart
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart'
show TargetPlatform, defaultTargetPlatform;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:go_router/go_router.dart';
import 'package:smooth_sheets/smooth_sheets.dart';

void main() {
// Make the system navigation bar transparent on Android.
if (Platform.isAndroid) {
if (defaultTargetPlatform == TargetPlatform.android) {
WidgetsFlutterBinding.ensureInitialized();
SystemChrome.setEnabledSystemUIMode(
SystemUiMode.edgeToEdge,
Expand Down
14 changes: 8 additions & 6 deletions lib/src/foundation/sheet_physics.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import 'dart:io';
import 'dart:math';

import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart'
show TargetPlatform, defaultTargetPlatform;
import 'package:flutter/gestures.dart';
import 'package:flutter/widgets.dart';

Expand Down Expand Up @@ -36,11 +37,12 @@ abstract class SheetPhysics {
/// the first time or after each time the drag motion stopped.
///
/// If null, no minimum threshold is enforced.
double? get dragStartDistanceMotionThreshold {
return Platform.isIOS
? const BouncingScrollPhysics().dragStartDistanceMotionThreshold
: null;
}
double? get dragStartDistanceMotionThreshold =>
switch (defaultTargetPlatform) {
TargetPlatform.iOS =>
const BouncingScrollPhysics().dragStartDistanceMotionThreshold,
_ => null,
};

/// Create a copy of this object appending the [ancestor] to
/// the physics chain, much like [ScrollPhysics.applyTo].
Expand Down
Loading

0 comments on commit 298c97b

Please sign in to comment.