mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00

* Updated the Material Design tokens to v2.3.5 * Linear and circular progress indicator token sets are deprecated in v0.207. The `md.com.progress-indicator` token set was created and should be used instead. * tokens is now using [semantic versioning](https://semver.org/) ï¼Thanks @guidezpl for reminding:) ) * ~Fixes #128877. The default text style is updated to `bodyLarge` now:)~ Added TODOs for the label text style of `PopupMenuButton`. Will create a separate PR because this change breaks Google testing.
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
import 'template.dart';
|
|
|
|
class ProgressIndicatorTemplate extends TokenTemplate {
|
|
const ProgressIndicatorTemplate(super.blockName, super.fileName, super.tokens, {
|
|
super.colorSchemePrefix = '_colors.',
|
|
});
|
|
|
|
@override
|
|
String generate() => '''
|
|
class _Circular${blockName}DefaultsM3 extends ProgressIndicatorThemeData {
|
|
_Circular${blockName}DefaultsM3(this.context);
|
|
|
|
final BuildContext context;
|
|
late final ColorScheme _colors = Theme.of(context).colorScheme;
|
|
|
|
@override
|
|
Color get color => ${componentColor('md.comp.progress-indicator.active-indicator')};
|
|
|
|
@override
|
|
Color get circularTrackColor => ${componentColor('md.comp.progress-indicator.track')};
|
|
}
|
|
|
|
class _Linear${blockName}DefaultsM3 extends ProgressIndicatorThemeData {
|
|
_Linear${blockName}DefaultsM3(this.context);
|
|
|
|
final BuildContext context;
|
|
late final ColorScheme _colors = Theme.of(context).colorScheme;
|
|
|
|
@override
|
|
Color get color => ${componentColor('md.comp.progress-indicator.active-indicator')};
|
|
|
|
@override
|
|
Color get linearTrackColor => ${componentColor('md.comp.progress-indicator.track')};
|
|
|
|
@override
|
|
double get linearMinHeight => ${getToken('md.comp.progress-indicator.track.thickness')};
|
|
}
|
|
''';
|
|
}
|