Flutter:
TextField(
controller: _controller,
keyboardType: TextInputType.emailAddress,
decoration: InputDecoration(
labelText: "Email",
hintText: "enter your email.",
border: OutlineInputBorder(
borderRadius: BorderRadius.circular(8)
)
),
)
SwiftUI:
@State var name = ""
TextField("Name", text: $name)
.keyboardType(.emailAddress)
.padding(16)
.background(Color(.secondarySystemBackground))
.cornerRadius(8)
Compose:
@Composable
fun Login() {
val email = remember {
mutableStateOf<String>("")
}
Column(
verticalArrangement = Arrangement.Center
) {
OutlinedTextField(
value = email.value,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Email
),
onValueChange = {
print(it)
email.value = it
}
)
}
}