I met some problems using Matrial ui icons - material-ui

I was using material UI with react in my project, and ÷ have some troubles when it come to import the material icons, ÷ already install
"#material-ui/core": "^4.12.3",
"#material-ui/icons": "^4.11.2",
"#mui/lab": "^5.0.0-alpha.48",
"#mui/material": "^5.0.1",
but for some reason i got this error
Module not found: Can't resolve '#mui/icons-material/Menu'
i don't know what I'm missing here.

The new version of material-ui is packaged as mui. So instead of #material-ui/icons:... you need #mui/icons-material:... to be installed in package.json. Same goes with all other material-ui packages.

Material UI has been recently updated to v5.0.1 and the package names/ packages has been changed to mui
You can access the v4 here - https://v4.mui.com/

Related

error shown in flutter native splash screen importing doest work

i have an error in initState importing doesnt package doesnt work
error in flutter native splash
Did you imported the package using import at the top? if so then check the version compatibility of package with your flutter version. If you've just added this package, try flutter clean and flutter pub get.
There is no Show() method on Flutter Native Splash. I advice reading the instructions on how to use the package.

Flutter | Error: Couldn't resolve the package

I created a package that is a collection of my own helper classes for faster developing...
The package also included firebase_analytics: which requires a native implementation for each platform i want it to run. Even if i dont wanted to use firebase at all, but still wanted to use my package i was forced to create firebase-config files for the app, because the app crashes if the firebase_analytics package does not find a valid file for the specific platform. To avoid those things i splitted my package in two packages.
The Core-Package: All helper classes that run native dart code
Optional extension: Only the classes that need the firebase implementation
So if i want to use the package without firebase i just have to depend on the core.
If i want to use the firebase variant i could simply depend the firebase package, because the extension package itself depends on the core-package in its own pubspec.yaml file.
PROBLEM: Since i restructured my package like i described, all my apps that depend on it are not building anymore. The console says that all packages that i depend on in my two packages can not be found. This error occures both ways: With firebase & without.
ERROR: (Scroll down for the complete console output)
MY ATTEMPTS:
"flutter clean" & "flutter pub get" in every package and app folder
"flutter pub cache repair"
CORE-PACKAGE Pubspec.yaml:
FIREBASE-Extension Pubspec.yaml:
Plain Console Output:
pastebin.com/m14cbqDV
Thanks for any help!!
I am facing the same issue while i was making a build in Xcode 13.So I had upgraded my flutter version 2.8.0 to 2.10.2 and also removed the version of all firebase dependencies, then the issue was finally solved.
I have faced similar issues and resolved them by removing package versions. Issues like this often arise due to mismatched versions of packages (eg firebase_core, firebase analytics). Please try to remove versions of the firebase packages or the whole packages. (like firebase_analytics :).
Sorry, my bad! As you can see i moved my dependencys to the dev section of my pubspec.yaml. They should be placed in the dependency section.

How to add a package in the android studio - flutter?

I started fluttering a few days ago. I want to add "font awesome" to my project, but I can't. I searched but could not find the right answer. I finally got this guide, but it doesn't work either.
Adding a package dependency to an app
To add the package, css_colors, to an app:
Depend on it
Open the pubspec.yaml file located inside the app folder, and add css_colors: under dependencies.
Install it
From the terminal: Run flutter pub get.
OR
From Android Studio/IntelliJ: Click Packages get in the action ribbon at the top of pubspec.yaml.
Import it
Add a corresponding import statement in the Dart code.
4. Stop and restart the app, if necessary
If the package brings platform-specific code (Kotlin/Java for Android, Swift/Objective-C for iOS), that code must be built into your app. Hot reload and hot restart only update the Dart code, so a full restart of the app might be required to avoid errors like MissingPluginException when using the package.
In the dependencies: section of your pubspec.yaml, add the following line:
dependencies:
font_awesome_flutter:
Look here https://pub.dev/packages/font_awesome_flutter/install
It contain examples and instructions.
Steps also the same:
add the package name to dependencies section. It very important to keep the correct number of spaces in every line of pubspec.yaml, it has very sensitive format
in your case:
dependencies:
font_awesome_flutter: ^8.10.0
Click "Packeges get" in top right corner
Import the package into your dart code
in your case:
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
Now your can use it in Icon widget
Icon(
FontAwesomeIcons.mars,
size:80.0)

how to "Migrate the plugin to the pubspec platforms manifest"

I have created a new flutter app and after adding cloud_firestore 0.13.0+1 it will not compile. No errors it just stops and removes the row of compile icons. An Analysing spinner revolves forever.
In pub.dev it says to "Migrate the plugin to the pubspec platforms manifest." unfortunately I have been unable to find out where that is or how to do it in the documents or StackOverflow. Please help.
According to documentation, the plugins you required need to be added under dependencies in to a pubsec.yaml file located in the root of your project.
dependencies:
cloud_firestore: ^0.13.0+1
After your plugins are added to pubsec.yaml, you can make use of those dependencies in your code by using imports.
import 'package:cloud_firestore/cloud_firestore.dart';

Redux-form-material-ui - Can't resolve 'material-ui/Radio'

I have migrated to the upcoming version (v1) of material-UI, and I installed v1 alongside the current version according to the recommendation:
yarn add material-ui#latest
yarn add material-ui-next#npm:material-ui#next
When I try to use redux-form and use the package redux-form-material-ui to connect the components, it searches for the material-UI components in "material-ui" folder, which gives an error:
Error: Can't resolve 'material-ui/Radio' in 'C:\path\to\redux-form-material-ui\lib'
But I import Radio from material-ui-next/Radio
So it looks for it in the wrong version.
How can I make this work? Should I uninstall the current version and install "next" as "material-ui" instead?
Here is what is installed:
"material-ui": "^0.20.0",
"material-ui-next": "npm:material-ui#next",
"redux-form-material-ui": "^5.0.0-beta.2",
"redux-form": "^7.3.0",
My way of getting around the problem was to uninstall both material UI packages and then install the v1 as "material-ui" , and the old one as "material-ui-old":
"material-ui": "npm:material-ui#next",
"material-ui-old": "npm:material-ui"
I had to change all the imports in the project.
But now it finds the 'material-ui/Radio'.