Designing flexible and stretchable solid-state electrolytes (SSEs) holds promise but challenge in flexible all-solid-state lithium-metal batteries (LMBs) owing to their insufficient ion conductivity and mechanical strength. Herein, we develop nitrogen-rich covalent organic frameworks (NCOF) with abundant Lewis-basic N atoms as lithiophilic sites to incorporate Lewis-acidic Li+ into its inner order structure for fabricating flexible and stretchable PEO-LI+@NCOF SSEs with the crosslinking of polyethylene oxide (PEO). The SSE film displays high mechanical strain (2.2 MPa), Young's modulus (689 MPa), stretchability (1000 %), ion conductivity (2.4 × 10–4 S cm-1), good flame resistance, and wide electrochemical window (4.8 V). Owing to the rich Lewis-basic N atoms with strong Li+ adsorption energy, orderly nanochannels, and negative charge environment within NCOFs, the SSE film endows orderly and rapid ion migration, low Li-ion diffusion barrier, and significantly enhanced ion conductivity for uniform lithium plating/stripping and suppressing Li-dendrite growth. The crosslinking of Li+@NCOF with PEO greatly enhances the mechanical stretchability, flame resistance, and electrochemical window of PEO-based SSEs. Consequently, the Li/PEO-LI+@NCOF/Li symmetrical cell exhibits stable cycling without short-circuiting for 1200 h at 0.1 mA cm-2/0.1 mAh cm-2. The LiFePO4/PEO-LI+@NCOF/Li battery exhibits a 500-cycle long lifespan at 1 C (78 % capacity retention), and its pouch cell verifies promising applications in flexible all-solid-state LMBs. Therefore, introducting Lewis-basic N-rich COFs verifies an effective strategy to design a flexible and stretchable SSE film with high mechanical strength, superior ion conductivity and flame resistance.