Skip to content

[FirebaseAI] Use InputField component in GenerativeAITextExample #1727

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import MarkdownUI
import SwiftUI
import FirebaseAI
import GenerativeAIUIComponents

struct GenerateContentScreen: View {
let firebaseService: FirebaseAI
Expand All @@ -39,18 +40,11 @@ struct GenerateContentScreen: View {
VStack(alignment: .leading) {
Text("Enter some text, then tap on _Go_ to run generateContent on it.")
.padding(.horizontal, 6)
HStack(alignment: .top) {
TextField("Enter generate content input", text: $userInput, axis: .vertical)
.focused($focusedField, equals: .message)
.textFieldStyle(.roundedBorder)
.onSubmit {
onGenerateContentTapped()
}
Button("Go") {
onGenerateContentTapped()
}
.padding(.top, 4)
InputField("Enter generate content input", text: $userInput) {
Text("Go")
}
.focused($focusedField, equals: .message)
.onSubmit { onGenerateContentTapped() }
}
.padding(.horizontal, 16)

Expand Down