Skip to content

Commit

Permalink
feat: 문제 제목이 Html인 경우 처리
Browse files Browse the repository at this point in the history
  • Loading branch information
w8385 committed Jan 15, 2024
1 parent 2560a43 commit dbab285
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
23 changes: 17 additions & 6 deletions lib/features/search/screen/search_screen.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import 'package:extended_image/extended_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/svg.dart';
import 'package:my_solved/components/atoms/text_field/text_field.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:my_solved/components/atoms/text_field/my_solved_search_field.dart';
import 'package:my_solved/components/molecules/segmented_control/segmented_control.dart';
import 'package:my_solved/components/styles/color.dart';
import 'package:my_solved/components/styles/font.dart';
Expand Down Expand Up @@ -181,10 +182,20 @@ class _SearchViewState extends State<SearchView> {
],
),
SizedBox(height: 4),
Text(
state.problems!.items[index].titleKo,
style: MySolvedTextStyle.title5,
),
// 문제 제목에 HTML 태그가 포함되어 있을 경우
state.problems!.items[index].titleKo
.contains("</")
? HtmlWidget(
state.problems!.items[index]
.titleKo,
textStyle:
MySolvedTextStyle.body1,
)
: Text(
state.problems!.items[index]
.titleKo,
style: MySolvedTextStyle.body1,
),
SizedBox(height: 8),
Wrap(
children: List.generate(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies:
flutter_bloc: ^8.1.3
meta: ^1.9.1
equatable: ^2.0.5

flutter_widget_from_html_core: ^0.14.11
boj_api:
path: packages/apis/boj_api
solved_api:
Expand Down

0 comments on commit dbab285

Please sign in to comment.