Skip to content

Activate InkSparkle on Canvaskit (Android only) #138487

@bleroux

Description

@bleroux

Is there an existing issue for this?

Use case

Since #99882, InkSparkle is the default splash animation for M3 apps, only on Android and when the platform is not web, see:

final bool useInkSparkle = platform == TargetPlatform.android && !kIsWeb;

Proposal

Because shaders are now supported on the Canvaskit renderer, it would be possible to make InkSparkle the default animation for Flutter web when isCanvasKit is true.

Here is a video showing the InkSparkle shader running on Chrome (Android emulator) :

  • ThemeData implementation was updated to change the default splash factory resolution.
  • The application was launched using: flutter run -d web-server --web-renderer=canvaskit --web-port 8080 --web-hostname 0.0.0.0.
  • adb reverse tcp:8080 tcp:8080 was runned before accesing the application from the emulator.
InkSplash-AndroidCanvaskit.mp4
Example app used to make the screenshot
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';

void main() {
  timeDilation = 10.0;
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      theme: ThemeData.dark(),
      home: Scaffold(
        body: Padding(
          padding: const EdgeInsets.all(8.0),
          child: Material(
            child: InkWell(
              onTap: () {},
              child: Container(
                width: 400,
                height: 100,
                decoration: BoxDecoration(
                  border: Border.all(color: Colors.white),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectc: proposalA detailed proposal for a change to Fluttere: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions