Skip to content

Instantly share code, notes, and snippets.

@IslamRustamov
Created June 7, 2023 20:02
Show Gist options
  • Save IslamRustamov/a77f6a1375733cfd7d8ce66f67c1b73e to your computer and use it in GitHub Desktop.
Save IslamRustamov/a77f6a1375733cfd7d8ce66f67c1b73e to your computer and use it in GitHub Desktop.
private func sort(result: FlutterResult, _ array: [Int]) {
var arr = array
for _ in 0...arr.count {
for value in 1...arr.count - 1 {
if arr[value-1] > arr[value] {
let largerValue = arr[value-1]
arr[value-1] = arr[value]
arr[value] = largerValue
}
}
}
result(arr)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment