Jetpack Compose
Android Developers
Jetpack Compose is a modern toolkit written in kotlin, for building native Android UI. Jetpack Compose simplifies and accelerates UI development on Android with less code, powerful tools, and intuitive Kotlin APIs.
Jetpack compose available
- Google I/O 2019 was the announcement of a new UI Toolkit for Android named Compose.
- If you want to use Jetpack Compose with Android Studio, you must use Android Studio Canary 4.1 or higher.
Programming language
1) support kotlin language.
2) Same syntax flutter.
3) Native app develop.
4) No xml file.
onCreate() function
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { //your design } }
Layout files for UI.
Composable function
@Composable fun Greeting(name: String) { Text(text = "Hello $name!") }
- A composable function is a normal function annotated with @Composable.
- Composable functions can call only other composable functions.
- In Compose, there will be no classes, only functions, and every function is a top-level function so there won’t be any inheritance or hierarchy problems in Compose.
State
- The state is only the concern of the UI and will be held in an instance of “State”.
- An object which contain data that is mapped to one or many widgets. Statue object we can update value or data effect is show widget.
- It change the runtime.
- There are two types 1) MutableState 2) Model
MutableState
The state store the data on execution and if composable is subscribed to it, the composable change the value of there are any changes.
@Model
Allows every property of our model to be observed for changes by our Compose components.
AppBar
TopAppBar( title = { Text(text = "AppBar") }, color = Color.White, navigationIcon = { AppBarIcon( icon = imageResource( id = R.drawable.ic_menu_black_24dp) ) { // Open nav drawer } } )
Jetpack Composewidgets
Row, Column, FlexRow, HeightSpacerm, Card, Column, FlexColumn, WidthSpacer, AspectRatio, Alignment, Center, ConstrainedBox, Container, Padding, VerticalScroller, FixedSpacer, Stack, TopAppBar, Button, Wrap, MaterialTheme
The flutter tutorial is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application
For more information about Flutter. visit www.fluttertutorial.in