In a Flutter app there is a version
attribute in the pubspec.yaml
file to specify the app version.
Is it possible to access this value from dart code when building for the web ?
You can check whether your Flutter app is running on a web browser by using the kIsWeb constant from the foundation library. You can find more information about the foundation library in Flutter's official documentation.
Yes. Flutter is great for both mobile and web app development as it is highly compatible with current-generation web rendering technologies like HTML, CSS, and JavaScript. Using Flutter, you can easily compile the existing code into a client experience, embed it into the browser, and then deploy it to any web server.
That supports flutter for web and other platforms
import 'package:package_info_plus/package_info_plus.dart';
PackageInfo packageInfo = await PackageInfo.fromPlatform();
String appName = packageInfo.appName;
String packageName = packageInfo.packageName;
String version = packageInfo.version;
String buildNumber = packageInfo.buildNumber;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With