flutter/dev/tools/gen_defaults/lib/progress_indicator_template.dart
Qun Cheng ea1268a78d
Update tokens to v2.3.5 (#145356)
* 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.
2024-03-28 22:22:20 +00:00

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')};
}
''';
}