Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dots appear under FAB with elevation without a background color #90254

Closed
PcolBP opened this issue Sep 17, 2021 · 10 comments
Closed

Dots appear under FAB with elevation without a background color #90254

PcolBP opened this issue Sep 17, 2021 · 10 comments
Labels
c: regression It was better in the past than it is now dependency: skia Skia team may need to help us f: material design flutter/packages/flutter/material repository. found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on r: fixed Issue is closed as already fixed in a newer version

Comments

@PcolBP
Copy link

PcolBP commented Sep 17, 2021

Description

After upgrading from flutter 2.2.3 as in title to 2.5.0 strange dots appears underneath floating action buttons.
Shadow appear with dot.
I noticed also when removing shadow from one of the button, dot dissapear on another one.
Tested on real devices on both platforms Android and IOS.

Sample tested also on master channel 2b6f3bf, bug still persist.

I allowed myself to tag @zanderso since you told me to create new issue.
Thanks a lot of for digging into it.

Steps to Reproduce

  1. Run flutter create bug-shadow-flutter.
  2. Update the files as follows:
Main:
import 'package:flutter/material.dart';
import 'themes.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Shadow Flickering',
      theme: Themes.light,
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: Padding(
        padding: const EdgeInsets.all(12),
        child: Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            FloatingActionButton(
              heroTag: hashCode,
              tooltip: 'filter',
              elevation: 13.5,
              onPressed: () {},
              child: Image.asset(
                'images/filter_menu.png',
                height: 40,
                color: Themes.mainColor,
              ),
            ),
            FloatingActionButton(
              heroTag: hashCode+1,
              tooltip: 'filter',
              elevation: 13.5,
              onPressed: () {},
              child: Image.asset(
                'images/filter_menu.png',
                height: 40,
                color: Themes.mainColor,
              ),
            ),
          ],
        ),
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      body: CustomScrollView(
        slivers: [
          const SliverAppBar(
            backgroundColor: Themes.mainColor,
            leading: SizedBox(),
            floating: true,
            flexibleSpace: FlexibleSpaceBar(
              centerTitle: true,
              titlePadding: EdgeInsets.only(bottom: 16),
              title: Text('articles'),
            ),
          ),
          SliverList(
            delegate: SliverChildBuilderDelegate(
                  (ctx, index) => Padding(
                    padding: const EdgeInsets.all(10),
                    child: Card(
                      color: Themes.mainColor,
                      child: SizedBox(
                        width: MediaQuery.of(context).size.width,
                        height: MediaQuery.of(context).size.height/4,
                      ),
              ),
                  ),
              childCount: 50,
            ),
          ),
        ],
      ),
    );
  }
}

themes file:
import 'package:flutter/material.dart';

class Themes {
  static const Color mainColor = Colors.red;
  static const Brightness brightness = Brightness.light;
  static const RoundedRectangleBorder _shapeRadiusAll = RoundedRectangleBorder(
    borderRadius: BorderRadius.all(
      Radius.circular(5),
    ),
  );

