New carbazole and quinoxaline based D-A polymer were synthesized. Excellent fluorescence sensing of Ni2+probe is designed. The materials has good solubility and able to form thin film. HOMO and LUMO energy levels of the polymers could be tuned. Shifting of optical and electrochemical band gap from 2.16 to 2.33.