Catalyzes the phosphorylation of riboflavin to FMN followed by the adenylation of FMN to FAD. ATP + riboflavin = ADP + FMN + H(+) ATP + FMN + H(+) = diphosphate + FAD Higher divalent cation concentrations lead to decrease in the turnover of riboflavin and the 5'-phosphotransferase activity, while the adenylyltransferase activity increases. With magnesium ions the highest turnover of riboflavin is observed between pH 6 and 7.5, while that of FAD is between 7.0 and 9.0. With zinc ions a steady increase in riboflavin turnover is observed between pH 4.5 and 10, while FAD is the major product at pH 7.0 and decreases rapidly above pH 8.0. 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.