  static ThemeData get light => ThemeData(
        shadowColor: Colors.black,
        splashColor: mainColor,
        primaryColor: mainColor,
        colorScheme: ColorScheme.fromSwatch(
          primarySwatch: Colors.red,
          brightness: brightness,
          accentColor: Colors.white38,
          backgroundColor: Colors.white,
        ),
        primaryColorLight: mainColor,
        primaryColorDark: mainColor,
        backgroundColor: Colors.white,
        tooltipTheme: const TooltipThemeData(
          preferBelow: false,
        ),
        elevatedButtonTheme: ElevatedButtonThemeData(
          style: ButtonStyle(
            backgroundColor: MaterialStateProperty.resolveWith(
              (states) => mainColor,
            ),
          ),
        ),
        textButtonTheme: TextButtonThemeData(
          style: ButtonStyle(
            foregroundColor:
                MaterialStateProperty.resolveWith((states) => Colors.white),
            backgroundColor:
                MaterialStateProperty.resolveWith((states) => mainColor),
          ),
        ),
        brightness: brightness,
        textTheme: const TextTheme(
          bodyText2: TextStyle(
            fontWeight: FontWeight.bold,
          ),
        ),
        snackBarTheme: const SnackBarThemeData(
          elevation: 10,
        ),
        cardTheme: const CardTheme(
          elevation: 15,
          shape: _shapeRadiusAll,
          clipBehavior: Clip.antiAlias,
        ),
        buttonTheme: const ButtonThemeData(
          buttonColor: mainColor,
          textTheme: ButtonTextTheme.primary,
          shape: _shapeRadiusAll,
        ),
        /*ButtonTheme.of(context).copyWith(
          buttonColor: mainColor,
          textTheme: ButtonTextTheme.primary,
          shape: _shapeRadiusAll,
        ),*/
        floatingActionButtonTheme: const FloatingActionButtonThemeData(
          elevation: 0,
          backgroundColor: Colors.transparent,
          splashColor: Colors.transparent,
        ),
        bottomSheetTheme: const BottomSheetThemeData(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.vertical(
              top: Radius.circular(10),
            ),
          ),
          clipBehavior: Clip.antiAliasWithSaveLayer,
          elevation: 10,
        ),
        tabBarTheme: const TabBarTheme(
          labelColor: Colors.white,
          unselectedLabelColor: Colors.white70,
          indicatorSize: TabBarIndicatorSize.label,
        ),
        appBarTheme: const AppBarTheme(
          elevation: 0,
          color: mainColor,
        ),
      );
}
3. Add to pubspec.yaml
assets:
    - images/filter_menu.png
  1. Download image 'filter_menu.png' from https://github.com/PcolBP/bug-shadow-flutter.git or just download whole respository which contain that sample.

Expected results:
Floating action buttons without strange dot underneath.

Actual results:
Strange dot underneath floating action buttons:
Screenshot_20210917-092035

Logs

flutter run --verbose

