As a general rule, avoid writing dialect. If you don’t have a dead-on ear for that sort of thing, it’s not going to work — and the failure state of attempted dialect is truly dire. Not only do you risk coming off as unintentionally funny (and “funny” is just one of the many many things in writing that you only want to be on purpose), you’re putting yourself in position to get called out for imposing a privileged outside-observer point of view upon the native speakers of whatever dialect you’re trying to write.
Furthermore, styles in writing change, and dialect has been out of fashion for some time now. But it wasn’t always so. English literature of the nineteenth century, in particular, was crammed full of painstaking representations of different dialects: national dialects, regional dialects, class dialects, all carefully done in what passed (in those pre-International Phonetic Alphabet days) for phonetic spelling. Sir Walter Scott did it — the characters in The Heart of Midlothian speak Scots broad enough to carpet a floor with — and Mark Twain did it and even Alfred, Lord Tennyson did it (check out his Northern Farmer: Old Style and Northern Farmer: New Style for a couple of wince-worthy examples.) One reason for the popularity of written-out dialect pronunciation may have been the common practice at the time of reading books out loud in the family circle; if the reader wanted to “do the voices”, the written-out dialect would give him or her some guidelines.
Sometimes, the way the writer transcribed a character’s dialect said as much about the writer’s own dialect and that of his or her intended audience as it did about that of the characters. Check out the coastal New England dialect as depicted by an educated Englishman for an English audience in Rudyard Kipling’s Captains Courageous, for example.
(The Heart of Midlothian and Captains Courageous are both good books in spite of the dialect writing. I don’t really recommend the Tennyson, though, except as a curiosity.)