Concept | Flutter | Jetpack Compose |
---|---|---|
Vertical Layout | Column | Column |
Horizontal Layout | Row | Row |
Stacking Layout | Stack | Box |
Flexible Space | Expanded | Spacer |
Text Display | Text | Text |
Text Style | style: TextStyle | style (TextStyle) |
Text Color | style: TextStyle(color: ...) | color |
Button | ElevatedButton, TextButton | Button |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct SphereView: View { | |
@State var start = Date() | |
func createPoint(at angle: Double, radius: Double, time: Double, center: CGPoint, pointSize: Double) -> (path: Path, color: Color) { | |
let wobble = sin(time * 2 + radius / 10) * 10 | |
let distanceModifier = 1 + sin(angle * 3 + time) * 0.1 | |
let adjustedRadius = (radius + wobble) * distanceModifier | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DotGridView.swift | |
// | |
import SwiftUI | |
struct DotPosition: Equatable, Hashable { | |
let row: Int | |
let column: Int | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
import Combine | |
struct CountdownView: View { | |
let countdownSeconds: Int = 10 | |
let numberOfDivision: Int = 36 | |
let handSize: CGSize = .init(width: 8, height: 24) | |
let radius: CGFloat = 100 | |
@State var count: Int = 10 |
OlderNewer