This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:ui_animations/cards/expanded_card.dart'; | |
import 'cards/summary_card.dart'; | |
class CardStackAnimation extends StatefulWidget { | |
const CardStackAnimation({super.key}); | |
@override | |
State<StatefulWidget> createState() => _CardStackAnimation(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val userImages = listOf( | |
R.drawable.img_user_1, | |
R.drawable.img_user_2, | |
R.drawable.img_user_3, | |
R.drawable.img_user_4, | |
R.drawable.img_user_5, | |
) | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [DashboardFragment] is a custom flutter fragment which is used to pass custom | |
* data from native app to dashboard part in flutter. This communication is set up on | |
* both native and in flutter module. | |
* | |
* @see To refer to the flutter part, please refer the flutter module. | |
* */ | |
const val KeyData = "key_data" | |
const val CommunicationChannel = "com.app/dataShare" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LazyColumn( | |
modifier = Modifier.padding(horizontal = 16.dp), | |
horizontalAlignment = Alignment.Start, | |
) { | |
item { | |
Spacer(modifier = Modifier.height(4.dp)) | |
} | |
items( | |
items = chatListItems, | |
key = { chatData -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HorizontalPager( | |
pageCount = 3, | |
beyondBoundsPageCount = 3, | |
state = viewPagerState, | |
modifier = Modifier | |
.background(MaterialTheme.colors.background) | |
.fillMaxSize(), | |
) { page -> | |
when (page) { | |
0 -> ChatListScreen() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TabRow( | |
modifier = Modifier.fillMaxWidth(), | |
selectedTabIndex = selectedPage, | |
indicator = { tabPositions -> | |
} | |
) { | |
homeTabs.forEachIndexed { index, tabData -> | |
Tab( | |
selected = index == selectedPage, | |
) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Row( | |
modifier = Modifier, | |
verticalAlignment = Alignment.CenterVertically | |
) { | |
Text( | |
text = stringResource(id = R.string.whatsapp_title), | |
style = TextStyle( | |
fontSize = 22.sp, | |
fontWeight = FontWeight.SemiBold, | |
color = if (isSystemInDarkTheme()) PrimaryGray_A101 else White |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Box { | |
Column { | |
AppBar() | |
TabBar() | |
HorizontalPager() | |
} | |
FloatingActionButton() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContent { | |
val viewModel: MainViewModel by viewModels() | |
var isEligible by remember { | |
mutableStateOf(false) | |
} | |
LaunchedEffect(true) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainViewModel: ViewModel() { | |
private val _creditScore = MutableStateFlow(0) | |
private val _age = MutableStateFlow(18) | |
val isEligible = combine(_creditScore, _age) { creditScore, age -> | |
creditScore > 400 && age > 18 && age < 70 | |
} | |
fun creditScore(score: Int) { |
NewerOlder