extension String {
func matchingStrings(regex: String) -> [[String]] {
guard let regex = try? NSRegularExpression(pattern: regex, options: []) else { return [] }
let nsString = self as NSString
let results = regex.matches(in: self, options: [], range: NSMakeRange(0, nsString.length))
return results.map { result in
(0..
http://www.yuukinishiyama.com/2018/10/23/wifi-ap-info-swift4/
需要開發者帳號
會自動生成呢個 or 可能出現係info.plist
This file contains 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
{ | |
"id": "xxxxx-xxxxx-xxxxx-xxxxx-xxxxx", | |
"name": "macbook", | |
"description": "M1 16gb 13inch", | |
"image_links": [ | |
"https://via.placeholder.com/150", | |
"https://via.placeholder.com/150" | |
], | |
"stock": 5, | |
"state": "ACTIVE" |
This file contains 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
Future<Uint8List> _downloadImage() async { | |
String dir = (await getApplicationDocumentsDirectory()).path; | |
File file = new File('$dir/$_filename'); | |
if (file.existsSync()) { | |
var image = await file.readAsBytes(); | |
return image; | |
} else { | |
var response = await http.get(_url,); | |
var bytes = response.bodyBytes; |