if (Platform.isAndroid) {
// Android-specific code/UI Component
} else if (Platform.isIOS) {
// iOS-specific code/UI Component
}
Don't forget to import IO Library.
import 'dart:io';
If you are using `import 'dart:html';` too in same file then you have to specify Platform definition as both libraries has definition of "Platform"
in that case use Platform Specific Code like Below:
import 'dart:io' as IO;
import 'dart:html';
if (IO.Platform.isAndroid) {
// Android-specific code/UI Component
} else if (IO.Platform.isIOS) {
// iOS-specific code/UI Component
}
If you are looking into Platform Integration properly I would Suggest Use Complete Example on Flutter site:
[
[To see links please register here]
][1]
[1]:
[To see links please register here]