Skip to content

Commit

Permalink
fix: Abstract Text widget font style = subtitle1
Browse files Browse the repository at this point in the history
  • Loading branch information
kkweon committed Jun 21, 2021
1 parent 2a6a271 commit 22c5323
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion client/lib/custom_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ class CustomTheme extends ChangeNotifier {
Icon get icon => _isDarkMode
? const Icon(Icons.dark_mode_outlined)
: const Icon(Icons.light_mode_outlined);
}
}
20 changes: 12 additions & 8 deletions client/lib/widgets/components/expandable_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class _ExpandableTextState extends State<ExpandableText> {

@override
Widget build(BuildContext context) {
final textStyle = Theme.of(context).textTheme.subtitle1;
const double iconSize = 35;

if (_isExpanded) {
return Card(
child: Padding(
Expand All @@ -26,11 +29,12 @@ class _ExpandableTextState extends State<ExpandableText> {
children: [
Text(
widget.text,
softWrap: true,
style: textStyle,
),
IconButton(
iconSize: iconSize,
onPressed: onPressed,
icon: const Icon(Icons.keyboard_arrow_up, size: 50)),
icon: const Icon(Icons.keyboard_arrow_up)),
],
),
));
Expand All @@ -39,19 +43,19 @@ class _ExpandableTextState extends State<ExpandableText> {
return Stack(alignment: Alignment.bottomCenter, children: [
Card(
child: Container(
padding: const EdgeInsets.only(top: 15, left: 15, right: 15),
height: 100,
padding: const EdgeInsets.all(15),
child: Text(
widget.text,
overflow: TextOverflow.fade,
maxLines: 3,
softWrap: true,
style: textStyle,
))),
Positioned(
bottom: 10,
bottom: iconSize / 3,
child: IconButton(
iconSize: iconSize,
onPressed: onPressed,
icon: const Icon(Icons.keyboard_arrow_down, size: 50)))
icon: const Icon(Icons.keyboard_arrow_down)))
]);
}

Expand All @@ -60,4 +64,4 @@ class _ExpandableTextState extends State<ExpandableText> {
_isExpanded = !_isExpanded;
});
}
}
}

0 comments on commit 22c5323

Please sign in to comment.