Jason Inbody
07/17/2021, 5:01 PMstruct SignInView : View {
@State var createAccount = false
@State var forgotPassword = false
var body: some View {
ZStack{
VStack(alignment: .center, spacing: 15) {
if(!createAccount && !forgotPassword){
Text("Sign In").font(.title).bold().foregroundColor(.white)
TextField("Email Address", text: self.$email)
}
if(createAccount){
Text("Create Account").font(.title).bold().foregroundColor(.white)
TextField("Email Address", text: self.$email)
SecureField("Password", text: self.$password)
SecureField("Confirm Password", text: self.$confirm)
Button(action: {self.createUserAccount()}) {
Text("Create Account")
}
} else if (forgotPassword) {
Text("Forgot Password").font(.title).bold().foregroundColor(.white)
TextField("Email Address", text: self.$email)
Button(action: {self.sendResetCode()}) {
Text("Email Reset Code")
}
TextField("Reset Code", text: self.$code)
Button(action: {self.resetPassword()}) {
Text("Reset Password")
}
}
}
}
}
Abhishek Dewan
07/17/2021, 5:06 PMAbhishek Dewan
07/17/2021, 5:07 PMAbhishek Dewan
07/17/2021, 5:07 PMJason Inbody
07/17/2021, 5:07 PMvar name by remember { mutableStateOf("") }
is kind of like @State *var* createAccount = *false*
Abhishek Dewan
07/17/2021, 5:07 PMJason Inbody
07/17/2021, 5:17 PM1.0.0-beta01
to early to use this?Jason Inbody
07/17/2021, 5:17 PM@Composable
fun SigninForm() {
Box(Modifier.fillMaxSize(), Alignment.Center) {
Box(Modifier.fillMaxSize(), Alignment.Center){
val path = Uri.parse("file:///android_asset/background.mp4")
VideoPlayer(uri = path)
}
var signInState by remember { mutableStateOf("login") }
if(signInState == "login") {
Login()
}else if(signInState == "signup"){
Signup()
} else if(signInState == "signup"){
ForgotPassword()
}
}
}
I get an error onJason Inbody
07/17/2021, 5:17 PMvar signInState by remember { mutableStateOf("login") }
Jason Inbody
07/17/2021, 5:17 PMType 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
Jason Inbody
07/17/2021, 5:25 PMJason Inbody
07/17/2021, 5:25 PMimport androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue
Abhishek Dewan
07/18/2021, 12:40 AMephemient
07/18/2021, 1:35 AM