1
0
mirror of https://github.com/flutter/samples.git synced 2025-11-08 13:58:47 +00:00
Files
samples/experimental/varfont_shader_puzzle/lib/styles.dart
Brett Morgan 54950c4284 Tidyup varfont_shader_puzzle (#1629)
* Tidyup `varfont_shader_puzzle`

* Add a rebuild script and a test

* Simplify fragment shaders

* Drop web

* Enable `beta` CI

* make it `beta` inclusive

* Pull out the program loading code
2023-02-07 13:59:06 +10:00

51 lines
1.3 KiB
Dart

// Copyright 2023 The Flutter team. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
class TextStyles {
const TextStyles({Key? key});
static TextStyle bodyStyle() {
return const TextStyle(
fontFamily: 'Roboto',
fontSize: 16,
color: Colors.black,
fontWeight: FontWeight.w400,
height: 1.5,
);
}
static TextStyle headlineStyle() {
return const TextStyle(
fontFamily: 'Roboto',
fontSize: 16,
color: Colors.black,
fontWeight: FontWeight.w700,
height: 1.5,
);
}
}
class ButtonStyles {
static ButtonStyle style() {
return ButtonStyle(
fixedSize: MaterialStateProperty.resolveWith<Size>((states) {
return const Size(100, 36);
}),
shape: MaterialStateProperty.resolveWith<OutlinedBorder>((states) {
return const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(18)));
}),
overlayColor: null,
backgroundColor: MaterialStateProperty.resolveWith<Color?>((states) {
if (states.contains(MaterialState.hovered)) {
return Colors.black; // Hovered bg (for desktop with mouse)
}
return Colors.grey[600]; // Default bg
}),
);
}
}