Remove hard-coded font family

This commit is contained in:
Ankit Mahato
2025-06-28 21:07:38 +05:30
parent 4f9ebe369a
commit 9e0e8211a4
2 changed files with 9 additions and 10 deletions

View File

@@ -1,5 +1,6 @@
// lib/dashbot/widgets/content_renderer.dart // lib/dashbot/widgets/content_renderer.dart
import 'dart:convert'; import 'dart:convert';
import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_highlight/flutter_highlight.dart'; import 'package:flutter_highlight/flutter_highlight.dart';
import 'package:flutter_highlight/themes/monokai-sublime.dart'; import 'package:flutter_highlight/themes/monokai-sublime.dart';
@@ -78,9 +79,8 @@ Widget _renderCodeBlock(
color: Theme.of(context).colorScheme.surfaceContainerLow, color: Theme.of(context).colorScheme.surfaceContainerLow,
child: SelectableText( child: SelectableText(
prettyJson, prettyJson,
style: const TextStyle( style: kCodeStyle.copyWith(
fontFamily: 'monospace', fontSize: Theme.of(context).textTheme.bodyMedium?.fontSize,
fontSize: 12,
), ),
), ),
); );
@@ -96,9 +96,8 @@ Widget _renderCodeBlock(
code, code,
language: language, language: language,
theme: monokaiSublimeTheme, theme: monokaiSublimeTheme,
textStyle: const TextStyle( textStyle: kCodeStyle.copyWith(
fontFamily: 'monospace', fontSize: Theme.of(context).textTheme.bodyMedium?.fontSize,
fontSize: 12,
), ),
), ),
); );
@@ -117,9 +116,8 @@ Widget _renderFallbackCode(
color: Theme.of(context).colorScheme.surfaceContainerLow, color: Theme.of(context).colorScheme.surfaceContainerLow,
child: SelectableText( child: SelectableText(
code, code,
style: const TextStyle( style: kCodeStyle.copyWith(
fontFamily: 'monospace', fontSize: Theme.of(context).textTheme.bodyMedium?.fontSize,
fontSize: 12,
color: Colors.red, color: Colors.red,
), ),
), ),

View File

@@ -1,5 +1,6 @@
import 'dart:convert'; import 'dart:convert';
import 'package:apidash_core/apidash_core.dart' as http; import 'package:apidash_core/apidash_core.dart' as http;
import 'package:apidash_design_system/apidash_design_system.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -251,7 +252,7 @@ class _TestRunnerWidgetState extends ConsumerState<TestRunnerWidget> {
width: double.infinity, width: double.infinity,
child: SelectableText( child: SelectableText(
test['command'], test['command'],
style: const TextStyle(fontFamily: 'monospace'), style: kCodeStyle,
), ),
), ),
if (hasResult) ...[ if (hasResult) ...[