Although no-one knows the exact origin of the flat-brimmed hat style, a majority of speculation notes that african-americans living within lower-class suburbanite neighborhoods, or "ghettos", were the originators of the style.

Dually noted was its representation of struggle arising from poor living conditions within the lower-socioeconomic segment of society.

Unfortunetly, somewhere along the way, "Twats" or "Fake Ass Bitches" stole the iconic style, and began to showcase it throughout middle-class and upper-class societies. Notoriety for this type of "douchebaggery" was taken by most "wiggers", whom still to this day showcase this style amoung their "dirty-ass" peers.

In an ideal world, the flat-brimmed hat would be quashed, and represent a segment of history. However, this would only allow other blatent showcases of "douchebaggery" to take its space.

Look at that kid. I just want to punch him in the lips. Only a fake-assbitch would wear a stupid flat-brimmed hat.

The flat brimmed baseball hat is said to have originated from Oakland and California.

"The first thing people did when buying a baseball hat in the 90's was bend the brim. Crack and drug dealers would wear glasses and a hat with a straight brim to throw off the stereotypical image" (of a backwards cap or bent baseball cap which was commonly worn in the 1990's)
"I wear these glasses so i can look like a square, but if you see me in a fight with a bear, don't help me nigga, help the bear"
The style generally moved to the gangster rap scene in the mid to late 90's to associate the rappers with drug dealers, wearing clothes straight off the rack (tags included) and being clean cut and fresh.

Post 2005 people without idea of origin wear the hat as the new style, rarely bending the brim in an "on field" cap style, this style is associated with post 1990 born, any social group from club goers to skaters.

Sources: Rapper, Slang inventor and style originator E-40 mentions in a documentary Blueprint of a self made Millionaire, where the style originated.
No gangster rap vidoes before 1994 featured a straight brim hat.

You looked like a nerd NOT having a Flat-Brimmed Hat and wearing glasses late 1980's early 90's.

You looked like you sold drugs wearing a Flat-Brimmed Hat hat mid 90's

You looked like a rapper late 90's fresh and clean cut possibly mating colours to your clothes and shoes.