Is it Possible to Update Dart Packages in Splash Screen? - flutter

I have a private dart package on Github. is it possible to find and update the latest version of the dart package when launching the app in Splash Screen.

Flutter needs all the information of your packages before compiling your app. The package information will be store at pubspec.lock file. The moment you build the app, Flutter will extract the package information from here. So the answer is it's not possible to check and update the package with Flutter codes after the app is built

Related

Is code obfuscation possible in a Flutter package (released in pub.dev)

I want to know if code obfuscation is possible as I have some logics which I want to hide when we re release our SDK in pub.dev
I could not find a way to do it. I refered the documentation.
Here is a link to the official documentation https://docs.flutter.dev/deployment/obfuscate
flutter build apk --obfuscate --split-debug-info=/<project-name>/<directory>
It looks like obfuscating a package is not possible Can obfuscated code for Flutter package or Flutter plugin
It isn't allowed nor possible to obfuscate packages for pub.dev.
It is supposed to be open source there, by its rules.

Ubuntu | Flutter Doctor: dart is not in you current flutter SDK

Warning: `dart` on your path resolves to /usr/lib/dart/bin/dart, which is
not inside your current Flutter SDK checkout at /home/ankit/flutter.
Consider adding /home/ankit/flutter/bin to the front of your path.
This exception started when the flutter was updated. How do I solve this?
The Problem:
This is happening because you have a separate installation of Dart on your system. The Flutter SDK includes and manages it's own dart SDK, but you can use the dart SDK separately.
Why it Matters
Flutter recommends that you use the dart SDK included with Flutter because Flutter manages it - It will automatically use and upgrade supported versions when using the flutter upgrade command on your terminal, and during initial install.
Flutter is noticing that you have a dart SDK install that did not come with the Flutter SDK. It's giving you a warning because of the possible differences in versions (and possibly other configurations) that could prevent an optimal flutter development experience.
System Path
Here's an explanation of path. You will probably need to set your path environment variables to get the whole fix.
This link shows the official Apple guide to working with the terminal environment variables (including path) but a quick google around should help you find any answers you can't find here.
The path resolves from "front" to "back" - meaning that if the executable in question occurs twice, it will grab the first one. Flutter doctor wants you to add the flutter dart path at the front so that subsequent dart calls will resolve to the Flutter Dart SDK.
The High-Level Solution
Unless you're doing dart development outside flutter, you don't need an additional dart SDK. Most of the time the Flutter dart SDK will work for cases besides flutter as well.
I would recommend removing your other dart install, and using the dart install that comes with flutter. This process will vary depending on how you installed the other dart SDK.
TLDR/Quick Fix
based on what you provided, run this on your Zsh command-line:
export PATH="/home/ankit/flutter/bin:$PATH"
It will only work until you restart your computer.

Flutter app which uses huawei_push rejected by Google Play Store

I want to use huawei_push kit in my flutter app but Google Play Store rejected my app because of PendingIntent issues (security rules). I want to use the same source code for Google Play Store and Huawei App Gallery. I was thinking of:
building APK based on flavor (huawei push kit dependencies won't be used in built APK),
using different pubspec.yaml files to avoid huawei push kit dependencies in the whole project.
Question:
How can I use huawei_push kit just for Huawei App Gallery still using the same source code for different stores?
Update:
The problem has been reported to R&D Team. And it's expected to be fixed in the next version.
At the same time, we provide a workaround solution. You may refer to this before next version release.(The Flutter plug-in is open source, so you can modify it directly)
Here's how to modify:
1.Open the pubspec.xml file in the root directory and find the plug-in.Like following:
dependencies:
flutter:
sdk: flutter
huawei_location: 5.0.0+301
You need to find the cache directory of the Flutter, for example:
Find the plug-in directory, for example:
If the plug-in points to a directory, for example:
dependencies:
huawei_location:
path: {library path}
directly access the directory.
2.Modify the build.gradle file in the android directory to modify the SDK version on which the file depends.
For example:
implementation 'com.huawei.hms:location:5.1.0.303'
P.S. The PendingIntent issue has been resolved in Push kit 5.3.0.304. So you can directly use this version.
After the modification, run the following command to trigger compilation:
flutter run

How to know on which flutter version a perticular project is made?

i have a flutter project and when i run it, it says to migrate to current version of flutter, but i don't want to migrate it, i can change my flutter version on which this project was made, so i can run it, i have tried to change my flutter version to 1.177, 1.22, 2.2 but it is still showing migrate error, so how to know if there any file available in project folder where we can see on which flutter version this perticular project is made, or is there other way to know it? please help.
If there is anything else you need, please tell me i will provide,
Thanks
in pubspec.lock file, you can check the version of every package including flutter in it.
also, It's optional to mention the flutter version in pubspec.yaml.
You can find the flutter and dart versions used in the project at the pubspec.lock file, at the very bottom.
Should be something like this:
sdks:
dart: ">=2.17.6 <3.0.0"
flutter: ">=3.0.0"

What is the difference between flutter plugin and flutter module?

I am new to flutter plugin development, I have read Developing packages & plugins and Writing a good Flutter plugin, but I am confused as a beginner, I have developed Flutter Application based on webview_flutter and a JavaScript library to work offline. I want to extend it as a module or a plugin.
Webview renders some stuff.
JavaScript library is being attached from assets.
I am not calling any Platform API directly from my code but my code depends on another plugin.
How do I proceed this? As a plugin or as a module?
A plugin is about making native functionality available to Flutter.
A module is about integrating Flutter with an existing native application.
Perhaps what you actually want is a reusable Pub package that you can publish to pub.dartlang.org (a plugin is also a Pub package, just a special one that additionally utilizes access to the native platform)
See also
https://flutter.io/docs/development/packages-and-plugins/developing-packages
https://www.dartlang.org/guides/libraries/create-library-packages
A "library package" is a Pub package in contrary to a plain Dart "application package" which is usually not published to pub.dartlang.org.
A pure Dart Pub package (library package) that does not depend on dart:html, dart:ui (Flutter) and is not a Flutter plugin, can be used on any platform (server, command line, Flutter, browser).
If your package has one of the named dependencies, it is limited to a specific platform.
pub.dartlang.org shows labels to categorize published packages accordingly (FLUTTER,WEB,OTHER)
Flutter plugins:
In short: Native related developments.
Flutter plugin is the wrapper of the native code like android( Kotlin or java) and iOS(swift or objective c). ... Flutter can do anything that a native application can through the use of Platform Channels and Message Passing. Flutter instructs the native iOS/Android code to perform an action and returns the result to Dart.
Flutter packages or modules:
In short: Make the development faster by using code from util libraries.
Flutter supports using shared packages contributed by other developers to the Flutter and Dart ecosystems. This allows quickly building an app without having to develop everything from scratch.