Flutter - Cocopods issues wite firebase - M1 issue

Had issues getting Flutter to connect to firebase. Had some cocopods issues. This seems to be a M1 Mac issue

Found a fix on this video https://www.youtube.com/watch?v=iWIiXADqsm0

install ffi:

sudo arch -x86_64 gem install ffi
cd ios
arch -x86_64 pod install --repo-update
cd ..

in the project dir

flutter clean
flutter pub get

be sure to properly initialize firebase

void main() async {
	WidgetsFlutterBinding.ensureInitialized();
	await Firebase.initializeApp(
		options: DefaultFirebaseOptions.currentPlatform,
	);
	runApp(MyApp());
}

Update Theres a new pattern

sudo gem uninstall ffi && sudo gem install ffi -- --enable-libffi-alloc

found here