Of course it’s optional. Some of the most popular apps on the planet ignore the local UI conventions of their parent OSes entirely.
TikTok is a Flutter app. It looks identical on iOS and Android. It uses basically no native UI elements.
It’s a pretty well-known strategy to create apps that look identical on all platforms so that you lessen your customer confusion and your support burden. The fact that Spotify, Facebook, Uber, and Reddit look exactly the same no matter what platform you’re on is more important than complying with OS design guidelines and UI elements.