This article presents an efficient numerical scheme based on some properties of dual Bernstein operational matrices for a class of linear and nonlinear two-dimensional weakly singular fractional partial integro-differential equations (WSFPID). A novel property of the suggested scheme is the conversion of the WSFPID into an algebraic system of equations. The corresponding linear and nonlinear system of equations are solved by well-known Newton-Raphson scheme. Convergence and an upper error bound, of the scheme are also analyzed. Finally, by providing several examples and reviewing the numerical results and comparing them with other available methods, we show that the mentioned method has acceptable accuracy and efficiency. The main important applications of the proposed scheme is that it can be applied on linear as well as nonlinear problems and can be applied on higher order partial differential equations too. Also, with a small number of bases, we can find a reasonable approximate solution.