[ +74 ms] executing: [C:\SDK\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +507 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +1 ms] 4cc385b
[ +1 ms] executing: [C:\SDK\flutter/] git tag --points-at 4cc385b
[ +52 ms] Exit code 0 from: git tag --points-at 4cc385b
[ ] 2.5.0
[ +10 ms] executing: [C:\SDK\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +36 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [C:\SDK\flutter/] git ls-remote --get-url origin
[ +33 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +112 ms] executing: [C:\SDK\flutter/] git rev-parse --abbrev-ref HEAD
[ +35 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +85 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +5 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +63 ms] executing: C:\SDK\platform-tools\adb.exe devices -l
[ +49 ms] List of devices attached
22c23a7c140d7ece device product:star2ltexx model:SM_G965F device:star2lte transport_id:1
YOGA9A7BB422 device product:YT3_10_row_lte model:Lenovo_YT3_X90L device:YT3 transport_id:2
ZH80052UJN device product:D2303 model:D2303 device:D2303 transport_id:3
[ +6 ms] C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell getprop
[ +92 ms] C:\SDK\platform-tools\adb.exe -s YOGA9A7BB422 shell getprop
[ +88 ms] C:\SDK\platform-tools\adb.exe -s ZH80052UJN shell getprop
[ +90 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +86 ms] Multiple devices found:
[ +4 ms] ro.hardware = samsungexynos9810
[ +1 ms] ro.hardware = r2_cht_ffd
[ ] ro.build.characteristics = tablet
[ ] ro.hardware = qcom
[ +23 ms] SM G965F (mobile) • 22c23a7c140d7ece • android-arm64 • Android 10 (API 29)
[ +2 ms] Lenovo YT3 X90L (mobile) • YOGA9A7BB422 • android-x64 • Android 6.0.1 (API 23)
[ ] D2303 (mobile) • ZH80052UJN • android-arm • Android 5.1.1 (API 22)
[ ] Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
[ ] Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.47
[ +2 ms] [1]: SM G965F (22c23a7c140d7ece)
[ ] [2]: Lenovo YT3 X90L (YOGA9A7BB422)
[ ] [3]: D2303 (ZH80052UJN)
[ ] [4]: Chrome (chrome)
[ ] [5]: Edge (edge)
[ +1 ms] Please choose one (To quit, press "q/Q")
[ ] :
[+8703 ms] 1
[ +12 ms] Skipping pub get: version match.
[ +118 ms] Generating
D:\bug\bug-shadow-flutter\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +91 ms] Initializing file store
[ +12 ms] Skipping target: gen_localizations
[ +7 ms] Skipping target: gen_dart_plugin_registrant
[ +1 ms] Skipping target: _composite
[ +2 ms] complete
[ +6 ms] Launching lib\main.dart on SM G965F in debug mode...
[ +5 ms] C:\SDK\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\SDK\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root
C:\SDK\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk/ --incremental --target=flutter
--debugger-module-names --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true --output-dill
C:\Users\Pioter\AppData\Local\Temp\flutter_tools.1cc7b0ed\flutter_tool.379e6711\app.dill --packages
D:\bug\bug-shadow-flutter.dart_tool\package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false
--enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill
build\c075001b96339384a97db4862b8ab8db.cache.dill.track.dill --enable-experiment=alternative-invalidation-strategy
[ +11 ms] executing: C:\SDK\build-tools\31.0.0\aapt dump xmltree
D:\bug\bug-shadow-flutter\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ +14 ms] Exit code 0 from: C:\SDK\build-tools\31.0.0\aapt dump xmltree
D:\bug\bug-shadow-flutter\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ +1 ms] N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:versionCode(0x0101021b)=(type 0x10)0x1
A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1e
A: android:compileSdkVersionCodename(0x01010573)="11" (Raw: "11")
A: package="com.example.bug" (Raw: "com.example.bug")
A: platformBuildVersionCode=(type 0x10)0x1e
A: platformBuildVersionName=(type 0x10)0xb
E: uses-sdk (line=7)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1e
E: uses-permission (line=14)
A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
E: application (line=16)
A: android:label(0x01010001)="bug" (Raw: "bug")
A: android:icon(0x01010002)=@0x7f080000
A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
"androidx.core.app.CoreComponentFactory")
E: activity (line=21)
A: android:theme(0x01010000)=@0x7f0a0000
A: android:name(0x01010003)="com.example.bug.MainActivity" (Raw: "com.example.bug.MainActivity")
A: android:launchMode(0x0101001d)=(type 0x10)0x1
A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
E: meta-data (line=35)
A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw:
"io.flutter.embedding.android.NormalTheme")
A: android:resource(0x01010025)=@0x7f0a0001
E: meta-data (line=45)
A: android:name(0x01010003)="io.flutter.embedding.android.SplashScreenDrawable" (Raw:
"io.flutter.embedding.android.SplashScreenDrawable")
A: android:resource(0x01010025)=@0x7f040000
E: intent-filter (line=49)
E: action (line=50)
A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
E: category (line=52)
A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
"android.intent.category.LAUNCHER")
E: meta-data (line=59)
A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
A: android:value(0x01010024)=(type 0x10)0x2
[ +8 ms] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell -x logcat -v time -t 1
[ +14 ms] <- compile package:bug/main.dart
[ +189 ms] --------- beginning of system
09-17 09:23:08.714 I/io_stats( 2514): !@ 8,0 r 686714 31883192 w 1437703 31934884 d 113043
62750840 f 324158 331956 iot 1007532 720863 th 102400 0 0 pt 0 inp 0 0 350967.816
[ +11 ms] executing: C:\SDK\platform-tools\adb.exe version
[ +21 ms] Android Debug Bridge version 1.0.41
Version 31.0.3-7562133
Installed as C:\SDK\platform-tools\adb.exe
[ +2 ms] executing: C:\SDK\platform-tools\adb.exe start-server
[ +22 ms] Building APK
[ +17 ms] Running Gradle task 'assembleDebug'...
[ +4 ms] Using gradle from D:\bug\bug-shadow-flutter\android\gradlew.bat.
[ +12 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +156 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ ] openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed mode)
[ +1 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +155 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ ] openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed mode)
[ +1 ms] executing: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ +170 ms] Exit code 0 from: C:\Program Files\Android\Android Studio\jre\bin\java -version
[ ] openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
OpenJDK 64-Bit Server VM (build 11.0.10+0-b96-7249189, mixed mode)
[ +3 ms] executing: [D:\bug\bug-shadow-flutter\android/] D:\bug\bug-shadow-flutter\android\gradlew.bat -Pverbose=true
-Ptarget-platform=android-arm64 -Ptarget=D:\bug\bug-shadow-flutter\lib\main.dart
-Pdart-defines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ== -Pdart-obfuscation=false -Ptrack-widget-creation=true
-Ptree-shake-icons=false -Pfilesystem-scheme=org-dartlang-root assembleDebug
[ +772 ms] Welcome to Gradle 6.7!
[ ] Here are the highlights of this release:
[ ] - File system watching is ready for production use
[ ] - Declare the version of Java your build requires
[ ] - Java 15 support
[ ] For more details see https://docs.gradle.org/6.7/release-notes.html
[+2897 ms] > Task :app:compileFlutterBuildDebug
[ ] [ +68 ms] executing: [C:\SDK\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] [ +463 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] [ ] 4cc385b
[ ] [ ] executing: [C:\SDK\flutter/] git tag --points-at 4cc385b
[ ] [ +48 ms] Exit code 0 from: git tag --points-at 4cc385b
[ ] [ ] 2.5.0
[ ] [ +7 ms] executing: [C:\SDK\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ ] [ +35 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] [ ] origin/stable
[ ] [ ] executing: [C:\SDK\flutter/] git ls-remote --get-url origin
[ ] [ +31 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] [ ] https://github.com/flutter/flutter.git
[ ] [ +57 ms] executing: [C:\SDK\flutter/] git rev-parse --abbrev-ref HEAD
[ ] [ +34 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] [ ] stable
[ ] [ +54 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] [ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] [ +100 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[ ] [ +4 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[ ] [ ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ ] [ +35 ms] Initializing file store
[ ] [ +12 ms] Done initializing file store
[ ] [ +43 ms] Skipping target: gen_localizations
[ ] [ +11 ms] Skipping target: gen_dart_plugin_registrant
[ +167 ms] [ +525 ms] Skipping target: kernel_snapshot
[ +297 ms] [ +304 ms] Skipping target: debug_android_application
[ ] [ ] Persisting file store
[ +109 ms] [ +8 ms] Done persisting file store
[ +1 ms] [ +4 ms] build succeeded.
[ ] [ +14 ms] "flutter assemble" took 1 084ms.
[ +89 ms] [ +138 ms] ensureAnalyticsSent: 135ms
[ ] [ +2 ms] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ ] [ ] exiting with code 0
[ +108 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[ ] > Task :app:preBuild UP-TO-DATE
[ ] > Task :app:preDebugBuild UP-TO-DATE
[ ] > Task :app:compileDebugAidl NO-SOURCE
[ ] > Task :app:compileDebugRenderscript NO-SOURCE
[ ] > Task :app:generateDebugBuildConfig UP-TO-DATE
[ ] > Task :app:checkDebugAarMetadata UP-TO-DATE
[ ] > Task :app:cleanMergeDebugAssets
[ ] > Task :app:mergeDebugShaders UP-TO-DATE
[ ] > Task :app:compileDebugShaders NO-SOURCE
[ ] > Task :app:generateDebugAssets UP-TO-DATE
[ ] > Task :app:mergeDebugAssets
[ +291 ms] > Task :app:copyFlutterAssetsDebug
[ ] > Task :app:generateDebugResValues UP-TO-DATE
[ +1 ms] > Task :app:generateDebugResources UP-TO-DATE
[ ] > Task :app:mergeDebugResources UP-TO-DATE
[ ] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[ ] > Task :app:extractDeepLinksDebug UP-TO-DATE
[ ] > Task :app:processDebugMainManifest UP-TO-DATE
[ ] > Task :app:processDebugManifest UP-TO-DATE
[ ] > Task :app:processDebugManifestForPackage UP-TO-DATE
[ +89 ms] > Task :app:processDebugResources UP-TO-DATE
[ +1 ms] > Task :app:compileDebugKotlin UP-TO-DATE
[ ] > Task :app:javaPreCompileDebug UP-TO-DATE
[ ] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[ ] > Task :app:compileDebugSources UP-TO-DATE
[ ] > Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
[ ] > Task :app:compressDebugAssets UP-TO-DATE
[ ] > Task :app:processDebugJavaRes NO-SOURCE
[ ] > Task :app:mergeDebugJavaResource UP-TO-DATE
[ ] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ +101 ms] > Task :app:dexBuilderDebug UP-TO-DATE
[ ] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[ ] > Task :app:mergeExtDexDebug UP-TO-DATE
[ ] > Task :app:mergeDexDebug UP-TO-DATE
[ ] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[ ] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[ ] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[ ] > Task :app:validateSigningDebug UP-TO-DATE
[ ] > Task :app:packageDebug UP-TO-DATE
[ +91 ms] > Task :app:assembleDebug
[ +39 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[ ] Use '--warning-mode all' to show the individual deprecation warnings.
[ ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[ ] BUILD SUCCESSFUL in 4s
[ +1 ms] 32 actionable tasks: 5 executed, 27 up-to-date
[ +540 ms] Running Gradle task 'assembleDebug'... (completed in 6,1s)
[ +79 ms] calculateSha: LocalDirectory: 'D:\bug\bug-shadow-flutter\build\app\outputs\flutter-apk'/app.apk
[ +614 ms] ✓ Built build\app\outputs\flutter-apk\app-debug.apk.
[ +5 ms] executing: C:\SDK\build-tools\31.0.0\aapt dump xmltree
D:\bug\bug-shadow-flutter\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ +17 ms] Exit code 0 from: C:\SDK\build-tools\31.0.0\aapt dump xmltree
D:\bug\bug-shadow-flutter\build\app\outputs\flutter-apk\app.apk AndroidManifest.xml
[ ] N: android=http://schemas.android.com/apk/res/android
E: manifest (line=2)
A: android:versionCode(0x0101021b)=(type 0x10)0x1
A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1e
A: android:compileSdkVersionCodename(0x01010573)="11" (Raw: "11")
A: package="com.example.bug" (Raw: "com.example.bug")
A: platformBuildVersionCode=(type 0x10)0x1e
A: platformBuildVersionName=(type 0x10)0xb
E: uses-sdk (line=7)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1e
E: uses-permission (line=14)
A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
E: application (line=16)
A: android:label(0x01010001)="bug" (Raw: "bug")
A: android:icon(0x01010002)=@0x7f080000
A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
"androidx.core.app.CoreComponentFactory")
E: activity (line=21)
A: android:theme(0x01010000)=@0x7f0a0000
A: android:name(0x01010003)="com.example.bug.MainActivity" (Raw: "com.example.bug.MainActivity")
A: android:launchMode(0x0101001d)=(type 0x10)0x1
A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
E: meta-data (line=35)
A: android:name(0x01010003)="io.flutter.embedding.android.NormalTheme" (Raw:
"io.flutter.embedding.android.NormalTheme")
A: android:resource(0x01010025)=@0x7f0a0001
E: meta-data (line=45)
A: android:name(0x01010003)="io.flutter.embedding.android.SplashScreenDrawable" (Raw:
"io.flutter.embedding.android.SplashScreenDrawable")
A: android:resource(0x01010025)=@0x7f040000
E: intent-filter (line=49)
E: action (line=50)
A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
E: category (line=52)
A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
"android.intent.category.LAUNCHER")
E: meta-data (line=59)
A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
A: android:value(0x01010024)=(type 0x10)0x2
[ +2 ms] Stopping app 'app.apk' on SM G965F.
[ ] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell am force-stop com.example.bug
[ +119 ms] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell pm list packages com.example.bug
[ +177 ms] package:com.example.bug
[ +2 ms] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell cat
/data/local/tmp/sky.com.example.bug.sha1
[ +69 ms] bebd2f07200a2fc20b3c4b34a0af23a76521f0b3
[ +1 ms] Latest build already installed.
[ ] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell -x logcat -v time -t 1
[ +151 ms] --------- beginning of main
09-17 09:23:20.506 D/RegisteredNfcFServicesCache( 1675): Service unchanged, not updating
[ +7 ms] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece shell am start -a android.intent.action.RUN -f
0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true --ez
verify-entry-points true com.example.bug/com.example.bug.MainActivity
[ +93 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.example.bug/.MainActivity (has
extras) }
[ ] Waiting for observatory port to be available...
[ +285 ms] W/FlutterActivityAndFragmentDelegate( 1453): A splash screen was provided to Flutter, but this is deprecated.
See flutter.dev/go/android-splash-migration for migration steps.
[ +175 ms] Observatory URL on device: http://127.0.0.1:38947/GKPt8nU3O44=/
[ +1 ms] executing: C:\SDK\platform-tools\adb.exe -s 22c23a7c140d7ece forward tcp:0 tcp:38947
[ +22 ms] 1181
[ ] Forwarded host port 1181 to device port 38947 for Observatory
[ +4 ms] Caching compiled dill
[ +24 ms] Connecting to service protocol: http://127.0.0.1:1181/GKPt8nU3O44=/
[ +317 ms] Launching a Dart Developer Service (DDS) instance at http://127.0.0.1:0, connecting to VM service at
http://127.0.0.1:1181/GKPt8nU3O44=/.
[ +169 ms] DDS is listening at http://127.0.0.1:1186/aRyZx_0h2_E=/.
[ +51 ms] Successfully connected to service protocol: http://127.0.0.1:1181/GKPt8nU3O44=/
[ +70 ms] DevFS: Creating new filesystem on the device (null)
[ +44 ms] DevFS: Created new filesystem on the device
(file:///data/user/0/com.example.bug/code_cache/bug-shadow-flutterINENYG/bug-shadow-flutter/)
[ +2 ms] Updating assets
[ +73 ms] Syncing files to device SM G965F...
[ +2 ms] <- reset
[ ] Compiling dart to kernel with 0 updated files
[ +3 ms] <- recompile package:bug/main.dart 19433bbd-9f5d-4be9-a6b1-3ce544360361
[ ] <- 19433bbd-9f5d-4be9-a6b1-3ce544360361
[ +60 ms] Updating files.
[ ] DevFS: Sync finished
[ +1 ms] Syncing files to device SM G965F... (completed in 68ms)
[ +1 ms] Synced 0.0MB.
[ +1 ms] <- accept
[ +6 ms] Connected to _flutterView/0x7cd7db2820.
[ +4 ms] Flutter run key commands.
[ +2 ms] r Hot reload. 🔥🔥🔥
[ +1 ms] R Hot restart.
[ +1 ms] h List all available interactive commands.
[ ] d Detach (terminate "flutter run" but leave application running).
[ +1 ms] c Clear the screen
[ +1 ms] q Quit (terminate the application on the device).
[ ] 💪 Running with sound null safety 💪
[ ] An Observatory debugger and profiler on SM G965F is available at: http://127.0.0.1:1186/aRyZx_0h2_E=/
[ +171 ms] DevTools activation throttled until 2021-09-17 20:16:04.843307.
[+1012 ms] The Flutter DevTools debugger and profiler on SM G965F is available at:
http://127.0.0.1:9104?uri=http://127.0.0.1:1186/aRyZx_0h2_E=/

flutter analyze

Analyzing bug-shadow-flutter...
No issues found! (ran in 1.6s)

flutter doctor -v

[✓] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Version 10.0.19043.1237], locale pl-PL)
• Flutter version 2.5.0 at C:\SDK\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b (9 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at C:\SDK
• Platform android-31, build-tools 31.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[✓] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.60.0)
• VS Code at C:\Users\Pioter\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.26.0

