fix platform specific code not working on web

This commit is contained in:
2026-02-25 12:05:07 +02:00
parent 281ea863e8
commit 5135629b33
11 changed files with 29 additions and 14 deletions

View File

@@ -1,5 +1,6 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:mzansi_innovation_hub/main.dart';
@@ -159,7 +160,7 @@ class _CurrencyExchangeRateState extends State<CurrencyExchangeRate> {
),
SizedBox(height: 10),
Consumer(builder: (context, bannerAdDisplay, child) {
if (Platform.isAndroid || Platform.isIOS) {
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
return MihBannerAd();
} else {
return const SizedBox(height: 0);

View File

@@ -231,7 +231,7 @@ class _TipCalcState extends State<TipCalc> {
),
SizedBox(height: 10),
Consumer(builder: (context, bannerAdDisplay, child) {
if (Platform.isAndroid || Platform.isIOS) {
if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
return MihBannerAd();
} else {
return const SizedBox(height: 0);