Skip to content

Instantly share code, notes, and snippets.

@ibrahim4851
Created October 9, 2023 21:04

Revisions

  1. ibrahim4851 created this gist Oct 9, 2023.
    82 changes: 82 additions & 0 deletions RecipeTitle.kt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,82 @@
    @OptIn(ExperimentalMaterial3Api::class)
    @Composable

    fun RecipeTitle(navController: NavController) {

    var recipeTitle by rememberSaveable { mutableStateOf("") }

    Surface(
    modifier = Modifier.fillMaxSize()
    )
    {
    Scaffold(
    modifier = Modifier.fillMaxSize(),

    ) { values ->
    Column(modifier = Modifier
    .fillMaxSize()
    .padding(end = 16.dp, bottom = 16.dp)) {

    Row(modifier = Modifier.fillMaxWidth()) {
    IconButton(onClick = { navController.currentBackStack }) {
    Icon(
    imageVector = Icons.Filled.ArrowBack,
    contentDescription = null
    )
    }
    }
    Column(
    modifier = Modifier
    .padding(values)
    .padding(start = 16.dp, end = 8.dp)
    .weight(1f)
    )
    {
    Text(
    text = "What's Your Recipe Title?",
    fontWeight = FontWeight.Bold,
    style = Typography.displaySmall
    )
    Spacer(modifier = Modifier.padding(8.dp))

    Text(
    text = "Keep the Title Short and Precise",
    style = Typography.titleLarge
    )
    Spacer(modifier = Modifier.padding(8.dp))

    TextFieldWithText(
    "",
    "e.g. Hamburger",
    KeyboardType.Text,
    recipeTitle
    )


    }
    Row(
    modifier = Modifier
    .fillMaxWidth()
    .weight(1f)
    .padding(start = 8.dp),
    horizontalArrangement = Arrangement.spacedBy(8.dp),
    verticalAlignment = Alignment.Bottom
    ){
    OutlinedButton(
    modifier = Modifier.weight(1f),
    onClick = { }
    ) {
    Text(text = "Cancel")
    }
    Button(
    onClick = {},
    modifier = Modifier.weight(1f)
    ) {
    Text(text = "Next")
    }
    }

    }
    }
    }
    }