INNER CODE UNIT · Dart
getAdsBlockedTotal
rignaneseleo/SlimSocial-for-Facebook · SlimSocial_for_Facebook/lib/controllers/fb_controller.dart:97
static int getAdsBlockedTotal() => sp.getInt(SpKeys.adsBlockedTotal) ?? 0;
/// Adds [count] to the running total and returns the new value.
///
/// Negative and zero counts are ignored: the page is the source of this
/// number and nothing there should be able to walk the total backwards.
static Future<int> addAdsBlocked(int count) async {
if (count <= 0) return getAdsBlockedTotal();
final total = getAdsBlockedTotal() + count;
await sp.setInt(SpKeys.adsBlockedTotal, total);
return total;
}
static int _clampTextZoom(int textZoom) {
if (textZoom < kMinTextZoom) return kMinTextZoom;
if (textZoom > kMaxTextZoom) return kMaxTextZoom;
return textZoom;