mirror of
https://github.com/flutter/samples.git
synced 2026-05-13 10:27:09 +00:00
added Type Jam puzzle app for review (#1554)
* added Type Jam puzzle app for review * pr round 2 prep * updated ci scripts for varfont_shader_puzzle * resolved unused and minor variable naming issues * rotator tiles row and col are final vars now * removed unused import and print from production * made constructors const where needed * pages_flow export refactored to directly come from that file * removed old api commented out section from FragmentShaded * updated pubspec yaml to correct project name * dart min version updated; removed unnecessary commented out dependencies from pubspec.yaml * updated pubspec.yaml min flutter version to ensure FragmentShader support * added/edited comments for explanation, esp on var fonts; removed obsolete comments * trailing newline added to pubspec.yaml eof
This commit is contained in:
52
experimental/varfont_shader_puzzle/lib/styles.dart
Normal file
52
experimental/varfont_shader_puzzle/lib/styles.dart
Normal file
@@ -0,0 +1,52 @@
|
||||
// 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>((Set<MaterialState> states) {
|
||||
return const Size(100, 36);
|
||||
}),
|
||||
shape: MaterialStateProperty.resolveWith<OutlinedBorder>(
|
||||
(Set<MaterialState> states) {
|
||||
return const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)));
|
||||
}),
|
||||
overlayColor: null,
|
||||
backgroundColor: MaterialStateProperty.resolveWith<Color?>(
|
||||
(Set<MaterialState> states) {
|
||||
if (states.contains(MaterialState.hovered)) {
|
||||
return Colors.black; // Hovered bg (for desktop with mouse)
|
||||
}
|
||||
return Colors.grey[600]; // Default bg
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user