what is the recommended i18n method for Dart programs without Flutter widgets (Games using Flame package)?
I tried the dart Intl package and the Flutter intl package with the Android Studio plugin but can't get it running properly. I use DeviceLocale to get the locale but want to use proper classes/methods to read the strings in each locale from files (e.g. arb), but I didn't figure out how to do it with the given tools. The Flutter intl package always wants a context for translations which I don't have necessarily in a Flame game. Of course I have a working solution based on a Translation class and Maps, but I expect there should be a common way to do this properly.
Does anyone have examples on how to implement this in a clean way?
Regards,
Ralph
Since Flutter Intl 1.8.0 version, you should be able to reference string keys without passing the context.
heyy there have you tried this package easy_localization , by far this is the best i have got when it comes to localizations
I am also developing a game and hit a limitation similar to yours. For that I developed a tool that is almost compatible with flutter gen-l10n but can handle non Flutter apps as well. If you want to give it a try it is available on pub.dev: https://pub.dev/packages/land. It also solves some ICU message limitations found in the Flutter provided solution.
Related
I builed a webscraper with python and selenium and I want to code an equivalent in flutter with dart. The issue is that in my python code i had to click on buttons etc on a website, but is it possible to do in flutter ? and if it is what Dart packages can i use ?
Thanks for all the help
I already looked into some packages but i didn't find anything
Many tutorials recommend using awesome flutter snippet extension by Neevash Ramdial.
But i cannot find it in the VSC extension marketplace no more!
You guys having problem with this as well?
While trying to update the project with Flutter 3 support, the organization was accidentally deleted due to a tooling bug.
The plugin has since been reuploaded to the VSCode marketplace, but users will need to reload the extension since the IDs are different.
Very sorry for the inconvenience caused here 💙
Link: https://marketplace.visualstudio.com/items?itemName=Nash.awesome-flutter-snippets
-- Nash
Awesome Flutter Snippets is a collection of commonly used Flutter classes and methods. It increases your speed of development by eliminating most of the boilerplate code associated with creating a widget. Widgets such as StreamBuilder and SingleChildScrollView can be created by typing the shortcut streamBldr and singleChildSV respectively.
It is built-in in Android Studio/VsCode. You can try by using short keyword like when you'll create StatefulWidget you can type stf and it give you hint as StatefulWidget.
It's probably not a programming question and a bit too generic but I can't find any resource about the differences of writing plugin for flutter using Kotlin vs Java. From my research, almost every plugin in pub.dev that I found is written in Java. I don't say Java is bad but I personally prefer Kotlin over Java because of the syntax.
I'm planning to build native code to interact with native libs both on iOS and Android for my project since I couldn't find any plugin that satisfy the project requirements. I'd like to share it on pubdev when it's done (hopefully) so I have to think twice before writing it.
The question is, if I do so (developing Kotlin-based plugin), will it make any difference? Like maybe requires the user to add some extra configuration to their project? Or maybe any Flutter project that uses Java can't use my package? and.. will it do the same for iOS (using Swift over Objective-C)? The docs is telling us that we can switch both in between, but doesn't tell any side effects about it.
No there is nothing to worry about. Flutter apps are now by default created with Kotlin/Swift and not with Java/ObjC. Of course if someone has an ultra old Flutter configuration, then he might have some problems but I wouldn't concern myself with it.
All the native plugin code is converted to a Gradle dependency or Pod(spec) dependency. The app developer doesn't have to care about it and that is a good thing.
I'm working with Parse Server, my task is to build a flutter application that using Parse SDK to communicate with the Parse Server. You can see the Parse SDK here, these are two packages, one is for Flutter, and another is for Dart. I don't know the difference between these two, and which one I should use.
If you create a Flutter app you should use Parse-SDK-Flutter package. In Migration Guide plugin developers provide this reason for moving from Dart to separate package:
This was done in order to provide a dart package for the parse-server, while keeping maintenance simple. You can find both packages in the package directory..
for this specific case, I'm trying to use Provider on Flutter Web,
but I'm sure that this will not be the last flutter package
that I will use on flutter web, so I'm trying to understand
how to solve this as a generic situation.
I came across this question :
Using flutter mobile packages in flutter web
and this answer:
you can also use libraries that are referencing Flutter framework that was repackaged for flutter_web. Like provider was forked [link]. You only can't use plugins atm.
For my understanding the suggested procedure is
Fork
Repack
Import
While "Fork" is straight forward, feel the need to ask:
How to Repack a Flutter Plugins to use for Flutter Web?
since this time I got lucky and Kevin already did the repacking
How do I import it? [edit: nevermind... ]
Thank you in advance
got the answer here
just
clone the repository you want to use,
copy the files in your project
fix the errors
then everything should work