[✓] Connected device (5 available)
• SM G965F (mobile) • 22c23a7c140d7ece • android-arm64 • Android 10 (API 29)
• Lenovo YT3 X90L (mobile) • YOGA9A7BB422 • android-x64 • Android 6.0.1 (API 23)
• D2303 (mobile) • ZH80052UJN • android-arm • Android 5.1.1 (API 22)
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
• Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.47

• No issues found!

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Sep 17, 2021
@danagbemava-nc
Copy link
Member

danagbemava-nc commented Sep 17, 2021

Issue is reproducible on master and stable. However, it does not reproduce on stable 2.2.3.

I played around with OP's code and here are my findings.

screenshots Various elevations levels

13.5 -- 24

13-24

13.5 -- 4

13-4

13.5 -- 1

13-1

13.5 -- 0

13-0

With and without backgroundColor

Simulator Screen Shot - iPhone 12 - 2021-09-17 at 14 00 52

Material vs FABS

Simulator Screen Shot - iPhone 12 - 2021-09-17 at 12 11 54

Stable 2.2.3

Simulator Screen Shot - iPhone 12 - 2021-09-17 at 12 26 07

Simulator Screen Shot - iPhone 12 - 2021-09-17 at 13 55 39

updated main.dart
import 'package:flutter/material.dart';
import 'themes.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Shadow Flickering',
      theme: Themes.light,
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      floatingActionButton: Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        children: [
          FloatingActionButton(
            heroTag: hashCode,
            tooltip: 'filter',
            elevation: 13.5,
            onPressed: () {},
            backgroundColor: Colors.transparent,
            foregroundColor: Colors.white,
            child: Image.asset(
              'images/filter_menu.png',
              height: 32,
              color: Themes.mainColor,
            ),
          ),
          Material(
            elevation: 13.5,
            color: Colors.transparent,
            child: Container(
              height: 32,
              width: 32,
              margin: EdgeInsets.only(left: 12.0),
              decoration: BoxDecoration(shape: BoxShape.circle),
              child: Image.asset(
                'images/filter_menu.png',
                color: Themes.mainColor,
                height: 32,
              ),
            ),
          ),
          FloatingActionButton(
            heroTag: hashCode + 1,
            tooltip: 'filter',
            elevation: 0,
            onPressed: () {},
            child: Image.asset(
              'images/filter_menu.png',
              height: 32,
              color: Themes.mainColor,
            ),
          ),
        ],
      ),
      floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
      body: CustomScrollView(
        slivers: [
          const SliverAppBar(
            backgroundColor: Themes.mainColor,
            leading: SizedBox(),
            floating: true,
            flexibleSpace: FlexibleSpaceBar(
              centerTitle: true,
              titlePadding: EdgeInsets.only(bottom: 16),
              title: Text('articles'),
            ),
          ),
          SliverList(
            delegate: SliverChildBuilderDelegate(
              (ctx, index) => Padding(
                padding: const EdgeInsets.all(10),
                child: Card(
                  color: Themes.mainColor,
                  child: SizedBox(
                    width: MediaQuery.of(context).size.width,
                    height: MediaQuery.of(context).size.height / 4,
                  ),
                ),
              ),
              childCount: 50,
            ),
          ),
        ],
      ),
    );
  }
}



