Two-dimensional nano-layered materials as multi-responsive chemosensors constructed by carbazole- and fluorene-based polyaniline-like derivatives.