解:过点D作DE⊥BC,垂足为E。
根据题意,得AF⊥BC,DE=AF。
∵斜面AB的坡度i=3:4,
∴$\frac{AF}{BF}=\frac{3}{4}。$
∴设AF=3x m,则BF=4x m。
∴在Rt△ABF中,$AB=\sqrt{AF^2+BF^2}=5x$ m。
∵在Rt△DEC中,∠C=18°,CD=20 m,
∴DE=CD·sin18°≈20×0.31=6.2(m)。
由AF=DE,得3x=6.2,解得$x=\frac{31}{15}。$
∴$AB=5×\frac{31}{15}≈10.3$(m)。
∴斜坡AB的长约为10.3 m