<?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 Walnut Software on Medium]]></title>
        <description><![CDATA[Stories by Walnut Software on Medium]]></description>
        <link>https://medium.com/@walnutistanbul?source=rss-b3874f1e56c4------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*d8zdO94jdzSmBgzXVFztlA.png</url>
            <title>Stories by Walnut Software on Medium</title>
            <link>https://medium.com/@walnutistanbul?source=rss-b3874f1e56c4------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 21:18:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@walnutistanbul/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 to Create Custom Switch Button in Flutter]]></title>
            <link>https://walnutistanbul.medium.com/how-to-create-custom-switch-button-in-flutter-23c85105f0e8?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/23c85105f0e8</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Sat, 30 Mar 2024 08:33:49 GMT</pubDate>
            <atom:updated>2024-03-30T08:33:49.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*YAwi8HgOlbhGzAI2fnoOdQ.jpeg" /></figure><p>Flutter’s materials include a switch button; however, sometimes this button may not be sufficient for your needs. Therefore, in this article, I will show you how to create your own switch button and how to use it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*IXCiV3jT6yVmlvk8ceOZhA.gif" /></figure><h3>Creating a Switch Button</h3><p><strong>●Step 1 Setting Up the Project:</strong></p><p>Open a new terminal. Navigate to the directory where you want to create a new Flutter project using terminal commands. Then, use the following command to create a new Flutter project:</p><pre>flutter create example_project</pre><p>You can replace “example_project” with the name of the project you want to create. In my case project name is <strong><em>flutter_switch_button</em></strong>.</p><p><strong>● Step 2:</strong> Add the code below to the main.dart file (located in the lib folder).</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_switch_button/custom_switch_button.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: CustomSwitch(),<br>    );<br>  }<br>}</pre><p><strong>● Step 3:</strong> Create a custom_switch_button.dart file inside the lib folder and add the following code to it.</p><pre>import &#39;package:flutter/material.dart&#39;;<br><br>class CustomSwitch extends StatefulWidget {<br>  final bool value;<br>  final ValueChanged&lt;bool&gt; onChanged;<br><br>  CustomSwitch({Key? key, required this.value, required this.onChanged})<br>      : super(key: key);<br><br>  @override<br>  _CustomSwitchState createState() =&gt; _CustomSwitchState();<br>}<br><br>class _CustomSwitchState extends State&lt;CustomSwitch&gt;<br>    with SingleTickerProviderStateMixin {<br>  late AnimationController _animationController;<br>  late Animation&lt;Alignment&gt; _circleAnimation;<br>  bool isFirstCircleVisible = false;<br><br>  @override<br>  void initState() {<br>    super.initState();<br>    _animationController =<br>        AnimationController(vsync: this, duration: Duration(milliseconds: 300));<br>    _circleAnimation = AlignmentTween(<br>      begin: widget.value ? Alignment.centerRight : Alignment.centerLeft,<br>      end: widget.value ? Alignment.centerLeft : Alignment.centerRight,<br>    ).animate(CurvedAnimation(<br>      parent: _animationController,<br>      curve: Curves.easeInOut,<br>    ));<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return GestureDetector(<br>      onTap: () {<br>        if (_animationController.isCompleted) {<br>          _animationController.reverse();<br>        } else {<br>          _animationController.forward();<br>        }<br>        widget.onChanged(!widget.value);<br>        setState(() {<br>          isFirstCircleVisible = !isFirstCircleVisible;<br>        });<br>      },<br>      child: Container(<br>        width: 80.0,<br>        height: 46.0,<br>        decoration: BoxDecoration(<br>          borderRadius: BorderRadius.circular(30),<br>          color: Colors.white,<br>        ),<br>        child: Stack(<br>          children: [<br>            Align(<br>              alignment: _circleAnimation.value,<br>              child: Container(<br>                  alignment: widget.value<br>                      ? ((Directionality.of(context) == TextDirection.rtl)<br>                          ? Alignment.centerLeft<br>                          : Alignment.centerRight)<br>                      : ((Directionality.of(context) == TextDirection.rtl)<br>                          ? Alignment.centerRight<br>                          : Alignment.centerLeft),<br>                  child: Container(<br>                    width: 40.0,<br>                    height: 40.0,<br>                    decoration: BoxDecoration(<br>                      color: widget.value ? Colors.green:Colors.pink,<br>                      shape: BoxShape.circle,<br>                    ),<br>                  )<br>                ),<br>              <br>            ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br><br>  @override<br>  void dispose() {<br>    _animationController.dispose();<br>    super.dispose();<br>  }<br>}<br></pre><h4>Code Explanation</h4><ol><li><strong>CustomSwitch Class:</strong> Define a new StatefulWidget called CustomSwitch. It takes two required parameters, value (a boolean indicating the current state of the switch) and onChanged (a callback function that will be called when the switch state changes).</li><li><strong>_CustomSwitchState Class:</strong> Create the state class _CustomSwitchState for the CustomSwitch widget.</li><li><strong>Animation Setup:</strong> Initialize an AnimationController and an Animation to control the animation of the switch. The animation is an alignment animation that controls the position of a circle within the switch. isFirstCircleVisible is a boolean variable to track the visibility of the first circle.</li><li><strong>InitState Method:</strong> Override the initState method to initialize the animation controller and set up the animation with appropriate values based on the initial state of the switch.</li><li><strong>Build Method:</strong> Override the build method to create the widget tree. It returns a GestureDetector that responds to taps. When tapped, it triggers the animation controller to either forward or reverse the animation, calls the onChanged callback, and updates the visibility of the first circle.</li><li><strong>Container Structure:</strong> The main visual representation of the switch is contained within a Container. It has a white background, rounded corners, and a fixed size.</li><li><strong>Stack and Align Widgets:</strong> Use a Stack widget to overlay two containers representing the switch&#39;s on and off states. The position of the circle is controlled by the Align widget using the animation values.</li><li><strong>Circle Decoration:</strong> The circle has a dynamic color based on the visibility of the first circle (isFirstCircleVisible). It is either green or red.</li><li><strong>Dispose Method:</strong> Override the dispose method to properly dispose of the animation controller when the widget is no longer needed, preventing memory leaks.</li></ol><h4>Usage</h4><p>The code example below demonstrates how to use a switch button we created.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_switch_button/custom_switch_button.dart&#39;;<br><br>class MyWidget extends StatefulWidget {<br>  const MyWidget({super.key});<br>  @override<br>  State&lt;MyWidget&gt; createState() =&gt; _MyWidgetState();<br>}<br>class _MyWidgetState extends State&lt;MyWidget&gt; {<br>  bool _enable = false;<br>  @override<br>  Widget build(BuildContext context) {<br>    return Center(<br>      child: CustomSwitch(<br>        value: _enable,<br>        onChanged: (bool val){<br>          setState(() {<br>            _enable = val;<br>          });<br>        },<br>      ),<br>    );<br>  }<br>}</pre><h4>Example</h4><p>Instead of using the ‘container,’ you can use ‘icon’ as an example.</p><pre>child: Image.asset(<br>  isFirstCircleVisible<br>      ? &#39;assets/icons/switch_button_green.png&#39;<br>      : &#39;assets/icons/switch_button_pink.png&#39;,<br>  height: 50,<br>  width: 50,<br>),</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*QZYio0D72T6yJLo91OEOkw.gif" /></figure><p><strong>Happy Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23c85105f0e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Upload Multiple Images in Flutter and Laravel 10]]></title>
            <link>https://walnutistanbul.medium.com/how-to-upload-multiple-images-in-flutter-and-laravel-10-07f9520ad842?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/07f9520ad842</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Tue, 19 Dec 2023 09:05:13 GMT</pubDate>
            <atom:updated>2023-12-19T09:05:13.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*y_Xj2PLsRQ75e0buLqVBEg.png" /></figure><p>In this article, I will explain how you can create a Laravel API that allows you to create a product and allows this product to receive multiple images. I will also show how to upload products and images from a Flutter application using the endpoint with the post method created in Laravel.</p><p><strong>📌 Attention</strong>: This article assumes that you’ve already set up the project and have some knowledge of Laravel.</p><p>👉 For more basic guides, you can check out detailed articles I’ve written separately for Flutter and Laravel at the following links.</p><p><strong>Laravel: </strong>🔗 <a href="https://walnutistanbul.medium.com/how-to-upload-multiple-images-in-laravel-10-bafadb76d915">How to Upload Multiple Images in Laravel 10</a></p><p><strong>Flutter: </strong>🔗 <a href="https://medium.com/@walnutistanbul/how-to-upload-multiple-images-in-flutter-using-api-laravel-6ccc1eace318">How to Upload Multiple Images in Flutter using Api(Laravel)</a></p><h3>Migration</h3><p>First, make sure that you have created two different tables in your migration file because, in the later stages, keeping all the data in a single table will cause you problems when you want to add or delete images. Here is an example of a migration.</p><pre>Schema::create(&#39;products&#39;, function (Blueprint $table) {<br>    $table-&gt;id();<br>    $table-&gt;string(&#39;name&#39;);<br>    $table-&gt;decimal(&#39;price&#39;, 10, 2);<br>    $table-&gt;text(&#39;description&#39;);<br>    $table-&gt;timestamps();<br>});<br>Schema::create(&#39;product_images&#39;, function (Blueprint $table) {<br>    $table-&gt;id();<br>    $table-&gt;string(&#39;url&#39;);<br>    $table-&gt;timestamps();<br><br>    $table-&gt;foreign(&#39;product_image_id&#39;)-&gt;references(&#39;id&#39;)-&gt;on(&#39;products&#39;);<br>});</pre><p><strong>● </strong>We used foreign keys to define the relationship between the tables.</p><p>✅ To apply the changes you made in your migration file to the database, run the following command.</p><pre>php artisan migrate</pre><h3>Models</h3><p>Now, we will create the models and establish relationships between them.</p><h4>Product Model</h4><pre>class Product extends Model<br>{<br>    use HasFactory;<br>    protected $fillable = [&#39;name&#39;, &#39;price&#39;, &#39;description&#39;];<br><br>    public function images()<br>    {<br>        return $this-&gt;hasMany(ProductImage::class);<br>    }<br>}</pre><p><strong>● </strong>hasMany indicates that a product can have many images.</p><h4>ProductImage Model</h4><pre>class ProductImage extends Model<br>{<br>    use HasFactory;<br><br>    protected $fillable = [&#39;url&#39;,&#39;product_id&#39;];<br><br>    public function product()<br>    {<br>        return $this-&gt;belongsTo(Product::class);<br>    }<br>}</pre><p><strong>● </strong>belongsTo specifies that the images belong to a product.</p><h4>Controller</h4><p>Create a ProductController and add this function to it.</p><pre>public function createProduct(Request $request)<br>{<br>    try {<br>        $request-&gt;validate([<br>            &#39;name&#39; =&gt; &#39;required|string&#39;,<br>            &#39;price&#39; =&gt; &#39;required|numeric&#39;,<br>            &#39;description&#39; =&gt; &#39;required|string&#39;,<br>            &#39;images&#39; =&gt; &#39;required|array&#39;,<br>            &#39;images.*&#39; =&gt; &#39;image|mimes:jpeg,png,jpg,gif|max:2048&#39;,<br>        ]);<br><br>        $product = new Product();<br>        $product-&gt;name = $request-&gt;name;<br>        $product-&gt;price = $request-&gt;price;<br>        $product-&gt;description = $request-&gt;description;<br>        $product-&gt;save();<br><br>        $imageUrls = [];<br><br>        if ($request-&gt;hasFile(&#39;images&#39;)) {<br>            foreach ($request-&gt;file(&#39;images&#39;) as $image) {<br>                $filename = $image-&gt;store(&#39;posts&#39;, &#39;public&#39;);<br><br>                $productImage = new ProductImage();<br>                $productImage-&gt;product_image_id = $product-&gt;id;<br>                $productImage-&gt;url = $filename;<br>                $productImage-&gt;save();<br><br>                $imageUrls[] = $filename;<br>            }<br>        }<br>        return response()-&gt;json([&#39;success&#39; =&gt; true, &#39;message&#39; =&gt; &#39;Prodcut Created Successfully&#39;, &#39;image_urls&#39; =&gt; $imageUrls], 200);<br>    } catch (\Exception $e) {<br>        return response()-&gt;json([&#39;error&#39; =&gt; &#39;An error occurred while creating product: &#39; . $e-&gt;getMessage()], 400);<br>    }<br>}</pre><p><strong>● </strong>This code first populates the “products” table with the data from the request, then it saves each image found in the “images” array to the “posts” folder. It also populates the “product_images” table by recording the image paths in the “url” column and the product’s ID in the “product_image_id” column. This way, you can retrieve both the product information and the image URLs associated with the product using the product’s ID.</p><h3>Routes</h3><p>Add the following route to the api.php file. This route allows you to post products and images using the &quot;/create&quot; path.</p><pre>Route::post(&#39;/create&#39;, [ProductController::class,&#39;createProduct&#39;]);</pre><p><strong>⚠️ Warning: </strong>An emulator cannot access addresses on localhost. To use endpoints in an emulator, you need to start your server using your IP address. If you don’t know your IP address, open the terminal and enter “ipconfig,” then copy your IPv4 address. The example command below demonstrates how to start your server using your IP address, for instance, on port 8000.</p><pre>php artisan serve --host=192.168.1.2 --port=8000</pre><h3>Flutter</h3><p>You need the <a href="https://pub.dev/packages/http/install">http</a> and <a href="https://pub.dev/packages/image_picker/install">image_picker</a> packages, and to facilitate displaying alerts in a Snackbar, you should also install the <a href="https://pub.dev/packages/get/install">get</a> package. After adding these packages to your pubspec.yaml file, include the following code in a Dart file and implement navigation to this screen.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br>import &#39;package:image_picker/image_picker.dart&#39;;<br>import &#39;dart:io&#39;;<br>import &#39;package:http/http.dart&#39; as http;<br><br>class AdminScreen extends StatelessWidget {<br>  final TextEditingController nameController = TextEditingController();<br>  final TextEditingController priceController = TextEditingController();<br>  final TextEditingController descriptionController = TextEditingController();<br>  final List&lt;File&gt; selectedImages = [];<br><br>  Future&lt;void&gt; addImages() async {<br>    final picker = ImagePicker();<br>    final List&lt;XFile&gt; images = await picker.pickMultiImage(<br>      maxWidth: 800, // can be customized<br>      maxHeight: 600, // can be customized<br>    );<br>    <br>    if (images != null) {<br>      for (XFile image in images) {<br>        selectedImages.add(File(image.path));<br>      }<br>    }<br>  }<br><br>  void createProduct() async {<br>    try {<br>      final String apiUrl = &#39;http://192.168.1.2:8000/api/create&#39;;<br>      final Map&lt;String, String&gt; headers = {&#39;Content-Type&#39;: &#39;multipart/form-data&#39;};<br><br>      final request = http.MultipartRequest(&#39;POST&#39;, Uri.parse(apiUrl));<br><br>      request.fields[&#39;name&#39;] = nameController.text;<br>      request.fields[&#39;price&#39;] = priceController.text;<br>      request.fields[&#39;description&#39;] = descriptionController.text;<br><br>      for (File image in selectedImages) {<br>        request.files.add(await http.MultipartFile.fromPath(<br>          &#39;images[]&#39;,<br>          image.path,<br>        ));<br>      }<br><br>      final response = await request.send();<br>      if (response.statusCode == 200) {<br>        Get.snackbar(&#39;Success&#39;, &#39;Product Successfully Created&#39;);<br>        nameController.clear();<br>        priceController.clear();<br>        descriptionController.clear();<br>        selectedImages.clear();<br>      } else {<br>        Get.snackbar(&#39;Error&#39;, &#39;Product Creation Failed&#39;);<br>      }<br>    } catch (e) {<br>      Get.snackbar(&#39;Error&#39;, &#39;Something went wrong: $e&#39;);<br>    }<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: Text(&#39;Create Porduct&#39;),<br>      ),<br>      body: Padding(<br>        padding: EdgeInsets.all(16.0),<br>        child: Column(<br>          children: [<br>            TextField(<br>              controller: nameController,<br>              decoration: InputDecoration(labelText: &#39;Product Name&#39;),<br>            ),<br>            TextField(<br>              controller: priceController,<br>              decoration: InputDecoration(labelText: &#39;Price&#39;),<br>            ),<br>            TextField(<br>              controller: descriptionController,<br>              decoration: InputDecoration(labelText: &#39;Description&#39;),<br>            ),<br>            ElevatedButton(<br>              onPressed: addImages,<br>              child: Text(&#39;Add Image&#39;),<br>            ),<br>            ElevatedButton(<br>              onPressed: createProduct,<br>              child: Text(&#39;Create Product&#39;),<br>            ),<br>            Column(<br>              children: selectedImages<br>                  .map((image) =&gt; Image.file(image))<br>                  .toList(),<br>            ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><h3>Code Explained</h3><p><strong>Ⅰ-Import Statements:</strong></p><ul><li>The code starts with import statements that bring in necessary packages and libraries for the Flutter application, including Material Design widgets, Get for state management, image_picker for selecting images, and http for making HTTP requests.</li></ul><p><strong>Ⅱ-Class Definition:</strong></p><ul><li>The AdminScreen class is defined, which extends StatelessWidget. This class represents the screen for creating a product.</li></ul><p><strong>Ⅲ-Text Editing Controllers:</strong></p><ul><li>Text editing controllers are created for three input fields: name, price, and description. These controllers will be used to retrieve the user’s input from the text fields.</li></ul><p><strong>Ⅳ-List for Selected Images:</strong></p><ul><li>A list named selectedImages is created to store the selected image files. It&#39;s initially an empty list.</li></ul><p><strong>Ⅴ-</strong><strong>addImages Function:</strong></p><ul><li>This asynchronous function is used for adding images to the selectedImages list. It utilizes the image_picker package to allow the user to select multiple images. The selected images are then added to the selectedImages list as File objects.</li></ul><p><strong>Ⅵ-</strong><strong>createProduct Function:</strong></p><ul><li>This function is responsible for creating a new product by sending a POST request to a specified API endpoint. It uses the http package to make the request.</li><li>It constructs a MultipartRequest and adds the product details (name, price, description) as fields.</li><li>It iterates through the selectedImages list and adds each image as a part of the request.</li><li>It sends the request and checks the response’s status code. If the response status code is 200 (indicating success), a success message is displayed using Get.snackbar, and the input fields and selected images are cleared. If the status code is not 200, an error message is displayed.</li></ul><p><strong>Ⅶ-</strong><strong>build Method:</strong></p><ul><li>The build method is implemented to define the UI of the screen. It returns a Scaffold widget with an AppBar and a Column containing various form fields and buttons.</li><li>Inside the Column, there are TextField widgets for entering the product name, price, and description. Two ElevatedButton widgets are provided to add images and create the product.</li><li>The selected images are displayed as Image widgets in a Column.</li></ul><p>📝 <strong>Summary:</strong></p><p>This code represents a Flutter screen that allows users to input product details, select images, and create a product by sending the data to a server via an HTTP POST request. The user is provided with feedback messages through snackbar notifications based on the response from the server.</p><p><strong>Good Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07f9520ad842" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Upload Multiple Images in Flutter using Api(Laravel)]]></title>
            <link>https://walnutistanbul.medium.com/how-to-upload-multiple-images-in-flutter-using-api-laravel-6ccc1eace318?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ccc1eace318</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[dart]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 14:20:22 GMT</pubDate>
            <atom:updated>2023-12-06T14:20:22.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*_QoeVCnsHtRFVQX1IIU-OQ.png" /></figure><p>In this article, I will explain how to create a product in a Flutter application using the Laravel API and how to upload multiple images for this product.</p><p>👉 You can take a look at my detailed article on the Laravel side by clicking the link below.</p><p>🔗 <a href="https://walnutistanbul.medium.com/how-to-upload-multiple-images-in-laravel-10-bafadb76d915">How to Upload Multiple Images in Laravel 10</a></p><h3>Creating a Flutter Project</h3><p><strong>●Step 1 Setting Up the Project:</strong></p><p>Open a new terminal. Navigate to the directory where you want to create a new Flutter project using terminal commands. Then, use the following command to create a new Flutter project:</p><pre>flutter create example_project</pre><p>You can replace “example_project” with the name of the project you want to create. In my case project name is <strong><em>upload_image</em></strong>.</p><p><strong>● Step 2 Add necessary dependencies:</strong></p><p>To define dependencies, first open the pubspec.yaml file, which is located at the bottom of your project. Afterward, add these package under the “dependencies” section. You can find the latest “image_picker” , “http” and “get” packages at those links.</p><p><strong>● image_picker:</strong></p><p><a href="https://pub.dev/packages/image_picker">https://pub.dev/packages/image_picker</a></p><p><strong>● http:</strong></p><p><a href="https://pub.dev/packages/http">https://pub.dev/packages/http</a></p><p><strong>● get:</strong></p><p><a href="https://pub.dev/packages/get">https://pub.dev/packages/get</a></p><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  image_picker: ^version<br>  http: ^version<br>  get: ^version</pre><p>Please make sure to replace the &quot;^version&quot; expression with versions of packages that are compatible with your Flutter version. My Flutter version is 3.13.2, and the versions of the packages I&#39;m using are as follows: <em>image_picker: ^1.0.4</em>, <em>http: ^1.1.0</em>, <em>get: ^4.6.6</em>.</p><p><strong>● Step 3:</strong> Add the code below to the main.dart file (located in the lib folder).</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:upload_image/admin_screen.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br><br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: AdminScreen(),<br>    );<br>  }<br>}</pre><p><strong>● Step 4:</strong> Create a admin_screen.dart file inside the lib folder and add the following code to it.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:get/get.dart&#39;;<br>import &#39;package:image_picker/image_picker.dart&#39;;<br>import &#39;dart:io&#39;;<br>import &#39;package:http/http.dart&#39; as http;<br><br>class AdminScreen extends StatelessWidget {<br>  final TextEditingController nameController = TextEditingController();<br>  final TextEditingController priceController = TextEditingController();<br>  final TextEditingController descriptionController = TextEditingController();<br>  final List&lt;File&gt; selectedImages = [];<br><br>  Future&lt;void&gt; addImages() async {<br>    final picker = ImagePicker();<br>    final List&lt;XFile&gt; images = await picker.pickMultiImage(<br>      maxWidth: 800, // can be customized<br>      maxHeight: 600, // can be customized<br>    );<br>    <br>    if (images != null) {<br>      for (XFile image in images) {<br>        selectedImages.add(File(image.path));<br>      }<br>    }<br>  }<br><br>  void createProduct() async {<br>    try {<br>      final String apiUrl = &#39;http://192.168.1.2:8000/api/create&#39;;<br>      final Map&lt;String, String&gt; headers = {&#39;Content-Type&#39;: &#39;multipart/form-data&#39;};<br><br>      final request = http.MultipartRequest(&#39;POST&#39;, Uri.parse(apiUrl));<br><br>      request.fields[&#39;name&#39;] = nameController.text;<br>      request.fields[&#39;price&#39;] = priceController.text;<br>      request.fields[&#39;description&#39;] = descriptionController.text;<br><br>      for (File image in selectedImages) {<br>        request.files.add(await http.MultipartFile.fromPath(<br>          &#39;images[]&#39;,<br>          image.path,<br>        ));<br>      }<br><br>      final response = await request.send();<br>      if (response.statusCode == 200) {<br>        Get.snackbar(&#39;Success&#39;, &#39;Product Successfully Created&#39;);<br>        nameController.clear();<br>        priceController.clear();<br>        descriptionController.clear();<br>        selectedImages.clear();<br>      } else {<br>        Get.snackbar(&#39;Error&#39;, &#39;Product Creation Failed&#39;);<br>      }<br>    } catch (e) {<br>      Get.snackbar(&#39;Error&#39;, &#39;Something went wrong: $e&#39;);<br>    }<br>  }<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      appBar: AppBar(<br>        title: Text(&#39;Create Porduct&#39;),<br>      ),<br>      body: Padding(<br>        padding: EdgeInsets.all(16.0),<br>        child: Column(<br>          children: [<br>            TextField(<br>              controller: nameController,<br>              decoration: InputDecoration(labelText: &#39;Product Name&#39;),<br>            ),<br>            TextField(<br>              controller: priceController,<br>              decoration: InputDecoration(labelText: &#39;Price&#39;),<br>            ),<br>            TextField(<br>              controller: descriptionController,<br>              decoration: InputDecoration(labelText: &#39;Description&#39;),<br>            ),<br>            ElevatedButton(<br>              onPressed: addImages,<br>              child: Text(&#39;Add Image&#39;),<br>            ),<br>            ElevatedButton(<br>              onPressed: createProduct,<br>              child: Text(&#39;Create Product&#39;),<br>            ),<br>            Column(<br>              children: selectedImages<br>                  .map((image) =&gt; Image.file(image))<br>                  .toList(),<br>            ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><h3>Code Explained</h3><p><strong>Ⅰ-Import Statements:</strong></p><ul><li>The code starts with import statements that bring in necessary packages and libraries for the Flutter application, including Material Design widgets, Get for state management, image_picker for selecting images, and http for making HTTP requests.</li></ul><p><strong>Ⅱ-Class Definition:</strong></p><ul><li>The AdminScreen class is defined, which extends StatelessWidget. This class represents the screen for creating a product.</li></ul><p><strong>Ⅲ-Text Editing Controllers:</strong></p><ul><li>Text editing controllers are created for three input fields: name, price, and description. These controllers will be used to retrieve the user’s input from the text fields.</li></ul><p><strong>Ⅳ-List for Selected Images:</strong></p><ul><li>A list named selectedImages is created to store the selected image files. It&#39;s initially an empty list.</li></ul><p><strong>Ⅴ-</strong><strong>addImages Function:</strong></p><ul><li>This asynchronous function is used for adding images to the selectedImages list. It utilizes the image_picker package to allow the user to select multiple images. The selected images are then added to the selectedImages list as File objects.</li></ul><p><strong>Ⅵ-</strong><strong>createProduct Function:</strong></p><ul><li>This function is responsible for creating a new product by sending a POST request to a specified API endpoint. It uses the http package to make the request.</li><li>It constructs a MultipartRequest and adds the product details (name, price, description) as fields.</li><li>It iterates through the selectedImages list and adds each image as a part of the request.</li><li>It sends the request and checks the response’s status code. If the response status code is 200 (indicating success), a success message is displayed using Get.snackbar, and the input fields and selected images are cleared. If the status code is not 200, an error message is displayed.</li></ul><p><strong>Ⅶ-</strong><strong>build Method:</strong></p><ul><li>The build method is implemented to define the UI of the screen. It returns a Scaffold widget with an AppBar and a Column containing various form fields and buttons.</li><li>Inside the Column, there are TextField widgets for entering the product name, price, and description. Two ElevatedButton widgets are provided to add images and create the product.</li><li>The selected images are displayed as Image widgets in a Column.</li></ul><p>📝 <strong>Summary:</strong></p><p>This code represents a Flutter screen that allows users to input product details, select images, and create a product by sending the data to a server via an HTTP POST request. The user is provided with feedback messages through snackbar notifications based on the response from the server.</p><p><strong>Good Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ccc1eace318" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Upload Multiple Images in Laravel 10]]></title>
            <link>https://walnutistanbul.medium.com/how-to-upload-multiple-images-in-laravel-10-bafadb76d915?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/bafadb76d915</guid>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Wed, 06 Dec 2023 14:17:45 GMT</pubDate>
            <atom:updated>2023-12-06T14:22:09.678Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*3LqI5Bo0lq9ffUugTPB0eA.png" /></figure><p>In this article, I will explain how you can create a Laravel API that allows you to create a product and allows this product to receive multiple images. This article will also provide you with the opportunity to test the API you have created.</p><p>👉 You can use the api you will create with the help of this article in flutter, you can take a look at my detailed article I wrote for flutter by clicking the link below.</p><p>🔗 <a href="https://medium.com/@walnutistanbul/how-to-upload-multiple-images-in-flutter-using-api-laravel-6ccc1eace318">How to Upload Multiple Images in Flutter using Api(Laravel)</a></p><p><strong>📌 </strong>This article already assumes that you have created a Laravel project. If you haven’t created a Laravel project and don’t know how to do so, you can refer to the article I wrote about it by following the link below.</p><p>🔗 <a href="https://medium.com/@walnutistanbul/how-to-create-laravel-project-724f236fcefb">How to Create Laravel Project</a></p><h3>Laravel API</h3><p><strong>●Step 1: Create Migrations</strong></p><p>Run the following command in the terminal to create a migration file.</p><pre>php artisan make:migration product_table</pre><p>Add the following code into this migration file.</p><pre>public function up(): void<br>{<br>    Schema::create(&#39;products&#39;, function (Blueprint $table) {<br>        $table-&gt;id();<br>        $table-&gt;string(&#39;name&#39;);<br>        $table-&gt;decimal(&#39;price&#39;, 10, 2);<br>        $table-&gt;text(&#39;description&#39;);<br>        $table-&gt;timestamps();<br>    });<br>    Schema::create(&#39;product_images&#39;, function (Blueprint $table) {<br>        $table-&gt;id();<br>        $table-&gt;unsignedBigInteger(&#39;product_image_id&#39;);<br>        $table-&gt;string(&#39;url&#39;);<br>        $table-&gt;timestamps();<br><br>        $table-&gt;foreign(&#39;product_image_id&#39;)-&gt;references(&#39;id&#39;)-&gt;on(&#39;products&#39;);<br>    });<br>}</pre><p><strong>● </strong>We used foreign keys to define the relationship between the tables.</p><p>✅ To apply the changes you made in your migration file to the database, run the following command.</p><pre>php artisan migrate</pre><p><strong>●Step 2: Create Models</strong></p><p>Run the following command in the terminal to create a <strong>Product</strong> model file.</p><pre>php artisan make:model Product</pre><p>Add the following code into this model file.</p><pre>class Product extends Model<br>{<br>    use HasFactory;<br>    protected $fillable = [&#39;name&#39;, &#39;price&#39;, &#39;description&#39;];<br><br>    public function images()<br>    {<br>        return $this-&gt;hasMany(ProductImage::class);<br>    }<br>}</pre><p><strong>● </strong>hasMany indicates that a product can have many images.</p><p>Run the following command in the terminal to create a <strong>ProductImage</strong> model file.</p><pre>php artisan make:model ProductImage</pre><p>Add the following code into this model file.</p><pre>class ProductImage extends Model<br>{<br>    use HasFactory;<br><br>    protected $fillable = [&#39;url&#39;,&#39;product_id&#39;];<br><br>    public function product()<br>    {<br>        return $this-&gt;belongsTo(Product::class);<br>    }<br>}</pre><p><strong>● </strong>belongsTo specifies that the images belong to a product.</p><p><strong>●Step 3: Create Controller</strong></p><p>Run the following command in the terminal to create a ProductController file.</p><pre>php artisan make:controller ProductController</pre><p>Add the following code into this controller file.</p><pre>public function createProduct(Request $request)<br>{<br>    try {<br>        $request-&gt;validate([<br>            &#39;name&#39; =&gt; &#39;required|string&#39;,<br>            &#39;price&#39; =&gt; &#39;required|numeric&#39;,<br>            &#39;description&#39; =&gt; &#39;required|string&#39;,<br>            &#39;images&#39; =&gt; &#39;required|array&#39;,<br>            &#39;images.*&#39; =&gt; &#39;image|mimes:jpeg,png,jpg,gif|max:2048&#39;,<br>        ]);<br><br>        $product = new Product();<br>        $product-&gt;name = $request-&gt;name;<br>        $product-&gt;price = $request-&gt;price;<br>        $product-&gt;description = $request-&gt;description;<br>        $product-&gt;save();<br><br>        $imageUrls = [];<br><br>        if ($request-&gt;hasFile(&#39;images&#39;)) {<br>            foreach ($request-&gt;file(&#39;images&#39;) as $image) {<br>                $filename = $image-&gt;store(&#39;posts&#39;, &#39;public&#39;);<br><br>                $productImage = new ProductImage();<br>                $productImage-&gt;product_image_id = $product-&gt;id;<br>                $productImage-&gt;url = $filename;<br>                $productImage-&gt;save();<br><br>                $imageUrls[] = $filename;<br>            }<br>        }<br>        return response()-&gt;json([&#39;success&#39; =&gt; true, &#39;message&#39; =&gt; &#39;Prodcut Created Successfully&#39;, &#39;image_urls&#39; =&gt; $imageUrls], 200);<br>    } catch (\Exception $e) {<br>        return response()-&gt;json([&#39;error&#39; =&gt; &#39;An error occurred while creating product: &#39; . $e-&gt;getMessage()], 400);<br>    }<br>}</pre><p><strong>● </strong>This code first populates the “products” table with the data from the request, then it saves each image found in the “images” array to the “posts” folder. It also populates the “product_images” table by recording the image paths in the “url” column and the product’s ID in the “product_image_id” column. This way, you can retrieve both the product information and the image URLs associated with the product using the product’s ID.</p><p><strong>●Step 4: Create Routes</strong></p><p>Add the following code to the api.phpfile. The main function of this code is to associate HTTP POST requests to the “/create” URL with the “createProduct” method of the “ProductController” class. In this way, this route can be used to create new products, and this is done only with POST requests.</p><pre>Route::post(&#39;/create&#39;, [ProductController::class,&#39;createProduct&#39;]);</pre><p>Add the following code to the web.phpfile. This code associates HTTP POST requests to the “/create-product” URL with the “createProduct” method of the “ProductController” class and names this route “product.create”.</p><pre>Route::post(&#39;/create-product&#39;, [ProductController::class,&#39;createProduct&#39;])-&gt;name(&#39;product.create&#39;);</pre><p><strong>●Step 5: Create View (Optional)</strong></p><p><strong>📌 </strong>If you want to test the API before using it in another environment like Flutter, you can benefit from this section (doing this allows you to catch errors more easily).</p><p>Go to the root directory of your project and navigate to the ‘resources/views’ directory. Create a file named ‘productCreate.blade.php’ in this directory, and add the following code to the file you’ve created.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;Create Product&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h1&gt;Create Product&lt;/h1&gt;<br><br>    @if(session(&#39;success&#39;))<br>        &lt;div class=&quot;alert alert-success&quot;&gt;<br>            Product Creating Successfully.<br>        &lt;/div&gt;<br>    @endif<br><br>    @if ($errors-&gt;any())<br>        &lt;div class=&quot;alert alert-danger&quot;&gt;<br>            &lt;ul&gt;<br>                @foreach ($errors-&gt;all() as $error)<br>                    &lt;li&gt;{{ $error }}&lt;/li&gt;<br>                @endforeach<br>            &lt;/ul&gt;<br>        &lt;/div&gt;<br>    @endif<br><br>    &lt;form method=&quot;POST&quot; action=&quot;{{ route(&#39;product.create&#39;) }}&quot; enctype=&quot;multipart/form-data&quot;&gt;<br>        @csrf<br>        &lt;div&gt;<br>            &lt;label for=&quot;name&quot;&gt;Product Name:&lt;/label&gt;<br>            &lt;input type=&quot;text&quot; name=&quot;name&quot; id=&quot;name&quot; value=&quot;{{ old(&#39;name&#39;) }}&quot; required&gt;<br>        &lt;/div&gt;<br><br>        &lt;div&gt;<br>            &lt;label for=&quot;price&quot;&gt;Price:&lt;/label&gt;<br>            &lt;input type=&quot;number&quot; name=&quot;price&quot; id=&quot;price&quot; value=&quot;{{ old(&#39;price&#39;) }}&quot; required&gt;<br>        &lt;/div&gt;<br><br>        &lt;div&gt;<br>            &lt;label for=&quot;description&quot;&gt;Desctiption:&lt;/label&gt;<br>            &lt;textarea name=&quot;description&quot; id=&quot;description&quot; required&gt;{{ old(&#39;description&#39;) }}&lt;/textarea&gt;<br>        &lt;/div&gt;<br><br>        &lt;div&gt;<br>            &lt;label for=&quot;images&quot;&gt;Images (Many):&lt;/label&gt;<br>            &lt;input type=&quot;file&quot; name=&quot;images[]&quot; id=&quot;images&quot; multiple required&gt;<br>        &lt;/div&gt;<br><br>        &lt;button type=&quot;submit&quot;&gt;Create Product&lt;/button&gt;<br>    &lt;/form&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p><strong>● </strong>This code allows the user to enter the name, price, description and multiple images of a product and sends this information to a server. With this information processed on the server side, a new product is created and notifications are shown to the user based on success or error statuses. This type of form can be used in web-based product management systems or e-commerce sites.</p><p><strong>Good Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bafadb76d915" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Laravel Project]]></title>
            <link>https://walnutistanbul.medium.com/how-to-create-laravel-project-724f236fcefb?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/724f236fcefb</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Fri, 01 Dec 2023 08:41:43 GMT</pubDate>
            <atom:updated>2023-12-01T08:41:43.418Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*z5PBvHRawtgK8VZIOYvJ2A.png" /></figure><p>In this article, I will explain the things you need when creating a Laravel project. Thanks to this article, you will be able to create a Laravel project and establish the project-database connection. Let’s get started!</p><h3>Creating a Laravel Project(Step by Step)</h3><h4>For Windows</h4><p><strong>●Step 1:Download PHP</strong></p><p>Start by downloading the latest version of PHP from the official website. You can find the official download page <a href="https://windows.php.net/download">here</a>.</p><ul><li>Choose the version on the download page, usually opting for the “Thread Safe” (TS) version.</li><li>Download the appropriate ZIP file for Windows.</li></ul><p><strong>a-)</strong> Extract Files: Unzip the downloaded ZIP file into a folder. The recommended directory is often something like C:\php, but you can use any folder you prefer.</p><p><strong>b-)</strong> Configure php.ini: In the extracted folder, copy the php.ini-development file and rename it to php.ini.</p><p><strong>c-)</strong> PATH Configuration: Add the directory containing PHP’s executable files to the system PATH variable. This ensures that you can run the PHP command from the command prompt.</p><ul><li>Right-click on your computer and select “Properties.”</li><li>Click on “Advanced system settings.”</li><li>Click on the “Environment Variables” button.</li><li>In the opened window, under the “System variables” section, find “Path” (or “PATH”) and click on the “Edit” button.</li><li>In the new window, click on “New” and add the path to the PHP directory (e.g., C:\php).</li></ul><p><strong>d-)</strong> Web Server Configuration (Optional): If you’re using a web server (like Apache, Nginx, etc.), you need to integrate PHP’s configuration file with the server. The steps vary depending on the type of server. For example, for Apache, you’ll need to edit the httpd.conf file.</p><p><strong>e-)</strong> Testing: After successfully completing the installation, open a command prompt and run the php -v command to check the PHP version.</p><p><strong>●Step 2: Install Composer</strong></p><p>Install Composer: If you haven’t already, download and install Composer, which is a dependency manager for PHP. You can find instructions on how to install Composer on the official website: <a href="https://getcomposer.org/doc/00-intro.md">Composer Installation</a>.</p><p><strong>●Step 3: Install Laravel Installer</strong></p><p>Open your command line or terminal and run the following command to install the Laravel installer globally on your system:</p><pre>composer global require laravel/installer</pre><p><strong>●Step 4: Create a New Laravel Project</strong></p><p>After installing the Laravel installer, navigate to the htdocs directory within the directory where XAMPP is installed in your terminal, and run the following command. This will allow you to create a new Laravel project. Creating your Laravel projects within the htdocs directory ensures more stable functionality.</p><pre>laravel new project-name</pre><p>Replace project-name with the name of your project. Laravel will set up a new project folder and install all the necessary dependencies.</p><p><strong>📌Database Connection</strong></p><p><strong>●Step 5: Download and Install XAMPP</strong></p><p><strong>Download</strong>: Visit the official XAMPP website at <a href="https://www.apachefriends.org/index.html">XAMPP Downloads</a>, select the version for your operating system (Windows, macOS, Linux), and download it.</p><p><strong>Installation:</strong> Run the downloaded XAMPP installer, and follow the on-screen instructions to complete the installation. Once done, XAMPP is installed on your computer.</p><p><strong>●Step 6: XAMPP Control Panel</strong></p><p>Open the XAMPP control panel and start Apache and MySQL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*NE1a2RKMbtpgKCItVMUxPA.png" /></figure><p><strong>●Step 7: Create a New DataBase</strong></p><p>Go to <a href="http://localhost/phpmyadmin">http://localhost/phpmyadmin</a> click on “new,” enter a database name, and click “create.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*vI7ZlEqBv2L-yPBzRmVydw.png" /></figure><p><strong>●Step 8: Laravel — Database Connection</strong></p><p>Open your Laravel project in a development environment like VSCode, and in the root directory of your Laravel project, locate the “.env” file. Update the DB_DATABASE value in the “.env” file with the name of the database you created in the previous step, and save the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*VPIFhdUwBOqwRt2ri9Bheg.png" /></figure><p><strong>●Step 9: Run Migration</strong></p><p>If you want to use a database, run the migration command to create the necessary tables:</p><pre>php artisan migrate</pre><p><strong>●Step 10: Serve Your Application</strong></p><p>To run your Laravel application, you can use the built-in development server. Run the following command:</p><pre>php artisan serve</pre><h4>For Mac</h4><p><strong>●Step 1:Install Homebrew</strong></p><p>If Homebrew is not already installed on your Mac, you can install it by running the following command in your terminal:</p><pre>/bin/bash -c &quot;$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)&quot;</pre><p><strong>●Step 2: Install PHP</strong></p><p>Use Homebrew to install the latest version of PHP by running the following command in your terminal:</p><pre>brew install php</pre><p><strong>●Step 3: Install Composer</strong></p><p>Composer is used to manage Laravel projects and their dependencies. You can download and install Composer by running the following commands in your terminal:</p><pre>brew install composer</pre><p><strong>●Step 4: Install Laravel</strong></p><p>Use Composer to create a new Laravel project by running the following command in your terminal:</p><pre>composer create-project --prefer-dist laravel/laravel project-name</pre><p>Replace “project-name” with a suitable name for your project.</p><p><strong>📌Database Connection</strong></p><p><strong>●Step 5:Install MySQL</strong></p><p>You can install MySQL on Mac using Homebrew. Run the following command in your terminal to install MySQL:</p><pre>brew install mysql</pre><p><strong>●Step 6: Start MySQL Server</strong></p><p>Start the MySQL server by using the following command:</p><pre>brew services start mysql</pre><p>This command starts the MySQL server and ensures it starts automatically on system boot.</p><p><strong>●Step 7:MySQL Root User and Password</strong></p><p>After starting MySQL, you need to set up a root user and password. Enter the MySQL shell with the following command in your terminal:</p><pre>mysql -u root -p</pre><p>You’ll be prompted to enter the password for the root user.</p><p><strong>●Step 8: Create a Database</strong></p><p>Create a new database for your Laravel project using the following SQL command in the MySQL terminal:</p><pre>CREATE DATABASE laravel_database;</pre><p>This command creates a database named “laravel_database.” You can adjust the name and other settings based on your project’s requirements.</p><p><strong>●Step 9: Laravel — Database Connection</strong></p><p>Open your Laravel project in a development environment like VSCode, and in the root directory of your Laravel project, locate the “.env” file. Update the DB_DATABASE value in the “.env” file with the name of the database you created in the previous step, and save the changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/267/1*VPIFhdUwBOqwRt2ri9Bheg.png" /></figure><p><strong>●Step 10: Run Migration</strong></p><p>If you want to use a database, run the migration command to create the necessary tables:</p><pre>php artisan migrate</pre><p><strong>●Step 11: Serve Your Application</strong></p><p>To run your Laravel application, you can use the built-in development server. Run the following command:</p><pre>php artisan serve</pre><p>By following these steps, you can create a Laravel project. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=724f236fcefb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Drawer]]></title>
            <link>https://walnutistanbul.medium.com/flutter-drawer-5a2596eae012?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a2596eae012</guid>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Thu, 30 Nov 2023 12:08:45 GMT</pubDate>
            <atom:updated>2023-11-30T12:08:45.308Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*pX5YhZaEO3kszK6Xauh-aQ.png" /></figure><p>Tab and drawer are the two fundamental options for navigation in applications utilizing Material Design. In this article, I will guide you step by step on using the drawer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*I5r5W2JfIecMAHKCAIE5qQ.gif" /></figure><h3>Creating a Flutter Drawer</h3><p><strong>●Step 1 Setting Up the Project:</strong></p><p>Open a new terminal. Navigate to the directory where you want to create a new Flutter project using terminal commands. Then, use the following command to create a new Flutter project:</p><pre>flutter create example_project</pre><p>You can replace “example_project” with the name of the project you want to create. In my case project name is <strong><em>flutter_drawer</em></strong>.</p><p><strong>● Step 2:</strong> Add the code below to the main.dart file (located in the lib folder).</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_drawer/main_page.dart&#39;;<br><br>void main() {<br>  runApp(MyApp());<br>}<br>class MyApp extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return MaterialApp(<br>      home: MainPage(),<br>    );<br>  }<br>}</pre><p><strong>● Step 3:</strong> Create a main_page.dart file inside the lib folder and add the following code to it.</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter_drawer/navigation_drawer_widget.dart&#39;;<br><br>class MainPage extends StatefulWidget {<br>  const MainPage({super.key});<br>  @override<br>  State&lt;MainPage&gt; createState() =&gt; _MainPageState();<br>}<br>class _MainPageState extends State&lt;MainPage&gt; {<br>  @override<br>  Widget build(BuildContext context) {<br>    return Scaffold(<br>      drawer: NavigationDrawerWidget(),<br>      appBar: AppBar(<br>        title: Text(&#39;Drawer&#39;),<br>      ),<br>      body: Builder(<br>        builder: (context) {<br>          return Container(<br>            alignment: Alignment.center,<br>            padding: EdgeInsets.symmetric(horizontal: 32),<br>            child: ElevatedButton(<br>              onPressed: () {<br>                Scaffold.of(context).openDrawer();<br>              },<br>              child: Text(&#39;Open Drawer&#39;),<br>            ),<br>          );<br>        }<br>      ),<br>    );<br>  }<br>}</pre><p><strong>● Step 4:</strong> To organize the content of the drawer, create a Dart file named ‘navigation_drawer_widget.dart’ in the ‘lib’ folder.</p><pre>import &#39;package:flutter/material.dart&#39;;<br><br>class NavigationDrawerWidget extends StatelessWidget {<br>  @override<br>  Widget build(BuildContext context) {<br>    return Drawer(<br>      child: ListView(     <br>        padding: EdgeInsets.zero,<br>        children: [<br>          DrawerHeader(<br>            decoration: BoxDecoration(<br>              color: Colors.blue,<br>            ),<br>            child: Text(&#39;Drawer Header&#39;),<br>          ),<br>          ListTile(<br>            title: Text(&#39;Item 1&#39;),<br>            onTap: () {},<br>          ),<br>          ListTile(<br>            title: Text(&#39;Item 2&#39;),<br>            onTap: () {},<br>          ),<br>        ],<br>      ),<br>    );<br>  }<br>}</pre><p><strong>📌 Attention</strong>: With these codes, you can use drawers in Flutter but things to pay attention to here are as follows:</p><p><strong>1-) </strong>To add a drawer to the app, wrap it in a Scaffold widget. The Scaffold widget provides a consistent visual structure to apps that follow the Material Design Guidelines.</p><pre>Scaffold(<br>  drawer: // Add a Drawer here in the next step.<br>);</pre><p><strong>2-)</strong> The code that opens the drawer inside the Scaffold (Scaffold.of(context).openDrawer();) must be called within a BuildContext, meaning it should be wrapped with a builder.</p><p><strong>Good Coding !</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a2596eae012" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Flutter Deeplinking without using Firebase (Android)]]></title>
            <link>https://walnutistanbul.medium.com/flutter-deeplinking-without-using-firebase-android-163737fb3fee?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/163737fb3fee</guid>
            <category><![CDATA[flutter-app-development]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[dart]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[flutter]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 06:23:10 GMT</pubDate>
            <atom:updated>2023-11-17T06:23:10.087Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*FOJn3gZw-3UV1r_GGTTGFw.png" /></figure><p>In this article, I will explain how to create Deeplinks in Flutter and how to open your application using these Deeplinks. With the help of this article, you will be able to open both your application and the desired page using Deeplinks. You will also be able to redirect to the desired page with Deeplinks while your application is already open.</p><h3>Setting Up the Project</h3><p>Open a new terminal. Navigate to the directory where you want to create a new Flutter project using terminal commands. Then, use the following command to create a new Flutter project:</p><pre>flutter create example_project</pre><p>You can replace “example_project” with the name of the project you want to create. In my case project name is <strong><em>deeplinking_example</em></strong>.</p><h3>Create a Deeplink</h3><p><strong>● Step 1 Add necessary dependencies:</strong></p><p>To define dependencies, first open the pubspec.yaml file, which is located at the bottom of your project. Afterward, add the uni_links package under the &quot;dependencies&quot; section. You can find the latest uni_links package at this link.</p><p><a href="https://pub.dev/packages/uni_links/install">https://pub.dev/packages/uni_links/install</a></p><p>The “dependencies” section should look like the following:</p><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br> uni_links: ^version</pre><p>Replace the ‘^version’ with a uni_linkspackage version compatible with your Flutter version. In my case it’s ^0.5.1 , my flutter version: 3.13.2.</p><p><strong>● Step 2: </strong>Add the following permissions to the AndroidManifest.xml file. You can refer to the images below for guidance on where to add these permissions.</p><pre>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;</pre><pre>&lt;meta-data android:name=&quot;flutter_deeplinking_enabled&quot; android:value=&quot;true&quot; /&gt;<br>&lt;intent-filter android:autoVerify=&quot;true&quot;&gt;<br>    &lt;action android:name=&quot;android.intent.action.VIEW&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.DEFAULT&quot;/&gt;<br>    &lt;category android:name=&quot;android.intent.category.BROWSABLE&quot;/&gt;<br>    &lt;data<br>        android:scheme=&quot;https&quot;<br>        android:pathPrefix=&quot;/data/&quot;<br>        android:host=&quot;your_domain_name.com&quot; /&gt;<br>&lt;/intent-filter&gt;</pre><p>If the Deeplink you want to open your application with does not have a specific prefix (in my case it’s /data/ ), you can delete the line android:pathPrefix=”/data/”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*o3NJ7EU83BNPGZD7Ogrudw.png" /></figure><p><strong>● Step 3: </strong>To be able to open your application using Deeplinks, you will need your applicationId and sha-256 key. First, to obtain the sha-256 key, paste and run the following command in the terminal.</p><p>➤ <strong>For Windows</strong></p><pre>keytool -list -v -keystore &quot;%USERPROFILE%\.android\debug.keystore&quot; -alias androiddebugkey -storepass android -keypass android</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*d3e0SGF5uHo3De4zZjke3g.png" /></figure><p>➤<strong>For Mac</strong></p><pre>keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android | grep &quot;SHA256&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/753/1*lIReI94fC4ENynvtbAeo-w.png" /></figure><p>Copy the SHA256 key and store it in a notepad. Now, navigate to the android/app directory in the root of your Flutter project. Open the build.gradle file located in the app folder, copy your applicationId from it, and also add it to your notepad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*1mXAt0ib0K-WjRoywXQhrw.png" /></figure><p><strong>● Step 4: </strong>Go to your hosting provider’s file manager and create a “.well-known” folder in the root directory where your website is located. Inside this folder, add the “assetlinks.json” file that you’ve organized as shown below.</p><p><strong>📌 Attention</strong>: If you don’t have a hosting provider, you can get a free hosting site domain from the following link.</p><p><a href="https://tr.000webhost.com/">https://000webhost.com</a></p><pre>[{<br>  &quot;relation&quot;: [&quot;delegate_permission/common.handle_all_urls&quot;],<br>  &quot;target&quot;: {<br>    &quot;namespace&quot;: &quot;android_app&quot;,<br>    &quot;package_name&quot;: &quot;com.your_application_name&quot;,<br>    &quot;sha256_cert_fingerprints&quot;:<br>    [&quot;your_sha256_key&quot;]<br>  }<br>}]</pre><p>We will use the applicationId and sha256 key that I previously asked you to save in your notepad. Replace “com.your_application_name” with your applicationId and “your_sha256_key” with your sha256 key. After making these changes, save the file and then add it to the “.well-known” folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*xLAc3M7ASZF4ewC3oiMGyw.png" /></figure><p><strong>● Step 5: </strong>Before using your Deeplink in your application, you can test it by using the link below. If you’ve done everything correctly, you should receive the “Success!” message as shown in the image below.</p><p><a href="https://developers.google.com/digital-asset-links/tools/generator?hl=tr">https://developers.google.com/digital-asset-links/tools/generator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*1yYacv9TrW2SvGrEKdNflA.png" /></figure><h3>Deeplink Usage</h3><p>The code below enables you to open your application using deep links and allows your application to listen for deep links while running in the background. You can add this code to your main.dart file and use it.</p><p>You know you can perform contextless Navigation. To perform page navigation using deep links, add the<a href="https://pub.dev/packages/get/install">get</a> package to your application through the link below, uncomment the lines I&#39;ve interpreted, and make sure to replace &#39;return MaterialApp&#39; with &#39;return GetMaterialApp&#39;. This will allow you to perform page navigation without needing to use context directly, offering a contextless way of navigating between pages in your application.</p><p><a href="https://pub.dev/packages/get/install">https://pub.dev/packages/get/install</a></p><pre>import &#39;dart:async&#39;;<br>import &#39;package:your_project_name/pages/login_screen.dart&#39;;<br>import &#39;package:flutter/foundation.dart&#39;;<br>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:flutter/services.dart&#39;;<br>import &#39;package:uni_links/uni_links.dart&#39;;<br>//import &#39;package:get/get.dart&#39;;<br><br>bool _initialUriIsHandled = false;<br>void main() {<br>  WidgetsFlutterBinding.ensureInitialized();<br>  runApp(MyApp());<br>}<br>class MyApp extends StatefulWidget {<br>  @override<br>  _MyAppState createState() =&gt; _MyAppState();<br>}<br>class _MyAppState extends State&lt;MyApp&gt;{<br>  Uri? _initialUri;<br>  Uri? _latestUri;<br>  Object? _err;<br><br>  StreamSubscription? _sub;<br><br>  @override<br>  void initState() {<br>    super.initState();<br>    _handleIncomingLinks();<br>    _handleInitialUri();<br>  }<br><br>  @override<br>  void dispose() {<br>    _sub?.cancel();<br>    super.dispose();<br>  }<br><br>  void _handleIncomingLinks() {<br>    if (!kIsWeb) {<br>      _sub = uriLinkStream.listen((Uri? uri) {<br>        if (!mounted) return;<br>        print(&#39;got uri: $uri&#39;);<br>        //Get.to(()=&gt; RegisterScreen());    <br>        setState(() {<br>          _latestUri = uri;<br>          _err = null;<br>        });<br>      }, onError: (Object err) {<br>        if (!mounted) return;<br>        print(&#39;got err: $err&#39;);<br>        setState(() {<br>          _latestUri = null;<br>          if (err is FormatException) {<br>            _err = err;<br>          } else {<br>            _err = null;<br>          }<br>        });<br>      });<br>    }<br>  }<br>  Future&lt;void&gt; _handleInitialUri() async {<br>    if (!_initialUriIsHandled) {<br>      _initialUriIsHandled = true;<br>      try {<br>        final uri = await getInitialUri();<br>        if (uri == null) {<br>          print(&#39;no initial uri&#39;);<br>        } else {<br>          print(&#39;got initial uri: $uri&#39;); <br>          //Get.to(()=&gt; RegisterScreen());      <br>        }<br>        if (!mounted) return;<br>        setState(() =&gt; _initialUri = uri);<br>      } on PlatformException {<br>        print(&#39;falied to get initial uri&#39;);<br>      } on FormatException catch (err) {<br>        if (!mounted) return;<br>        print(&#39;malformed initial uri&#39;);<br>        setState(() =&gt; _err = err);<br>      }<br>    }<br>  }<br>  @override<br>  Widget build(BuildContext context) {<br>    //return GetMaterialApp( <br>    return MaterialApp(<br>      theme: ThemeData(<br>        elevatedButtonTheme: ElevatedButtonThemeData(<br>          style: ButtonStyle(<br>            backgroundColor: MaterialStateProperty.all&lt;Color&gt;(Colors.red),<br>          ),<br>        ),<br>        appBarTheme: AppBarTheme(color: Colors.black),<br>        primaryColor: Colors.black,<br>        scaffoldBackgroundColor: Colors.white,<br>      ),<br>      debugShowCheckedModeBanner: false,<br>      home: LoginScreen(),<br>    );<br>    //);<br>  }<br>}</pre><p>The “_handleInitialUri” function will run when the application is opened with a Deeplink and handle the Deeplink. The “_handleIncomingLinks” function, on the other hand, will run when a Deeplink is clicked while the application is open in the background and handle the Deeplink.</p><p><strong>Good Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=163737fb3fee" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Encryption/Decryption Errors in Flutter]]></title>
            <link>https://walnutistanbul.medium.com/encryption-decryption-errors-in-flutter-6df40b1b1b11?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/6df40b1b1b11</guid>
            <category><![CDATA[error]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Wed, 01 Nov 2023 07:06:47 GMT</pubDate>
            <atom:updated>2023-11-01T07:06:47.000Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*SuO2SI-ldfZMmqaQ8yPPmA.png" /></figure><p>In this article, I will explain how to fix the “Input buffer too short,” “Invalid or corrupted pad block,” and “Invalid value: Not in inclusive range” errors that you might encounter during encryption and decryption processes in Flutter. Common reasons for these errors include improper padding of the data to be encrypted based on the data’s length. You can add the following code to a Dart file to use the <a href="https://pub.dev/packages/pointycastle/install">pointycastle</a> package for encryption and decryption processes. You can understand the logic of how the code works from the explanation below and use it following the instructions provided in the usage section.</p><pre>import &#39;dart:typed_data&#39;;<br>import &#39;package:pointycastle/pointycastle.dart&#39;;<br>import &#39;dart:convert&#39;;<br><br>class EncryptData {<br>  static String encryptAES(String text, String password) {<br>    final keyBytes = Uint8List.fromList(utf8.encode(password));<br>    final iv = Uint8List(16);<br>    final cipher = BlockCipher(&quot;AES/CBC&quot;)..init(true, ParametersWithIV(KeyParameter(keyBytes), iv));<br><br>    final inputBytes = Uint8List.fromList(utf8.encode(text));<br>    final encryptedBytes = encryptBytes(cipher, inputBytes);<br><br>    final encryptedText = base64.encode(encryptedBytes);<br><br>    return encryptedText;<br>  }<br><br>  static String decryptAES(String encryptedText, String password) {<br>    final keyBytes = Uint8List.fromList(utf8.encode(password));<br>    final iv = Uint8List(16);<br>    final cipher = BlockCipher(&quot;AES/CBC&quot;)..init(false, ParametersWithIV(KeyParameter(keyBytes), iv));<br><br>    final encryptedBytes = base64.decode(encryptedText);<br>    final decryptedBytes = decryptBytes(cipher, encryptedBytes);<br><br>    final decryptedText = utf8.decode(decryptedBytes);<br><br>    return decryptedText;<br>  }<br><br>  static Uint8List encryptBytes(BlockCipher cipher, Uint8List input) {<br>    final blockSize = cipher.blockSize;<br>    final paddedInput = padBlock(input, blockSize);<br>    final result = Uint8List(paddedInput.length);<br>    for (var i = 0; i &lt; paddedInput.length; i += blockSize) {<br>      cipher.processBlock(paddedInput, i, result, i);<br>    }<br>    return result;<br>  }<br><br>  static Uint8List decryptBytes(BlockCipher cipher, Uint8List input) {<br>    final blockSize = cipher.blockSize;<br>    final result = Uint8List(input.length);<br>    for (var i = 0; i &lt; input.length; i += blockSize) {<br>      cipher.processBlock(input, i, result, i);<br>    }<br>    return removePadding(result);<br>  }<br><br>  static Uint8List padBlock(Uint8List input, int blockSize) {<br>    final padLength = blockSize - (input.length % blockSize);<br>    final padded = Uint8List(input.length + padLength);<br>    padded.setAll(0, input);<br>    for (var i = input.length; i &lt; padded.length; i++) {<br>      padded[i] = padLength;<br>    }<br>    return padded;<br>  }<br><br>  static Uint8List removePadding(Uint8List input) {<br>    final padLength = input.last;<br>    return input.sublist(0, input.length - padLength);<br>  }<br>}</pre><p><strong>Ⅰ-</strong> Now, a class named EncryptData is defined. This class contains two main methods for encrypting and decrypting data using the AES algorithm: encryptAES and decryptAES.</p><p><strong>Ⅱ-</strong> The encryptAES method is used for encrypting text data. It takes two parameters: text and password. The text is the data you want to encrypt, and the password is the encryption key.</p><p><strong>Ⅲ-</strong> Inside the encryptAES method:</p><ul><li>keyBytes is created by encoding the password as UTF-8 and converting it to a Uint8List.</li><li>An initialization vector (iv) is created as a Uint8List with 16 bytes.</li><li>A cipher is initialized with the AES algorithm in CBC mode using the encryption key and the initialization vector.</li><li>The text is encoded as UTF-8 and converted to a Uint8List named inputBytes.</li><li>The encryptBytes function is used to encrypt inputBytes using the cipher.</li><li>The resulting encrypted bytes are encoded as a base64 string, and the encrypted text is returned.</li></ul><p><strong>Ⅳ-</strong> The decryptAES method is used for decrypting the encrypted text. It also takes encryptedText and password as parameters.</p><p><strong>Ⅴ-</strong> Inside the decryptAES method:</p><ul><li>The password is used to generate keyBytes, just like in the encryption method.</li><li>An iv is created.</li><li>The cipher is initialized for decryption using the same key and iv.</li><li>encryptedText is decoded from base64 to retrieve the encrypted bytes.</li><li>The decryptBytes function is used to decrypt the bytes using the cipher.</li><li>The decrypted bytes are converted back to a UTF-8 string, and the original text is returned.</li></ul><p><strong>Ⅵ-</strong> The encryptBytes, decryptBytes, padBlock, and removePadding methods are used to handle the low-level details of AES encryption and decryption. They ensure that the input data is properly processed and padded for encryption and that padding is removed during decryption.</p><p>This code provides a way to encrypt and decrypt text using the AES algorithm with CBC mode and base64 encoding for the output.</p><h3>Usage</h3><p>You need to specify a 16-character key for the encryption process. The encryption and decryption operations in the code below are based on the password/key provided. If encryption and decryption operations are to be performed in different Dart files, you must redeclare the same key there.</p><pre>final password = &quot;your_16lengthkey&quot;;<br>String email = &quot;example@gmail.com&quot;<br>String encryptedEmail = EncryptData.encryptAES(email, password);<br>String decryptedEmail = EncryptData.decryptAES(encryptedEmail,password);</pre><p><strong>Good Coding!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6df40b1b1b11" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[4 Packages to Simplify the Design of Your Flutter Application]]></title>
            <link>https://walnutistanbul.medium.com/4-packages-to-simplify-the-design-of-your-flutter-application-41e263c19746?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/41e263c19746</guid>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[flutter]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[ideas]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Wed, 01 Nov 2023 06:56:16 GMT</pubDate>
            <atom:updated>2023-11-01T06:56:16.210Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*lNcuVn0XZTDs3M7-rEolbA.png" /></figure><p>In this article, I will show you four packages that will help you enhance the design of your application.</p><h3>⚠️ Warning</h3><p>If you have an older version of Flutter, installing the latest version of the package can sometimes lead to issues. In such cases, you should install a package version that is compatible with your Flutter version.</p><h3><strong>1- S</strong>tep Progress Indicator</h3><p>This is a <em>bar indicator</em> made of a series of selected and unselected steps. If you need a progress bar indicator that will change based on parameters, you can get help from this package.</p><p><a href="https://pub.dev/packages/step_progress_indicator">https://pub.dev/packages/step_progress_indicator</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*a74ECyDwtOIAJEXg3wrUZA.gif" /></figure><h4><strong>Usage</strong></h4><p>To install the package in your project, modify the pubspec.yaml file as follows. Replace the ‘^latest_version’ expression with the version available at ‘<a href="https://pub.dev/packages/step_progress_indicator/install">this link</a>’.</p><pre>dependencies:<br>  step_progress_indicator: ^latest_version</pre><h4><strong>Example</strong></h4><p>You can view the features provided by the package at ‘<a href="https://pub.dev/packages/step_progress_indicator/example">this link</a>’. Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47Jole9bZ21x7aJo1LEUSw.png" /></figure><pre>StepProgressIndicator(<br>    totalSteps: 100,<br>    currentStep: 32,<br>    size: 8,<br>    padding: 0,<br>    selectedColor: Colors.yellow,<br>    unselectedColor: Colors.cyan,<br>    roundedEdges: Radius.circular(10),<br>    selectedGradientColor: LinearGradient(<br>        begin: Alignment.topLeft,<br>        end: Alignment.bottomRight,<br>        colors: [Colors.yellowAccent, Colors.deepOrange],<br>    ),<br>    unselectedGradientColor: LinearGradient(<br>        begin: Alignment.topLeft,<br>        end: Alignment.bottomRight,<br>        colors: [Colors.black, Colors.blue],<br>    ),<br>),</pre><h3>2- Dotted Border</h3><p>A flutter package to let users easily add a dashed border around any widget.</p><p><a href="https://pub.dev/packages/dotted_border">https://pub.dev/packages/dotted_border</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*hMGXjkFW9Ga--M3Jfh0jZw.png" /></figure><h4>Usage</h4><p>To install the package in your project, modify the pubspec.yaml file as follows. Replace the ‘^latest_version’ expression with the version available at ‘<a href="https://pub.dev/packages/dotted_border/install">this link</a>’</p><pre>dependencies:<br>  dotted_border: ^latest_version</pre><p><strong>Example</strong></p><p>You can view the features provided by the package at ‘<a href="https://pub.dev/packages/dotted_border/example">this link</a>’. Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/1*MchOTxattTi-rOyk3vtVeA.png" /></figure><pre>DottedBorder(<br>  color: Colors.grey[400]!,<br>  dashPattern: const[8,4],<br>  child: Center(<br>    child: Icon(Icons.add,<br>      size: 10,<br>      color: Colors.grey,          <br>    ),<br>  ),<br>),</pre><h3>3- Lottie</h3><p>You can use this package to display Lottie animations in your Flutter application. You can click on ‘<a href="https://lottiefiles.com/">this link</a>’ for Lottie animations.</p><p><a href="https://pub.dev/packages/lottie">https://pub.dev/packages/lottie</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/146/1*V6i54zsxLz4DVwHASPNMcg.gif" /></figure><h4>Usage</h4><p>To install the package in your project, modify the pubspec.yaml file as follows. Replace the ‘^latest_version’ expression with the version available at ‘<a href="https://pub.dev/packages/lottie/install">this link</a>’</p><pre>dependencies:<br>  lottie: ^latest_version</pre><p>To be able to add and use the Lottie animations you’ve downloaded into your project files, create an ‘assets’ folder within your project, and make the following changes in the pubspec.yaml file. After making these changes, you can use the animations you’ve added to the assets folder in your project with the help of the Lottie package.</p><pre>assets:<br>     - assets/</pre><p><strong>Example</strong></p><p>You can view the features provided by the package at ‘<a href="https://pub.dev/packages/lottie/example">this link</a>’. Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*zpaVVIqsDOCCEySS-jHECA.gif" /></figure><pre>Stack(<br>  alignment: Alignment.center,<br>  children: [<br>    Lottie.asset(<br>      &#39;assets/animation_confetti.json&#39;,<br>      height: 300,<br>      reverse: true,<br>      repeat: false,<br>      fit: BoxFit.cover,<br>    ),                  <br>    Lottie.asset(<br>      &#39;assets/animation_paymentshield.json&#39;,<br>      height: 200,<br>      reverse: true,<br>      repeat: false,<br>      fit: BoxFit.cover<br>    ), <br>  ],<br>),</pre><h3>4- Flutter Easyloading</h3><p>A clean and lightweight loading/toast widget for Flutter. This package will come in handy when you want to display a widget on the screen in error scenarios, successful creation scenarios, etc.</p><p><a href="https://pub.dev/packages/flutter_easyloading">https://pub.dev/packages/flutter_easyloading</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*hjmLTExZ9k-6KDQmd7Y_CQ.gif" /></figure><h4>Usage</h4><p>To install the package in your project, modify the pubspec.yaml file as follows. Replace the ‘^latest_version’ expression with the version available at ‘<a href="https://pub.dev/packages/flutter_easyloading/install">this link</a>’</p><pre>dependencies:<br>  dotted_border: ^latest_version</pre><p><strong>Example</strong></p><p>You can view the features provided by the package at ‘<a href="https://pub.dev/packages/flutter_easyloading/example">this link</a>’. Here’s an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*UjLd0rXNwZBYMw6pJ2OF2g.png" /></figure><pre>EasyLoading.showInfo(&#39;Please create your task type&#39;); //1<br><br><br>EasyLoading.showSuccess(&#39;Create Success&#39;); //2<br><br><br>EasyLoading.showError(&#39;Duplicated Task&#39;); //3</pre><p><strong>Good Coding !</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41e263c19746" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[100% Secure Secret Sharing Among Developers]]></title>
            <link>https://walnutistanbul.medium.com/100-secure-secret-sharing-among-developers-e125ae1d9264?source=rss-b3874f1e56c4------2</link>
            <guid isPermaLink="false">https://medium.com/p/e125ae1d9264</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[free]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Walnut Software]]></dc:creator>
            <pubDate>Tue, 31 Oct 2023 13:15:09 GMT</pubDate>
            <atom:updated>2023-10-31T13:15:09.836Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*BeWphS8lMJZrKqV0CacQHQ.png" /></figure><h3>Revolutionize Confidential Sharing with Our Web App</h3><p>Experience the thrill of safeguarded secret sharing with our groundbreaking web application! We’re here to make sharing secrets not only secure but also engaging and exhilarating.</p><p>🤫 <strong>Built on a Foundation of Privacy:</strong> Our application is armed with state-of-the-art security measures to ensure your secrets stay safe. When you share your secrets, only the people you want to access them can do so.</p><p>🔒 <strong>Encryption and Expiry Dates:</strong> We use encryption to keep your secrets secure. What’s more, the link automatically expires after the sender’s designated number of views or specified days. This way, your secret remains protected until the right eyes meet it.</p><p>💬 <strong>Instant Message Viewing:</strong> Recipients can click on the link, and if it hasn’t expired, they’ll instantly unveil the message you’ve sent. It’s that simple and seamless.</p><p>🌟 <strong>Why Choose Our Web App?</strong></p><ul><li><strong>Security First: </strong>Your secrets are our top priority, and we’ve gone to great lengths to protect them.</li><li><strong>Customizable Control: </strong>You decide who gets to see your secret, and for how long.</li><li><strong>Effortless Sharing:</strong> Sharing secrets has never been this user-friendly.</li></ul><p>Discover the future of confidential sharing today. Try our web app and experience the joy of secure secret-sharing like never before!</p><p>🔗 <a href="https://secret.walnut.ist/">Get Started Now</a></p><p>Don’t miss out on the opportunity to revolutionize the way you share secrets. Your secrets, your control, your web app. Try it now!</p><h3>Sneak Peek: Unveiling Our Web App in Action</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*CvtAld7pW0KmMB6FUjlozg.png" /></figure><p>On this screen, you can write the secret you want to share, choose how many times it can be viewed using the ‘Expire After’ options, and decide how many days until it expires. Your secrets, your rules!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*JoQlV0DeAfDLh_YIXbNWWw.png" /></figure><p>On this screen, you can copy the link, remove the ‘include password’ option, and separate the link’s initial part from the password. This way, you can distribute the link’s initial part and password through various channels, further enhancing security.</p><p>When the recipient accesses the link’s initial part, they will be prompted to enter the password before gaining access to the secret you’ve shared. Your secrets, now with an extra layer of security!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*-dO66zciEeLI2Ius35bCow.png" /></figure><p>When your recipient opens the link, this screen will appear. If you separated the password in the previous step, you can enter it here and click the “View Secret” button to unlock the mystery. Your secrets, their excitement!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*z_rAXhZ1eRlhK07woLkXFg.png" /></figure><p>On this screen, you can see your secret. You have the option to copy the secret or download it in your preferred format. Your secrets, now at your fingertips!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*gVjl6KWGghc0xI9oeNBRqA.png" /></figure><p>If your secret has expired, this screen will appear when the link is opened, ensuring your secrets remain protected. Your secrets are always safeguarded.</p><p>🌐 In a world where privacy and security are paramount, our web application has redefined the way you share secrets. From customizable expiration dates and encryption to separating link components for enhanced security, we offer a seamless and secure experience. Your secrets are protected, your control is paramount, and your convenience is guaranteed. And if a secret has expired, rest assured, your secrets remain safeguarded. Join us today and experience the future of confidential sharing, where secrets are more than just safe — they’re under your command.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e125ae1d9264" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>