<?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 Batuhan Sahin on Medium]]></title>
        <description><![CDATA[Stories by Batuhan Sahin on Medium]]></description>
        <link>https://medium.com/@bthnshn263506?source=rss-3e9c53770511------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tCEQZahHHMmDfEdOWChqSA.png</url>
            <title>Stories by Batuhan Sahin on Medium</title>
            <link>https://medium.com/@bthnshn263506?source=rss-3e9c53770511------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 22:46:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bthnshn263506/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[Integrating AWS Cognito Post Confirmation with Lambda and DynamoDB]]></title>
            <link>https://blog.devgenius.io/integrating-aws-cognito-post-confirmation-with-lambda-and-dynamodb-a2561c50b5d0?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2561c50b5d0</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cognito]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[lambda]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Thu, 22 Feb 2024 10:05:55 GMT</pubDate>
            <atom:updated>2024-02-23T15:57:11.843Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s digital landscape, secure and efficient user management is a critical component of the success of any web or mobile application. Amazon Web Services (AWS) addresses this need with a suite of powerful tools that streamline the process of user authentication and data management. Among these tools, AWS Cognito stands out as a robust user authentication service, while AWS Lambda and DynamoDB offer scalable solutions for serverless computing and database management, respectively. In this article, we will explore how to leverage the AWS Cognito Post Confirmation trigger to invoke a Lambda function, which in turn updates a DynamoDB table, creating a seamless flow of user data management from authentication to database storage.</p><figure><img alt="AWS" src="https://cdn-images-1.medium.com/max/1024/1*HG_p1VHxHzegTgwCrwub6g.jpeg" /><figcaption>AWS Stack</figcaption></figure><h3>User Registration and Post Confirmation Trigger</h3><p>AWS Cognito facilitates user registration and sign-in to your application. During user registration, Cognito automatically performs a verification process and, upon user confirmation, offers a trigger mechanism for additional processes. This trigger can be used to initiate customizable operations using AWS Lambda functions.</p><h4>Step 1: Create an AWS Cognito User Pool</h4><ul><li>Navigate to Cognito in the AWS Management Console.</li><li>Click on “Manage User Pools” and create a new user pool.</li><li>Configure the necessary settings for your user pool (e.g., automatic verification messages, and security settings).</li></ul><h3>Data Transfer to DynamoDB with Lambda Function</h3><p>When your Lambda function receives a trigger from Cognito, it can process user information and transfer this data to DynamoDB. This process ensures your application’s database is automatically updated with user registrations.</p><h4>Step 2: Create a DynamoDB Table</h4><ul><li>Go to AWS DynamoDB and select “Create table.”</li><li>Name your table and define a primary key (e.g., user ID).</li><li>Click on “Create” to create your table.</li></ul><p>To enable your AWS Lambda function to transfer data to AWS DynamoDB, you must assign an appropriate IAM (Identity and Access Management) role to your Lambda function. This role should be configured to include permissions for accessing your DynamoDB tables. Below are the steps to grant your Lambda function access to DynamoDB:</p><h4>Step 3: Creating an IAM Role</h4><ul><li>Go to the AWS Management Console and open the IAM service.</li><li>Select Roles from the left menu and click on the Create Role button.</li><li>Choose AWS service and select Lambda as the service that will use this role.</li><li>Click on the Next: Permissions button.</li></ul><h4>Step 4: Adding a Permission Policy</h4><p>Add a policy that includes the necessary permissions for your Lambda function to access DynamoDB. This could typically be the <strong>AmazonDynamoDBFullAccess</strong> policy, but it’s best practice to grant only the minimum necessary permissions. For example, you could create a custom policy that grants write access only to a specific table.</p><ul><li>Type AmazonDynamoDBFullAccess in the policy search box to find and select this policy. Alternatively, for a more restrictive policy, click on Create policy. Use the policy creator in the new tab to create a custom policy, then return and add your created policy to the role.</li><li>Click on Next: Tags (optional) and then Next: Review.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0k3cKol0znR0IcS9_NIKCA.png" /></figure><h4>Step 5: Create a Lambda Function</h4><ul><li>Go to AWS Lambda and select “Create function.”</li><li>Name your function and choose an appropriate runtime (e.g., Node.js or Python).</li><li>Add the role that you have created</li><li>Click on “Create function” to create your function.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ow0TNJUfjc3xJe7SvMuYBA.png" /></figure><h4>Step 6: Configure the Cognito Trigger</h4><ul><li>Return to the settings of your Cognito user pool.</li><li>Find the “Triggers” tab and select the “Post confirmation” trigger.</li><li>Choose the Lambda function you created earlier for this trigger.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xgfNMvOffJ9KuNtuBU5Xrg.png" /></figure><h4>Step 7: Writing a Lambda Function to Insert Data into DynamoDB</h4><p>This example specifically shows how to handle a scenario where you’re responding to an event from AWS Cognito’s Post Confirmation trigger, capturing a user’s unique ID (sub) and email address from the event object, and then storing these details in a DynamoDB table.</p><p>Before you use this code, ensure you replace YOUR_REGION with the AWS region, your DynamoDB table is hosted in, and YOUR_TABLE_NAME with the name of your DynamoDB table.</p><pre>// Node.js 20.x<br>import { DynamoDBClient } from &quot;@aws-sdk/client-dynamodb&quot;;<br>import { PutCommand } from &quot;@aws-sdk/lib-dynamodb&quot;;<br><br>const dynamoDBClient = new DynamoDBClient({ region: YOUR_REGION});<br><br>export const handler = async (event) =&gt; {<br>  const tableName = YOUR_TABLE_NAME;<br><br>  const userId = event.request.userAttributes.sub;<br>  const email = event.request.userAttributes.email;<br><br>  const params = {<br>    TableName: tableName,<br>    Item: {<br>      userId: userId,<br>      email: email,<br>    }<br>  };<br><br>  try {<br>    await dynamoDBClient.send(new PutCommand(params));<br>    console.log(`User ${userId} added to table ${tableName}`);<br>  } catch (error) {<br>    console.error(`Error adding user ${userId} to table ${tableName}:`, error);<br>    throw new Error(`Error adding user to table: ${error.message}`);<br>  }<br><br>  return event;<br>};</pre><p>In conclusion, integrating AWS Lambda with DynamoDB to handle data insertion tasks, especially in response to AWS Cognito events, represents a powerful and scalable approach to managing user data within AWS ecosystems. By leveraging the example code provided, you can efficiently capture and store user information post-confirmation, ensuring your application’s backend processes remain both responsive and resilient. Remember, the key to a successful implementation involves not only the correct setup of AWS services but also ensuring that your Lambda function has the appropriate permissions to interact with DynamoDB. As you continue to develop and refine your application, consider exploring additional AWS services and features to further enhance your application’s capabilities and performance.</p><h3>My Other Articles</h3><ul><li><a href="https://medium.com/@bthnshn263506/in-4-minutes-angular-localization-using-chatgpt-8d2cd3e8ff0f">Angular Localization in 4 Minutes Using chatGPT</a></li><li><a href="https://medium.com/codimis/what-is-dependency-injection-dependency-injection-in-flutter-1bd83e472240">What is Dependency Injection? Dependency Injection in Flutter</a></li><li><a href="https://medium.com/codimis/grpc-with-dart-quick-start-9-steps-870caefe41f2">Grpc with Dart (Quick Start 9 Steps)</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2561c50b5d0" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/integrating-aws-cognito-post-confirmation-with-lambda-and-dynamodb-a2561c50b5d0">Integrating AWS Cognito Post Confirmation with Lambda and DynamoDB</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Angular Localization in 4 Minutes Using chatGPT]]></title>
            <link>https://medium.com/@bthnshn263506/in-4-minutes-angular-localization-using-chatgpt-8d2cd3e8ff0f?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d2cd3e8ff0f</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[internationalization]]></category>
            <category><![CDATA[localization]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[html]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Wed, 07 Jun 2023 14:13:44 GMT</pubDate>
            <atom:updated>2023-06-07T17:06:17.508Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bb69yHhX-NF1hyb35DePfQ.jpeg" /></figure><p>In today’s interconnected world, where businesses and individuals have the ability to reach a global audience, localization has become an essential aspect of any successful venture. Localization refers to adapting a product, service, or content to meet a specific target market or locale&#39;s cultural, linguistic, and functional requirements. It goes beyond mere translation, encompassing a comprehensive approach to ensure that the offering resonates with the local audience and provides a seamless user experience.</p><blockquote>We will use @ngx-translate/core, and @ngx-translate/http-loader to translate our HTML text.</blockquote><p>Firstly, we need to install our packages,</p><pre>npm install @ngx-translate/core<br>npm install @ngx-translate/http-loader</pre><p>In our <strong>app.module.ts</strong> we need to configure our translate module, to use our .json file which includes our languages.</p><p>In @NgModule we need to import our translate module.</p><pre>imports: [<br>    CommonModule,<br>    HttpClientModule,<br>    TranslateModule.forRoot({<br>      defaultLanguage: &#39;tr&#39;,<br>      loader: {<br>          provide: TranslateLoader,<br>          useFactory: (createTranslateLoader),<br>          deps: [HttpClient]<br>      }<br>  }),</pre><p>For useFactory we are using our function to show where our .json file is.</p><pre>export function createTranslateLoader(http: HttpClient) {<br>  return new TranslateHttpLoader(http, &#39;./assets/i18n/&#39;, &#39;.json&#39;);<br>}</pre><p>I am creating all my languages files in src-&gt;app-&gt;assets-&gt;i18n folder inside.</p><p>I use the default language for tr.json and I will ad en.json for Turkish and English Language. In this part try to use ChatGPT for more fast changes in the JSON file.</p><pre>{<br>&quot;authentication&quot;: {<br>    &quot;signIn&quot;: &quot;Sign In&quot;,<br>    &quot;google&quot;: &quot;Sign in or Sign up&quot;,<br>    &quot;forgotPassword&quot;: &quot;Forgot Password&quot;,<br>    &quot;dontHaveAccount&quot;: &quot;Don&#39;t have an account?&quot;,<br>    &quot;or&quot;: &quot;or&quot;,<br>    &quot;login&quot;: &quot;Log In&quot;,<br>    &quot;username&quot;: &quot;Username&quot;,<br>    &quot;password&quot;: &quot;Password&quot;,<br>    &quot;resetPass&quot;: &quot;Reset Password&quot;,<br>    &quot;resetPassBody&quot;: &quot;Please enter your email address to request password reset.&quot;,<br>    &quot;resetPassButton&quot;: &quot;Reset Password&quot;,<br>    &quot;goBackLogin&quot;: &quot;Go Back to Login&quot;,<br>    &quot;thanksRegister&quot;: &quot;Thank you for registering&quot;,<br>    &quot;sendMail&quot;: &quot;Please check your email and click on the link to activate your account.&quot;,<br>    &quot;resendMail&quot;: &quot;Resend&quot;,<br>    &quot;alreadyAccount&quot;: &quot;Already have an account?&quot;,<br>    &quot;signUp&quot;: &quot;Sign Up&quot;<br>    }<br>}</pre><p>It is my en.json I will copy It and past it to chatGPT to translate it to Turkish and I will give chatGPT to right prompt to translate</p><pre>{<br>&quot;authentication&quot;: {<br>    &quot;signIn&quot;: &quot;Sign In&quot;,<br>    &quot;google&quot;: &quot;Sign in or Sign up&quot;,<br>    &quot;forgotPassword&quot;: &quot;Forgot Password&quot;,<br>    &quot;dontHaveAccount&quot;: &quot;Don&#39;t have an account?&quot;,<br>    &quot;or&quot;: &quot;or&quot;,<br>    &quot;login&quot;: &quot;Log In&quot;,<br>    &quot;username&quot;: &quot;Username&quot;,<br>    &quot;password&quot;: &quot;Password&quot;,<br>    &quot;resetPass&quot;: &quot;Reset Password&quot;,<br>    &quot;resetPassBody&quot;: &quot;Please enter your email address to request password reset.&quot;,<br>    &quot;resetPassButton&quot;: &quot;Reset Password&quot;,<br>    &quot;goBackLogin&quot;: &quot;Go Back to Login&quot;,<br>    &quot;thanksRegister&quot;: &quot;Thank you for registering&quot;,<br>    &quot;sendMail&quot;: &quot;Please check your email and click on the link to activate your account.&quot;,<br>    &quot;resendMail&quot;: &quot;Resend&quot;,<br>    &quot;alreadyAccount&quot;: &quot;Already have an account?&quot;,<br>    &quot;signUp&quot;: &quot;Sign Up&quot;<br>    }<br>} Translate this to the Turkish in json format file</pre><p>I write it in the chatGPT and chatGPT returns this you can use it in every language</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*lNp6yVAe9dEyCogTIAOfNg.png" /></figure><p>I can continue with any language but it is enough for this article. Okay, we are ready to use this file.</p><blockquote>src-&gt;app-&gt;assets-&gt;i18n-&gt;tr.json</blockquote><blockquote>src-&gt;app-&gt;assets-&gt;i18n-&gt;en.json</blockquote><p>In your first .ts file like home.componant.ts I do not know what is your first page. You need to use:</p><pre>import { TranslateService } from &#39;@ngx-translate/core&#39;;<br>  <br>constructor(public translate: TranslateService) {<br>    // this language will be used as a fallback when a translation isn&#39;t <br>    // found in the current language<br>    translate.setDefaultLang(translate.getBrowserLang()??&quot;tr&quot;);<br>    <br>}</pre><p>In the button on your page, you can change directly the language. It is our change function to trigger it in the HTML file.</p><pre> onSelected(value:string): void {<br>    switch (value) {<br>      case &#39;Türkçe&#39;:<br>        this.translate.use(&#39;tr&#39;);<br>        break;<br>      case &#39;English&#39;:<br>        this.translate.use(&#39;en&#39;);<br>        break;<br>   <br>}</pre><p>You can write a dropdown button like this:</p><pre> &lt;select #language (change)=&quot;onSelected(language.value)&quot;<br>            class=&quot;lg:self-end p-2 lg:mr-5 mb-6 text-sm text-gray-900 border border-gray-300 rounded-lg bg-gray-50 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500&quot;&gt;<br>            &lt;option selected disabled&gt;Choose a language&lt;/option&gt;<br>            &lt;option&gt;Türkçe&lt;/option&gt;<br>            &lt;option&gt;English&lt;/option&gt;<br>  &lt;/select&gt;</pre><p>Everything ready we can start to change our HTML text.</p><pre>&lt;span&gt;{{&quot;authentication.goBackLogin&quot;|translate}}&lt;/span&gt;</pre><p>We use the pipe to translate our text. When we changed our language it will directly take the text other .json file.</p><p>If you want to use this pipe in your child module. You need to import it in too.</p><p>It is my child module and I am using this. Extend needs to be true. Copy the createTranslateLoader function in here too.</p><pre>imports: [<br>    CommonModule,<br>    HttpClientModule,<br>    TranslateModule.forChild({<br>      extend: true,<br>      loader: {provide: TranslateLoader, <br>      useFactory: (createTranslateLoader), <br>      deps: [HttpClient] }<br>  })<br>  ],</pre><p>In my first component I am checking the is there any current language if it is not I am setting language in it too. I am doing this for the user who skips my first page and goes to this page directly I am trying to take the user language.</p><pre>import { TranslateService } from &#39;@ngx-translate/core&#39;;<br><br>constructor(translate: TranslateService){<br>    if(!translate.currentLang){<br>      translate.setDefaultLang(translate.getBrowserLang()??&quot;en&quot;);<br>    }<br>  }</pre><blockquote>I wanted to write about them as I have experienced them so far. There is of course more. You can chech it the package usage <a href="https://github.com/ngx-translate/core">in here</a></blockquote><h3>My Other Articles</h3><ul><li><a href="https://medium.com/codimis/grpc-with-dart-quick-start-9-steps-870caefe41f2">Grpc with Dart (Quick Start 9 Steps)</a></li><li><a href="https://medium.com/codimis/android-12-and-flutter-52b78d9fefdb">Android 12 and Flutter</a></li><li><a href="https://medium.com/codimis/what-is-dependency-injection-dependency-injection-in-flutter-1bd83e472240">What is Dependency Injection? Dependency Injection in Flutter</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d2cd3e8ff0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android 12 and Flutter]]></title>
            <link>https://blog.codimis.com/android-12-and-flutter-52b78d9fefdb?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/52b78d9fefdb</guid>
            <category><![CDATA[android-12]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[ui]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Tue, 29 Nov 2022 12:11:17 GMT</pubDate>
            <atom:updated>2024-03-22T11:14:19.962Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*LKjMEyPAapv8-YR8ozOIdg.jpeg" /></figure><p>Android 12, released on October 4, 2021, entered our lives with plenty of changes. Therefore, we need to learn how to implement these changes in our Flutter app and which widgets or libraries we can use to implement new features. You can find <a href="https://developer.android.com/about/versions/12/summary">here</a> which features come and which were deprecated. Let’s start with the short video.</p><p><a href="https://medium.com/codimis/terminal-productivity-booster-zsh-plugins-e8750ad1453d">Terminal Productivity Booster Zsh Plugins</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F62JB64aQC9A%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D62JB64aQC9A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F62JB64aQC9A%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2f0ba60317e787a1ff3024a6d675457c/href">https://medium.com/media/2f0ba60317e787a1ff3024a6d675457c/href</a></iframe><blockquote>As you can see some features have changed. Let’s learn how to implement them.</blockquote><p>First thing first, the splash screen has been changed, you can check out that in the <a href="https://developer.android.com/develop/ui/views/launch/splash-screen">document</a>.</p><ul><li>The <strong>app icon</strong> should be a vector drawable image, and it can be static or animated. Although animations can have an unlimited duration, they recommend not exceeding 1,000 milliseconds. By default, the launcher icon is used.</li><li>The <strong>icon background</strong> is optional and is useful if you need more contrast between the icon and the window background. If you use an <a href="https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive">adaptive icon</a>, its background is displayed if there is enough contrast with the window background.</li><li>As with adaptive icons, one-third of the foreground is masked.</li><li>The <strong>window background</strong> consists of a single opaque color. If the window background is set and is a plain color, it is used by default if the attribute is not set.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*JKhVXB2TL_BnwTCCzVvqpA.png" /></figure><p>There is a package that can help us with the splash screen.</p><p><a href="https://medium.com/codimis/terminals-are-colorful-and-beautiful-with-powerlevel10k-624594a2cc6f">Terminals are Colorful and Beautiful with Powerlevel10k</a></p><h3>flutter_native_splash</h3><p>It is very easy to use this package, and you can provide another splash screen if the user uses another Android version or IOS. You can change the splash screen theme. In the folders, you need to create flutter_native_splash.yaml and then you can configure it.</p><p><a href="https://pub.dev/packages/flutter_native_splash">You can check this package here.</a></p><p>First, add flutter_native_splash it as a dependency in your pubspec.yaml file.</p><pre>flutter_native_splash:<br>  # This package generates native code to customize Flutter&#39;s default white native splash screen<br>  # with background color and splash image.<br>  # Customize the parameters below, and run the following command in the terminal:<br>  # flutter pub run flutter_native_splash:create<br>  # To restore Flutter&#39;s default white splash screen, run the following command in the terminal:<br>  # flutter pub run flutter_native_splash:remove<br><br>  # color or background_image is the only required parameter.  Use color to set the background<br>  # of your splash screen to a solid color.  Use background_image to set the background of your<br>  # splash screen to a png image.  This is useful for gradients. The image will be stretch to the<br>  # size of the app. Only one parameter can be used, color and background_image cannot both be set.<br>  color: &quot;#42a5f5&quot;<br>  #background_image: &quot;assets/background.png&quot;<br><br>  # Optional parameters are listed below.  To enable a parameter, uncomment the line by removing<br>  # the leading # character.<br><br>  # The image parameter allows you to specify an image used in the splash screen.  It must be a<br>  # png file and should be sized for 4x pixel density.<br>  #image: assets/splash.png<br><br>  # The branding property allows you to specify an image used as branding in the splash screen.<br>  # It must be a png file. It is supported for Android, iOS and the Web.  For Android 12,<br>  # see the Android 12 section below.<br>  #branding: assets/dart.png<br><br>  # To position the branding image at the bottom of the screen you can use bottom, bottomRight,<br>  # and bottomLeft. The default values is bottom if not specified or specified something else.<br>  #branding_mode: bottom<br><br>  # The color_dark, background_image_dark, image_dark, branding_dark are parameters that set the background<br>  # and image when the device is in dark mode. If they are not specified, the app will use the<br>  # parameters from above. If the image_dark parameter is specified, color_dark or<br>  # background_image_dark must be specified.  color_dark and background_image_dark cannot both be<br>  # set.<br>  #color_dark: &quot;#042a49&quot;<br>  #background_image_dark: &quot;assets/dark-background.png&quot;<br>  #image_dark: assets/splash-invert.png<br>  #branding_dark: assets/dart_dark.png<br><br>  # Android 12 handles the splash screen differently than previous versions.  Please visit<br>  # https://developer.android.com/guide/topics/ui/splash-screen<br>  # Following are Android 12 specific parameter.<br>  android_12:<br>    # The image parameter sets the splash screen icon image.  If this parameter is not specified,<br>    # the app&#39;s launcher icon will be used instead.<br>    # Please note that the splash screen will be clipped to a circle on the center of the screen.<br>    # App icon with an icon background: This should be 960×960 pixels, and fit within a circle<br>    # 640 pixels in diameter.<br>    # App icon without an icon background: This should be 1152×1152 pixels, and fit within a circle<br>    # 768 pixels in diameter.<br>    #image: assets/android12splash.png<br><br>    # Splash screen background color.<br>    #color: &quot;#42a5f5&quot;<br><br>    # App icon background color.<br>    #icon_background_color: &quot;#111111&quot;<br><br>    # The branding property allows you to specify an image used as branding in the splash screen.<br>    #branding: assets/dart.png<br><br>    # The image_dark, color_dark, icon_background_color_dark, and branding_dark set values that<br>    # apply when the device is in dark mode. If they are not specified, the app will use the<br>    # parameters from above.<br>    #image_dark: assets/android12splash-invert.png<br>    #color_dark: &quot;#042a49&quot;<br>    #icon_background_color_dark: &quot;#eeeeee&quot;<br><br>  # The android, ios and web parameters can be used to disable generating a splash screen on a given<br>  # platform.<br>  #android: false<br>  #ios: false<br>  #web: false<br><br>  # Platform specific images can be specified with the following parameters, which will override<br>  # the respective image parameter.  You may specify all, selected, or none of these parameters:<br>  #image_android: assets/splash-android.png<br>  #image_dark_android: assets/splash-invert-android.png<br>  #image_ios: assets/splash-ios.png<br>  #image_dark_ios: assets/splash-invert-ios.png<br>  #image_web: assets/splash-web.png<br>  #image_dark_web: assets/splash-invert-web.png<br>  #background_image_android: &quot;assets/background-android.png&quot;<br>  #background_image_dark_android: &quot;assets/dark-background-android.png&quot;<br>  #background_image_ios: &quot;assets/background-ios.png&quot;<br>  #background_image_dark_ios: &quot;assets/dark-background-ios.png&quot;<br>  #background_image_web: &quot;assets/background-web.png&quot;<br>  #background_image_dark_web: &quot;assets/dark-background-web.png&quot;<br>  #branding_android: assets/brand-android.png<br>  #branding_dark_android: assets/dart_dark-android.png<br>  #branding_ios: assets/brand-ios.png<br>  #branding_dark_ios: assets/dart_dark-ios.png<br><br>  # The position of the splash image can be set with android_gravity, ios_content_mode, and<br>  # web_image_mode parameters.  All default to center.<br>  #<br>  # android_gravity can be one of the following Android Gravity (see<br>  # https://developer.android.com/reference/android/view/Gravity): bottom, center,<br>  # center_horizontal, center_vertical, clip_horizontal, clip_vertical, end, fill, fill_horizontal,<br>  # fill_vertical, left, right, start, or top.<br>  #android_gravity: center<br>  #<br>  # ios_content_mode can be one of the following iOS UIView.ContentMode (see<br>  # https://developer.apple.com/documentation/uikit/uiview/contentmode): scaleToFill,<br>  # scaleAspectFit, scaleAspectFill, center, top, bottom, left, right, topLeft, topRight,<br>  # bottomLeft, or bottomRight.<br>  #ios_content_mode: center<br>  #<br>  # web_image_mode can be one of the following modes: center, contain, stretch, and cover.<br>  #web_image_mode: center<br><br>  # The screen orientation can be set in Android with the android_screen_orientation parameter.<br>  # Valid parameters can be found here:<br>  # https://developer.android.com/guide/topics/manifest/activity-element#screen<br>  #android_screen_orientation: sensorLandscape<br><br>  # To hide the notification bar, use the fullscreen parameter.  Has no effect in web since web<br>  # has no notification bar.  Defaults to false.<br>  # NOTE: Unlike Android, iOS will not automatically show the notification bar when the app loads.<br>  #       To show the notification bar, add the following code to your Flutter app:<br>  #       WidgetsFlutterBinding.ensureInitialized();<br>  #       SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom, SystemUiOverlay.top]);<br>  #fullscreen: true<br><br>  # If you have changed the name(s) of your info.plist file(s), you can specify the filename(s)<br>  # with the info_plist_files parameter.  Remove only the # characters in the three lines below,<br>  # do not remove any spaces:<br>  #info_plist_files:<br>  #  - &#39;ios/Runner/Info-Debug.plist&#39;<br>  #  - &#39;ios/Runner/Info-Release.plist&#39;</pre><p>When you have finished the configuration you just need to run this command flutter pub run flutter_native_splash:create.</p><p>Someone made a video about it.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdB0dOnc2k10%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdB0dOnc2k10&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdB0dOnc2k10%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fa4bf8677186058a5c78a4a3977f0618/href">https://medium.com/media/fa4bf8677186058a5c78a4a3977f0618/href</a></iframe><h3>Dynamic Color</h3><p>Dynamic color experiences are built with M3 color schemes. Beginning with Android 12, users can generate individualized schemes through wallpaper selection and other customization settings. With M3 as a foundation, user-generated colors can coexist with app colors, putting a range of customizable visual experiences in the hands of users.</p><p>Material You works in dynamic color situations like Android 12 and soon Apple iOS devices by grabbing the dominant color from wallpaper and harmonizing it with brand colors.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fc1qCSu4SGss%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dc1qCSu4SGss&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fc1qCSu4SGss%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/be12191275675606970fbc507954530a/href">https://medium.com/media/be12191275675606970fbc507954530a/href</a></iframe><p>You can check the package <a href="https://pub.dev/packages/dynamic_color">here</a>.</p><h3>Android 12’s Overscroll Indicator</h3><p>Android 12 changed the overscroll indicator from a glow effect to a stretch effect. Therefore, we must update our app to behave appropriately when the default appearance or behaviors change between OS versions.</p><p>Flutter 3 introduces Material Design 3 integration which offers a lot of great features to take advantage of going forward, such as dynamic themes. You can use it by setting useMaterial3 to true in ThemeData.</p><pre>ThemeData(<br> useMaterial3: true,<br> …<br>)</pre><p>However, this can lead to a jarring theme transformation in your app, and will certainly affect your brand theming if you are not updating everything along with it. Plus, this will use Material Design 3 (and the stretch indicator) on all versions of Android, which isn’t really expected.</p><blockquote>You can also implement this overscroll with using another way. I have shared the medium article about it in the source part.</blockquote><p><a href="https://m3.material.io/develop/flutter">Material Design 3 for Flutter</a></p><blockquote>A video just so you don’t have to dream about it</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FUu5p2XCN-qw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DUu5p2XCN-qw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FUu5p2XCN-qw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/36d9ba774edecfe2202f6780c03aa0c4/href">https://medium.com/media/36d9ba774edecfe2202f6780c03aa0c4/href</a></iframe><blockquote>I wanted to write about them as I have experienced them so far. There is of course more. Maybe part 2 will come.</blockquote><p>Source</p><ul><li><a href="https://medium.com/geekculture/properly-implementing-android-12s-overscroll-indicator-in-flutter-a1f1a11ce249">Properly Implementing Android 12&#39;s Overscroll Indicator in Flutter</a></li><li><a href="https://developer.android.com/develop/ui/views/launch/splash-screen">Splash screens | Views | Android Developers</a></li><li><a href="https://en.wikipedia.org/wiki/Android_12">Android 12 - Wikipedia</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52b78d9fefdb" width="1" height="1" alt=""><hr><p><a href="https://blog.codimis.com/android-12-and-flutter-52b78d9fefdb">Android 12 and Flutter</a> was originally published in <a href="https://blog.codimis.com/">Codimis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Grpc with Dart (Quick Start 9 Steps)]]></title>
            <link>https://blog.codimis.com/grpc-with-dart-quick-start-9-steps-870caefe41f2?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/870caefe41f2</guid>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Wed, 17 Aug 2022 04:23:00 GMT</pubDate>
            <atom:updated>2024-03-22T11:09:06.870Z</atom:updated>
            <content:encoded><![CDATA[<p>We are all working with services. Are you tired of working with Rest? Also, do you not want to use any other language for server-side programming? What if I say there is a much faster tech we have? If you are excited, you are in the right post, I will mention about google’s framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*xtB-zaagRlt7I-GQR4gDaw.png" /></figure><h3>Let’s Start with What is Grpc?</h3><p>gRPC is a modern open-source high-performance Remote Procedure Call (RPC) framework that can run in any environment. It can efficiently connect services in and across data centers with pluggable support for load balancing, tracing, health checking, and authentication. It is also applicable in the last mile of distributed computing to connect devices, mobile applications, and browsers to backend services (Web site is <a href="https://grpc.io/">here</a>).</p><p><a href="https://medium.com/codimis/terminals-are-colorful-and-beautiful-with-powerlevel10k-624594a2cc6f">Terminals are Colorful and Beautiful with Powerlevel10k</a></p><h3>Supported languages</h3><p>Each gRPC language/platform has links to the following pages and more:</p><ul><li>Quick start</li><li>Tutorials</li><li>API reference</li></ul><p>Select a language to visit its website:</p><ul><li><a href="https://grpc.io/docs/languages/csharp/">C#</a></li><li><a href="https://grpc.io/docs/languages/cpp/">C++</a></li><li><a href="https://grpc.io/docs/languages/dart/">Dart</a></li><li><a href="https://grpc.io/docs/languages/go/">Go</a></li><li><a href="https://grpc.io/docs/languages/java/">Java</a></li><li><a href="https://grpc.io/docs/languages/kotlin/">Kotlin</a></li><li><a href="https://grpc.io/docs/languages/node/">Node</a></li><li><a href="https://grpc.io/docs/languages/objective-c/">Objective-C</a></li><li><a href="https://grpc.io/docs/languages/php/">PHP</a></li><li><a href="https://grpc.io/docs/languages/python/">Python</a></li><li><a href="https://grpc.io/docs/languages/ruby/">Ruby</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXRXTsQwyZSU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXRXTsQwyZSU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXRXTsQwyZSU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/64b993c88e89fa47d4e6c7f1c980f844/href">https://medium.com/media/64b993c88e89fa47d4e6c7f1c980f844/href</a></iframe><blockquote>Today we make some practice with using t<a href="https://grpc.io/docs/languages/dart/quickstart/">he quick start dart document </a>.</blockquote><p>1- Let’s start with download our example</p><p><a href="https://github.com/batttuh/Grpc-Dart-Example/archive/refs/heads/main.zip">Download the repo as a zip file</a> and unzip it, or clone the repo:</p><pre>git clone <a href="https://github.com/batttuh/Grpc-Dart-Example.git">https://github.com/batttuh/Grpc-Dart-Example.git</a></pre><p>2- Download package dependencies:</p><ul><li>$ dart pub get</li></ul><p>3- Let’s start with our dependencies when you click the pubspec.yaml you will see protobuf.</p><h3>What is Protobuf?</h3><p>Protocol buffers are Google’s language-neutral, platform-neutral, extensible mechanism for serializing structured data — think XML, but smaller, faster, and simpler. You define how you want your data to be structured once, then you can use special generated source code to easily write and read your structured data to and from a variety of data streams and using a variety of languages.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FuGYZn6xk-hA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DuGYZn6xk-hA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FuGYZn6xk-hA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cedb9b420790d7f03a1506637dd8ee3d/href">https://medium.com/media/cedb9b420790d7f03a1506637dd8ee3d/href</a></iframe><p>4- Start with looking at <a href="https://developers.google.com/protocol-buffers/docs/proto3">p</a>roto3 syntax, you can visit the website via <a href="https://developers.google.com/protocol-buffers/docs/proto3">this link</a>.</p><p>5- In the protos file you will see that helloworld.proto. This proto file includes our messages(that means our requests response messages) and we are using messages to build our service.</p><pre>// The request message containing the user’s name.</pre><pre>message HelloRequest {</pre><pre>string name = 1;</pre><pre>}</pre><pre>// The response message containing the greetings</pre><pre>message HelloReply {</pre><pre>string message = 1;</pre><pre>}</pre><p>6- We can write our service, it seems very easy.</p><pre><em>// The greeting service definition.<br></em><strong>service</strong> Greeter {<br>  <em>// Sends a greeting<br></em>  <strong>rpc</strong> SayHello (HelloRequest) <strong>returns</strong> (HelloReply) {}<br>  <em>// Sends another greeting<br></em>  <strong>rpc</strong> SayHelloAgain (HelloRequest) <strong>returns</strong> (HelloReply) {}<br>}</pre><p>SayHello takes HelloRequest and returns HelloReply, it is like request and response, am I right? You can even return an empty response too. Like using:</p><pre>message Empty{}<br>service Greeter{<br>  <strong>rpc</strong> SayHello (HelloRequest) <strong>returns</strong> (Empty) {}<br>}</pre><p>Or you can change it, take an empty message and return Hello Request. It is so basic.</p><p><a href="https://medium.com/codimis/terminal-productivity-booster-zsh-plugins-e8750ad1453d">Terminal Productivity Booster Zsh Plugins</a></p><p>7- If you change anything in the Proto file. You need to use protoc command because we need to recompile our updated proto file. You need to first <a href="https://github.com/protocolbuffers/protobuf#protocol-compiler-installation">download protocol buffers for using protoc command.</a></p><p>If you did not understand how to download it you can use this video.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FES_GI-lmhEU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DES_GI-lmhEU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FES_GI-lmhEU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a76023c2a9d303dc89e6677633f832f4/href">https://medium.com/media/a76023c2a9d303dc89e6677633f832f4/href</a></iframe><pre>protoc --dart_out=grpc:lib/src/generated -Iprotos protos/helloworld.proto</pre><p>8- We need to start with the server first, Open bin/server.dart</p><pre><strong>class</strong> <strong>GreeterService</strong> <strong>extends</strong> GreeterServiceBase {<br>  @override<br>  Future&lt;HelloReply&gt; sayHello(ServiceCall call, HelloRequest request) <strong>async</strong> {<br>    <strong>return</strong> HelloReply()..message = &#39;Hello, ${request.name}!&#39;;<br>  }<br><br>  @override<br>  Future&lt;HelloReply&gt; sayHelloAgain(ServiceCall call, HelloRequest request) <strong>async</strong> {<br>    <strong>return</strong> HelloReply()..message = &#39;Hello again, ${request.name}!&#39;;<br>  }<br>}</pre><p>In there we take GreeterServiceBase which comes from our protoc file when we compile it, we create files. You do not need to look at these files because it is so complicated. You just need to override our service functions which are coming fromGreeterServiceBase you can easily make this because our class alerts it.</p><p>9- Then we are starting with the Client Side we control our functions and we can use these service functions here.</p><pre>Future&lt;<strong>void</strong>&gt; main(List&lt;<strong>String</strong>&gt; args) <strong>async</strong> {<br>  <strong>final</strong> channel = ClientChannel(<br>    &#39;localhost&#39;,<br>    port: 50051,<br>    options: <strong>const</strong> ChannelOptions(credentials: ChannelCredentials.insecure()),<br>  );<br>  <strong>final</strong> stub = GreeterClient(channel);<br><br>  <strong>final</strong> name = args.isNotEmpty ? args[0] : &#39;world&#39;;<br><br>  <strong>try</strong> {<br>    <strong>var</strong> response = <strong>await</strong> stub.sayHello(HelloRequest()..name = name);<br>    print(&#39;Greeter client received: ${response.message}&#39;);<br>    response = <strong>await</strong> stub.sayHelloAgain(HelloRequest()..name = name);<br>    print(&#39;Greeter client received: ${response.message}&#39;);<br>  } <strong>catch</strong> (e) {<br>    print(&#39;Caught error: $e&#39;);<br>  }<br>  <strong>await</strong> channel.shutdown();<br>}</pre><p>If you are using any other server which is running on your PC, not on your mobile phone you just need to change <strong>“localhost”</strong> to <strong>“10.0.2.2”</strong>. This syntax may be complex. We can change a little bit. Let’s take connection in another function.</p><pre>ClientChannel createClient() {</pre><pre>return ClientChannel(</pre><pre>&#39;localhost&#39;,</pre><pre>port: 50051,</pre><pre>options: ChannelOptions(</pre><pre>credentials: ChannelCredentials.insecure(),</pre><pre>codecRegistry:CodecRegistry(codecs: const [GzipCodec(), IdentityCodec()]),),);</pre><pre>}</pre><p>Connect it in the main function and use another variable to make ClientConnection because when we finished using the channel we need to shut down it.</p><pre>Future&lt;void&gt; main(List&lt;String&gt; args) async {</pre><pre>final channel = createClient();</pre><pre>final stub = GreeterClient(channel);</pre><pre>final name = args.isNotEmpty ? args[0] : &#39;world&#39;;</pre><pre>try {</pre><pre>final response = await stub.sayHello(</pre><pre>HelloRequest()..name = name,</pre><pre>options: CallOptions(compression: const GzipCodec()),</pre><pre>);</pre><pre>print(&#39;Greeter client received: ${response.message}&#39;);</pre><pre>} catch (e) {</pre><pre>print(&#39;Caught error: $e&#39;);</pre><pre>}</pre><pre>await channel.shutdown();</pre><pre>}</pre><p>Full codes in here:</p><pre>import &#39;package:grpc/grpc.dart&#39;;</pre><pre>import &#39;package:helloworld/src/generated/helloworld.pbgrpc.dart&#39;;</pre><pre>import &#39;server.dart&#39;;</pre><pre>ClientChannel createClient() {</pre><pre>return ClientChannel(</pre><pre>&#39;localhost&#39;,</pre><pre>port: 50051,</pre><pre>options: ChannelOptions(</pre><pre>credentials: ChannelCredentials.insecure(),</pre><pre>codecRegistry:CodecRegistry(codecs: const [GzipCodec(), IdentityCodec()]),),);</pre><pre>}</pre><pre>Future&lt;void&gt; main(List&lt;String&gt; args) async {</pre><pre>final channel = createClient();</pre><pre>final stub = GreeterClient(channel);<br>//It is for taken value in the command linefinal name = args.isNotEmpty ? args[0] : &#39;world&#39;;</pre><pre>try {</pre><pre>var response = await stub.sayHello(</pre><pre>HelloRequest()..name = name,</pre><pre>options: CallOptions(compression: const GzipCodec()),);</pre><pre>print(&#39;Greeter client received: ${response.message}&#39;);</pre><pre>} catch (e) {</pre><pre>print(&#39;Caught error: $e&#39;);</pre><pre>}</pre><pre>await channel.shutdown();</pre><pre>}</pre><p>Now we can use another function which is sayHelloAgain.</p><pre><br>response=await stub.sayHelloAgain(HelloRequest(name: &#39;Batuhan&#39;));</pre><pre>print(&#39;Greeter client received: ${response.message}&#39;);</pre><p>You can easily use this but there is a different thing in here we do not use CallOptions, what is this CallOptions?</p><p>CallOptions can specify static metadata, set the timeout, and configure per-RPC metadata providers. The metadata providers are invoked in order for every RPC and can modify the outgoing metadata (including metadata provided by previous providers).</p><p><strong>THAT’S IT CONGRATULATIONS. YOU BUİLD CLİENT AND SERVER SERVİCE</strong></p><h3>TO RUN THE APP</h3><ol><li>Run the server:</li></ol><ul><li>$ dart bin/server.dart</li></ul><p>2. From another terminal, run the client. Add a name as a command-line argument:</p><ul><li>$ dart bin/client.dart Alice</li></ul><pre>Greeter client received: Hello, Alice!<br>Greeter client received: Hello again, Batuhan!</pre><h3><strong>If you know Turkish you can take a look at this</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FD2mP5vWtVL4%3Fstart%3D9%26feature%3Doembed%26start%3D9&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DD2mP5vWtVL4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FD2mP5vWtVL4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/764ccfa065929b82764e811e84a3f0d8/href">https://medium.com/media/764ccfa065929b82764e811e84a3f0d8/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWQNBqIjw0d8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWQNBqIjw0d8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWQNBqIjw0d8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a34cbad7c53e4a47afc63cd96707d79a/href">https://medium.com/media/a34cbad7c53e4a47afc63cd96707d79a/href</a></iframe><h3><strong>SOURCES</strong></h3><p><a href="https://grpc.io/">gRPC</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=870caefe41f2" width="1" height="1" alt=""><hr><p><a href="https://blog.codimis.com/grpc-with-dart-quick-start-9-steps-870caefe41f2">Grpc with Dart (Quick Start 9 Steps)</a> was originally published in <a href="https://blog.codimis.com/">Codimis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Dependency Injection? Dependency Injection in Flutter]]></title>
            <link>https://blog.codimis.com/what-is-dependency-injection-dependency-injection-in-flutter-1bd83e472240?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bd83e472240</guid>
            <category><![CDATA[dependency-injection]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[app-development]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Wed, 10 Aug 2022 07:56:53 GMT</pubDate>
            <atom:updated>2024-03-22T11:08:50.717Z</atom:updated>
            <content:encoded><![CDATA[<p>I have started to learn Spring Boot and there is one argument that caught my attention “IoC and Dependency Injection”. Then I asked myself “How can I handle ‘Dependency Injection’ in Dart? Is there any library for making Dependency Injection easy?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FOCq02DMj0rMqGlrdhx_PA.jpeg" /></figure><blockquote>First thing first let’s learn IoC and Dependency Injection.</blockquote><blockquote>Giving control to the container to <strong>create and inject instances of objects</strong> that your application depends on.In other words, instead of creating an object with the new operator, let the container do that for you. Inversion of control relies on dependency injection because a mechanism is needed in order to activate the components providing the specific functionality</blockquote><blockquote>Dependency injection is a pattern used to create instances of objects that other objects rely upon. This is accomplished without knowing at compile time which class is going to be used to provide the functionality. Instead, it is done by simply injecting properties into an object, a process called dependency injection.</blockquote><blockquote>What is difference between IoC and DI?</blockquote><p>IoC is a generic term meaning rather than having the application call the methods in a framework, the framework calls implementations provided by the application.</p><p><a href="https://medium.com/codimis/terminals-are-colorful-and-beautiful-with-powerlevel10k-624594a2cc6f">Terminals are Colorful and Beautiful with Powerlevel10k</a></p><p>DI is a form of IoC, where implementations are passed into an object through constructors/setters/service look-ups, which the object will ‘depend’ on in order to behave correctly.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FEPv9-cHEmQw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DEPv9-cHEmQw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FEPv9-cHEmQw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0aba8b3e9b86c5deb659b86b0469d282/href">https://medium.com/media/0aba8b3e9b86c5deb659b86b0469d282/href</a></iframe><blockquote>Why do we need to use DI?</blockquote><p>Dependency injection in Flutter is an object-oriented technique that sends the dependencies of another object to an object. The objective of the dependency injection strategy is to eliminate this dependency by isolating the use from the formation of the item.</p><p>This diminishes the measure of required standard code and further develops adaptability.</p><p>In dart, the most basic way to handle dependency injection is by passing services to a class through the constructor.</p><pre>class MyClass {</pre><pre>//MyClass is dependent on OtherClass<br>OtherClass service;</pre><pre>  MyClass(this.service)<br>}</pre><p>It’s easy to see why classes with many dependencies can get out of hand very fast.</p><blockquote>Libraries for Dependency Injection</blockquote><p>Although dependency injection is a simple example, libraries are frequently used to abstract it from the designer. Many of these libraries take advantage of reflection (mirrors in Dart). There are issues in a flutter, however:</p><ol><li>Mirrors are crippled for execution reasons.</li><li>The settled idea of widgets makes it unfeasible to pass conditions many levels down the tree.</li></ol><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvBT-FhgMaWM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvBT-FhgMaWM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvBT-FhgMaWM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/fed197172502e6f1a9689145c3a0554b/href">https://medium.com/media/fed197172502e6f1a9689145c3a0554b/href</a></iframe><h3>Injection Library</h3><blockquote>The injection library, on the other hand, can be used to solve similar issues. Annotations used by the injection library are listed below.</blockquote><blockquote><strong>@Injector</strong> — An inversion of control container developed from a bunch of modules.</blockquote><blockquote><strong>@provides and @module</strong> — Define classes and methods providing dependencies.</blockquote><blockquote><strong>@component</strong> — In performing an injection.</blockquote><blockquote><a href="https://github.com/google/inject.dart">https://github.com/google/inject.dart</a></blockquote><pre>@moduleclass <br>DripCoffeeModule {<br>@provide <br>@brandName <br>String provideBrand() =&gt; ‘Coffee by Dart Inc.’; <br>@provide <br>@modelName <br>String provideModel() =&gt; ‘DripCoffeeStandard’; <br>@provide <br>@asynchronous <br>Future&lt;PowerOutlet&gt; providePowerOutlet() async =&gt; new PowerOutlet(); @provide <br>@singleton <br>Electricity provideElectricity(PowerOutlet outlet) =&gt; new Electricity(outlet);<br>@provide <br>@asynchronous <br>Future&lt;Heater&gt; provideHeater(Electricity e) async =&gt; new ElectricHeater(e); <br>@provide <br>Pump providePump(Heater heater) =&gt; new Thermosiphon(heater);<br>}<br></pre><h3>flutter_simple_dependency_injection Library</h3><blockquote>This implementation <em>does not</em> rely on the dart reflection apis (mirrors) and favours a simple factory based approach. This increases the performance and simplicity of this implementation.</blockquote><blockquote>Support for multiple injectors (useful for unit testing or code running in isolates)</blockquote><blockquote>Support for types and named types</blockquote><blockquote>Support for singletons</blockquote><blockquote>Support simple values (useful for configuration parameters like api keys or urls)</blockquote><blockquote><a href="https://pub.dev/packages/flutter_simple_dependency_injection">https://pub.dev/packages/flutter_simple_dependency_injection</a></blockquote><pre><strong>import</strong> &#39;package:flutter_simple_dependency_injection/injector.dart&#39;;<br><br><strong>void</strong> main() {<br> <br>  <strong>final</strong> injector = ModuleContainer().initialise(Injector());<br><br>  injector.<strong>get</strong>&lt;SomeService&gt;().doSomething();<br><br><br>  <strong>final</strong> instances = injector.getAll&lt;SomeType&gt;();<br>  print(instances.length); <em>// prints &#39;3&#39;</em><br>  <strong>final</strong> instance =<br>      injector.<strong>get</strong>&lt;SomeOtherType&gt;(additionalParameters: {&quot;id&quot;: &quot;some-id&quot;});<br>  print(instance.id); <em>// prints &#39;some-id&#39;</em><br>}<br><br><strong>class</strong> <strong>ModuleContainer</strong> {<br>  Injector initialise(Injector injector) {<br>    injector.map&lt;Logger&gt;((i) =&gt; Logger(), isSingleton: <strong>true</strong>);<br>    injector.map&lt;String&gt;((i) =&gt; &quot;https://api.com/&quot;, key: &quot;apiUrl&quot;);<br>    injector.map&lt;SomeService&gt;(<br>        (i) =&gt; SomeService(i.<strong>get</strong>&lt;Logger&gt;(), i.<strong>get</strong>&lt;String&gt;(key: &quot;apiUrl&quot;)));<br><br>    <em>// note that you can configure mapping in a fluent programming style too</em><br>    injector.map&lt;SomeType&gt;((injector) =&gt; SomeType(&quot;0&quot;))<br>            ..map&lt;SomeType&gt;((injector) =&gt; SomeType(&quot;1&quot;), key: &quot;One&quot;)<br>            ..map&lt;SomeType&gt;((injector) =&gt; SomeType(&quot;2&quot;), key: &quot;Two&quot;);<br><br>    injector.mapWithParams&lt;SomeOtherType&gt;((i, p) =&gt; SomeOtherType(p[&quot;id&quot;]));<br><br>    <strong>return</strong> injector;<br>  }<br>}<br><strong>class</strong> <strong>Logger</strong> {<br>  <strong>void</strong> log(String message) =&gt; print(message);<br>}<br><br><strong>class</strong> <strong>SomeService</strong> {<br>  <strong>final</strong> Logger _logger;<br>  <strong>final</strong> String _apiUrl;<br><br>  SomeService(<strong>this</strong>._logger, <strong>this</strong>._apiUrl);<br><br>  <strong>void</strong> doSomething() {<br>    _logger.log(&quot;Doing something with the api at &#39;$_apiUrl&#39;&quot;);<br>  }<br>}<br><br><strong>class</strong> <strong>SomeType</strong> {<br>  <strong>final</strong> String id;<br>  SomeType(<strong>this</strong>.id);<br>}<br><br><strong>class</strong> <strong>SomeOtherType</strong> {<br>  <strong>final</strong> String id;<br>  SomeOtherType(<strong>this</strong>.id);<br>}</pre><p><a href="https://medium.com/codimis/terminal-productivity-booster-zsh-plugins-e8750ad1453d">Terminal Productivity Booster Zsh Plugins</a></p><h3>Injector Library</h3><blockquote>Injector is a simple dependency injection lib for Dart.</blockquote><blockquote>It does not replace a complex dependency injection framework like Dagger, but it provides the basics that most apps need. Feature requests are welcomed!</blockquote><blockquote>Internally the injector is a singleton that stores instances and builders in a Map.</blockquote><blockquote><a href="https://pub.dev/packages/injector">https://pub.dev/packages/injector</a></blockquote><pre><em>// Register a dependency (Every time a new instance)</em><br>injector.registerDependency&lt;Car&gt;(() {<br>      <strong>var</strong> engine = injector.<strong>get</strong>&lt;Engine&gt;();<br>      <strong>var</strong> fuel = injector.<strong>get</strong>&lt;Fuel&gt;();<br>      <strong>var</strong> driver = injector.<strong>get</strong>&lt;Driver&gt;();<br>      <br>      <strong>return</strong> CarImpl(engine,fuel,driver);<br>    });<br>    <br><em>// Register a singleton</em><br>injector.registerSingleton&lt;Car&gt;(() {<br>          <strong>var</strong> engine = injector.<strong>get</strong>&lt;Engine&gt;();<br>          <strong>var</strong> fuel = injector.<strong>get</strong>&lt;Fuel&gt;();<br>          <strong>var</strong> driver = injector.<strong>get</strong>&lt;Driver&gt;();<br>          <br>          <strong>return</strong> CarImpl(engine,fuel,driver);<br>        });<br>        <br> <em>// Use custom Factories by extending [Factory].</em><br> injector.register(CustomFactory(() =&gt; Engine()));<br>    <br><em>// Register your dependencies / singletons in the  __main.dart__ file</em></pre><h3>Kiwi Library</h3><blockquote>A simple yet efficient IoC container for Dart and Flutter.</blockquote><blockquote>The container does not rely on reflection, it’s just a Map, so it&#39;s fast.</blockquote><blockquote>IMPORTANT: Dart2 is required to use this package.</blockquote><blockquote>This package can be used with, or without code generation. While code generation allows you to code faster, it comes with additional configuration on your part (to be setup once). This section is only about Kiwi, which contains the IoC container and the annotations. If you are looking for the kiwi_generator configuration, you can find documentation <a href="https://github.com/vanlooverenkoen/kiwi/tree/master/kiwi_generator">here</a>.</blockquote><blockquote><a href="https://pub.dev/packages/kiwi">https://pub.dev/packages/kiwi</a></blockquote><pre><strong>class</strong> <strong>Service</strong> {}<br><br><strong>class</strong> <strong>ServiceA</strong> <strong>extends</strong> <strong>Service</strong> {}<br><br><strong>class</strong> <strong>ServiceB</strong> <strong>extends</strong> <strong>Service</strong> {<br>  ServiceB(ServiceA serviceA);<br>}<br>...<br><em>// Registers a complex factory by resolving the dependency</em><br><em>// when the type is resolved.</em><br>KiwiContainer container = KiwiContainer();<br>container.registerFactory((c) =&gt; ServiceB(c.resolve&lt;ServiceA&gt;()));</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F1CHicTngyZY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D1CHicTngyZY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F1CHicTngyZY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9f7311fc2b0e8f041230da696fb5212e/href">https://medium.com/media/9f7311fc2b0e8f041230da696fb5212e/href</a></iframe><h3>Flutter Modular Library</h3><blockquote>Modular proposes to solve two problems:</blockquote><blockquote>- Modularized routes.</blockquote><blockquote>- Modularized Dependency Injection.</blockquote><blockquote>In a monolithic architecture, where we have our entire application as a single module. However, producing a larger app in a “monolithic” way can generate technical debt in both maintenance and scalability. With this in mind, developers adopted architectural strategies to better divide the code, minimizing the negative impacts on the project’s maintainability and scalability.</blockquote><blockquote><a href="https://pub.dev/packages/flutter_modular">https://pub.dev/packages/flutter_modular</a></blockquote><blockquote>A module represents a set of Routes and Binds.</blockquote><blockquote>- ROUTE: Page setup eligible for navigation.</blockquote><blockquote>- BIND: Represents an object that will be available for injection to other dependencies.</blockquote><pre><strong>void main(){ <br>return runApp(ModularApp(module: AppModule(), <br>child: &lt;MainWidget&gt;));<br>} </strong></pre><pre><strong>class AppModule extends Module {<br>@override <br>List&lt;Bind&gt; get binds =&gt; [];<br> @override <br>List&lt;ModularRoute&gt; get routes =&gt; [];<br>}</strong></pre><h3>Sources</h3><ul><li><a href="https://www.linkedin.com/pulse/dependency-injection-flutter-zubair-rehman/">Dependency Injection In Flutter</a></li><li><a href="https://www.section.io/engineering-education/dependency-injection-in-flutter/">Dependency Injection in Flutter</a></li><li><a href="https://levelup.gitconnected.com/dependency-injection-in-dart-flutter-apps-3332f1a61041">Dependency Injection in Dart/Flutter Apps</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bd83e472240" width="1" height="1" alt=""><hr><p><a href="https://blog.codimis.com/what-is-dependency-injection-dependency-injection-in-flutter-1bd83e472240">What is Dependency Injection? Dependency Injection in Flutter</a> was originally published in <a href="https://blog.codimis.com/">Codimis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Performance Tips]]></title>
            <link>https://blog.codimis.com/flutter-performance-tips-f32093100b37?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/f32093100b37</guid>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-tips]]></category>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[flutter-performance]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 08:34:43 GMT</pubDate>
            <atom:updated>2024-03-22T09:44:29.963Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2apbDG4yOKEkcK4ZWdOEXg.png" /></figure><p>When I was building a new app, I realized I used every widget and built all the necessary functionalities, but I didn’t think about how my app would perform? Thus, I started searching for what I had to do to optimize the performance of my application and found one video.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FPKGguGUwSYE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DPKGguGUwSYE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FPKGguGUwSYE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c1b8259a89ff7c4e210a8da7f53a8ee/href">https://medium.com/media/0c1b8259a89ff7c4e210a8da7f53a8ee/href</a></iframe><p>I have finally found everything about the performance. In addition to that, the document contains some tips about best practices of flutter apps on the flutter main page (the link is <a href="https://docs.flutter.dev/perf/best-practices">here</a>).</p><p><a href="https://medium.com/codimis/terminals-are-colorful-and-beautiful-with-powerlevel10k-624594a2cc6f">Terminals are Colorful and Beautiful with Powerlevel10k</a></p><p>I will explain some tools you can use with your app and provide instructions on how to use them. Have a great read.</p><p><strong>DO NOT WORRY GUYS, THE FLUTTER AND DART TEAMS MADE PERFECT OPTIMIZATION FOR US</strong></p><ul><li>Flutter aims to provide 60 frames per second (fps) performance or 120 fps performance on devices capable of 120Hz updates.</li><li>For 60fps, frames need to render approximately every 16ms.</li><li>Every day with new updates flutter changes itself and improves performance</li></ul><p><strong>WHAT ARE THE TOOLS THAT WE NEED FOR INCREASING APP PERFORMANCE?</strong></p><blockquote>Performance View: The performance view offers timing and performance information for activity in your application. It consists of three parts, each increasing in granularity.</blockquote><blockquote>— Flutter frames chart (Flutter apps only)</blockquote><blockquote>— Timeline events chart</blockquote><blockquote>— CPU profiler</blockquote><blockquote>— It comes complex but we need to start to learn. You can learn it from <a href="https://docs.flutter.dev/development/tools/devtools/performance">here</a>.</blockquote><blockquote>Benchmarking: You can measure and track your app’s performance by writing benchmark tests. The Flutter Driver library provides support for benchmarking. Using this integration test framework, you can generate metrics to track the following:</blockquote><blockquote>— Jank</blockquote><blockquote>— Download size</blockquote><blockquote>— Battery efficiency</blockquote><blockquote>— Startup time</blockquote><blockquote><a href="https://www2.logrocket.com/signup-awr">LogRocket</a>: Frontend application monitoring solution that lets you replay problems as if they happened in your own browser. Instead of guessing why errors happen, or asking users for screenshots and log dumps, LogRocket lets you replay the session to quickly understand what went wrong. It works perfectly with any app, regardless of framework, and has plugins to log additional context from Redux, Vuex, and @ngrx/store.</blockquote><blockquote>The Flutter plugin for your IDE might be useful. In the Flutter Performance window, enable the <strong>Show widget rebuild information</strong> check box. This feature helps you detect when frames are being rendered and displayed in more than 16ms. Where possible, the plugin provides a link to a relevant tip.</blockquote><h3><strong>Which components are expensive?</strong></h3><ul><li>Minimizing calls to saveLayer</li><li>Avoid overly large single widgets with a large build() function. Split them into different widgets based on encapsulation</li><li>Minimize the use of opacity and clipping</li><li>Implement grids and lists thoughtfully when building a large grid or list, use the lazy builder methods</li><li>Minimize layout passes caused by intrinsic operations</li></ul><p><a href="https://medium.com/codimis/terminal-productivity-booster-zsh-plugins-e8750ad1453d">Terminal Productivity Booster Zsh Plugins</a></p><p>If your frames are rendering well under 16ms total in <a href="https://docs.flutter.dev/testing/build-modes#profile">profile mode</a>, you likely don’t have to worry about performance even if some performance pitfalls apply. However, you should still aim to build and render a frame as fast as possible. Why?</p><ul><li>Lowering the frame render time below 16ms might not make a visual difference, but it <strong>improves battery life</strong> and thermal issues.</li><li>It might run fine on your device, but consider performance for the lowest device you are targeting.</li><li>As 120fps devices become more widely available, you’ll want to render frames in under 8ms (total) in order to provide the smoothest experience.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSQcmrl_NkqY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSQcmrl_NkqY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSQcmrl_NkqY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/899805ef64ef1a975ffdacc4ed6fa6db/href">https://medium.com/media/899805ef64ef1a975ffdacc4ed6fa6db/href</a></iframe><h3>Let’s Make It Easy</h3><ul><li>Make use of constant widgets</li><li>Avoid re-building widgets</li><li>Make use of async/await</li><li>Efficiently use operators</li><li>Make use of interpolation techniques: The process of inserting variable values into placeholders in a string literal.</li></ul><blockquote>print(‘The word $text has ${text.length} letters’);</blockquote><ul><li>ProGuard and keep rules: ProGuard is <strong>a tool to help minify, obfuscate, and optimize your code</strong>. It is not only especially useful for reducing the overall size of your Android application as well as removing unused classes and methods that contribute toward the intrinsic 64k method limit of Android applications.</li></ul><h3>My Previous Post</h3><p><a href="https://medium.com/codimis/what-is-flutter-widget-5b25a636193">What is Flutter Widget?</a></p><h4>SOURCES</h4><ul><li><a href="https://medium.com/@swav.kulinski/flutter-and-android-obfuscation-8768ac544421">Flutter and Android obfuscation</a></li><li><a href="https://www.educative.io/answers/what-is-string-interpolation-in-dart">What is string interpolation in Dart?</a></li><li><a href="https://blog.codemagic.io/how-to-improve-the-performance-of-your-flutter-app./">How to improve the performance of your Flutter app | Codemagic Blog</a></li><li><a href="https://blog.logrocket.com/performance-improvements-mobile-apps-flutter/#load-list-items-efficiently">Performance improvements for mobile apps in Flutter - LogRocket Blog</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f32093100b37" width="1" height="1" alt=""><hr><p><a href="https://blog.codimis.com/flutter-performance-tips-f32093100b37">Flutter Performance Tips</a> was originally published in <a href="https://blog.codimis.com/">Codimis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Flutter Widget?]]></title>
            <link>https://blog.codimis.com/what-is-flutter-widget-5b25a636193?source=rss-3e9c53770511------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b25a636193</guid>
            <category><![CDATA[flutter-widget]]></category>
            <category><![CDATA[widgetkit]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[flutter-ui]]></category>
            <category><![CDATA[widget]]></category>
            <dc:creator><![CDATA[Batuhan Sahin]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 05:56:58 GMT</pubDate>
            <atom:updated>2024-03-22T09:43:09.796Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*GQ3zQ1uln6vVTGB_5VKKHg.jpeg" /></figure><p>As this is my first Medium post, please don’t be harsh with me. Here we go… Are you saying what the widget is? Yes, you are in the right place. Everyone told us when we were learning flutter that everything is a widget. When we looked at the Flutter document (you can visit it <a href="https://docs.flutter.dev/development/ui/widgets-intro"><em>here</em></a>). It says that we can create our User Interface by using widgets. There are also a lot of widgets in the Flutter, I’m not even sure how many there are. If you want to provide the statement “everything is a widget” you can look at the class extends and you can click them with the ctrl+left click. You will see that at the end of the class inheritance you will see Widget. Let’s start with common questions.</p><p><a href="https://medium.com/codimis/terminal-productivity-booster-zsh-plugins-e8750ad1453d">Terminal Productivity Booster Zsh Plugins</a></p><h3><strong><em>What is the widget?</em></strong></h3><p>Everything, every building is designed as widgets in the Flutter. In the doc, they say that they take inspiration from React(You can visit it <a href="https://reactjs.org/"><em>here</em></a>) (this is additional information :D). Widgets describe what their view should look like given their current configuration and state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d0V-N_hq-biPhJN9KgsKXg.jpeg" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FFU2Eeizo95o%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DFU2Eeizo95o&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FFU2Eeizo95o%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c63961d57011a4d68393ec38d3fd1fe8/href">https://medium.com/media/c63961d57011a4d68393ec38d3fd1fe8/href</a></iframe><h3><strong><em>So How many types of widgets do we have?</em></strong></h3><p>Some people think that we have 2 or 3 widgets type but it is not correct guys.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*72Pt5eo6PC645VsFOmsHBQ.png" /></figure><p>You see that there is a more than 2 types of the main widget categories we have. Let&#39;s start with explain the first one</p><p><a href="https://medium.com/codimis/terminals-are-colorful-and-beautiful-with-powerlevel10k-624594a2cc6f">Terminals are Colorful and Beautiful with Powerlevel10k</a></p><ul><li><strong>StatelessWidget</strong>: In Flutter, this class is designed for widgets that run once when the screen is first created and stay there permanently.</li><li><strong>StatefulWidget</strong>: It has a mutable state and we can create it for changing during the lifetime of the widget. We need to inform it if we had changed some value by using setState.</li><li><strong>ProxyWidget</strong>: A widget that has a child widget provided to it, instead of building a new widget.</li><li><strong>InheritedWidget</strong>: the base class that allows those classes to extend the information under the tree from it.</li><li><strong>ParentDataWidget</strong>: Base class for widgets that hook ParentData information to children of RenderObjectWidgets. For example, stack uses the positioned parent data widget to position each child.</li><li><strong>RenderObjectWidget</strong>: Responsible for controlling the sizes, layouts, and logic used for painting widgets to the screen and forming the UI for the application.</li><li><strong>LeafRenderObjectWidget<em>: </em></strong>A superclass for RenderObjectWidgets that configure RenderObject subclasses that have no children.</li><li><strong>SingleChildRenderObjectWidget<em>: </em></strong>A superclass for RenderObjectWidgets that configure RenderObject subclasses that have a single child slot.</li><li><strong>MultiChildRenderObjectWidget<em>: </em></strong>A superclass for <a href="https://api.flutter.dev/flutter/widgets/RenderObjectWidget-class.html">RenderObjectWidget</a>s that configure <a href="https://api.flutter.dev/flutter/rendering/RenderObject-class.html">RenderObject</a> subclasses that have a single list of children. (This superclass only provides the storage for that child list, it doesn’t actually provide the updating logic.)</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F7rXDaNAAeak%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D7rXDaNAAeak&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F7rXDaNAAeak%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/812c85bcc1eecaf6ba1fb96dbcd7194f/href">https://medium.com/media/812c85bcc1eecaf6ba1fb96dbcd7194f/href</a></iframe><p><strong><em>10 widgets you better know</em></strong></p><ul><li><strong>SafeArea</strong>: Our widgets can avoid being not to be seen by using SafeArea. It gives us clean layouts.</li><li><strong>WrapWidget</strong>: If there is not enough space on the screen we can use Wrap and it fits on the screen. Also, we can control direction.</li><li><strong>RichText</strong>: We can modify our text by using TextSpan in RichText’s text property.</li><li><strong>ClipRRect</strong>: We can wrap the image and make it Rectangle</li><li><strong>MediaQuery</strong>: we can see that device’s width height and other props by using it.</li></ul><blockquote>MediaQuery.of(context).size.width</blockquote><blockquote>MediaQuery.of(context).orientation</blockquote><ul><li><strong>FutureBuilder</strong>: help you to execute some asynchronous function and based on that function’s result your UI will update.</li><li><strong>Flexible</strong>: Make our UI to responsible. It uses with flex attribute and we can divide the screen pieces by using flex.</li><li><strong>SizeBox</strong>: We can use width and height for controlling child width and height.</li><li><strong>Align</strong>: The widget that is used to align its child within itself and optionally sizes itself based on the child’s size.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FhLLz_yzLWcU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DhLLz_yzLWcU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FhLLz_yzLWcU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/4ab21505887b70eb1fd3d70bad10d93f/href">https://medium.com/media/4ab21505887b70eb1fd3d70bad10d93f/href</a></iframe><h3>Sources</h3><p><a href="https://api.flutter.dev/index.html">Flutter - Dart API docs</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b25a636193" width="1" height="1" alt=""><hr><p><a href="https://blog.codimis.com/what-is-flutter-widget-5b25a636193">What is Flutter Widget?</a> was originally published in <a href="https://blog.codimis.com/">Codimis</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>