Skip to content

[RefreshIndicator] The valueColor animation does not respect the alpha value of the given color #134489

@AlexV525

Description

@AlexV525

Is there an existing issue for this?

Steps to reproduce

  1. Set a color value with alpha less than 0xff for RefreshIndicator.color.
  2. Try the animation.
  3. The alpha was manipulated by the tween with [0, 1], rather than [0, color.alpha].

ColorTween(
begin: (widget.color ?? theme.colorScheme.primary).withOpacity(0.0),
end: (widget.color ?? theme.colorScheme.primary).withOpacity(1.0),
).chain(CurveTween(

Expected results

The alpha value should respect the given.

Actual results

The alpha value of the color was manipulated by the color tween, which was fixed to [0, 1].

Code sample

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true, // This doesn't matter.
      ),
      home: Builder(
        builder: (context) => Scaffold(
          appBar: AppBar(
            backgroundColor: Theme.of(context).colorScheme.inversePrimary,
            title: const Text('Flutter Demo Home Page'),
          ),
          body: RefreshIndicator(
            onRefresh: () => Future.delayed(const Duration(seconds: 3), () {}),
            color: Colors.blue.withOpacity(0.5),
            child: ListView(
              physics: const AlwaysScrollableScrollPhysics(),
              children: [
                Text(
                  'Pull to display to indicator.',
                  style: Theme.of(context).textTheme.headlineMedium,
                  textAlign: TextAlign.center,
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Actual Expected
Actual Expected

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[!] Flutter (Channel [user-branch], 3.14.0-14.0.pre.42, on Microsoft Windows [Version 10.0.22621.2134], locale en-US)
    ! Flutter version 3.14.0-14.0.pre.42 on channel [user-branch] at X:\SDK\flutter-master
    • Framework revision ec653ff9ac (27 minutes ago), 2023-09-12 09:48:13 +0800
    • Engine revision 3b75e3de7e
    • Dart version 3.2.0 (build 3.2.0-122.0.dev)
    • DevTools version 2.26.2
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listf: material designflutter/packages/flutter/material repository.found in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-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