File tree Expand file tree Collapse file tree
packages/flutterfire_cli/lib/src/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,15 +144,15 @@ class InstallCommand extends FlutterFireCommand {
144144 .where (
145145 (element) => listAvailablePluginsInVersion.contains (element.name),
146146 )
147- .map ((plugin) => plugin.displayName)
148147 .toList ();
148+ final displayNames = choices.map ((plugin) => plugin.displayName).toList ();
149149 final defaultSelection = List <bool >.filled (choices.length, false );
150150 for (final dependency in flutterApp! .package.dependencies) {
151- final enumValue = FlutterFirePlugins .values .firstWhereOrNull (
151+ final enumValue = choices .firstWhereOrNull (
152152 (element) => element.name == dependency,
153153 );
154154 if (enumValue != null ) {
155- final index = choices.indexOf (enumValue.displayName );
155+ final index = choices.indexOf (enumValue);
156156 defaultSelection[index] = true ;
157157 }
158158 }
@@ -161,11 +161,12 @@ class InstallCommand extends FlutterFireCommand {
161161
162162 final selectedChoices = promptMultiSelect (
163163 'Select the Firebase plugins you would like to install' ,
164- choices ,
164+ displayNames ,
165165 defaultSelection: defaultSelection,
166166 );
167167 for (final index in selectedChoices) {
168- selectedPlugins.add (FlutterFirePlugins .values[index]);
168+ // retrieve plugin based on the choices list
169+ selectedPlugins.add (choices[index]);
169170 }
170171 return selectedPlugins;
171172 }
You can’t perform that action at this time.
0 commit comments