Posts

Showing posts from July, 2025

Reusing the same animation within your app

Image
 

flutter animation

 import 'package:flutter/material.dart'; import 'dart:async'; // Import for Timer class HomePage extends StatefulWidget {   const HomePage({Key? key}) : super(key: key);   @override   _HomePageState createState() => _HomePageState(); } class _HomePageState extends State<HomePage> {   List<ScrollController> _scrollControllers = [];   List<ScrollController> _fruitScrollControllers = [];   List<Timer?> _timers = [];   @override   void initState() {     super.initState();     _initScrollControllers();     _startScrolling();   }   void _initScrollControllers() {     for (int i = 0; i < 2; i++) {       _scrollControllers.add(ScrollController());       _fruitScrollControllers.add(ScrollController());     }   }   void _startScrolling() {     for (int i = 0; i < _scrollControllers.length; i++) {     ...

free islamic api

 https://islamicapi.com/doc/

🚀 𝗛𝗼𝘄 𝗜 𝗥𝗲𝗱𝘂𝗰𝗲 𝗙𝗹𝘂𝘁𝘁𝗲𝗿 𝗔𝗽𝗽 𝗦𝗶𝘇𝗲 𝗪𝗶𝘁𝗵𝗼𝘂𝘁 𝗖𝗼𝗺𝗽𝗿𝗼𝗺𝗶𝘀𝗶𝗻𝗴 𝗙𝗲𝗮𝘁𝘂𝗿𝗲𝘀

  ✅ 𝟭. 𝗥𝗲𝗺𝗼𝘃𝗲 𝗨𝗻𝘂𝘀𝗲𝗱 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝗶𝗲𝘀 Keep your pubspec.yaml clean. Use pub remove, and audit packages that add weight (e.g. http, firebase_analytics, image_picker). ✅ 𝟮. 𝗦𝗽𝗹𝗶𝘁 𝗽𝗲𝗿 𝗔𝗕𝗜 (𝗔𝗻𝗱𝗿𝗼𝗶𝗱 𝗼𝗻𝗹𝘆) Generate separate builds for armeabi-v7a, arm64-v8a, and x86_64. Saves up to 30–50% in size compared to a fat APK. ✅ 𝟯. 𝗨𝘀𝗲 --𝘀𝗽𝗹𝗶𝘁-𝗱𝗲𝗯𝘂𝗴-𝗶𝗻𝗳𝗼 When building for release, always use: 𝘧𝘭𝘶𝘵𝘵𝘦𝘳 𝘣𝘶𝘪𝘭𝘥 𝘢𝘱𝘬 --𝘴𝘱𝘭𝘪𝘵-𝘥𝘦𝘣𝘶𝘨-𝘪𝘯𝘧𝘰=𝘣𝘶𝘪𝘭𝘥/𝘥𝘦𝘣𝘶𝘨-𝘪𝘯𝘧𝘰 It strips debug symbols and makes crash logs still readable with stack trace deobfuscation. ✅ 𝟰. 𝗖𝗼𝗺𝗽𝗿𝗲𝘀𝘀 & 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗲 𝗔𝘀𝘀𝗲𝘁𝘀 Convert PNGs to WebP, compress images, remove oversized fonts, and lazy-load animations. ✅ 𝟱. 𝗠𝗶𝗻𝗶𝗺𝗶𝘇𝗲 𝗣𝗮𝗰𝗸𝗮𝗴𝗲 𝗨𝘀𝗲 Do you really need a full package just for one button or animation? Sometimes custom code is lighter and cleaner. ✅ 𝟲. 𝗔𝘃𝗼𝗶𝗱 𝗨𝗻𝘂𝘀𝗲𝗱 𝗜𝗰𝗼𝗻𝘀/𝗙𝗼𝗻𝘁𝘀 Icon...

flutter subscription code android and ios

 1.Subscription_helper.dart import 'dart:async'; import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:helper_app/usecase/shared_pref_helper.dart'; import 'package:in_app_purchase/in_app_purchase.dart'; class InAppPurchaseService extends ChangeNotifier {   final InAppPurchase _inAppPurchase = InAppPurchase.instance;   StreamSubscription<List<PurchaseDetails>>? _purchaseSubscription;   final SharedPreferenceUseCaseRepo _sharedPreferences = SharedPreferenceUseCaseRepo();   ProductDetails? _selectedProDetails;   ProductDetails? get selectedProDetails => _selectedProDetails;   set selectedProDetails(ProductDetails? productDetails) {     _selectedProDetails = productDetails;     notifyListeners();   }   bool isLoading = false;   /// Available products   List<ProductDetails> availableProducts = [];   Completer<bool>? _pur...

What the Heck Is Dependency Injection?

  Have you ever written a widget that   somehow   ended up knowing about your database, API client, local storage, and maybe even Firebase auth? Be honest we’ve all been there. At first, everything works fine. You call a service from your UI, get the result, display it. But a few weeks later… Your widget’s  build()  method is 100+ lines Your  HomeScreen  knows about every feature in the app Writing a test requires bootstrapping your entire app Welcome to  tight coupling hell . The good news? There’s a simple fix it’s called  Dependency Injection (DI) . And in this post, I’m going to show you  why it matters ,  how it works in Flutter , and  how to start using it in your real apps . Let’s go. First, What the Heck Is Dependency Injection? Think of it like this: Instead of your class creating everything it needs, you just  give  it what it needs from the outside. For example, if a class needs an  ApiClient , you don...