The Brinkman model describes flow of fluid in complex porous media with a high-contrast permeability coefficient such that the flow is dominated by Darcy in some regions and by Stokes in others. A weak Galerkin (WG) finite element method for solving the Brinkman equations in two or three dimensional spaces by using polynomials is developed and analyzed. The WG method is designed by using the generalized functions and their weak derivatives which are defined as generalized distributions. The variational form we considered in this paper is based on two gradient operators which is different from the usual gradient-divergence operators for Brinkman equations. The WG method is highly flexible by allowing the use of discontinuous functions on arbitrary polygons or polyhedra with certain shape regularity. Optimal-order error estimates are established for the corresponding WG finite element solutions in various norms. Some computational results are presented to demonstrate the robustness, reliability, accuracy, and flexibility of the WG method for the Brinkman equations.