<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Abdallahhossam on Medium]]></title>
        <description><![CDATA[Stories by Abdallahhossam on Medium]]></description>
        <link>https://medium.com/@abdallahhossam847?source=rss-d0479bbbcbab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qaM7lMpFY8s1VkF9v92SsQ.jpeg</url>
            <title>Stories by Abdallahhossam on Medium</title>
            <link>https://medium.com/@abdallahhossam847?source=rss-d0479bbbcbab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 00:22:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abdallahhossam847/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Structure Production-Ready Flutter Applications]]></title>
            <link>https://medium.com/@abdallahhossam847/how-i-structure-production-ready-flutter-applications-b49bdb1ed22b?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/b49bdb1ed22b</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[cross-platform]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 16:50:00 GMT</pubDate>
            <atom:updated>2026-09-21T16:50:00.984Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gsFquiGedFCmBZxtb-r7Q.jpeg" /></figure><p>Building a Flutter application that works is easy.</p><p>Building one that is still easy to maintain after 12 months, dozens of features, multiple developers, thousands of users, and several production releases is a completely different problem.</p><p>After working on multiple production Flutter applications, I learned that architecture is not about creating as many folders, layers, and abstractions as possible.</p><p>It is about making change predictable.</p><p>When I start a serious Flutter project today, my goal is simple:</p><blockquote><em>A developer should be able to understand where a feature lives, how data flows through it, and where a change should be made without exploring the entire codebase.</em></blockquote><p>In this article, I’ll walk through how I structure production-ready Flutter applications and the architectural decisions behind it.</p><h3>1. Start With Features, Not Technical Layers</h3><p>One of the most common structures in Flutter projects looks like this:</p><pre>lib/<br>├── models/<br>├── screens/<br>├── widgets/<br>├── services/<br>├── repositories/<br>├── controllers/<br>└── utils/</pre><p>This looks perfectly reasonable when the application has five screens.</p><p>Then the application grows.</p><p>You suddenly have 40 screens, 60 models, 30 services, and hundreds of widgets spread across unrelated folders.</p><p>If I want to modify the checkout feature, I may need to jump between:</p><pre>models/order.dart<br>services/payment_service.dart<br>repositories/order_repository.dart<br>screens/checkout_screen.dart<br>widgets/payment_card.dart<br>controllers/checkout_controller.dart</pre><p>Everything related to checkout is technically organized, but physically scattered across the project.</p><p>For production applications, I usually prefer a <strong>feature-first architecture</strong>.</p><pre>lib/<br>├── core/<br>├── features/<br>│   ├── auth/<br>│   ├── home/<br>│   ├── products/<br>│   ├── cart/<br>│   ├── checkout/<br>│   ├── orders/<br>│   └── profile/<br>└── main.dart</pre><p>Now everything related to a business capability lives together.</p><p>This becomes extremely valuable as the application grows.</p><h3>2. Structure Each Feature Into Clear Layers</h3><p>Inside each feature, I separate responsibilities.</p><p>A simplified structure might look like this:</p><pre>features/<br>└── products/<br>    ├── data/<br>    │   ├── datasources/<br>    │   ├── models/<br>    │   └── repositories/<br>    │<br>    ├── domain/<br>    │   ├── entities/<br>    │   ├── repositories/<br>    │   └── usecases/<br>    │<br>    └── presentation/<br>        ├── cubit/<br>        ├── pages/<br>        └── widgets/</pre><p>The exact folders can change depending on the size of the project.</p><p>That point is important.</p><p>I don’t believe every Flutter application needs a textbook implementation of Clean Architecture.</p><p>Architecture should solve complexity, not create it.</p><p>A relatively small application may only need:</p><pre>products/<br>├── data/<br>├── logic/<br>└── presentation/</pre><p>A large application with complex business rules may justify stronger separation between data, domain, and presentation layers.</p><p>The architecture should grow with the product.</p><h3>3. The Presentation Layer Should Not Know Everything</h3><p>One mistake I frequently see is putting business logic directly inside widgets.</p><p>For example:</p><pre>onPressed: () async {<br>  final response = await dio.post(<br>    &#39;/orders&#39;,<br>    data: {<br>      &#39;product_id&#39;: product.id,<br>      &#39;quantity&#39;: quantity,<br>    },<br>  );</pre><pre>  if (response.statusCode == 200) {<br>    Navigator.pushNamed(context, &#39;/success&#39;);<br>  }<br>}</pre><p>It works.</p><p>But now the UI knows:</p><ul><li>which API endpoint to call</li><li>how the request is structured</li><li>which HTTP client is being used</li><li>what response represents success</li><li>what should happen after the operation</li></ul><p>That becomes painful to maintain and test.</p><p>I prefer the UI to express <strong>intent</strong>.</p><p>Something closer to:</p><pre>context.read&lt;CheckoutCubit&gt;().placeOrder();</pre><p>The widget shouldn’t care whether placing an order requires REST APIs, GraphQL, Firebase, Supabase, local storage, or carrier pigeons.</p><p>Its responsibility is presentation.</p><h3>4. State Management Is an Architectural Boundary</h3><p>I have worked with different state-management approaches, but for many production projects I like using <strong>Cubit/BLoC</strong> because it creates an explicit boundary between UI and application logic.</p><p>A simple example:</p><pre>class ProductsCubit extends Cubit&lt;ProductsState&gt; {<br>  final GetProductsUseCase getProducts;</pre><pre>  ProductsCubit(this.getProducts)<br>      : super(ProductsInitial());</pre><pre>  Future&lt;void&gt; loadProducts() async {<br>    emit(ProductsLoading());</pre><pre>    try {<br>      final products = await getProducts();<br>      emit(ProductsLoaded(products));<br>    } catch (error) {<br>      emit(<br>        ProductsError(<br>          error.toString(),<br>        ),<br>      );<br>    }<br>  }<br>}</pre><p>The UI then reacts to state:</p><pre>BlocBuilder&lt;ProductsCubit, ProductsState&gt;(<br>  builder: (context, state) {<br>    return switch (state) {<br>      ProductsLoading() =&gt;<br>        const CircularProgressIndicator(),</pre><pre>      ProductsLoaded(:final products) =&gt;<br>        ProductsList(products: products),</pre><pre>      ProductsError(:final message) =&gt;<br>        ErrorView(message: message),</pre><pre>      _ =&gt;<br>        const SizedBox.shrink(),<br>    };<br>  },<br>)</pre><p>The important part isn’t BLoC itself.</p><p>The important part is creating predictable data flow.</p><pre>User Action<br>     ↓<br>Presentation<br>     ↓<br>State Management<br>     ↓<br>Use Case<br>     ↓<br>Repository<br>     ↓<br>Data Source<br>     ↓<br>API / Database</pre><p>And then:</p><pre>API Response<br>     ↓<br>Data Source<br>     ↓<br>Repository<br>     ↓<br>Domain<br>     ↓<br>State<br>     ↓<br>UI</pre><p>Once this flow becomes consistent across the application, debugging becomes significantly easier.</p><h3>5. Repository Pattern Keeps Infrastructure Replaceable</h3><p>Imagine your application initially uses Firebase.</p><p>Later, the business decides to migrate to a custom Node.js backend.</p><p>If your Firebase calls exist throughout widgets and controllers, that migration can become a nightmare.</p><p>Instead, I prefer defining contracts.</p><pre>abstract class ProductRepository {<br>  Future&lt;List&lt;Product&gt;&gt; getProducts();</pre><pre>  Future&lt;Product&gt; getProduct(String id);</pre><pre>  Future&lt;void&gt; addToFavorites(String productId);<br>}</pre><p>The application depends on the contract.</p><p>The implementation handles infrastructure.</p><pre>class ProductRepositoryImpl<br>    implements ProductRepository {</pre><pre>  final ProductRemoteDataSource remoteDataSource;</pre><pre>  ProductRepositoryImpl(this.remoteDataSource);</pre><pre>  @override<br>  Future&lt;List&lt;Product&gt;&gt; getProducts() {<br>    return remoteDataSource.getProducts();<br>  }<br>}</pre><p>This separation gives you flexibility.</p><p>Today:</p><pre>Flutter<br>   ↓<br>Repository<br>   ↓<br>Firebase</pre><p>Tomorrow:</p><pre>Flutter<br>   ↓<br>Repository<br>   ↓<br>Node.js API</pre><p>The presentation layer doesn’t need to know that anything changed.</p><h3>6. Keep API Logic Inside Data Sources</h3><p>HTTP implementation details belong inside the data layer.</p><p>For example:</p><pre>class ProductRemoteDataSource {<br>  final Dio dio;</pre><pre>  ProductRemoteDataSource(this.dio);</pre><pre>  Future&lt;List&lt;ProductModel&gt;&gt; getProducts() async {<br>    final response = await dio.get(&#39;/products&#39;);</pre><pre>    return (response.data[&#39;data&#39;] as List)<br>        .map(<br>          (json) =&gt; ProductModel.fromJson(json),<br>        )<br>        .toList();<br>  }<br>}</pre><p>This gives me one clear place for infrastructure concerns such as:</p><ul><li>endpoints</li><li>request parameters</li><li>JSON parsing</li><li>HTTP errors</li><li>authentication headers</li><li>pagination</li><li>network configuration</li></ul><p>The rest of the application doesn’t need to understand how the server works.</p><h3>7. Centralize Networking</h3><p>I almost never create a new HTTP client inside individual features.</p><p>Instead, I configure networking centrally.</p><p>For example:</p><pre>class ApiClient {<br>  static Dio create() {<br>    final dio = Dio(<br>      BaseOptions(<br>        baseUrl: Environment.apiUrl,<br>        connectTimeout:<br>            const Duration(seconds: 20),<br>        receiveTimeout:<br>            const Duration(seconds: 20),<br>      ),<br>    );</pre><pre>    dio.interceptors.add(<br>      AuthInterceptor(),<br>    );</pre><pre>    dio.interceptors.add(<br>      LogInterceptor(<br>        requestBody: true,<br>        responseBody: true,<br>      ),<br>    );</pre><pre>    return dio;<br>  }<br>}</pre><p>This gives me centralized control over:</p><ul><li>authentication</li><li>refresh tokens</li><li>logging</li><li>timeouts</li><li>headers</li><li>retry policies</li><li>error normalization</li></ul><p>When authentication changes, I shouldn’t need to modify 25 repositories.</p><h3>8. Normalize Errors Before They Reach the UI</h3><p>Production APIs fail.</p><p>Users lose internet connections.</p><p>Tokens expire.</p><p>Servers return unexpected responses.</p><p>A good architecture assumes failure is normal.</p><p>Instead of allowing raw exceptions everywhere:</p><pre>DioException<br>SocketException<br>TimeoutException<br>FormatException</pre><p>I prefer translating them into application-level failures.</p><pre>sealed class Failure {<br>  final String message;</pre><pre>  const Failure(this.message);<br>}</pre><pre>class NetworkFailure extends Failure {<br>  const NetworkFailure(super.message);<br>}</pre><pre>class ServerFailure extends Failure {<br>  const ServerFailure(super.message);<br>}</pre><pre>class AuthenticationFailure extends Failure {<br>  const AuthenticationFailure(super.message);<br>}</pre><p>Now the rest of the application speaks a language it understands.</p><p>The UI doesn’t care whether a timeout originated from Dio or another networking library.</p><p>It cares that the request failed and what the user should see.</p><h3>9. Dependency Injection Makes Everything Easier to Replace</h3><p>Dependencies shouldn’t appear magically inside classes.</p><p>Instead of:</p><pre>class ProductsCubit extends Cubit&lt;ProductsState&gt; {<br>  final Dio dio = Dio();<br>}</pre><p>I inject dependencies:</p><pre>class ProductsCubit extends Cubit&lt;ProductsState&gt; {<br>  final GetProductsUseCase getProducts;</pre><pre>  ProductsCubit(this.getProducts)<br>      : super(ProductsInitial());<br>}</pre><p>Then dependencies are configured centrally using tools such as get_it, injectable, Riverpod providers, or another DI solution.</p><p>Conceptually:</p><pre>Dio<br> ↓<br>RemoteDataSource<br> ↓<br>Repository<br> ↓<br>UseCase<br> ↓<br>Cubit<br> ↓<br>UI</pre><p>This also makes testing much easier because dependencies can be replaced with mocks or fakes.</p><h3>10. Environment Configuration Is Not Optional</h3><p>A production application usually has multiple environments.</p><p>For example:</p><pre>Development<br>Staging<br>Production</pre><p>Each environment may have different:</p><ul><li>API URLs</li><li>Firebase projects</li><li>analytics settings</li><li>payment credentials</li><li>logging behavior</li><li>feature flags</li></ul><p>I don’t want this:</p><pre>const baseUrl =<br>    &#39;https://api.myproductionapp.com&#39;;</pre><p>scattered around the codebase.</p><p>Instead:</p><pre>class Environment {<br>  static const apiUrl = String.fromEnvironment(<br>    &#39;API_URL&#39;,<br>  );<br>}</pre><p>Then the application can be built with environment-specific configuration.</p><p>This makes CI/CD, testing, staging deployments, and release management much safer.</p><h3>11. Never Put Secrets in the Flutter Application</h3><p>This deserves its own section.</p><p>A mobile application is distributed to users.</p><p>Therefore, anything bundled inside it should be considered potentially discoverable.</p><p>You should never treat Flutter as a secure place for:</p><pre>Stripe secret keys<br>Database admin credentials<br>Private API credentials<br>Firebase service-account keys<br>Payment gateway secrets</pre><p>Sensitive operations belong on the backend.</p><p>For example:</p><pre>Flutter App<br>     ↓<br>Your Backend<br>     ↓<br>Payment Provider</pre><p>Not:</p><pre>Flutter App<br>     ↓<br>Secret Payment API</pre><p>This architectural decision can prevent extremely serious security problems.</p><h3>12. Build Reusable UI Without Building a Giant Widget Library</h3><p>Reusable components are useful.</p><p>Over-abstraction isn’t.</p><p>I usually create reusable components when the same design or behavior appears repeatedly.</p><p>For example:</p><pre>core/<br>└── widgets/<br>    ├── app_button.dart<br>    ├── app_text_field.dart<br>    ├── loading_view.dart<br>    ├── error_view.dart<br>    └── empty_state.dart</pre><p>But feature-specific widgets remain inside their feature.</p><pre>features/<br>└── products/<br>    └── presentation/<br>        └── widgets/<br>            ├── product_card.dart<br>            ├── product_price.dart<br>            └── product_rating.dart</pre><p>ProductCard does not need to become a global widget just because it is reusable inside the products feature.</p><p>Global abstractions should actually be global.</p><h3>13. Separate Design Tokens From Widgets</h3><p>For applications with a real design system, I centralize visual constants.</p><pre>core/<br>└── theme/<br>    ├── app_colors.dart<br>    ├── app_typography.dart<br>    ├── app_spacing.dart<br>    ├── app_radius.dart<br>    └── app_theme.dart</pre><p>Instead of:</p><pre>Container(<br>  padding: const EdgeInsets.all(17),<br>  decoration: BoxDecoration(<br>    color: Color(0xFF123456),<br>    borderRadius: BorderRadius.circular(13),<br>  ),<br>)</pre><p>I prefer something conceptually closer to:</p><pre>Container(<br>  padding: EdgeInsets.all(AppSpacing.md),<br>  decoration: BoxDecoration(<br>    color: AppColors.surface,<br>    borderRadius:<br>        BorderRadius.circular(AppRadius.md),<br>  ),<br>)</pre><p>The exact implementation isn’t important.</p><p>Consistency is.</p><p>When the design team changes the application’s spacing system or brand colors, you want predictable changes rather than a search-and-replace operation across 150 files.</p><h3>14. Navigation Should Also Be Structured</h3><p>Navigation becomes surprisingly complicated in large applications.</p><p>You may eventually need:</p><ul><li>authentication guards</li><li>nested navigation</li><li>deep links</li><li>push-notification routes</li><li>web URLs</li><li>redirects</li><li>role-based access</li></ul><p>For larger projects, I prefer treating routing as infrastructure rather than scattering:</p><pre>Navigator.push(...)</pre><p>everywhere.</p><p>Packages such as go_router can help centralize this behavior.</p><p>Conceptually:</p><pre>/auth/login<br>/home<br>/products/:id<br>/cart<br>/checkout<br>/orders/:id<br>/profile</pre><p>Now deep linking becomes part of the application’s architecture rather than an afterthought.</p><h3>15. Caching Should Be Intentional</h3><p>Not every API response needs caching.</p><p>But production applications frequently benefit from caching data such as:</p><ul><li>user profile</li><li>categories</li><li>configuration</li><li>previously loaded products</li><li>authentication state</li><li>feature flags</li></ul><p>Depending on the requirement, I might use:</p><pre>SharedPreferences<br>Hive<br>SQLite<br>Secure Storage<br>In-memory cache</pre><p>But I try to answer three questions first:</p><p><strong>What are we caching?</strong></p><p><strong>How long is it valid?</strong></p><p><strong>What invalidates it?</strong></p><p>Without an invalidation strategy, caching can easily create more bugs than performance improvements.</p><h3>16. Performance Starts With Architecture</h3><p>Flutter is fast, but poorly structured applications can still become slow.</p><p>Some things I watch carefully include:</p><ul><li>unnecessary widget rebuilds</li><li>extremely large widget trees</li><li>expensive work inside build()</li><li>unoptimized images</li><li>excessive API requests</li><li>loading huge datasets without pagination</li><li>unnecessary state updates</li><li>blocking the UI isolate</li></ul><p>For example, don’t download 10,000 products because the backend technically allows it.</p><p>Use pagination.</p><pre>GET /products?page=1&amp;limit=20</pre><p>Then load additional pages when necessary.</p><p>Good backend design and good Flutter architecture work together.</p><h3>17. Observability Matters After Release</h3><p>Development doesn’t end when the app reaches the App Store or Google Play.</p><p>Production applications need visibility.</p><p>I usually want some combination of:</p><pre>Crash reporting<br>Analytics<br>Structured logging<br>Performance monitoring<br>API monitoring<br>User-event tracking</pre><p>A crash that happens on your machine is easy to investigate.</p><p>A crash happening to 2% of users in another country on a device you don’t own is a completely different situation.</p><p>Production architecture should help you answer:</p><pre>What failed?<br>Where did it fail?<br>Which version is affected?<br>How many users are affected?<br>What happened before the failure?</pre><p>Without observability, production debugging becomes guesswork.</p><h3>18. Testing the Right Things</h3><p>I don’t believe that chasing 100% test coverage automatically produces a reliable application.</p><p>I care more about testing important behavior.</p><p>For example:</p><h3>Unit Tests</h3><p>Business logic:</p><pre>Pricing calculations<br>Validation<br>Use cases<br>Repositories<br>State transitions</pre><h3>Widget Tests</h3><p>Important UI behavior:</p><pre>Forms<br>Error states<br>Loading states<br>Reusable components</pre><h3>Integration Tests</h3><p>Critical user journeys:</p><pre>Login<br>Checkout<br>Payment<br>Order creation<br>Subscription</pre><p>If a bug could directly cost the business money, that workflow deserves serious testing.</p><h3>19. My Typical Production Structure</h3><p>Putting everything together, a larger Flutter project might look something like this:</p><pre>lib/<br>│<br>├── app/<br>│   ├── app.dart<br>│   ├── router/<br>│   └── dependency_injection/<br>│<br>├── core/<br>│   ├── constants/<br>│   ├── errors/<br>│   ├── network/<br>│   ├── storage/<br>│   ├── theme/<br>│   ├── utils/<br>│   └── widgets/<br>│<br>├── features/<br>│   │<br>│   ├── auth/<br>│   │   ├── data/<br>│   │   ├── domain/<br>│   │   └── presentation/<br>│   │<br>│   ├── products/<br>│   │   ├── data/<br>│   │   ├── domain/<br>│   │   └── presentation/<br>│   │<br>│   ├── cart/<br>│   │   ├── data/<br>│   │   ├── domain/<br>│   │   └── presentation/<br>│   │<br>│   ├── checkout/<br>│   │   ├── data/<br>│   │   ├── domain/<br>│   │   └── presentation/<br>│   │<br>│   └── profile/<br>│       ├── data/<br>│       ├── domain/<br>│       └── presentation/<br>│<br>└── main.dart</pre><p>But remember:</p><p><strong>This structure is not the architecture.</strong></p><p>The folders are just a representation of architectural decisions.</p><p>The real architecture is the direction of dependencies and the boundaries between responsibilities.</p><h3>20. The Architecture I Try to Achieve</h3><p>At a high level, this is what I want:</p><pre>┌──────────────────────────────┐<br>│             UI               │<br>│    Pages • Widgets • Views   │<br>└──────────────┬───────────────┘<br>               ↓<br>┌──────────────────────────────┐<br>│      State Management        │<br>│        Cubit / BLoC          │<br>└──────────────┬───────────────┘<br>               ↓<br>┌──────────────────────────────┐<br>│          Use Cases           │<br>│       Business Actions       │<br>└──────────────┬───────────────┘<br>               ↓<br>┌──────────────────────────────┐<br>│         Repository           │<br>│      Domain Contracts        │<br>└──────────────┬───────────────┘<br>               ↓<br>┌──────────────────────────────┐<br>│        Data Sources          │<br>│   Remote • Local • Cache     │<br>└──────────────┬───────────────┘<br>               ↓<br>┌──────────────────────────────┐<br>│     External Services        │<br>│ API • Firebase • DB • SDKs   │<br>└──────────────────────────────┘</pre><p>Each layer has a responsibility.</p><p>And more importantly, each layer has things it <strong>shouldn’t</strong> know about.</p><p>That is where much of the maintainability comes from.</p><h3>What I Don’t Do</h3><p>There are also several practices I intentionally avoid.</p><p>I don’t automatically create a use case for every single repository method just because a Clean Architecture diagram says so.</p><p>I don’t create interfaces when there is no meaningful boundary to protect.</p><p>I don’t put every widget into a global widgets folder.</p><p>I don’t introduce five architectural layers into a small MVP that may change completely next month.</p><p>And I don’t choose architecture because it looks impressive in a GitHub repository.</p><p>Architecture has a cost.</p><p>Every abstraction makes some future changes easier while making the current system more complex.</p><p>The goal is finding the right balance.</p><h3>Production Architecture Is About Change</h3><p>The best architecture isn’t necessarily the one with the most layers.</p><p>It’s the one that makes future changes boring.</p><p>Imagine receiving these requirements six months after launch:</p><blockquote><em>Replace Firebase with our Node.js backend.</em></blockquote><blockquote><em>Add subscriptions.</em></blockquote><blockquote><em>Add offline support.</em></blockquote><blockquote><em>Introduce a second payment gateway.</em></blockquote><blockquote><em>Add a web application.</em></blockquote><blockquote><em>Support multiple user roles.</em></blockquote><blockquote><em>Add another developer to the team.</em></blockquote><p>A well-structured codebase should allow these changes without requiring you to rewrite half of the application.</p><p>That’s what I mean by <strong>production-ready</strong>.</p><p>Not an application that merely works today.</p><p>An application designed to survive tomorrow.</p><h3>Final Thoughts</h3><p>Flutter gives us an incredibly productive framework for building applications across multiple platforms.</p><p>But Flutter itself doesn’t give us maintainable architecture automatically.</p><p>That comes from engineering decisions.</p><p>For serious production projects, I generally optimize for:</p><ul><li>feature-first organization</li><li>clear responsibility boundaries</li><li>predictable state management</li><li>repository abstractions</li><li>isolated infrastructure</li><li>dependency injection</li><li>centralized networking</li><li>environment configuration</li><li>intentional caching</li><li>secure backend boundaries</li><li>testing critical workflows</li><li>production observability</li></ul><p>Most importantly, I try to avoid both extremes:</p><p><strong>No architecture at all</strong> creates chaos as the product grows.</p><p><strong>Too much architecture</strong> creates complexity before the product even needs it.</p><p>Good software architecture sits somewhere between them.</p><p>It gives today’s developers enough simplicity to move quickly while giving tomorrow’s developers enough structure to keep moving.</p><p>And in production software, that balance matters far more than having the perfect folder structure.</p><p>If you’re building a Flutter product and need help designing the architecture, developing an MVP, or taking an existing application to production, feel free to connect with me.</p><p>I work with Flutter applications across the full product lifecycle — from architecture and mobile development to backend integration, payments, deployment, and production scaling.</p><p><strong>— Abdallah Hossam</strong><br>Senior Software Engineer | Flutter &amp; Full-Stack Development</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b49bdb1ed22b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter vs React Native in 2026: What Should a Startup Choose?]]></title>
            <link>https://medium.com/@abdallahhossam847/flutter-vs-react-native-in-2026-what-should-a-startup-choose-146c50fd7873?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/146c50fd7873</guid>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[enterpreneurship]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Fri, 28 Aug 2026 20:49:11 GMT</pubDate>
            <atom:updated>2026-08-28T20:49:11.260Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Wosi0MGwOBJap4O9UlXGkg.png" /></figure><p>If you’re building a startup in 2026, one of the first technical decisions you’ll face is surprisingly difficult:</p><p><strong>Should you build your mobile app with Flutter or React Native?</strong></p><p>Both allow you to build Android and iOS applications from largely the same codebase. Both are mature enough for production applications. Both have strong ecosystems and are used by real businesses.</p><p>So the question isn’t really:</p><p><strong>“Which framework is better?”</strong></p><p>The better question is:</p><p><strong>“Which framework makes more sense for my startup?”</strong></p><p>As a software engineer who has spent years building production mobile applications, I believe the answer depends heavily on what you’re building, your team, your budget, and where you expect the product to go.</p><p>Let’s break it down from a startup’s perspective.</p><h3>First: Why Cross-Platform at All?</h3><p>Imagine you’re launching a startup and need both an Android and an iOS application.</p><p>With traditional native development, you may need separate implementations:</p><ul><li>Kotlin/Java for Android</li><li>Swift for iOS</li></ul><p>That can mean separate development effort, duplicated features, additional testing and potentially a larger engineering team.</p><p>Cross-platform frameworks change that equation.</p><p>With Flutter or React Native, a significant portion of your application can be shared between Android and iOS.</p><p>For an early-stage startup, that’s important.</p><p>You’re usually trying to optimize three things:</p><p><strong>Time. Money. Speed of iteration.</strong></p><p>This is exactly why Flutter and React Native are so attractive.</p><h3>Flutter</h3><p>Flutter is Google’s open-source UI framework and uses the Dart programming language.</p><p>One of Flutter’s biggest advantages is how much control it gives developers over the application’s user interface.</p><p>Instead of depending primarily on the operating system’s native UI components, Flutter controls much of its own rendering.</p><p>For a startup, this can be extremely useful.</p><p>Your application can maintain a highly consistent design across Android and iOS while still running from the same project.</p><h3>Where Flutter shines</h3><h3>1. Consistent UI</h3><p>If your startup has a custom design system, animations or a highly branded interface, Flutter is particularly attractive.</p><p>You can create a UI that behaves very consistently across platforms.</p><p>That’s valuable for products such as:</p><ul><li>Fintech applications</li><li>E-commerce apps</li><li>Marketplace platforms</li><li>Education platforms</li><li>Social applications</li><li>Booking systems</li><li>SaaS companion apps</li></ul><p>For products where the app itself is a major part of the customer experience, this matters.</p><h3>2. Fast product development</h3><p>Flutter’s development experience makes iteration extremely fast.</p><p>Features such as Hot Reload allow developers to see many code changes without restarting the entire application.</p><p>That sounds like a developer convenience, but there’s a business impact.</p><p>Faster iteration can mean:</p><p><strong>Design changes → implementation → testing → release</strong></p><p>happens faster.</p><p>For a startup still experimenting with its product, reducing that feedback loop is valuable.</p><h3>3. One strong ecosystem</h3><p>Flutter provides many things directly within its ecosystem: UI components, navigation capabilities, animation tools, and a large package ecosystem.</p><p>From an engineering perspective, I find this particularly useful when building applications that need to grow beyond a simple prototype.</p><p>A properly architected Flutter application can start as an MVP and evolve into a much larger product without requiring the startup to rewrite the entire application.</p><h3>React Native</h3><p>React Native approaches cross-platform development differently.</p><p>It allows developers to build mobile applications using React and JavaScript/TypeScript.</p><p>Its biggest strategic advantage is obvious:</p><p><strong>JavaScript and TypeScript have enormous ecosystems.</strong></p><p>If your startup already employs React developers, React Native can therefore be extremely attractive.</p><p>Instead of introducing an entirely different programming ecosystem, your existing engineering team may be able to transfer a significant amount of its React knowledge to mobile development.</p><h3>Where React Native shines</h3><h3>1. Existing React teams</h3><p>Suppose your startup already has:</p><ul><li>React developers</li><li>TypeScript infrastructure</li><li>JavaScript libraries</li><li>Frontend engineering processes</li></ul><p>In that situation, choosing React Native may reduce the organizational cost of introducing mobile development.</p><p>Your developers still need to understand mobile-specific concepts, of course, but the technology stack is much more familiar.</p><h3>2. Large JavaScript ecosystem</h3><p>React Native benefits from the enormous JavaScript ecosystem.</p><p>There are libraries and tools available for almost everything.</p><p>The framework itself has also evolved substantially.</p><p>By 2026, React Native’s New Architecture is no longer simply an experimental direction. Modern releases are built around it, improving the framework’s foundations for communication with native code, rendering and performance.</p><p>React Native 0.84 also made Hermes V1 its default JavaScript engine, while subsequent 2026 releases continued improving tooling, animations and platform integration.</p><p>So some comparisons you may find online from 2020–2023 no longer accurately represent modern React Native.</p><h3>Performance: Flutter vs React Native</h3><p>This is where comparisons often become unnecessarily dramatic.</p><p>You’ll frequently see claims like:</p><blockquote><em>“Flutter is fast and React Native is slow.”</em></blockquote><p>or:</p><blockquote><em>“React Native is basically native, so it’s faster.”</em></blockquote><p>Neither is a useful way for a startup founder to make this decision.</p><p>For the majority of startup applications, <strong>both frameworks can deliver excellent performance when the application is engineered properly.</strong></p><p>Your architecture, API design, image handling, caching strategy, state management and developer experience can matter more than the framework logo.</p><p>That said, I generally give Flutter an advantage when an application requires:</p><ul><li>Complex custom interfaces</li><li>Heavy animations</li><li>Highly consistent rendering</li><li>Large amounts of UI customization</li></ul><p>Flutter’s rendering model gives developers significant control over the experience.</p><p>But if you’re building a standard marketplace, booking app, dashboard, social product or business application, either technology is capable of delivering the performance most users expect.</p><h3>Development Cost</h3><p>This is probably more important to your startup than benchmark charts.</p><p>Let’s imagine your startup needs:</p><ul><li>Authentication</li><li>User profiles</li><li>Payments</li><li>Push notifications</li><li>REST APIs</li><li>Maps</li><li>Chat</li><li>Analytics</li><li>Android</li><li>iOS</li></ul><p>Building separate native applications could require considerably more development effort.</p><p>Flutter and React Native both allow you to reuse much of the application’s code and engineering effort.</p><p>That can reduce development cost significantly.</p><p>However, don’t make the mistake of assuming:</p><p><strong>Cross-platform = cheap.</strong></p><p>A production application still requires:</p><ul><li>Backend development</li><li>Database architecture</li><li>Security</li><li>Testing</li><li>DevOps</li><li>App Store deployment</li><li>Monitoring</li><li>Maintenance</li></ul><p>The framework reduces duplication.</p><p>It doesn’t eliminate software engineering.</p><h3>What About Hiring?</h3><p>React Native has an advantage here because of JavaScript.</p><p>There are enormous numbers of JavaScript and React developers around the world.</p><p>Flutter’s talent pool is smaller, because Dart is primarily associated with Flutter.</p><p>However, there’s another side to this.</p><p>A JavaScript developer isn’t automatically a React Native engineer.</p><p>Mobile development introduces concepts around:</p><ul><li>Application lifecycle</li><li>Permissions</li><li>Push notifications</li><li>Native integrations</li><li>App stores</li><li>Device APIs</li><li>Offline behavior</li><li>Mobile performance</li></ul><p>So startups should hire for <strong>mobile engineering ability</strong>, not simply programming-language familiarity.</p><h3>So Which Should Your Startup Choose?</h3><p>Here’s how I would make the decision.</p><h3>Choose React Native if:</h3><p>Your startup already has a strong React/TypeScript team.</p><p>You want to keep your engineering organization heavily centered around the JavaScript ecosystem.</p><p>You already have infrastructure or knowledge that can transfer naturally into React Native development.</p><p>In that situation, React Native is an excellent business decision.</p><h3>Choose Flutter if:</h3><p>You’re starting the mobile product from scratch.</p><p>You want a highly customized and consistent user interface.</p><p>You want one dedicated mobile codebase for Android and iOS.</p><p>You’re building a product where the mobile experience is a major part of your competitive advantage.</p><p>You expect the application to grow significantly after the MVP.</p><p>In those situations, <strong>Flutter would usually be my choice.</strong></p><h3>What Would I Choose for a New Startup?</h3><p>If I were starting a new mobile-first startup in 2026 with no existing technical constraints, I would choose <strong>Flutter</strong>.</p><p>Not because React Native is a bad framework.</p><p>It isn’t.</p><p>React Native has matured considerably, and for companies already invested in React and TypeScript, it may actually be the smarter choice.</p><p>I would choose Flutter because I value:</p><ul><li>Predictable cross-platform UI</li><li>Strong control over the interface</li><li>Fast iteration</li><li>Excellent performance</li><li>A cohesive mobile development ecosystem</li><li>The ability to grow from MVP to a larger production application</li></ul><p>But technology should follow the business — not the other way around.</p><p>If you already have five excellent React engineers, hiring an entirely new Flutter team because somebody told you Flutter wins a benchmark would probably be a poor business decision.</p><p>Likewise, if you’re starting from zero and building a highly customized mobile-first product, choosing a framework solely because JavaScript developers are easier to find may not be the right decision either.</p><h3>Final Thoughts</h3><p>Flutter vs React Native isn’t a battle where one framework needs to disappear for the other to win.</p><p>They’re two different approaches to solving the same business problem:</p><p><strong>How can we build great applications for Android and iOS without maintaining two completely separate products?</strong></p><p>For most startups in 2026:</p><p><strong>Existing React team → strongly consider React Native.</strong></p><p><strong>New mobile-first product → strongly consider Flutter.</strong></p><p><strong>Highly customized UI → Flutter has an advantage.</strong></p><p><strong>Deep JavaScript/TypeScript organization → React Native has an advantage.</strong></p><p>The most important decision isn’t choosing the framework with the loudest community.</p><p>It’s choosing an architecture and engineering team capable of turning your idea into a reliable product.</p><h3>Ready to Build Your Mobile App?</h3><p>If you’re planning to build an MVP, launch a new startup, or turn an existing idea into a production-ready mobile application, I can help you take it from concept to launch.</p><p>I’m a <strong>Senior Software Engineer specializing in Flutter and backend development</strong>, building scalable applications for Android and iOS with features such as:</p><ul><li>Custom UI/UX</li><li>REST API integration</li><li>Firebase</li><li>Authentication</li><li>Payment gateways</li><li>Push notifications</li><li>Maps and location services</li><li>Databases and backend development</li><li>Third-party integrations</li><li>Clean and scalable architecture</li></ul><p>Whether you need an MVP or a complete production-ready application, you can check out my Flutter development packages and place an order directly through Fiverr:</p><p>👉 <strong>Hire me on Fiverr:</strong> <a href="https://www.fiverr.com/s/bk9YBgq">https://www.fiverr.com/s/bk9YBgq</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=146c50fd7873" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing a FlutterFlow Application: A Production-Ready Guide]]></title>
            <link>https://systemweakness.com/securing-a-flutterflow-application-a-production-ready-guide-0d3955be5400?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d3955be5400</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[flutterflow]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Wed, 22 Jul 2026 14:05:07 GMT</pubDate>
            <atom:updated>2026-07-24T08:17:18.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qM08_9hx_mcsAbAlWiV8vQ.png" /></figure><h3>Introduction</h3><p>FlutterFlow enables teams to build applications rapidly, but speed should never come at the expense of security. While FlutterFlow provides many secure defaults, the responsibility for protecting user data, backend services, and business logic ultimately belongs to the development team.</p><p>A secure FlutterFlow application is built on multiple layers of defense. Even if one layer fails, the remaining layers continue protecting the system. This article covers the most important security practices for FlutterFlow applications running with Supabase, Firebase, REST APIs, or any modern backend.</p><h3>1. Never Trust the Client</h3><p>The first rule of application security is simple:</p><blockquote><strong><em>The client is always untrusted.</em></strong></blockquote><p>Whether your application is built with FlutterFlow or handwritten Flutter code, users can:</p><ul><li>Reverse engineer the APK or IPA</li><li>Modify network requests</li><li>Bypass UI restrictions</li><li>Execute hidden API calls</li><li>Change local variables</li><li>Automate requests using scripts</li></ul><p>Anything enforced only in FlutterFlow can eventually be bypassed.</p><p>Instead:</p><ul><li>Validate everything on the backend.</li><li>Check permissions server-side.</li><li>Verify ownership of resources.</li><li>Ignore any client-calculated values.</li></ul><h3>2. Use Backend Authorization</h3><p>Never rely on:</p><ul><li>Hidden buttons</li><li>Conditional visibility</li><li>Disabled widgets</li><li>Navigation restrictions</li></ul><p>Example:</p><p>A button that deletes an order is hidden for regular users.</p><p>That does <strong>NOT</strong> prevent someone from calling:</p><pre>DELETE /orders/123</pre><p>directly.</p><p>The backend must verify:</p><ul><li>Is the user authenticated?</li><li>Does the user own this order?</li><li>Does the user have permission?</li><li>Is the order deletable?</li></ul><p>Only then should the operation execute.</p><h3>3. Enable Row Level Security (Supabase)</h3><p>If using Supabase:</p><p><strong>Always enable RLS on every table.</strong></p><p>Without RLS:</p><p>Anyone with your project URL and anon key can potentially query every row.</p><p>Example:</p><p>Instead of:</p><pre>Allow:<br>SELECT *</pre><p>Use policies like:</p><pre>Users can only read<br>their own profile.</pre><p>or</p><pre>Vendor can only access<br>his own products.</pre><p>Every table should have carefully designed policies for:</p><ul><li>SELECT</li><li>INSERT</li><li>UPDATE</li><li>DELETE</li></ul><h3>4. Never Expose Service Role Keys</h3><p>The Supabase Service Role key is essentially root access.</p><p>Never place it in:</p><ul><li>FlutterFlow</li><li>Flutter code</li><li>APK</li><li>IPA</li><li>GitHub</li><li>Public repositories</li><li>JavaScript</li></ul><p>Instead:</p><p>Use:</p><ul><li>Edge Functions</li><li>Backend servers</li><li>Secure cloud functions</li></ul><p>Only the backend should possess Service Role credentials.</p><h3>5. Store Secrets Securely</h3><p>Never hardcode:</p><ul><li>API keys</li><li>Payment secrets</li><li>Stripe secrets</li><li>Tap secrets</li><li>Twilio secrets</li><li>OpenAI keys</li><li>Gemini keys</li></ul><p>Use:</p><ul><li>Edge Function Secrets</li><li>Environment Variables</li><li>Secret Managers</li></ul><p>Examples:</p><ul><li>Supabase Secrets</li><li>GitHub Secrets</li><li>Google Secret Manager</li><li>AWS Secrets Manager</li></ul><h3>6. Move Sensitive Logic to Edge Functions</h3><p>Business logic should never exist solely inside FlutterFlow.</p><p>Good candidates include:</p><ul><li>Payment processing</li><li>Coupon validation</li><li>Wallet calculations</li><li>Admin operations</li><li>Notification sending</li><li>Order pricing</li><li>Tax calculations</li><li>Refund processing</li></ul><p>Instead of:</p><pre>FlutterFlow<br>↓</pre><pre>Calculate final price<br>↓</pre><pre>Update database</pre><p>Use:</p><pre>FlutterFlow<br>↓</pre><pre>Edge Function<br>↓</pre><pre>Validate<br>↓</pre><pre>Calculate</pre><pre>↓</pre><pre>Update database</pre><p>The server becomes the source of truth.</p><h3>7. Validate Every Input</h3><p>Never assume users enter valid data.</p><p>Validate:</p><ul><li>Length</li><li>Required fields</li><li>Number ranges</li><li>File size</li><li>MIME type</li><li>Email</li><li>Phone</li><li>Dates</li><li>UUIDs</li><li>IDs</li></ul><p>Reject anything unexpected.</p><p>Input validation protects against:</p><ul><li>SQL Injection</li><li>Malformed requests</li><li>Crashes</li><li>Abuse</li></ul><h3>8. Protect Against SQL Injection</h3><p>FlutterFlow itself doesn’t generate SQL directly, but custom APIs, RPCs, and backend code can.</p><p>Never concatenate SQL strings.</p><p>Bad:</p><pre>SELECT * FROM users<br>WHERE id = &#39;$userInput&#39;</pre><p>Good:</p><p>Use parameterized queries.</p><h3>9. Use RPC Functions Instead of Direct Table Access</h3><p>Sometimes users only need one operation.</p><p>Instead of granting table permissions:</p><pre>UPDATE Wallet</pre><p>Create:</p><pre>withdraw_money()</pre><p>The RPC function can:</p><ul><li>Validate balance</li><li>Verify ownership</li><li>Log activity</li><li>Prevent abuse</li></ul><p>Users never receive direct write access.</p><h3>10. Rate Limit Sensitive Operations</h3><p>Protect endpoints like:</p><ul><li>Login</li><li>Register</li><li>OTP</li><li>Password reset</li><li>Payment</li><li>Notifications</li><li>Search</li><li>File uploads</li></ul><p>Without rate limits:</p><p>Attackers can:</p><ul><li>Spam APIs</li><li>Guess passwords</li><li>Consume resources</li></ul><p>Implement:</p><ul><li>IP limits</li><li>User limits</li><li>Daily quotas</li><li>Request throttling</li></ul><h3>11. Secure File Uploads</h3><p>Never trust uploaded files.</p><p>Validate:</p><ul><li>Extension</li><li>MIME type</li><li>Maximum size</li><li>Image dimensions</li><li>Virus scanning (when applicable)</li></ul><p>Store files using private buckets whenever possible.</p><p>Avoid predictable filenames.</p><h3>12. Secure Storage Buckets</h3><p>For Supabase Storage:</p><p>Avoid:</p><pre>Public bucket<br>↓</pre><pre>Sensitive documents</pre><p>Instead:</p><p>Private bucket</p><p>↓</p><p>Signed URL</p><p>↓</p><p>Temporary access</p><p>This prevents unauthorized downloads.</p><h3>13. Never Trust Prices from the Client</h3><p>Bad:</p><pre>FlutterFlow:</pre><pre>Total = 50 SAR</pre><p>Send:</p><pre>50</pre><p>to backend.</p><p>A hacker changes:</p><pre>50</pre><pre>↓</pre><pre>1</pre><p>Now the order costs 1 SAR.</p><p>Correct flow:</p><p>Client sends:</p><pre>Product IDs<br>Quantity<br>Coupon</pre><p>Server calculates:</p><ul><li>Prices</li><li>Discounts</li><li>Taxes</li><li>Shipping</li><li>Total</li></ul><p>The client never decides money.</p><h3>14. Secure Authentication</h3><p>Use:</p><ul><li>Email verification</li><li>Strong password rules</li><li>Multi-factor authentication when possible</li><li>Session expiration</li><li>Refresh token rotation</li></ul><p>Invalidate sessions after:</p><ul><li>Password change</li><li>Email change</li><li>Suspicious login</li></ul><h3>15. Verify Ownership</h3><p>Never assume because a user sends an ID that they own it.</p><p>Always verify.</p><p>Example:</p><p>User requests:</p><pre>Delete Order 500</pre><p>Backend checks:</p><pre>Does Order 500 belong<br>to current user?</pre><p>If not:</p><pre>403 Forbidden</pre><h3>16. Log Security Events</h3><p>Record:</p><ul><li>Failed logins</li><li>Admin actions</li><li>Payments</li><li>Wallet updates</li><li>Deleted records</li><li>Permission failures</li></ul><p>Logs help investigate incidents.</p><h3>17. Detect Abuse</h3><p>Monitor:</p><ul><li>Thousands of requests</li><li>Failed logins</li><li>OTP abuse</li><li>Excessive uploads</li><li>Rapid purchases</li></ul><p>Alert administrators when suspicious activity occurs.</p><h3>18. Keep Dependencies Updated</h3><p>Regularly update:</p><ul><li>Flutter SDK</li><li>FlutterFlow runtime</li><li>Packages</li><li>Supabase SDK</li><li>Firebase SDK</li></ul><p>Security vulnerabilities are frequently fixed through updates.</p><h3>19. Obfuscate Release Builds</h3><p>For Android:</p><p>Use Flutter obfuscation when building release versions.</p><p>Benefits:</p><ul><li>Harder reverse engineering</li><li>More difficult code analysis</li><li>Better protection of business logic</li></ul><p>Obfuscation is <strong>not</strong> security by itself, but it raises the cost of attacks.</p><h3>20. Prevent API Abuse</h3><p>Every API should verify:</p><ul><li>Authentication</li><li>Authorization</li><li>Input validation</li><li>Rate limiting</li></ul><p>Never expose endpoints that execute privileged operations without proper verification.</p><h3>21. Use HTTPS Everywhere</h3><p>Never communicate over HTTP.</p><p>Always:</p><ul><li>HTTPS APIs</li><li>Secure WebSockets</li><li>TLS encryption</li></ul><p>Reject insecure connections.</p><h3>22. Protect Against Replay Attacks</h3><p>Sensitive operations like:</p><ul><li>Payments</li><li>Wallet transfers</li><li>OTP verification</li></ul><p>should use:</p><ul><li>Nonces</li><li>Expiration timestamps</li><li>Idempotency keys</li></ul><p>This prevents the same request from being executed multiple times.</p><h3>23. Backup Your Database</h3><p>Security also means resilience.</p><p>Maintain:</p><ul><li>Automatic backups</li><li>Point-in-time recovery</li><li>Disaster recovery plans</li></ul><p>Regularly test restoration procedures.</p><h3>24. Perform Security Testing</h3><p>Before every release:</p><ul><li>Test authentication</li><li>Test permissions</li><li>Test API endpoints</li><li>Test storage access</li><li>Test RLS policies</li><li>Test Edge Functions</li><li>Test payment flows</li></ul><p>Attempt to break your own application before attackers do.</p><h3>25. Security Checklist</h3><p>Before shipping a FlutterFlow application, verify:</p><ul><li>✅ Row Level Security enabled</li><li>✅ Service Role key never exposed</li><li>✅ Secrets stored securely</li><li>✅ Sensitive logic moved to Edge Functions</li><li>✅ Input validation implemented</li><li>✅ Authorization enforced server-side</li><li>✅ File uploads validated</li><li>✅ Private storage buckets protected</li><li>✅ Prices calculated on the backend</li><li>✅ Ownership verification implemented</li><li>✅ Logging enabled</li><li>✅ Rate limiting configured</li><li>✅ HTTPS enforced</li><li>✅ Dependencies updated</li><li>✅ Release builds obfuscated</li><li>✅ Database backups enabled</li></ul><h3>Conclusion</h3><p>FlutterFlow is capable of powering secure, enterprise-grade applications — but only when combined with strong backend security practices. The visual interface accelerates development, but it should never be treated as a security boundary.</p><p>The most secure FlutterFlow architectures follow a simple principle:</p><ul><li>The client collects input.</li><li>The backend validates everything.</li><li>The database enforces access with Row Level Security.</li><li>Sensitive operations run in secure server-side functions.</li><li>Secrets never leave the server.</li><li>Every request is authenticated, authorized, and logged.</li></ul><p>By treating the client as untrusted, enforcing least-privilege access, and moving critical logic to the backend, you can build FlutterFlow applications that are resilient against common attack vectors while remaining scalable and maintainable for production use.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d3955be5400" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/securing-a-flutterflow-application-a-production-ready-guide-0d3955be5400">Securing a FlutterFlow Application: A Production-Ready Guide</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python 3 course]]></title>
            <link>https://medium.com/@abdallahhossam847/python-3-course-7bdbd0525afe?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bdbd0525afe</guid>
            <category><![CDATA[udemy]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-3-tutorial]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Sat, 22 Mar 2025 19:45:59 GMT</pubDate>
            <atom:updated>2025-03-22T19:45:59.600Z</atom:updated>
            <content:encoded><![CDATA[<p>Fully Beginner Python 3 course on Udemy in Arabic</p><p><a href="https://www.udemy.com/course/draft/5484170/?referralCode=0D3BEBAEE8991181C706">https://www.udemy.com/course/draft/5484170/?referralCode=0D3BEBAEE8991181C706</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bdbd0525afe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build and deploy a website using Flutter and Firebase]]></title>
            <link>https://medium.com/@abdallahhossam847/build-and-deploy-website-using-flutter-and-firebase-4db51c16fbd9?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/4db51c16fbd9</guid>
            <category><![CDATA[deploy]]></category>
            <category><![CDATA[figma]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Mon, 10 Mar 2025 08:35:37 GMT</pubDate>
            <atom:updated>2025-03-10T08:42:17.453Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://youtu.be/K9UK9qLRWLw?si=eG9OPjqOm7pR2OrL">https://youtu.be/K9UK9qLRWLw?si=eG9OPjqOm7pR2OrL</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4db51c16fbd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Banking System in Dart]]></title>
            <link>https://medium.com/@abdallahhossam847/banking-system-in-dart-a3610a34b4d3?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3610a34b4d3</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Mon, 24 Feb 2025 11:50:57 GMT</pubDate>
            <atom:updated>2025-02-24T11:50:57.749Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*UGnxoMz7SLRX-eSyNmwiFQ.jpeg" /></figure><p>Here’s a <strong>Dart-only</strong> banking system project that follows <strong>Object-Oriented Programming (OOP)</strong> principles. The system includes classes for <strong>bank, account, and Transaction</strong> and allows deposits, withdrawals, transfers, and balance checks.</p><pre>import &#39;dart:io&#39;;<br><br>// Class representing a Bank Account<br>class Account {<br>  String accountNumber;<br>  String ownerName;<br>  double _balance;<br><br>  Account({required this.accountNumber, required this.ownerName, double balance = 0.0})<br>      : _balance = balance;<br><br>  // Getter for balance<br>  double get balance =&gt; _balance;<br><br>  // Deposit money<br>  void deposit(double amount) {<br>    if (amount &gt; 0) {<br>      _balance += amount;<br>      print(&quot;Deposited: \$${amount.toStringAsFixed(2)} | New Balance: \$${_balance.toStringAsFixed(2)}&quot;);<br>    } else {<br>      print(&quot;Invalid deposit amount!&quot;);<br>    }<br>  }<br><br>  // Withdraw money<br>  bool withdraw(double amount) {<br>    if (amount &gt; 0 &amp;&amp; amount &lt;= _balance) {<br>      _balance -= amount;<br>      print(&quot;Withdrawn: \$${amount.toStringAsFixed(2)} | New Balance: \$${_balance.toStringAsFixed(2)}&quot;);<br>      return true;<br>    } else {<br>      print(&quot;Insufficient funds or invalid amount!&quot;);<br>      return false;<br>    }<br>  }<br><br>  // Display account details<br>  void displayAccountInfo() {<br>    print(&quot;\nAccount Number: $accountNumber&quot;);<br>    print(&quot;Owner: $ownerName&quot;);<br>    print(&quot;Balance: \$${_balance.toStringAsFixed(2)}&quot;);<br>  }<br>}<br><br>// Class for handling bank transactions<br>class Bank {<br>  List&lt;Account&gt; accounts = [];<br><br>  // Create a new account<br>  void createAccount(String ownerName, String accountNumber) {<br>    accounts.add(Account(accountNumber: accountNumber, ownerName: ownerName));<br>    print(&quot;\nAccount created successfully for $ownerName!&quot;);<br>  }<br><br>  // Find account by account number<br>  Account? findAccount(String accountNumber) {<br>    return accounts.firstWhere((acc) =&gt; acc.accountNumber == accountNumber, orElse: () =&gt; Account(accountNumber: &#39;&#39;, ownerName: &#39;&#39;, balance: -1));<br>  }<br><br>  // Deposit into an account<br>  void deposit(String accountNumber, double amount) {<br>    var account = findAccount(accountNumber);<br>    if (account != null &amp;&amp; account.balance != -1) {<br>      account.deposit(amount);<br>    } else {<br>      print(&quot;Account not found!&quot;);<br>    }<br>  }<br><br>  // Withdraw from an account<br>  void withdraw(String accountNumber, double amount) {<br>    var account = findAccount(accountNumber);<br>    if (account != null &amp;&amp; account.balance != -1) {<br>      account.withdraw(amount);<br>    } else {<br>      print(&quot;Account not found!&quot;);<br>    }<br>  }<br><br>  // Transfer money between accounts<br>  void transfer(String fromAccount, String toAccount, double amount) {<br>    var sender = findAccount(fromAccount);<br>    var receiver = findAccount(toAccount);<br><br>    if (sender != null &amp;&amp; receiver != null &amp;&amp; sender.balance != -1 &amp;&amp; receiver.balance != -1) {<br>      if (sender.withdraw(amount)) {<br>        receiver.deposit(amount);<br>        print(&quot;Transfer of \$${amount.toStringAsFixed(2)} successful from $fromAccount to $toAccount.&quot;);<br>      }<br>    } else {<br>      print(&quot;Invalid sender or receiver account!&quot;);<br>    }<br>  }<br><br>  // Display all accounts<br>  void displayAllAccounts() {<br>    print(&quot;\n=== Bank Accounts ===&quot;);<br>    if (accounts.isEmpty) {<br>      print(&quot;No accounts found.&quot;);<br>      return;<br>    }<br>    for (var account in accounts) {<br>      account.displayAccountInfo();<br>    }<br>  }<br>}<br><br>// Main function for testing<br>void main() {<br>  Bank bank = Bank();<br>  while (true) {<br>    print(&quot;\n=== Banking System ===&quot;);<br>    print(&quot;1. Create Account&quot;);<br>    print(&quot;2. Deposit&quot;);<br>    print(&quot;3. Withdraw&quot;);<br>    print(&quot;4. Transfer&quot;);<br>    print(&quot;5. View Account Details&quot;);<br>    print(&quot;6. View All Accounts&quot;);<br>    print(&quot;7. Exit&quot;);<br>    stdout.write(&quot;Choose an option: &quot;);<br>    String? choice = stdin.readLineSync();<br><br>    switch (choice) {<br>      case &quot;1&quot;:<br>        stdout.write(&quot;\nEnter Account Holder Name: &quot;);<br>        String? name = stdin.readLineSync();<br>        stdout.write(&quot;Enter Account Number: &quot;);<br>        String? accNum = stdin.readLineSync();<br>        if (name != null &amp;&amp; accNum != null) {<br>          bank.createAccount(name, accNum);<br>        }<br>        break;<br>      case &quot;2&quot;:<br>        stdout.write(&quot;\nEnter Account Number: &quot;);<br>        String? accNum = stdin.readLineSync();<br>        stdout.write(&quot;Enter Deposit Amount: &quot;);<br>        double amount = double.tryParse(stdin.readLineSync() ?? &#39;&#39;) ?? 0;<br>        if (accNum != null) {<br>          bank.deposit(accNum, amount);<br>        }<br>        break;<br>      case &quot;3&quot;:<br>        stdout.write(&quot;\nEnter Account Number: &quot;);<br>        String? accNum = stdin.readLineSync();<br>        stdout.write(&quot;Enter Withdrawal Amount: &quot;);<br>        double amount = double.tryParse(stdin.readLineSync() ?? &#39;&#39;) ?? 0;<br>        if (accNum != null) {<br>          bank.withdraw(accNum, amount);<br>        }<br>        break;<br>      case &quot;4&quot;:<br>        stdout.write(&quot;\nEnter Sender Account Number: &quot;);<br>        String? fromAcc = stdin.readLineSync();<br>        stdout.write(&quot;Enter Receiver Account Number: &quot;);<br>        String? toAcc = stdin.readLineSync();<br>        stdout.write(&quot;Enter Transfer Amount: &quot;);<br>        double amount = double.tryParse(stdin.readLineSync() ?? &#39;&#39;) ?? 0;<br>        if (fromAcc != null &amp;&amp; toAcc != null) {<br>          bank.transfer(fromAcc, toAcc, amount);<br>        }<br>        break;<br>      case &quot;5&quot;:<br>        stdout.write(&quot;\nEnter Account Number: &quot;);<br>        String? accNum = stdin.readLineSync();<br>        var account = bank.findAccount(accNum ?? &#39;&#39;);<br>        if (account != null &amp;&amp; account.balance != -1) {<br>          account.displayAccountInfo();<br>        } else {<br>          print(&quot;Account not found!&quot;);<br>        }<br>        break;<br>      case &quot;6&quot;:<br>        bank.displayAllAccounts();<br>        break;<br>      case &quot;7&quot;:<br>        print(&quot;Exiting Banking System...&quot;);<br>        return;<br>      default:<br>        print(&quot;Invalid choice! Please enter a valid option.&quot;);<br>    }<br>  }<br>}</pre><h3>How It Works</h3><ul><li>The Account class represents individual bank accounts with deposit and withdrawal methods.</li><li>The Bank class manages multiple accounts, allowing users to:</li><li>Create accounts</li><li>Deposit money</li><li>Withdraw money</li><li>Transfer funds between accounts</li><li>View account details</li><li>A <strong>console-based menu</strong> lets users interact with the system.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3610a34b4d3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Firebase Cloud Messaging with Flutter]]></title>
            <link>https://medium.com/@abdallahhossam847/firebase-cloud-messaging-with-flutter-da3bb6962e95?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/da3bb6962e95</guid>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[firebasecloudmessaging]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Tue, 19 Nov 2024 21:53:33 GMT</pubDate>
            <atom:updated>2024-11-19T21:53:33.361Z</atom:updated>
            <content:encoded><![CDATA[<p>Firebase Cloud Messaging (FCM) is a powerful tool for sending push notifications to Flutter applications. Here’s an explanation of how to integrate and manage Firebase notifications in your Flutter project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bOaesV06CC-GTM0rCDVGEg.png" /></figure><h3>Step 1: Set Up Firebase Project</h3><ol><li>Go to Firebase Console.</li><li>Create a new project or open an existing one.</li><li>Add your Flutter app to the Firebase project:</li></ol><ul><li>For Android: Download the google-services.json file and place it in the android/app/ directory.</li><li>For iOS: Download the GoogleService-Info.plist file and place it in the ios/Runner directory.</li></ul><p>4. Enable Firebase Cloud Messaging in the Firebase Console.</p><p>Step 2: Add Dependencies</p><pre>dependencies:<br>  firebase_core: ^2.0.0<br>  firebase_messaging: ^14.0.0</pre><p>Run flutter pub get to install the dependencies.</p><h3>Step 3: Configure Your Flutter App</h3><h4>For Android</h4><ol><li>Add the following to your android/build.gradle file:</li></ol><pre>dependencies {<br>    classpath &#39;com.google.gms:google-services:4.3.15&#39;<br>}</pre><p>2. Add the plugin to your android/app/build.gradle file:</p><pre>apply plugin: &#39;com.google.gms.google-services&#39;</pre><h4>For iOS</h4><ol><li>Enable push notifications in the Xcode project.</li><li>Add the following to your ios/Runner/AppDelegate.swift:</li></ol><pre>import Firebase<br>import FirebaseMessaging<br><br>@UIApplicationMain<br>@objc class AppDelegate: FlutterAppDelegate {<br>    override func application(<br>        _ application: UIApplication,<br>        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?<br>    ) -&gt; Bool {<br>        FirebaseApp.configure()<br>        Messaging.messaging().delegate = self<br>        UNUserNotificationCenter.current().delegate = self<br>        return super.application(application, didFinishLaunchingWithOptions: launchOptions)<br>    }<br>}</pre><p>3. Add the required keys in the ios/Runner/Info.plist file:</p><pre>&lt;key&gt;FirebaseAppDelegateProxyEnabled&lt;/key&gt;<br>&lt;false/&gt;</pre><h3>Step 4: Initialize Firebase in Flutter</h3><p>Initialize Firebase in your Flutter application:</p><pre>import &#39;package:firebase_core/firebase_core.dart&#39;;<br><br>void main() async {<br>  WidgetsFlutterBinding.ensureInitialized();<br>  await Firebase.initializeApp();<br>  runApp(MyApp());<br>}</pre><h3>Step 5: Setup Firebase Messaging</h3><h4>Request Permissions</h4><p>Request permission for notifications:</p><pre>import &#39;package:firebase_messaging/firebase_messaging.dart&#39;;<br><br>Future&lt;void&gt; requestNotificationPermissions() async {<br>  FirebaseMessaging messaging = FirebaseMessaging.instance;<br>  NotificationSettings settings = await messaging.requestPermission(<br>    alert: true,<br>    badge: true,<br>    sound: true,<br>  );<br><br>  if (settings.authorizationStatus == AuthorizationStatus.authorized) {<br>    print(&#39;User granted permission&#39;);<br>  } else {<br>    print(&#39;User declined or has not accepted permission&#39;);<br>  }<br>}</pre><h4>Foreground Notifications</h4><p>Handle notifications when the app is in the foreground:</p><pre>FirebaseMessaging.onMessage.listen((RemoteMessage message) {<br>  print(&#39;Message received: ${message.notification?.title}&#39;);<br>});</pre><h4>Background Notifications</h4><p>Handle background notifications by defining a callback:</p><pre>Future&lt;void&gt; _firebaseMessagingBackgroundHandler(RemoteMessage message) async {<br>  await Firebase.initializeApp();<br>  print(&quot;Handling a background message: ${message.messageId}&quot;);<br>}<br><br>FirebaseMessaging.onBackgroundMessage(_firebaseMessagingBackgroundHandler);</pre><h3>Step 6: Get Device Token</h3><p>Retrieve the FCM token for sending notifications to the device:</p><pre>FirebaseMessaging.instance.getToken().then((String? token) {<br>  assert(token != null);<br>  print(&quot;FCM Token: $token&quot;);<br>});</pre><h3>Step 7: Display Notifications</h3><p>Flutter uses the flutter_local_notifications package for displaying notifications. Add this package and configure it to handle notification payloads.</p><pre>import &#39;package:flutter_local_notifications/flutter_local_notifications.dart&#39;;<br><br>final FlutterLocalNotificationsPlugin localNotifications =<br>    FlutterLocalNotificationsPlugin();<br><br>void initLocalNotifications() {<br>  const AndroidInitializationSettings androidSettings =<br>      AndroidInitializationSettings(&#39;@mipmap/ic_launcher&#39;);<br>  const InitializationSettings settings =<br>      InitializationSettings(android: androidSettings);<br><br>  localNotifications.initialize(settings);<br>}<br><br>void showNotification(RemoteMessage message) {<br>  const AndroidNotificationDetails androidDetails =<br>      AndroidNotificationDetails(&#39;channel_id&#39;, &#39;channel_name&#39;,<br>          importance: Importance.max, priority: Priority.high);<br><br>  const NotificationDetails notificationDetails =<br>      NotificationDetails(android: androidDetails);<br><br>  localNotifications.show(0, message.notification?.title,<br>      message.notification?.body, notificationDetails);<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da3bb6962e95" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[GPS with Google Maps]]></title>
            <link>https://medium.com/@abdallahhossam847/gps-with-google-maps-5c6e0ad1079a?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c6e0ad1079a</guid>
            <category><![CDATA[google-maps]]></category>
            <category><![CDATA[gps]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[gps-navigation]]></category>
            <category><![CDATA[gps-tracking-system]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 11:13:01 GMT</pubDate>
            <atom:updated>2024-10-31T11:13:01.807Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*ER-BR1LDvqxf3JTvptAVZg.png" /></figure><p>The history of GPS (Global Positioning System) is a fascinating journey through technology and innovation, evolving over decades to become a vital tool for navigation, mapping, and timing across the globe. Here’s a detailed overview:</p><h3>Early Development</h3><ul><li><strong>1920s</strong>: The concept of radio navigation began with the development of radio waves for locating ships at sea. The U.S. Navy experimented with radio signals to determine positions.</li><li><strong>1940s</strong>: During World War II, the U.S. military developed more sophisticated navigation systems, including LORAN (Long Range Navigation), which used radio signals from land-based stations to determine a receiver’s position.</li></ul><h3>Birth of Satellite Navigation</h3><ul><li><strong>1950s</strong>: The Soviet Union launched the first artificial satellite, Sputnik, in 1957. This event marked the beginning of the space age and sparked interest in satellite-based navigation.</li><li><strong>1960s</strong>: The U.S. Department of Defense initiated the TRANSIT program, which used satellites for navigation. This system allowed submarines to determine their position using satellite signals, but it was primarily designed for military use.</li></ul><h3>Development of GPS</h3><ul><li><strong>1973</strong>: The U.S. Department of Defense formally began developing GPS as a military navigation system, aiming to create a global positioning system that could provide accurate and reliable location data.</li><li><strong>1978</strong>: The first GPS satellite, Navstar 1, was launched. This satellite was part of the initial constellation of satellites designed to provide global coverage.</li><li><strong>1983</strong>: Following the downing of Korean Air Flight 007, President Ronald Reagan announced that GPS would be made available for civilian use.</li></ul><h3>Expansion and Improvements</h3><ul><li><strong>1993</strong>: The GPS system was fully operational, consisting of 24 satellites in orbit. The system provided accurate positioning data worldwide, benefiting both military and civilian applications.</li><li><strong>1995</strong>: The U.S. government declared GPS fully operational, with enhanced accuracy due to improvements in satellite technology and the introduction of new signals.</li></ul><h3>Civilian Applications</h3><ul><li><strong>2000</strong>: The U.S. government discontinued selective availability, which had intentionally degraded civilian GPS accuracy. This change allowed civilian users to access the full accuracy of GPS, typically within 5 to 10 meters.</li><li><strong>2000s</strong>: GPS technology began to be widely adopted in various industries, including automotive navigation, aviation, maritime navigation, and outdoor recreation. The technology also started to be integrated into smartphones, making GPS accessible to the general public.</li></ul><h3>Modern Era and Global Navigation Satellite Systems (GNSS)</h3><ul><li><strong>2010s</strong>: Other countries developed their own GNSS systems, including Russia’s GLONASS, the European Union’s Galileo, and China’s BeiDou. These systems increased global coverage and redundancy.</li><li><strong>2018</strong>: The U.S. Air Force declared the GPS III satellite system operational, offering improved accuracy and resilience against jamming and interference.</li></ul><p><strong>.2020</strong>: GPS technology continues to evolve, with ongoing improvements in satellite technology, signal processing, and integration with other technologies (like inertial navigation systems) to enhance accuracy and reliability. The rise of location-based services, autonomous vehicles, and the Internet of Things (IoT) has further expanded the use of GPS.</p><p>To use Google Maps in a Flutter application, you’ll need to follow a few steps for setup and implementation. Here’s a guide to help you get started:</p><h3>1. Set Up Your Project in Google Cloud Console</h3><ol><li>Go to the Google Cloud Console.</li><li>Create a new project or select an existing one.</li><li>Enable the <strong>Maps SDK for Android</strong> and the <strong>Maps SDK for iOS</strong> in the <strong>APIs &amp; Services</strong> section.</li><li>Generate an <strong>API Key</strong> from <strong>Credentials</strong>.</li></ol><h3>2. Add the Google Maps Flutter Package</h3><p>Add the google_maps_flutter package in your pubspec.yaml file:</p><pre>dependencies:<br>  google_maps_flutter: latest_version</pre><p>Then, install the dependencies by running:</p><pre>flutter pub get</pre><h3>3. Configure API Keys for Android and iOS</h3><h4>Android Configuration</h4><ol><li>Open android/app/src/main/AndroidManifest.xml.</li><li>Inside the &lt;application&gt; tag, add the following meta-data tag with your API key:</li></ol><pre>&lt;meta-data<br>    android:name=&quot;com.google.android.geo.API_KEY&quot;<br>    android:value=&quot;YOUR_API_KEY&quot; /&gt;</pre><h4>iOS Configuration</h4><ol><li>In your ios/Runner directory, open AppDelegate.swift (or AppDelegate.m for Objective-C).</li><li>Import the GoogleMaps library and initialize it with your API key:</li></ol><pre>import GoogleMaps<br><br>@UIApplicationMain<br>@objc class AppDelegate: FlutterAppDelegate {<br>    override func application(<br>        _ application: UIApplication,<br>        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?<br>    ) -&gt; Bool {<br>        GMSServices.provideAPIKey(&quot;YOUR_API_KEY&quot;)<br>        return super.application(application, didFinishLaunchingWithOptions: launchOptions)<br>    }<br>}</pre><h3>4. Implement Google Maps in Flutter</h3><p>After setup, you can create a Google Maps widget in your Flutter app. Here’s a basic example:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:google_maps_flutter/google_maps_flutter.dart&#39;;<br><br>void main() =&gt; runApp(MyApp());<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      debugShowCheckedModeBanner: false,<br>      title: &#39;Google Maps Demo&#39;,<br>      theme: ThemeData(<br>        primarySwatch: Colors.blue,<br>      ),<br>      home: MapScreen(),<br>    );<br>  }<br>}<br><br>class MapScreen extends StatefulWidget {<br>  @override<br>  _MapScreenState createState() =&gt; _MapScreenState();<br>}<br><br>class _MapScreenState extends State&lt;MapScreen&gt; {<br>  late GoogleMapController _mapController;<br><br>  // Define the initial camera position (e.g., San Francisco)<br>  final CameraPosition _initialPosition = CameraPosition(<br>    target: LatLng(37.7749, -122.4194),<br>    zoom: 10.0,<br>  );<br><br>  // Define a set of markers<br>  final Set&lt;Marker&gt; _markers = {<br>    Marker(<br>      markerId: MarkerId(&#39;san_francisco&#39;),<br>      position: LatLng(37.7749, -122.4194),<br>      infoWindow: InfoWindow(<br>        title: &#39;San Francisco&#39;,<br>        snippet: &#39;An interesting city&#39;,<br>      ),<br>      icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueRed),<br>    ),<br>  };<br><br>  // Map created callback<br>  void _onMapCreated(GoogleMapController controller) {<br>    _mapController = controller;<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: Text(&#39;Google Maps in Flutter&#39;),<br>      ),<br>      body: GoogleMap(<br>        onMapCreated: _onMapCreated,<br>        initialCameraPosition: _initialPosition,<br>        markers: _markers,<br>        mapType: MapType.normal,<br>        myLocationEnabled: true,<br>        zoomControlsEnabled: true,<br>      ),<br>      floatingActionButton: FloatingActionButton(<br>        onPressed: () {<br>          // Move camera to a new position (example: Los Angeles)<br>          _mapController.animateCamera(<br>            CameraUpdate.newCameraPosition(<br>              CameraPosition(<br>                target: LatLng(34.0522, -118.2437), // Los Angeles coordinates<br>                zoom: 10.0,<br>              ),<br>            ),<br>          );<br>        },<br>        child: Icon(Icons.location_pin),<br>      ),<br>    );<br>  }<br>}</pre><h3>But What if you want to get the user location ?!</h3><p>To use Google Maps with the Geolocator package in Flutter, you’ll need to set up both google_maps_flutter and geolocator packages. This will enable showing the user’s current location on the map and updating the location as they move.</p><h3>1. Add Dependencies</h3><p>Add google_maps_flutter and geolocator in your pubspec.yaml:</p><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  google_maps_flutter: latest_version<br>  geolocator: latest_version<br>  geocoding: latest_version # Optional, if you want to convert coordinates to addresses</pre><p>Run:</p><pre>flutter pub get</pre><h3>2. Configure Permissions for Location Access</h3><h4>Android</h4><p>In android/app/src/main/AndroidManifest.xml, add the following permissions outside the &lt;application&gt; tag:</p><pre>&lt;manifest&gt;<br>    &lt;!-- Required for geolocation --&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.ACCESS_FINE_LOCATION&quot; /&gt;<br>    &lt;uses-permission android:name=&quot;android.permission.ACCESS_COARSE_LOCATION&quot; /&gt;<br>&lt;/manifest&gt;</pre><h4>iOS</h4><p>In ios/Runner/Info.plist, add the following keys:</p><pre>&lt;key&gt;NSLocationWhenInUseUsageDescription&lt;/key&gt;<br>&lt;string&gt;We need your location to show it on the map.&lt;/string&gt;<br>&lt;key&gt;NSLocationAlwaysUsageDescription&lt;/key&gt;<br>&lt;string&gt;We need your location to show it on the map.&lt;/string&gt;<br>&lt;key&gt;NSLocationWhenInUseUsageDescription&lt;/key&gt;<br>&lt;string&gt;Location is used to display your current location on the map.&lt;/string&gt;</pre><h3>3. Full Code Example with Google Maps and Geolocator</h3><p>Here is the complete Flutter code to set up a map with the user’s current location:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:google_maps_flutter/google_maps_flutter.dart&#39;;<br>import &#39;package:geolocator/geolocator.dart&#39;;<br><br>void main() =&gt; runApp(MyApp());<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      debugShowCheckedModeBanner: false,<br>      title: &#39;Google Maps with Geolocator&#39;,<br>      theme: ThemeData(<br>        primarySwatch: Colors.blue,<br>      ),<br>      home: MapScreen(),<br>    );<br>  }<br>}<br><br>class MapScreen extends StatefulWidget {<br>  @override<br>  _MapScreenState createState() =&gt; _MapScreenState();<br>}<br><br>class _MapScreenState extends State&lt;MapScreen&gt; {<br>  late GoogleMapController _mapController;<br>  Position? _currentPosition;<br>  final Set&lt;Marker&gt; _markers = {};<br><br>  // Initial Camera Position - if user location not available<br>  static const CameraPosition _initialPosition = CameraPosition(<br>    target: LatLng(37.7749, -122.4194), // San Francisco as default location<br>    zoom: 10.0,<br>  );<br><br>  @override<br>  void initState() {<br>    super.initState();<br>    _getCurrentLocation();<br>  }<br><br>  // Method to get the current location of the user<br>  Future&lt;void&gt; _getCurrentLocation() async {<br>    bool serviceEnabled;<br>    LocationPermission permission;<br><br>    // Check if location services are enabled<br>    serviceEnabled = await Geolocator.isLocationServiceEnabled();<br>    if (!serviceEnabled) {<br>      await Geolocator.openLocationSettings();<br>      return;<br>    }<br><br>    // Check for location permissions<br>    permission = await Geolocator.checkPermission();<br>    if (permission == LocationPermission.denied) {<br>      permission = await Geolocator.requestPermission();<br>      if (permission == LocationPermission.denied) {<br>        return;<br>      }<br>    }<br>    if (permission == LocationPermission.deniedForever) {<br>      return;<br>    }<br><br>    // Get the current location<br>    Position position = await Geolocator.getCurrentPosition(<br>        desiredAccuracy: LocationAccuracy.high);<br><br>    setState(() {<br>      _currentPosition = position;<br>      _markers.add(<br>        Marker(<br>          markerId: MarkerId(&#39;currentLocation&#39;),<br>          position: LatLng(position.latitude, position.longitude),<br>          infoWindow: InfoWindow(<br>            title: &#39;Your Location&#39;,<br>          ),<br>          icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueBlue),<br>        ),<br>      );<br>    });<br><br>    // Move the camera to the current location<br>    _mapController.animateCamera(<br>      CameraUpdate.newCameraPosition(<br>        CameraPosition(<br>          target: LatLng(position.latitude, position.longitude),<br>          zoom: 14.0,<br>        ),<br>      ),<br>    );<br>  }<br><br>  // Callback when the map is created<br>  void _onMapCreated(GoogleMapController controller) {<br>    _mapController = controller;<br>    if (_currentPosition != null) {<br>      _mapController.animateCamera(<br>        CameraUpdate.newCameraPosition(<br>          CameraPosition(<br>            target: LatLng(_currentPosition!.latitude, _currentPosition!.longitude),<br>            zoom: 14.0,<br>          ),<br>        ),<br>      );<br>    }<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: Text(&#39;Google Maps with Geolocator&#39;),<br>      ),<br>      body: GoogleMap(<br>        onMapCreated: _onMapCreated,<br>        initialCameraPosition: _initialPosition,<br>        markers: _markers,<br>        myLocationEnabled: true,<br>        myLocationButtonEnabled: true,<br>      ),<br>      floatingActionButton: FloatingActionButton(<br>        onPressed: _getCurrentLocation,<br>        child: Icon(Icons.location_searching),<br>      ),<br>    );<br>  }<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c6e0ad1079a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Dependency Inversion VS Dependency Injection]]></title>
            <link>https://medium.com/@abdallahhossam847/dependency-inversion-vs-dependency-injection-e940cc752a4b?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/e940cc752a4b</guid>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Mon, 28 Oct 2024 15:17:16 GMT</pubDate>
            <atom:updated>2024-10-28T15:17:16.013Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Dependency Inversion Principle (DIP)</h3><p>The <strong>Dependency Inversion Principle</strong> is a fundamental guideline in SOLID principles, focusing on how high-level modules should not depend on low-level modules directly. Instead, both should depend on abstractions.</p><h4>Key Ideas:</h4><ul><li><strong>High-level modules</strong> (e.g., business logic or controllers) should not rely on <strong>low-level modules</strong> (e.g., specific implementations like repositories).</li><li>Both high- and low-level modules should depend on abstractions, such as interfaces or abstract classes.</li></ul><p>In Flutter, applying DIP means ensuring that UI components or business logic don’t directly depend on concrete implementations but instead rely on interfaces or abstract classes. This practice makes it easier to swap implementations and improves testability.</p><h4>Example:</h4><p>Suppose you have a UserService that needs a UserRepository to fetch user data:</p><pre>// Define an abstraction (interface)<br>abstract class UserRepository {<br>  Future&lt;User&gt; fetchUser();<br>}<br><br>// High-level module depends on the abstraction<br>class UserService {<br>  final UserRepository userRepository;<br><br>  UserService(this.userRepository);<br><br>  Future&lt;User&gt; getUser() =&gt; userRepository.fetchUser();<br>}</pre><p>Here, UserService does not directly depend on a specific UserRepository implementation but on an abstraction (UserRepository). This setup respects the Dependency Inversion Principle.</p><h3>2. Dependency Injection (DI)</h3><p><strong>Dependency Injection</strong> is a design pattern for implementing the Dependency Inversion Principle. It involves providing dependencies to a class externally rather than creating them internally.</p><h4>Key Ideas:</h4><ul><li><strong>Inject dependencies</strong> (like instances of classes) into the objects that need them.</li><li>Makes it easy to switch between different implementations of a dependency, improving flexibility and testability.</li><li>There are different types of Dependency Injection:</li><li><strong>Constructor Injection</strong>: Passing dependencies through the constructor.</li><li><strong>Setter Injection</strong>: Setting dependencies using a method or property.</li><li><strong>Property Injection</strong>: Setting dependencies directly on a public field.</li></ul><p>In Flutter, Dependency Injection can be achieved using packages like provider, get_it, or riverpod, which help manage and inject dependencies.</p><h4>Example:</h4><p>Using get_it to inject dependencies:</p><ol><li><strong>Define the Dependency</strong>:</li></ol><pre>// Define a concrete implementation of UserRepository<br>class ApiUserRepository implements UserRepository {<br>  @override<br>  Future&lt;User&gt; fetchUser() {<br>    // Fetch user from API<br>  }<br>}</pre><p>2. <strong>Set up DI in main.dart</strong>:</p><pre>final getIt = GetIt.instance;<br><br>void setup() {<br>  getIt.registerLazySingleton&lt;UserRepository&gt;(() =&gt; ApiUserRepository());<br>}<br><br>void main() {<br>  setup();<br>  runApp(MyApp());<br>}</pre><p>3. <strong>Inject in a Widget</strong>:</p><pre>class UserScreen extends StatelessWidget {<br>  final UserService userService = UserService(GetIt.I&lt;UserRepository&gt;());<br><br>  @override<br>  Widget build(BuildContext context) {<br>    // Use userService here<br>  }<br>}</pre><h3>Dependency Inversion vs. Dependency Injection in Flutter</h3><ul><li><strong>Dependency Inversion</strong> is a <em>principle</em> that tells you to depend on abstractions rather than concrete implementations.</li><li><strong>Dependency Injection</strong> is a <em>pattern</em> that helps you follow this principle by making it easier to inject dependencies into your classes.</li></ul><p>In Flutter, combining DIP and DI helps build modular, testable, and maintainable applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e940cc752a4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SOLID principles]]></title>
            <link>https://medium.com/@abdallahhossam847/solid-principles-19902e531cba?source=rss-d0479bbbcbab------2</link>
            <guid isPermaLink="false">https://medium.com/p/19902e531cba</guid>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Abdallahhossam]]></dc:creator>
            <pubDate>Wed, 23 Oct 2024 17:19:20 GMT</pubDate>
            <atom:updated>2024-10-23T17:19:20.453Z</atom:updated>
            <content:encoded><![CDATA[<p>The SOLID principles are a set of design principles that aim to make software designs more understandable, flexible, and maintainable. They are especially useful in object-oriented programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xLiqpgVj3yNtmTglJU0AFg.png" /><figcaption>Solid</figcaption></figure><h3>1. Single Responsibility Principle (SRP)</h3><p>A class should have only one reason to change, meaning it should only have one job or responsibility.</p><p><strong>Example:</strong> Suppose you have a class that handles both user authentication and user data fetching. This violates the SRP.</p><pre>class AuthService {<br>  void login(String username, String password) {<br>    // Logic for logging in<br>  }<br>}<br><br>class UserService {<br>  void fetchUserData(String userId) {<br>    // Logic for fetching user data<br>  }<br>}</pre><h3>2. Open/Closed Principle (OCP)</h3><p>Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. This means you should be able to add new functionality without changing existing code.</p><p><strong>Example:</strong> You can use abstract classes or interfaces to define behaviors that can be extended.</p><pre>abstract class Notification {<br>  void send(String message);<br>}<br><br>class EmailNotification implements Notification {<br>  @override<br>  void send(String message) {<br>    // Logic to send email notification<br>  }<br>}<br><br>class SMSNotification implements Notification {<br>  @override<br>  void send(String message) {<br>    // Logic to send SMS notification<br>  }<br>}<br><br>class NotificationService {<br>  void notify(Notification notification, String message) {<br>    notification.send(message);<br>  }<br>}</pre><h3>3. Liskov Substitution Principle (LSP)</h3><p>Objects of a superclass should be replaceable with objects of a subclass without affecting the functionality of the program. Essentially, subclasses should extend the behavior of the parent class without changing its expected behavior.</p><p><strong>Example:</strong> You might have a base class and subclasses for different types of vehicles.</p><pre>class Vehicle {<br>  void start() {<br>    // Logic to start vehicle<br>  }<br>}<br><br>class GasCar extends Vehicle {<br>  @override<br>  void start() {<br>    // Logic to start gas car<br>  }<br>}<br><br>class ElectricCar extends Vehicle {<br>  @override<br>  void start() {<br>    // Logic to start electric car<br>  }<br>}</pre><h3>4. Interface Segregation Principle (ISP)</h3><p>No client should be forced to depend on methods it does not use. Instead of having one large interface, you should have smaller, more specific ones.</p><p><strong>Example:</strong> Instead of a generic Printer interface, create separate interfaces for different types of printers.</p><pre>abstract class DocumentPrinter {<br>  void printDocument(String document);<br>}<br><br>abstract class DocumentScanner {<br>  void scanDocument(String document);<br>}<br><br>class SimplePrinter implements DocumentPrinter {<br>  @override<br>  void printDocument(String document) {<br>    // Logic to print document<br>  }<br>}</pre><h3>5. Dependency Inversion Principle (DIP)</h3><p>High-level modules should not depend on low-level modules; both should depend on abstractions. Additionally, abstractions should not depend on details; details should depend on abstractions.</p><p><strong>Example:</strong> Instead of a class directly instantiating a dependency, it should accept the dependency through its constructor.</p><pre>abstract class Database {<br>  void connect();<br>}<br><br>class MySQLDatabase implements Database {<br>  @override<br>  void connect() {<br>    // Logic to connect to MySQL<br>  }<br>}<br><br>class UserService {<br>  final Database database;<br><br>  UserService(this.database);<br><br>  void fetchUsers() {<br>    database.connect();<br>    // Logic to fetch users<br>  }<br>}</pre><p>By applying the SOLID principles in Flutter development, you can create more maintainable and scalable applications. This results in better separation of concerns, easier testing, and improved code reusability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=19902e531cba" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>