Skip to content

Conversation

@auto-submit
Copy link
Contributor

@auto-submit auto-submit bot commented Jan 29, 2025

Reverts: #162315

Initiated by: TahaTesser

Reason for reverting: Red tree due to unapproved golden images.

Original PR Author: TahaTesser

Reviewed By: {justinmc}

This change reverts the following previous change:
Fixes #162098

Description

This PR fixes Tab linear and elastic animation blinks/flickers when skipping multiple tabs. Previous attempt to fix elastic animation didn't cover linear animation tests and didn't have enough number of tab items which this PR fixes.

  • Fixed Linear and elastic animation blink issue.
  • Added tests for linear and elastic animation with various tab sizes (LTR and RTL)
  • Added tests for linear and elastic animation when skipping tabs (LTR and RTL)

Code Sample

expand to view the code sample
import 'package:flutter/material.dart';
// import 'package:flutter/scheduler.dart';

void main() {
  // timeDilation = 10;
  runApp(const TabBarDemo());
}

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

  @override
  Widget build(BuildContext context) {
    final List<Widget> tabs = <Widget>[
      const Tab(text: 'Short'),
      const Tab(text: 'A Bit Longer Text'),
      const Tab(text: 'An Extremely Long Tab Label That Overflows'),
      const Tab(text: 'Tiny'),
      const Tab(text: 'Moderate Length'),
      const Tab(text: 'Just Right'),
      const Tab(text: 'Supercalifragilisticexpialidocious'),
      const Tab(text: 'Longer Than Usual'),
    ];

    return MaterialApp(
      home: DefaultTabController(
        length: tabs.length,
        child: Scaffold(
          appBar: AppBar(
            bottom: TabBar(
              tabAlignment: TabAlignment.start,
              isScrollable: true,
              indicatorAnimation: TabIndicatorAnimation.elastic,
              tabs: tabs,
            ),
            title: const Text('Tabs Demo'),
          ),
          body: TabBarView(
            children: <Widget>[
              for (int i = 0; i < tabs.length; i++) const Icon(Icons.directions_car),
            ],
          ),
        ),
      ),
    );
  }
}

Before

before.mov

After

after.mov

Linear animation before (left) and After (right) comparison.

Screenshot 2025-01-28 at 17 27 50

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@auto-submit auto-submit bot added the revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests. label Jan 29, 2025
@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Jan 29, 2025
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - this may be producing unstable images for testing

@Piinks Piinks added warning: land on red to fix tree breakage emergency Jump the queue; land PR in front of all others; only use for emergencies labels Jan 29, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Jan 29, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Jan 29, 2025
@mdebbar mdebbar added this pull request to the merge queue Jan 29, 2025
Merged via the queue into master with commit 2c1e4b1 Jan 29, 2025
13 of 14 checks passed
@mdebbar mdebbar deleted the revert_b007899d3a7a072e880e3984856c777cc9c5082b branch January 29, 2025 21:10
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 30, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 31, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 1, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 2, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emergency Jump the queue; land PR in front of all others; only use for emergencies f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. revert of Bot Only: Tracking label for bot. Tracks new revert of pull requests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TabBar broken animation

4 participants