Skip to content

Commit 4f005c9

Browse files
committed
feat: add google_fonts package and update text styles in shader viewer and main app theme
1 parent 2f52d18 commit 4f005c9

File tree

4 files changed

+19
-5
lines changed

4 files changed

+19
-5
lines changed

lib/main.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import 'package:flutter/foundation.dart';
22
import 'package:flutter/material.dart';
33
import 'package:flutter_web_plugins/url_strategy.dart';
44
import 'package:go_router/go_router.dart';
5+
import 'package:google_fonts/google_fonts.dart';
56
import 'package:shadcn_ui/shadcn_ui.dart';
67
import 'package:shaders/widgets/widgets.dart';
78

@@ -174,6 +175,11 @@ class _RgbGlitchDemoState extends State<RgbGlitchDemo> {
174175
Widget build(BuildContext context) {
175176
return ShadApp.custom(
176177
themeMode: ThemeMode.light,
178+
theme: ShadThemeData(
179+
colorScheme: ShadGrayColorScheme.light(),
180+
brightness: Brightness.light,
181+
textTheme: ShadTextTheme.fromGoogleFont(GoogleFonts.poppins),
182+
),
177183

178184
appBuilder: (context) {
179185
return MaterialApp.router(

lib/shader_source_viewer.dart

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/services.dart';
3+
import 'package:google_fonts/google_fonts.dart';
34
import 'package:shadcn_ui/shadcn_ui.dart';
45

56
class ShaderSourceViewer extends StatefulWidget {
@@ -79,11 +80,9 @@ class _ShaderSourceViewerState extends State<ShaderSourceViewer> {
7980
)
8081
: SelectableText(
8182
_sourceCode!,
82-
style: const TextStyle(
83-
fontFamily: 'GeistMono',
84-
fontFamilyFallback: <String>['Courier'],
85-
fontSize: 12,
86-
color: Color.fromARGB(255, 55, 113, 57),
83+
style: GoogleFonts.spaceMono(
84+
fontSize: 14,
85+
color: const Color.fromARGB(255, 33, 77, 34)
8786
),
8887
),
8988
),

pubspec.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,14 @@ packages:
165165
url: "https://pub.dev"
166166
source: hosted
167167
version: "14.8.1"
168+
google_fonts:
169+
dependency: "direct main"
170+
description:
171+
name: google_fonts
172+
sha256: b1ac0fe2832c9cc95e5e88b57d627c5e68c223b9657f4b96e1487aa9098c7b82
173+
url: "https://pub.dev"
174+
source: hosted
175+
version: "6.2.1"
168176
http:
169177
dependency: transitive
170178
description:

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies:
2020
path: ^1.9.1
2121
shadcn_ui: ^0.28.1
2222
url_launcher: ^6.3.2
23+
google_fonts: ^6.2.1
2324

2425
dev_dependencies:
2526
flutter_test:

0 commit comments

Comments
 (0)