A series of donor-acceptor-donor type molecules (P(2,7-DEF) and P(3,6-DEF)) based on fluorenone acceptor units and 3,4-ethylenedioxythiophene (EDOT) donor units were successfully obtained by Stille coupling reaction in this work, and then generated their corresponding D-A polymers by electrodeposition method. As prepared P(2,7-DEF) and P(3,6-DEF) were characterized by CV, UV–vis spectroscopy, SEM, spectroelectrochemistry, and kinetic studies. Both of these two monomers revealed bright red/yellow light-emitting property in dilute solution. Since the π-conjugation length is longer, the oxidation potential of 2,7-DEF was reduced to 0.85 V, accompanied with red-shifted electronic spectra and emission spectra. The resulting P(2,7-DEF) demonstrated distinct electrochromic properties under various potentials with two different colors from dark-brown to blue-purple. Due to its more porous structure, P(2,7-DEF) also showed favorable optical contrast (26.3 %), very fast switching time (0.32 s), and decent coloration efficiency (221.25 cm2 C−1). However, P(3,6-DEF) displayed much worse electrochromic performances due to its bad electroactivity. P(2,7-DEF) also displayed better redox stability (remaining 79 % electroactivity after 1000 cycles), good optical stability (6 % reduction in optical contrast after 3200 s), and stable optical memory. From these results, P(2,7-DEF) can be further used as a promising near-infrared electrochromic materials.