For the user interface, which should be slightly different on iOSand Android, there should be a way to determine which one you are working on, but I could not find it in the documentation. What is it?
iOS
Android
Thanks Collin, the final answer is:
bool isIOS = Theme.of(context).platform == TargetPlatform.iOS;
import 'dart:io' show Platform; if (Platform.isAndroid) { // Android-specific code } else if (Platform.isIOS) { // iOS-specific code }
Other options include:
Platform.isFuchsia Platform.isLinux Platform.isMacOS Platform.isWindows
Docs: https://docs.flutter.io/flutter/dart-io/Platform-class.html.
defaultTargetPlatform , Theme.of(context).targetPlatform. iOS ( defaultTargetPlatform TargetPlatform.android ). , Theme.
defaultTargetPlatform
Theme.of(context).targetPlatform
TargetPlatform.android
Theme
You can do
defaultTargetPlatform == TargetPlatform.iOS ? kIOSTheme : kDefaultTheme,
of import 'package:flutter/foundation.dart';
import 'package:flutter/foundation.dart';
Source: https://habr.com/ru/post/1684622/More articles:How to filter multicast receive socket by interface? - cHow to iterate over a string and return a new string that stops at a specific character - pythonС# Передача одной переменной двум параметрам "out" - c#Why doesn't using Math.max as a parameter work in this scenario? - javascriptParallelize a loop in bash - bashDefining parameters in JavaScript reduces - javascriptIs there a way to implement pagination in spring webflux and spring data is reactive - springSpring Custom query with page - springAccounting for unique weekdays from a timestamp column in a dataframe in Python - pythonDynamic pandas frame filtering - pythonAll Articles