flutter_native_admob
flutter_native_admob copied to clipboard
NativeTextStyle's fontSize is not working
NativeTextStyle's fontSize is not working, i tested it with many values but it's not changing from the default one
import 'package:flutter/material.dart';
import 'package:flutter_native_admob/flutter_native_admob.dart';
import 'package:flutter_native_admob/native_admob_controller.dart';
import 'package:flutter_native_admob/native_admob_options.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
static const _adUnitID = "ca-app-pub-3940256099942544/8135179316";
final _nativeAdController = NativeAdmobController();
Widget showAds(double fontSize) => Container(
height: 90,
child: NativeAdmob(
adUnitID: _adUnitID,
controller: _nativeAdController,
type: NativeAdmobType.banner,
options: NativeAdmobOptions(
headlineTextStyle : NativeTextStyle(
fontSize: fontSize,
),
),
),
);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin example app'),
),
body: ListView(
children: <Widget>[
showAds(5.0),
showAds(10.0),
showAds(20.0),
showAds(30.0),
showAds(40.0),
],
),
),
);
}
}
@Errechydy i tried the code you provided as it is. and it works for me. for every Ad i got a bigger fontsize, like the value given in the showAds()
method.
@korchix have you tried it in a real device?
@korchix have you tried it in a real device?
i have run it in a real device (iphone x)
@korchix Weird, i have run it on Android device (Nubia ZTE) the font didn't change, i don't know if that happens on all Android devices or it's related only to the device i have
@Errechydy try to run it on an android emulator like the Pixel 2 XL or something like that.
@korchix I will, but to be honest i don't trust emulators that much. in many cases things work on emulators well then when you test them on a real device they don't
I can confirm that Text Size don't change on Android but works on IOS
+1 fontSize does not work on android devices.