-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Create a "Flutter for Jetpack Compose developers" page #11232
base: main
Are you sure you want to change the base?
Conversation
added links from the legacy android page to compose version
Visit the preview URL for this PR (updated for commit 9ab28d9): https://flutter-docs-prod--pr11232-for-compose-devs-5p2wixgb.web.app |
I'm confused. How does this overlap with this: #11219 ? |
#11219 is a targeted flow for an add to app like thing for Flutter developers that need to add a Compose activity. This PR is speaking more to Compose developers who want to implement flutter and see how their knowledge transfers. There is minimal overlap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jwill! Thanks for writing this! It's a great start.
My primary issue is the focus here should be on how to use Flutter, not how to program better in Compose. ;) I don't think we need so many Kotlin examples.
@@ -2378,7 +2384,7 @@ In Flutter, access this functionality using the | |||
For more information on using the Firebase Cloud Messaging API, | |||
see the [`firebase_messaging`][] plugin documentation. | |||
|
|||
|
|||
[Flutter for Jetpack Compose devs]: /flutter-for/compose-devs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, please update the src/_data/sidenav to include this file. Also, modify the title of the original page. Perhaps "Flutter for Android devs using View" ??? Then this page can be "Flutter for Android devs using Jetpack Compose".
You can then modify properties on composables that have related | ||
properties or accept a `TextStyle`. | ||
|
||
```kotlin | ||
// Font files bunded with app | ||
val firaSansFamily = FontFamily( | ||
Font(R.font.firasans_light, FontWeight.Light), | ||
Font(R.font.firasans_regular, FontWeight.Normal), | ||
Font(R.font.firasans_italic, FontWeight.Normal, FontStyle.Italic), | ||
Font(R.font.firasans_medium, FontWeight.Medium), | ||
Font(R.font.firasans_bold, FontWeight.Bold) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd delete this. Not a Compose tutorial.
) | ||
|
||
val bodyFontFamily = FontFamily( | ||
Font( | ||
googleFont = GoogleFont("Acme"), | ||
fontProvider = provider, | ||
) | ||
) | ||
|
||
val displayFontFamily = FontFamily( | ||
Font( | ||
googleFont = GoogleFont("Aboreto"), | ||
fontProvider = provider, | ||
) | ||
) | ||
|
||
// Usage | ||
Text(text = "text", fontFamily = firaSansFamily, fontWeight = FontWeight.Light) | ||
Text(text = "text", fontFamily = bodyFontFamily, fontWeight = FontWeight.Medium) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More delete-y.
``` | ||
|
||
:::note | ||
To download custom fonts to use in your apps, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean "custom" fonts? I think you mean "other Google fonts".
I actually cut down on the number of examples from the page I modeled it on, Flutter for SwiftUI devs (https://docs.flutter.dev/get-started/flutter-for/swiftui-devs). There are sections on animation and there concepts in that other page that didn't feel essential and were getting into the weeds. My goal here was targeting a developer who is conversant with Compose and wants to do Flutter. I think it's important to discuss the commonalities to allow them to hit the ground running with real apples to apples examples versus just a textual description. I can concede that maybe some things can be excerpted more aggressively and places where I listed the two common ways for "A" Compose concept that map to "B" Flutter implementation might be reduced to one. If you are proposing to cut out the Kotlin side of a section totally, it might be better to eliminate the section altogether. Eg The google fonts section could be excised totally with just a pointer to the recently updated typography page. |
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Co-authored-by: Shams Zakhour (ignore Sfshaza) <[email protected]>
Description of what this PR is changing or adding, and why:
Adds a page for Flutter for Jetpack Compose devs.
Issues fixed by this PR (if any):
Fixes #5611 and #9051
PRs or commits this PR depends on (if any):
Presubmit checklist