September 2019
Beginner
512 pages
12h 52m
English
The Dart callback passed down to the native part of the plugin through the handle seen before is responsible for calculating the Fibonacci, like before. However, it is not exactly the same:
void backgroundIsolateMain() { print('background isolate entry point running'); const backgroundchannel = MethodChannel( 'com.example.handson/background_channel' ); WidgetsFlutterBinding.ensureInitialized(); backgroundchannel.setMethodCallHandler((MethodCall call) async { if (call.method == 'calculate') { print('calculating fibonacci from a background process'); int first = 0; int second = 1; for (var i = 2; i <= 50; i++) { var temp = second; second = first + second; first = temp; sleep(Duration(milliseconds: 500)); print("first: ...Read now
Unlock full access