bottom_sheet_template.dart 1.12 KB
Newer Older
1 2 3 4 5 6 7
// 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 BottomSheetTemplate extends TokenTemplate {
8 9 10
  const BottomSheetTemplate(super.blockName, super.fileName, super.tokens, {
    super.colorSchemePrefix = '_colors.',
  });
11 12 13 14

  @override
  String generate() => '''
class _${blockName}DefaultsM3 extends BottomSheetThemeData {
15
  _${blockName}DefaultsM3(this.context)
16 17 18 19 20 21 22
    : super(
      elevation: ${elevation("md.comp.sheet.bottom.docked.standard.container")},
      modalElevation: ${elevation("md.comp.sheet.bottom.docked.modal.container")},
      shape: ${shape("md.comp.sheet.bottom.docked.container")},
    );

  final BuildContext context;
23
  late final ColorScheme _colors = Theme.of(context).colorScheme;
24 25 26 27 28 29

  @override
  Color? get backgroundColor => ${componentColor("md.comp.sheet.bottom.docked.container")};

  @override
  Color? get surfaceTintColor => ${componentColor("md.comp.sheet.bottom.docked.container.surface-tint-layer")};
30 31 32

  @override
  Color? get shadowColor => Colors.transparent;
33 34 35
}
''';
}