Skip to content

Commit

Permalink
feat: use bodyMedium font size for titles (#115)
Browse files Browse the repository at this point in the history
Reduces the text sizes of the radio/checkbox titles and the custom path
text field as suggested by @juanruitina.


![image](https://github.com/user-attachments/assets/634d355f-fc85-4be9-85bd-4e51d384c29a)

UDENG-4608
  • Loading branch information
d-loose authored Sep 24, 2024
2 parents 884d378 + e1536b7 commit 19dc2c0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class _CustomPathTextField extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
TextFormField(
style: Theme.of(context).textTheme.bodyMedium,
initialValue: customPath,
onChanged: notifier.setCustomPath,
decoration: InputDecoration(
Expand Down
5 changes: 3 additions & 2 deletions flutter_packages/prompting_client_ui/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:prompting_client/prompting_client.dart';
import 'package:prompting_client_ui/fake_prompting_client.dart';
import 'package:prompting_client_ui/l10n.dart';
import 'package:prompting_client_ui/prompt_page.dart';
import 'package:prompting_client_ui/theme.dart';
import 'package:ubuntu_logger/ubuntu_logger.dart';
import 'package:ubuntu_service/ubuntu_service.dart';
import 'package:yaru/yaru.dart';
Expand Down Expand Up @@ -77,8 +78,8 @@ class PromptDialog extends StatelessWidget {
Widget build(BuildContext context) {
return YaruTheme(
builder: (context, yaru, child) => MaterialApp(
theme: yaru.theme,
darkTheme: yaru.darkTheme,
theme: yaru.theme?.customize(),
darkTheme: yaru.darkTheme?.customize(),
debugShowCheckedModeBanner: false,
localizationsDelegates: localizationsDelegates,
supportedLocales: supportedLocales,
Expand Down
12 changes: 12 additions & 0 deletions flutter_packages/prompting_client_ui/lib/theme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';

extension ThemeDataX on ThemeData {
ThemeData customize() {
return copyWith(
extensions: [
YaruToggleButtonThemeData(titleStyle: textTheme.bodyMedium),
],
);
}
}

0 comments on commit 19dc2c0

Please sign in to comment.