Aflatoxin B1 (AFB1), produced by the Aspergillus species, is one of the most potent carcinogens, posing significant health risks through contamination of food supplies. Monitoring an aflatoxin biosynthesis gene such as the aflD gene provides an early warning mechanism to prevent contamination. However, traditional methods for gene detection have limitations, including the need for sophisticated equipment and slow reaction kinetics, making them unsuitable for rapid and on-site testing. To address these challenges, we developed a novel biosensing platform based on space-confinement mechanisms using hydrogel particle arrays for the detection of the aflD gene. This system confines reactants within the outer water layer of poly(ethylene glycol) carboxylate (PEG-COOH) hydrogel particles, significantly enhancing reaction kinetics by increasing local concentrations of the aflD gene. By incorporating graphene oxide to reduce background interference, the platform further improves detection specificity. The fluorescent probe used in this platform is a newly synthesized V-shaped dicationic fluorophore (VLM), which binds selectively to double-stranded DNA (dsDNA) and offers enhanced fluorescence upon binding to the aflD gene. This space-confinement-enhanced system detects the aflD gene with high sensitivity and rapid response, outperforming conventional methods by accelerating detection rates up to 240 times. The biosensor achieved a detection limit of 19.05 nM and a linear range of 50-1000 nM and required only 15 s for detection. This platform exhibited excellent sensitivity and specificity for the aflD gene, with high potential for real-time, on-site monitoring.