You can use Magic Keyboard, including Magic Keyboard with Numeric Keypad, to enter text on iPhone. Magic Keyboard connects to iPhone using Bluetooth®.
Make sure the keyboard is turned on and charged.
On iPhone, go to Settings Commands for dictating text on iPhone