@@ -453,6 +453,8 @@ To return multiple values in a function, aggregate the values in a [record][].
453
453
}
454
454
```
455
455
456
+ [ record ] : /language/records#multiple-returns
457
+
456
458
## Generators
457
459
458
460
When you need to lazily produce a sequence of values,
@@ -499,9 +501,38 @@ Iterable<int> naturalsDownFrom(int n) sync* {
499
501
}
500
502
```
501
503
504
+
502
505
[ `Iterable` ] : {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-core/Iterable-class.html
503
506
[ `Stream` ] : {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-async/Stream-class.html
504
- [ record ] : /language/records#multiple-returns
507
+
508
+ ## External functions {#external}
509
+
510
+ An external function is a function whose body is implemented separately from its
511
+ declaration. Include the ` external ` keyword before a function declaration, like so:
512
+
513
+ ``` dart
514
+ external void someFunc(int i);
515
+ ```
516
+
517
+ An external function's implementation can come from another Dart library,
518
+ or, more commonly, from another language. In interop contexts, ` external `
519
+ introduces type information for foreign functions or values,
520
+ making them usable in Dart. Implementation and usage is
521
+ heavily platform specific, so check out the interop docs on, for example,
522
+ [ C] [ ] or [ JavaScript] [ ] to learn more.
523
+
524
+ External functions can be top-level functions, [ instance methods] [ ] ,
525
+ [ getters or setters] [ ] , or [ non-redirecting constructors] [ ] .
526
+ An [ instance variable] [ ] can be ` external ` too,
527
+ which is equivalent to an external getter and (if the variable
528
+ is not ` final ` ) an external setter.
529
+
530
+ [ instance methods ] : /language/methods#instance-methods
531
+ [ getters or setters ] : /language/methods#getters-and-setters
532
+ [ non-redirecting constructors ] : /language/constructors#redirecting-constructors
533
+ [ instance variable ] : /language/classes#instance-variables
534
+ [ C ] : /interop/c-interop
535
+ [ JavaScript ] : /interop/js-interop
505
536
506
537
[ Function API reference ] : {{site.dart-api}}/{{site.sdkInfo.channel}}/dart-core/Function-class.html
507
538
[ Callable objects ] : /language/callable-objects
0 commit comments