Catalyzes the phosphorylation of riboflavin to FMN followed by the adenylation of FMN to FAD (PubMed:27672192). Can also catalyze the phosphorylation of the toxic riboflavin analogs 8-demethyl-8-aminoriboflavin (AF) to 8-demethyl-8-aminoriboflavin mononucleotide (AFMN) and roseoflavin (RoF) to roseoflavin mononucleotide (RoFMN), and the adenylation of AFMN to 8-demethyl-8-aminoriboflavin adenine dinucleotide (AFAD) (PubMed:27672192). ATP + riboflavin = ADP + FMN + H(+) ATP + FMN + H(+) = diphosphate + FAD kcat is 0.40 sec(-1) with riboflavin as substrate. kcat is 4.39 sec(-1) with FMN as substrate. Cofactor biosynthesis; FAD biosynthesis; FAD from FMN: step 1/1. Cofactor biosynthesis; FMN biosynthesis; FMN from riboflavin (ATP route): step 1/1. Belongs to the RibF family.