try? it out
import SwiftUI
struct ContentView: View {
var body: some View {
Button(action: {}) {
Text("Press to confirm your flight")
.padding(20)
.frame(maxWidth: .infinity)
.foregroundColor(.white)
}
.background(
RoundedRectangle(cornerRadius: 100)
.overlay(
LinearGradient(colors: [.red, .green, .yellow], startPoint: .leading, endPoint: .trailing)
)
.clipShape(
RoundedRectangle(cornerRadius: 100)
)
)
.padding(.horizontal, 20)
}
}
#Preview {
ContentView()
}