flutter doctor -v
[✓] Flutter (Channel master, 2.6.0-6.0.pre.128, on macOS 11.5.1 20G80 darwin-arm, locale en-GB)
    • Flutter version 2.6.0-6.0.pre.128 at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fa9790ca47 (7 hours ago), 2021-09-17 01:37:03 -0400
    • Engine revision e70febab63
    • Dart version 2.15.0 (build 2.15.0-118.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.5.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.60.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12 (API 31) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 11.5.1 20G80 darwin-arm
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 93.0.4577.82

• No issues found!
[✓] Flutter (Channel stable, 2.5.0, on macOS 11.5.1 20G80 darwin-arm, locale en-GB)
    • Flutter version 2.5.0 at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4cc385b4b8 (9 days ago), 2021-09-07 23:01:49 -0700
    • Engine revision f0826da7ef
    • Dart version 2.14.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.11.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.60.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12 (API 31) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 11.5.1 20G80 darwin-arm
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 93.0.4577.82

• No issues found!
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-arm, locale en-GB)
    • Flutter version 2.2.3 at /Users/nexus/dev/sdks/flutter_rc/flutter
    • Framework revision f4abaa0735 (3 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.5.1, Build version 12E507
    • CocoaPods version 1.11.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code (version 1.60.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.26.0

[✓] Connected device (3 available)
    • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12 (API 31) (emulator)
    • macOS (desktop)             • macos         • darwin-arm64   • macOS 11.5.1 20G80 darwin-arm
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 93.0.4577.82

• No issues found!

Edit: add more info

@danagbemava-nc danagbemava-nc added f: material design flutter/packages/flutter/material repository. found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on c: regression It was better in the past than it is now and removed in triage Presently being triaged by the triage team labels Sep 17, 2021
@danagbemava-nc danagbemava-nc changed the title Strange dot appears with shadow after upgrade flutter from 2.2.3 to 2.5.0 Dots appear under FAB with elevation without a background color Sep 17, 2021
@HansMuller
Copy link
Contributor

CC @rami-a

@erickcchoi
Copy link

Same issue here, Strange dot will appear when FAB backgound color defined by "Color.fromARGB(0, 71, 150, 236)"

@justinmc
Copy link
Contributor

I just spent some time trying to bisect this only to realize that this bug is happening randomly. If I hard restart the repro app, it has a ~50% chance of occurring or not.

Bisecting again with a bunch of restarts, I see that this first appeared in 2.5.0-1.0 pre. The commit that caused it was eb64852 from the engine PR flutter/engine#27124. Looks like that brought in a shadow change from Skia.

@untp @yjbanov @flar Do you have any idea what in that PR caused this regression and what we can do to fix it?

@untp
Copy link

untp commented Dec 29, 2021

@justinmc Thanks for mentioning me. I didn't know there was a regression. I digged down the issue and found Skia causing the issue. Here is my findings:

The issue is reproduced when Scaffold.floatingActionButton used:
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        floatingActionButton: FloatingActionButton(
          backgroundColor: Colors.transparent,
          elevation: 12,
          onPressed: () {},
        ),
      ),
    ),
  );
}
The issue is NOT reproduced when Scaffold.body used:
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: FloatingActionButton(
          backgroundColor: Colors.transparent,
          elevation: 12,
          onPressed: () {},
        ),
      ),
    ),
  );
}

