Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Rich Text View의 Adapter 로직 구현 #8

Open
3 tasks done
seungwone opened this issue Jul 11, 2024 · 0 comments
Open
3 tasks done

feat: Rich Text View의 Adapter 로직 구현 #8

seungwone opened this issue Jul 11, 2024 · 0 comments
Assignees

Comments

@seungwone
Copy link
Collaborator

seungwone commented Jul 11, 2024

배경 소개

Server Driven UI 구현

기능 설명

서버로부터 전달받은 Dart 언어 레벨의 데이터를 파싱해서 Flutter 위젯으로 변환

요구사항

  • contents의 viewType을 확인하고 적절한 컴포넌트로 파싱
  • String 값으로 주어지는 textColor를 Color 타입으로 변환
  • String 값으로 주어지는 textStyle을 비트마스킹을 통해 int 타입으로 변환

관련 자료

서버 Response

  "responseData": {
    "screenName": "Home",
    "contents": [
      {
        "viewType": "BViewType",
        "content": {
          "title": "This is B ViewType"
        }
      },
      {
        "viewType": "AViewType",
        "content": {
          "title": "This is A ViewType",
          "iconUrl": "https://avatars.githubusercontent.com/u/103282546?s=200&v=4"
        }
      },
      {
        "viewType": "RichViewType",
        "content": {
          "title": "This is RichText ViewType",
          "richText": [
            {
              "text": {
                "text": "이것은",
                "fontSize": 14
              }
            },
            {
              "text": {
                "text": "새로운",
                "fontSize": 16
              }
            },
            {
              "text": {
                "text": "Rich Text",
                "background": "yellow",
                "fontSize": 24
              }
            },
            {
              "text": {
                "text": "ViewType",
                "textColor": "red",
                "fontSize": 30
              }
            },
            {
              "text": {
                "text": "어떻게 구현할수 있을까요?",
                "textStyle": [
                  "underline"
                ],
                "textSize": 24
              }
            },
            {
              "image": {
                "url": "https://img.icons8.com/?size=512&id=63684&format=png",
                "width": 24,
                "height": 24
              }
            }
          ]
        }
      }
    ]
  }
}
@seungwone seungwone self-assigned this Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant