  In this work, we extend the theory of B\'ekoll\`e-Bonami $B_p$ weights. Here
we replace the constant $p$ by a non-negative measurable function $p(\cdot),$
which is log-H\"older continuous function with lower bound $1$. We show that
the Bergman projector on the unit ball of $\mathbb C^n$ is continuous on the
weighted variable Lebesgue spaces $L^{p(\cdot)}(w)$ if and only if $w$ belongs
to the generalised B\'ekoll\`e-Bonami class $B_{p(\cdot)}$. To achieve this, we
define a maximal function and show that it is bounded on $L^{p(\cdot)}(w)$ if
$w\in B_{p(\cdot)}$. We next state and prove a weighted extrapolation theorem
that allows us to conclude.