The reason is floatingActionButton is wrapped with scale and rotation animations. Rotation's default value is 360 degrees (2 * pi).

When Transform.rotate used in Scaffold.body, the issue is reproduced:
import 'package:flutter/material.dart';

void main() {
  runApp(
    MaterialApp(
      home: Scaffold(
        body: Transform.rotate(
          angle: 2 * pi,
          child: FloatingActionButton(
            backgroundColor: Colors.transparent,
            elevation: 12,
            onPressed: () {},
          ),
        ),
      ),
    ),
  );
}

Then I wrote a low level (dart:ui) implementation, found a strange error.

Here is the code:
import 'dart:math';
import 'dart:ui';

import 'package:flutter/material.dart';

// Change this to BugType.none or BugType.fixed
const reproducedBugType = BugType.flashing;

enum BugType { none, fixed, flashing }

final circlePath = Path()..addOval(const Rect.fromLTWH(0, 0, 56, 56));

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  window.onDrawFrame = () {
    final builder = SceneBuilder();

    final whiteBackground = PictureRecorder();
    Canvas(whiteBackground).drawColor(Colors.white, BlendMode.src);
    builder.addPicture(Offset.zero, whiteBackground.endRecording());

    builder.pushTransform(Matrix4.rotationZ(2 * pi).storage);

    final path = reproducedBugType == BugType.none
        ? (Path()..addOval(const Rect.fromLTWH(0, 0, 56, 56)))
        : reproducedBugType == BugType.fixed
            ? circlePath
            : circlePath.shift(Offset.zero);

    builder.pushPhysicalShape(
        path: path, elevation: 12, color: Colors.transparent);

    window.render(builder.build());
    window.scheduleFrame();
  };
  window.scheduleFrame();
}

The issue is reproduced when a global variable is used. There is no issue with using a local variable. This is a memory management problem.

Then I tried Skia only implementation (fiddle) and it reproduced. The issue needs to be fixed by the Skia team.

@justinmc justinmc added the dependency: skia Skia team may need to help us label Dec 29, 2021
@justinmc justinmc removed their assignment Dec 29, 2021
@justinmc
Copy link
Contributor

@untp Thanks for the analysis! I'll get ahold of the Skia team.

@justinmc
Copy link
Contributor

I created a Skia bug here: https://bugs.chromium.org/p/skia/issues/detail?id=12773

@justinmc
Copy link
Contributor

The Skia bug has been fixed. We can try this out again once that fix makes its way into Flutter master.

@TahaTesser
Copy link
Member

Looks this is fixed, can't see dots when testing the sample on master, closing.

@TahaTesser TahaTesser added the r: fixed Issue is closed as already fixed in a newer version label Mar 24, 2022
@github-actions
Copy link

github-actions bot commented Apr 7, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: regression It was better in the past than it is now dependency: skia Skia team may need to help us f: material design flutter/packages/flutter/material repository. found in release: 2.5 Found to occur in 2.5 found in release: 2.6 Found to occur in 2.6 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

7 participants