Author: Chris Lattner
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
| class Contact { | |
| // Constructor is marked 'const' so all fields must be final. | |
| final String name; | |
| final int age; | |
| // const at class level have to go along with static keyword | |
| static const alive = true; | |
| // const constructor | |
| const Contact(this.name, this.age); |
- Proposal: TBD
- Author: Evan Maloney
- Status: Draft
- Review manager: TBD
Frequently, closures are used as completion callbacks for asynchronous operations, such as when dealing with network requests. It is quite common to model these sorts of operations in such a way that an object instance represents a request/response transaction, for example:
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
| CMDeviceMotion *deviceMotion = [NSKeyedUnarchiver unarchiveObjectWithData:[[NSData alloc] initWithBase64EncodedString: | |
| @"YnBsaXN0MDDUAQIDBAUINzhUJHRvcFgkb2JqZWN0c1gkdmVyc2lvblkkYXJjaGl2ZXLRBgdUcm9v" | |
| "dIABowkKL1UkbnVsbN8QEgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLl8QJmtD" | |
| "TURldmljZU1vdGlvbkNvZGluZ0tleU1hZ25ldGljRmllbGRYXxAla0NNRGV2aWNlTW90aW9uQ29k" | |
| "aW5nS2V5Um90YXRpb25SYXRlWl8QKWtDTURldmljZU1vdGlvbkNvZGluZ0tleVVzZXJBY2NlbGVy" | |
| "YXRpb25aXxAja0NNRGV2aWNlTW90aW9uQ29kaW5nS2V5UXVhdGVybmlvbldfEBxrQ01Mb2dJdGVt" | |
| "Q29kaW5nS2V5VGltZXN0YW1wXxAla0NNRGV2aWNlTW90aW9uQ29kaW5nS2V5Um90YXRpb25SYXRl" | |
| "WF8QNWtDTURldmljZU1vdGlvbkNvZGluZ0tleU1hZ25ldGljRmllbGRDYWxpYnJhdGlvbkxldmVs" | |
| "XxAja0NNRGV2aWNlTW90aW9uQ29kaW5nS2V5UXVhdGVybmlvblpfECprQ01EZXZpY2VNb3Rpb25D" | |
| "b2RpbmdLZXlEb2luZ1lhd0NvcnJlY3Rpb25fECtrQ01EZXZpY2VNb3Rpb25Db2RpbmdLZXlEb2lu" |