Chuyển đến nội dung chính

Bài đăng

Hiển thị các bài đăng có nhãn Compose

Hosting Jetpack Compose inside Flutter (and the reverse) — hướng dẫn Flutter

Teams with Compose design systems still want Flutter product surfaces. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi When to embed Compose views and how Hybrid Composition modes affect them. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế HCPP improves fidelity for complex native views including Compose. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi gọi boundary. Boundary trả ...

Hosting Jetpack Compose inside Flutter (and the reverse)

Teams with Compose design systems still want Flutter product surfaces. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence When to embed Compose views and how Hybrid Composition modes affect them. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model HCPP improves fidelity for complex native views including Compose. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A contro...

Hosting Jetpack Compose inside Flutter (and the reverse) — hướng dẫn Flutter

Teams with Compose design systems still want Flutter product surfaces. Bài này chuyển quan sát đó thành một mô hình nhỏ để bạn có thể kiểm thử, đo lường và giữ cho code dễ bảo trì khi app lớn lên. Vấn đề cốt lõi When to embed Compose views and how Hybrid Composition modes affect them. Câu hỏi hữu ích không phải API hay pattern có đẹp riêng lẻ hay không, mà là state nằm ở đâu, boundary nào chịu trách nhiệm khi lỗi xảy ra, và người dùng phục hồi thế nào khi happy path biến mất. Mô hình thực tế HCPP improves fidelity for complex native views including Compose. Hãy bắt đầu bằng một owner rõ ràng cho behavior. Widget chỉ nên render và phát intent; IO, persistence, permission và retry nên nằm sau một interface nhỏ. Nhờ vậy bạn có seam để fake trong test và một chỗ ghi lại các dữ kiện cần theo dõi ở production. Trong app Flutter, boundary thường có dạng: Widget phát intent như load, submit, refresh hoặc retry. Controller hoặc use case validate intent rồi gọi boundary. Boundary trả ...

Hosting Jetpack Compose inside Flutter (and the reverse)

Teams with Compose design systems still want Flutter product surfaces. This article turns that observation into a small implementation model you can test, measure, and keep boring when the app grows. The problem in one sentence When to embed Compose views and how Hybrid Composition modes affect them. The useful question is not whether the API or pattern looks elegant in isolation. It is where state lives, which boundary owns failure, and how a user recovers when the happy path disappears. A practical model HCPP improves fidelity for complex native views including Compose. Start with one explicit owner for the behavior. Keep widgets responsible for rendering and user intent; keep IO, persistence, permissions, and retries behind a small interface. That gives you a seam for a fake in tests and a place to record the facts that matter in production. For a Flutter app, the boundary usually looks like this: The widget emits an intent such as load, submit, refresh, or retry. A contro...

Using Jetpack libraries in Compose | Session

  Xin chào tất cả mọi người, tôi ở đây để nói về Jetpack Compose, bộ công cụ giao diện người dùng mới của chúng tôi, hoạt động tốt như thế nào với các thư viện Jetpack hiện có mà bạn có thể đã sử dụng trong ứng dụng của mình. Một trong những phần quan trọng nhất khi thiết kế Compose là bạn có thể dần dần áp dụng nó với các ứng dụng hiện có của mình mà không cần viết lại mọi thứ từ đầu. Điều đó có nghĩa là doanh nghiệp của bạn và các lớp dữ liệu bên dưới lớp Giao diện người dùng có thể được sử dụng với Giao diện người dùng Compose mới sáng bóng của chúng tôi. Ví dụ, hãy lấy ứng dụng này, Bloom. Bloom là một ứng dụng mua sắm trong nhà và vườn cung cấp cho người dùng khả năng tìm kiếm thông qua một bộ thực vật khổng lồ và xem qua các bộ sưu tập cây có liên quan được tạo sẵn. Hãy đi sâu vào cách chúng ta có thể viết màn hình này trong Compose thay vì sử dụng Views và XML. Tất cả điều đó với sức mạnh của Jetpack. Trong trường hợp của Bloom, chúng tôi đã tận dụng rất nhiều thư viện Jetpa...