import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; /// Adsterra 300×250 medium rectangle banner. /// Native-looking container, no "AD" label. /// Best for in-content placements (settings page, panel). const String _kMediumRectCode = ''' '''; class MediumRectBanner extends StatelessWidget { const MediumRectBanner({super.key}); String get _html => ''' $_kMediumRectCode '''; @override Widget build(BuildContext context) { return Container( width: double.infinity, constraints: const BoxConstraints(maxHeight: 270), decoration: BoxDecoration( color: Colors.transparent, border: Border( top: BorderSide(color: Colors.grey.withValues(alpha: 0.08)), bottom: BorderSide(color: Colors.grey.withValues(alpha: 0.08)), ), ), child: SizedBox( height: 250, child: InAppWebView( initialSettings: InAppWebViewSettings( javaScriptEnabled: true, domStorageEnabled: true, transparentBackground: true, cacheEnabled: false, safeBrowsingEnabled: false, useHybridComposition: true, ), onWebViewCreated: (c) async { await c.loadData( data: _html, mimeType: 'text/html', encoding: 'utf-8', baseUrl: WebUri('https://adsterra.com'), ); }, ), ), ); } }