Skip to content

Refactor MaterialStateProperty lerp functions #104506

@TahaTesser

Description

@TahaTesser

Currently MaterialStateProperty lerp functions are localized to each class and duplicated across the source code.

button_style.dart

static MaterialStateProperty<T?>? _lerpProperties<T>(MaterialStateProperty<T>? a, MaterialStateProperty<T>? b, double t, T? Function(T?, T?, double) lerpFunction ) {

class _LerpProperties<T> implements MaterialStateProperty<T?> {

scrollbar_theme.dart

static MaterialStateProperty<T>? _lerpProperties<T>(

class _LerpProperties<T> implements MaterialStateProperty<T> {

checkbox_theme.dart

static MaterialStateProperty<T>? _lerpProperties<T>(

class _LerpProperties<T> implements MaterialStateProperty<T> {

data_table_theme.dart

static MaterialStateProperty<T>? _lerpProperties<T>(MaterialStateProperty<T>? a, MaterialStateProperty<T>? b, double t, T Function(T?, T?, double) lerpFunction ) {

class _LerpProperties<T> implements MaterialStateProperty<T> {

navigation_bar_theme.dart

static MaterialStateProperty<T>? _lerpProperties<T>(

class _LerpProperties<T> implements MaterialStateProperty<T> {

radio_theme.dart

static MaterialStateProperty<T>? _lerpProperties<T>(

class _LerpProperties<T> implements MaterialStateProperty<T> {

switch_theme.dart

static MaterialStateProperty<T>? _lerpProperties<T>(

class _LerpProperties<T> implements MaterialStateProperty<T> {

Solution

Remove duplication and add lerp functions to material_state.dart

Metadata

Metadata

Assignees

Labels

c: tech-debtTechnical debt, code quality, testing, etc.f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions