<?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 Shakil Ansari on Medium]]></title>
        <description><![CDATA[Stories by Shakil Ansari on Medium]]></description>
        <link>https://medium.com/@ansarishakil.ismail?source=rss-e5b194d67f18------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*y1Di4pb_KNLswwt5xzx9UA.jpeg</url>
            <title>Stories by Shakil Ansari on Medium</title>
            <link>https://medium.com/@ansarishakil.ismail?source=rss-e5b194d67f18------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:24:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ansarishakil.ismail/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 solved gradel version error follow step by step]]></title>
            <link>https://medium.com/@ansarishakil.ismail/how-to-solved-gradel-version-error-flow-step-by-stem-cb0938a22d58?source=rss-e5b194d67f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb0938a22d58</guid>
            <dc:creator><![CDATA[Shakil Ansari]]></dc:creator>
            <pubDate>Sun, 01 Jun 2025 16:17:12 GMT</pubDate>
            <atom:updated>2025-10-03T16:48:37.879Z</atom:updated>
            <content:encoded><![CDATA[<p>How to solved gradel version error follow step by step</p><pre>FAILURE: Build failed with an exception.<br><br>* What went wrong:<br>Execution failed for task &#39;:gradle:compileGroovy&#39;.<br>&gt; BUG! exception in phase &#39;semantic analysis&#39; in source unit &#39;C:\flutter\packages\flutter_tools\gradle\src\main\groovy\app_plugin_loader.groovy&#39; Unsupported class file major version 65<br><br>* Try:<br>&gt; Run with --stacktrace option to get the stack trace.<br>&gt; Run with --info or --debug option to get more log output.<br>&gt; Run with --scan to get full insights.<br><br>* Get more help at https://help.gradle.org<br><br>BUILD FAILED in 15s<br><br>┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐<br>│ [!] Your project&#39;s Gradle version is incompatible with the Java version that Flutter is using    │<br>│ for Gradle.                                                                                      │<br>│                                                                                                  │<br>│ If you recently upgraded Android Studio, consult the migration guide at                          │<br>│ https://flutter.dev/to/to/java-gradle-incompatibility.                                           │<br>│                                                                                                  │<br>│ Otherwise, to fix this issue, first, check the Java version used by Flutter by running `flutter  │<br>│ doctor --verbose`.                                                                               │<br>│                                                                                                  │<br>│ Then, update the Gradle version specified in                                                     │<br>│ D:\api_todo_app\android\gradle\wrapper\gradle-wrapper.properties to be compatible with that Java │<br>│ version. See the link below for more information on compatible Java/Gradle versions:             │<br>│ https://docs.gradle.org/current/userguide/compatibility.html#java                                │<br>│                                                                                                  │<br>│                                                                                                  │<br>└──────────────────────────────────────────────────────────────────────────────────────────────────┘<br>Error: Gradle task assembleDebug failed with exit code 1</pre><p>This is your looking error</p><blockquote>Step- 1 :-Go to setting file and open <a href="http://setting_gradel/">setting_gradel</a> and update plug</blockquote><pre>this is your old pluging <br>plugins {<br>    id &quot;dev.flutter.flutter-plugin-loader&quot; version &quot;1.0.0&quot;<br>    id &quot;com.android.application&quot; version &quot;7.3.0&quot; apply false<br>    id &quot;org.jetbrains.kotlin.android&quot; version &quot;1.7.10&quot; apply false<br>}<br>update pluging error <br>plugins {<br>    id &quot;dev.flutter.flutter-plugin-loader&quot; version &quot;1.0.0&quot;<br>    id &quot;com.android.application&quot; version &quot;7.3.1&quot; apply false<br>    id &quot;org.jetbrains.kotlin.android&quot; version &quot;2.1.20&quot; apply false<br>}</pre><p>Step-2 :- go to android file and open gradel and update gradel_wraper_propertise</p><pre>/// This is your old gradel version is 7.6.3;<br><br> distributionBase=GRADLE_USER_HOME<br>distributionPath=wrapper/dists<br>zipStoreBase=GRADLE_USER_HOME<br>zipStorePath=wrapper/dists<br>distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip<br><br>/// Updated your gradel version is 8.14.1;<br><br> distributionBase=GRADLE_USER_HOME<br>distributionPath=wrapper/dists<br>zipStoreBase=GRADLE_USER_HOME<br>zipStorePath=wrapper/dists<br>distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-all.zip</pre><p>Step-3 :- open Terminal and run comma</p><pre>flutter clenn<br>flutter pub get<br>flutter run</pre><p>Thanku Your project is running</p><p>Never GivUp in Your Life <a href="https://www.instagram.com/udaanbiz5132?igsh=aHQwdTFrbnAxZGM5">NeverGiveUp_in_Your_life</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb0938a22d58" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Flutter Firebase CRUD App [Create, Read, Update, Delete,and Search] Using Getx Follow…]]></title>
            <link>https://medium.com/@ansarishakil.ismail/how-to-create-flutter-firebase-crud-app-create-read-update-delete-and-search-using-getx-follow-eccc2af61335?source=rss-e5b194d67f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/eccc2af61335</guid>
            <dc:creator><![CDATA[Shakil Ansari]]></dc:creator>
            <pubDate>Fri, 07 Mar 2025 16:52:58 GMT</pubDate>
            <atom:updated>2025-03-09T01:23:54.295Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Create Flutter Firebase CRUD App [Create, Read, Update, Delete,and Search] Using Getx Follow Step by Step.</h3><blockquote><strong>t specifies a Flutter app that will be used to create, read, update and delete data. We’ll be creating a Flutter App in this tutorial. We’ll be using Firebase and Firestore to manage data. The concepts that we’ll learn in this tutorial are listed below.’</strong></blockquote><ul><li>Setup Firebase project and connect it to our Flutter app</li><li>Setup Firestore database that will be used to manage data</li></ul><h3>Create, update, Read and delete data from Firebase Firestore</h3><h3>Step 1: Create New Project And Setup Firebase’</h3><pre>flutter create project_name</pre><p>Add Dependenct</p><pre>flutter pub add firebase_core:<br>flutter pub add firebase_database,<br>flutter pub add get</pre><p><strong>Initialize Firebase:</strong> In your main.dart</p><pre>void main()async {<br>  WidgetsFlutterBinding.ensureInitialized();<br>  await Firebase.initializeApp(<br>    options: DefaultFirebaseOptions.currentPlatform,<br>  );<br>  runApp(const MyApp());<br>}<br>class MyApp extends StatelessWidget {<br><br><br>  const MyApp({super.key});<br>  @override<br>  Widget build(BuildContext context) {<br>    return GetMaterialApp(<br>          title: &#39;Flutter Demo&#39;,<br>          theme: ThemeData(<br>            colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),<br>            useMaterial3: true,<br>          ),<br>          home:  const HomeScreen(),<br>          debugShowCheckedModeBanner: false,<br>        );<br>  }<br>}</pre><h3>Step 2: Crude Opration’</h3><h3>1. Create</h3><p>Add an item to Firebase Database:</p><pre>class CrudeGetService extends GetxController {<br><br>  final DatabaseReference databaseRef= FirebaseDatabase.instance.ref(&quot;students&quot;);<br>  final TextEditingController userName = TextEditingController();<br>  final TextEditingController userEmail = TextEditingController();<br>  RxList userList = &lt;CrudeUserModel&gt;[].obs;<br><br><br>  Future&lt;void&gt; addUser() async {<br>    final newUserRef = databaseRef.push();<br>    await newUserRef.set({<br>      &quot;id&quot;: newUserRef.key,<br>      &quot;name&quot;: userName.text.trim(),<br>      &quot;email&quot;: userEmail.text.trim(),<br>    })<br>  }<br>}<br></pre><h3>2. Read</h3><p>Fetch items in real-time:<br>Below is the complete code for the screen that demonstrates real-time item fetching.</p><pre>Future&lt;void&gt; readUsers() async {<br>    final snapshot = await databaseRef.get();<br>    if (snapshot.exists) {<br>      final data = snapshot.value as Map;<br>      userList.value = data.entries.map((e) {<br>        return CrudeUserModel.fromJson(Map&lt;String, dynamic&gt;.from(e.value));<br>      }).toList();<br>    } else {<br>      Fluttertoast.showToast(msg: &quot;No Data&quot;);<br>    }<br>  }</pre><h3>3. Update</h3><p>Modify an existing item:</p><pre>Future&lt;void&gt; updateUser(String userId) async {<br>    await databaseRef.child(userId).update({<br>      &quot;name&quot;: userName.text.trim(),<br>      &quot;email&quot;: userEmail.text.trim(),<br>    });<br>  }</pre><h3>4. Delete</h3><p>Remove an item:</p><pre> Future&lt;void&gt; deleteUser(String userId) async {<br>    await dbRefs.child(userId).remove();<br>  }</pre><h3>4. Summary in this Crude App</h3><p>Create a GetXService and instance FirebaseDatabase storage</p><p>with two Controller name and number</p><pre>class GetxService extends GetxController {<br>  final DatabaseReference databaseRef= FirebaseDatabase.instance.ref(&quot;students&quot;);<br>  final TextEditingController userName = TextEditingController();<br>  final TextEditingController userNumber = TextEditingController();<br>  RxList userList = &lt;CrudeUserModel&gt;[].obs;<br>  Future&lt;void&gt; addUser() async {<br>    final newUserRef = databaseRef.push();<br>    await newUserRef.set({<br>      &quot;id&quot;: newUserRef.key,<br>      &quot;name&quot;: userName.text.trim(),<br>      &quot;number&quot;: userNumber.text.trim(),<br>    });<br>    Get.showSnackbar(GetSnackBar(title:&quot;Insert User Success&quot;,message: &quot;$userName&quot;, snackPosition: SnackPosition.TOP,duration: const Duration(milliseconds: 500),));<br>    readUser();<br>    userName.clear();<br>    userNumber.clear();<br>  }<br><br>  Future&lt;void&gt; readUser() async {<br>    final snapshot = await dbRefs.get();<br>    if (snapshot.exists) {<br>      final data = snapshot.value as Map;<br>      userList.value = data.entries.map((e) {<br>        return CrudeUserModel.fromJson(Map&lt;String, dynamic&gt;.from(e.value));<br>      }).toList();<br>    } else {<br>      Fluttertoast.showToast(msg: &quot;No Data&quot;);<br>    }<br>  }<br>  Future&lt;void&gt; updateUser(String userId) async {<br>    await databaseRef.child(userId).update({<br>      &quot;name&quot;: userName.text.trim(),<br>      &quot;number&quot;: userNumber.text.trim(),<br>    });<br>    readUser();<br>    userName.clear();<br>    userNumber.clear();<br>  }<br>  Future&lt;void&gt; deleteUser(String userId) async {<br>    await databaseRef.child(userId).remove();<br>    readUser();<br>  }<br>}</pre><h3>5. Show Data in HomeScreen,</h3><pre><br>class HomeScreen extends StatefulWidget {<br>  const CrudeHomePage({super.key});<br>  @override<br>  State&lt;HomeScreen&gt; createState() =&gt; _HomeScreenState();<br>}<br>class _HomeScreenState extends State&lt;HomeScreen&gt; {<br>  var getService = Get.put(GetxService());<br>  @override<br>  void initState() {<br>    super.initState();<br>    getService.readUser();<br>  }<br>  @override<br>  Widget build(BuildContext context) {<br>    var getService = Get.put(GetxService());<br>    return Scaffold(<br>      backgroundColor: const Color(0xFF1d2630),<br>      appBar: AppBar(<br>        title:<br>            const Text(&quot;FirebaseDatabase Crude&quot;, style: TextStyle(fontSize: 21,color: Colors.white,fontWeight: FontWeight.bold)),<br>        backgroundColor: const Color(0xFF1d2630),<br>      ),<br>      body:<br>      Column(<br>        children: [<br>          Padding(<br>            padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 10),<br>            child: TextField(<br>              onChanged: (query) {<br><br>           },<br>              cursorColor: Colors.white70,<br>              style: const TextStyle(fontSize: 10, color: Colors.white70),<br>              decoration: InputDecoration(<br>                prefixIcon: const Icon(<br>                  Icons.search,<br>                  color: Colors.white70,<br>                ),<br>                suffixIcon: IconButton(<br>                    onPressed: () {},<br>                    icon:  const Icon(<br>                      Icons.mic,<br>                      color: Colors.white70,<br>                    )),<br>                hintText: &quot;Search User....&quot;,<br>                border:  const OutlineInputBorder(<br>                    borderRadius: BorderRadius.only(<br>                      topRight: Radius.circular(20),<br>                      topLeft: Radius.circular(20),<br>                      bottomRight: Radius.circular(20),<br>                      bottomLeft: Radius.circular(20),<br>                    ),<br>                    borderSide: BorderSide(<br>                      color: Colors.white,<br>                      style: BorderStyle.solid,<br>                      width: 2,<br>                      strokeAlign: Material.defaultSplashRadius,<br>                    ),<br>                    gapPadding: 2),<br>                hintStyle: TextStyle(fontWeight: FontWeight.bold),<br>                fillColor: Colors.white,<br>                focusedBorder: OutlineInputBorder(<br>                  borderRadius: BorderRadius.circular(20),<br>                  borderSide: const BorderSide(<br>                    color: Colors.white60,<br>                    width: 2,<br>                  ),<br>                ),<br>              ),<br>            ),<br>          ),<br>          Expanded(<br>            child: Obx(<br>              () {<br>                return ListView.builder(<br>                  itemCount: getService.userList.length,<br>                  itemBuilder: (context, index) {<br>                    final user = getService.userList[index];<br>                    return ListTile(<br>                      title: Text(user.name ?? &quot;User Name&quot;,<br>                          style: const TextStyle(color: Colors.white70, fontSize: 18)),<br>                      subtitle: Text(user.email ?? &quot;User Contact&quot;,<br>                          style: const TextStyle(color: Colors.white70, fontSize: 15)),<br>                      leading:  CircleAvatar(<br>                        backgroundColor: Colors.green,<br>                        child: Text(user.name[index][0].toString().toUpperCase(),style: const TextStyle(fontSize: 20,color: Colors.white,fontWeight: FontWeight.bold),),<br>                      ),<br>                      trailing: PopupMenuButton(<br>                        icon: const Icon(Icons.more_vert, color: Colors.green),<br>                        color: Colors.white70,<br>                        itemBuilder: (context) =&gt; [<br>                          PopupMenuItem(<br>                            child: ListTile(<br>                              leading: const Icon(Icons.edit),<br>                              title: const Text(&quot;Update&quot;),<br>                              onTap: () {<br>                                Navigator.pop(context);<br>                                getService.userName.text = user.name ?? &#39;&#39;;<br>                                getService.userNumber.text = user.number?? &#39;&#39;;<br>                                showDialog(<br>                                    context: context,<br>                                    builder: (context) {<br>                                      return BottomSheet(<br>                                        onClosing: () {<br>                                          Navigator.pop(context);<br>                                        },<br>                                        builder: (context) {<br>                                          return Padding(<br>                                            padding: EdgeInsets.only(<br>                                                left: 0,<br>                                                right: 0,<br>                                                bottom: MediaQuery.of(context)<br>                                                    .viewInsets<br>                                                    .bottom),<br>                                            child: SizedBox(<br>                                              height:<br>                                                  MediaQuery.of(context).size.height /<br>                                                      3,<br>                                              width:<br>                                                  MediaQuery.of(context).size.width,<br>                                              child: Column(<br>                                                children: [<br>                                                  Padding(<br>                                                    padding:<br>                                                        const EdgeInsets.symmetric(<br>                                                            horizontal: 20,<br>                                                            vertical: 12),<br>                                                    child: TextField(<br>                                                      controller: getService.userName,<br>                                                      decoration: InputDecoration(<br>                                                        suffixIcon:<br>                                                            const Icon(Icons.person),<br>                                                        border: OutlineInputBorder(<br>                                                            borderRadius:<br>                                                                BorderRadius.circular(<br>                                                                    15)),<br>                                                        hintText: &quot;Enter Name&quot;,<br>                                                      ),<br>                                                    ),<br>                                                  ),<br>                                                  Padding(<br>                                                    padding:<br>                                                        const EdgeInsets.symmetric(<br>                                                            horizontal: 20,<br>                                                            vertical: 20),<br>                                                    child: TextField(<br>                                                      controller:<br>                                                          getService.userNumber,<br>                                                      decoration: InputDecoration(<br>                                                        suffixIcon:<br>                                                            const Icon(Icons.call),<br>                                                        border: OutlineInputBorder(<br>                                                            borderRadius:<br>                                                                BorderRadius.circular(<br>                                                                    15)),<br>                                                        hintText:<br>                                                            &quot;Enter Number&quot;,<br>                                                      ),<br>                                                    ),<br>                                                  ),<br>                                                  Padding(<br>                                                    padding:<br>                                                        const EdgeInsets.symmetric(<br>                                                            horizontal: 20,<br>                                                            vertical: 20),<br>                                                    child: SizedBox(<br>                                                      height: 40,<br>                                                      width: 250,<br>                                                      child: ElevatedButton(<br>                                                        onPressed: () {<br>                                                          getService<br>                                                              .updateUser(user.id!);<br>                                                          Navigator.pop(context);<br>                                                        },<br>                                                        child:<br>                                                            const Text(&quot;Update User&quot;),<br>                                                      ),<br>                                                    ),<br>                                                  ),<br>                                                ],<br>                                              ),<br>                                            ),<br>                                          );<br>                                        },<br>                                      );<br>                                    });<br>                              },<br>                            ),<br>                          ),<br>                          PopupMenuItem(<br>                            child: ListTile(<br>                              leading: const Icon(Icons.delete),<br>                              title: const Text(&quot;Delete&quot;),<br>                              onTap: () {<br>                                Navigator.pop(context);<br>                                getService.deleteUser(user.id!);<br>                              },<br>                            ),<br>                          ),<br>                        ],<br>                      ),<br>                    );<br>                  },<br>                );<br>              },<br>            ),<br>          ),<br>        ],<br>      ),<br><br>      floatingActionButton: FloatingActionButton.extended(<br>        onPressed: () {<br>          showAppDialogs(dialogTitle: &quot;Add New User&quot;, setButton: &#39;Add User&#39;);<br>        },<br>        label: const Icon(Icons.add, color: Colors.white),<br>        backgroundColor: Colors.orangeAccent,<br>      ),<br>    );<br>  }<br>  void showAppDialogs({required String dialogTitle, required String setButton}) {<br>    showDialog(<br>      context: context,<br>      builder: (context) {<br>        return Center(<br>          child: Padding(<br>            padding: EdgeInsets.only(<br>                bottom: MediaQuery.of(context).viewInsets.bottom),<br>            child: SizedBox(<br>              height: MediaQuery.of(context).size.height * 0.5,<br>              width: double.infinity,<br>              child: Card(<br>                shape: RoundedRectangleBorder(<br>                  borderRadius: BorderRadius.circular(30),<br>                  side: const BorderSide(width: 3, color: Colors.orange),<br>                ),<br>                color: Colors.white,<br>                child: Column(<br>                  children: [<br>                    const Padding(<br>                      padding: EdgeInsets.only(left: 20, top: 20),<br>                      child: Text(&quot;Add New User&quot;,<br>                          style: TextStyle(<br>                              fontSize: 20,<br>                              fontWeight: FontWeight.bold,<br>                              color: Colors.orange)),<br>                    ),<br>                    const SizedBox(height: 10),<br>                    InkWell(<br>                      onTap: () {<br><br>                      },<br>                      child: const CircleAvatar(<br>                        radius: 40,<br>                        backgroundImage:<br>                              AssetImage(<br>                            &quot;assets/images/main_home_image.jpeg&quot;),<br>                        backgroundColor: Colors.orange,<br>                      ),<br>                    ),<br>                    Padding(<br>                      padding: const EdgeInsets.symmetric(<br>                          horizontal: 10, vertical: 10),<br>                      child: TextField(<br>                        controller: getService.userName,<br>                        keyboardType: TextInputType.name,<br>                        style: const TextStyle(color: Colors.orange),<br>                        decoration: const InputDecoration(<br>                          border: OutlineInputBorder(<br>                              borderRadius:<br>                              BorderRadius.all(Radius.circular(15))),<br>                          labelText: &quot;Enter Your Name&quot;,<br>                          labelStyle: TextStyle(color: Colors.orange),<br>                          prefixIcon: Icon(Icons.person, color: Colors.orange),<br>                        ),<br>                      ),<br>                    ),<br>                    Row(<br>                      children: [<br>                        Padding(<br>                          padding: const EdgeInsets.only(<br>                            left: 10,<br>                          ),<br>                          child: SizedBox(<br>                            width: 200,<br>                            height: 60,<br>                            child: TextField(<br>                              maxLength: 12,<br>                              controller: getService.userNumbe,<br>                              keyboardType: TextInputType.phone,<br>                              style: const TextStyle(color: Colors.orange),<br>                              decoration:  const InputDecoration(<br>                                border: OutlineInputBorder(<br>                                    borderRadius:<br>                                    BorderRadius.all(Radius.circular(15))),<br>                                labelText: &quot;Enter Mobile Number&quot;,<br>                                labelStyle: TextStyle(color: Colors.orange),<br>                                prefixIcon:<br>                                Icon(Icons.phone, color: Colors.orange),<br>                              ),<br>                            ),<br>                          ),<br>                        ),<br>                        const SizedBox(<br>                          width: 5,<br>                        ),<br>                        FloatingActionButton.extended(<br>                          backgroundColor: Colors.orange,<br>                          onPressed: () {<br><br>                          },<br>                          label: const Row(<br>                            children: [<br>                              Icon(<br>                                Icons.contact_page,<br>                                color: Colors.white,<br>                              ),<br>                              SizedBox(<br>                                width: 5,<br>                              ),<br>                              Text(&quot;Contact&quot;,<br>                                  style: TextStyle(<br>                                      fontSize: 18,<br>                                      fontWeight: FontWeight.bold,<br>                                      color: Colors.white)),<br>                            ],<br>                          ),<br>                        ),<br>                      ],<br>                    ),<br>                    Padding(<br>                      padding: const EdgeInsets.symmetric(<br>                          horizontal: 10, vertical: 20),<br>                      child: SizedBox(<br>                        width: 350,<br>                        height: 50,<br>                        child: ElevatedButton(<br>                          style: const ButtonStyle(<br>                              backgroundColor:<br>                              WidgetStatePropertyAll(Colors.orange)),<br>                          onPressed: () {<br>                            getService.addUser();<br>                            Get.back();<br>                          },<br>                          child: const Text(&quot;Save&quot;,<br>                              style: TextStyle(<br>                                  fontSize: 20,<br>                                  fontWeight: FontWeight.bold,<br>                                  color: Colors.white)),<br>                        ),<br>                      ),<br>                    ),<br>                  ],<br>                ),<br>              ),<br>            ),<br>          ),<br>        );<br>      },<br>    );<br>  }<br>}</pre><p>Never Give Up In this Life <a href="https://www.instagram.com/share/reel/BAH20ER9Ut">https://www.instagram.com/share/reel/BAH20ER9Ut</a></p><p>follow me</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eccc2af61335" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How can You solve this Flutter Kotlin version error? I explane step by step.]]></title>
            <link>https://medium.com/@ansarishakil.ismail/fixed-error-kotlin-version-9699b2e0f57a?source=rss-e5b194d67f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/9699b2e0f57a</guid>
            <dc:creator><![CDATA[Shakil Ansari]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 17:14:35 GMT</pubDate>
            <atom:updated>2025-01-29T17:44:14.646Z</atom:updated>
            <content:encoded><![CDATA[<p>This is Your Flutter Kotlin Version Error</p><p>* What went wrong:<br>Execution failed for task ‘:app:compileDebugKotlin’.<br>&gt; A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction<br> &gt; Compilation error. See log for more details</p><p>* Try:<br>&gt; Run with — stacktrace option to get the stack trace.<br>&gt; Run with — info or — debug option to get more log output.<br>&gt; Run with — scan to get full insights.</p><p>* Get more help at <a href="https://help.gradle.org/">https://help.gradle.org</a></p><p>BUILD FAILED in 36s</p><p>┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────┐<br>│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │<br>│ Find the latest version on <a href="https://kotlinlang.org/docs/releases.html#release-details">https://kotlinlang.org/docs/releases.html#release-details</a>, then │<br>│ update the │<br>│ version number of the plugin with id “org.jetbrains.kotlin.android” in the plugins block of │<br>│ D:\mycalculator\android\settings.gradle. │<br>│ │<br>│ Alternatively (if your project was created before Flutter 3.19), update │<br>│ D:\mycalculator\android\build.gradle │<br>│ ext.kotlin_version = ‘&lt;latest-version&gt;’ │<br>└──────────────────────────────────────────────────────────────────────────────────────────────┘<br>Error: Gradle task assembleDebug failed with exit code 1</p><p>Step 1 — Go to s<a href="http://settings.gradle/">ettings.gradle</a> change Version</p><pre>pluginManagement {<br>    def flutterSdkPath = {<br>        def properties = new Properties()<br>        file(&quot;local.properties&quot;).withInputStream { properties.load(it) }<br>        def flutterSdkPath = properties.getProperty(&quot;flutter.sdk&quot;)<br>        assert flutterSdkPath != null, &quot;flutter.sdk not set in local.properties&quot;<br>        return flutterSdkPath<br>    }()<br><br>    includeBuild(&quot;$flutterSdkPath/packages/flutter_tools/gradle&quot;)<br><br>    repositories {<br>        google()<br>        mavenCentral()<br>        gradlePluginPortal()<br>    }<br>}<br>// old Version<br>plugins {<br>    id &quot;dev.flutter.flutter-plugin-loader&quot; version &quot;1.0.0&quot;<br>    id &quot;com.android.application&quot; version &quot;7.3.0&quot; apply false<br>    id &quot;org.jetbrains.kotlin.android&quot; version &quot;1.7.10&quot; apply false<br>}<br><br>include &quot;:app&quot;<br></pre><p>Get Solution Step by Step</p><h4>Step — 1 . Open <a href="http://settings.gradle/">settings.gradle</a></h4><p>Step — 2 Change kotlin version</p><pre>// Change New Version<br>plugins {<br>    id &quot;dev.flutter.flutter-plugin-loader&quot; version &quot;1.0.0&quot;<br>    id &quot;com.android.application&quot; version &quot;7.3.1&quot; apply false<br>    id &quot;org.jetbrains.kotlin.android&quot; version &quot;2.1.10&quot; apply false<br>}</pre><p>Step — 3 Go to Terminal and command</p><pre>flutter clean<br>flutter run </pre><p>Flutter run Success ;</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9699b2e0f57a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Building a Simple Calculator App with Flutter using State Management(Provider)?]]></title>
            <link>https://medium.com/@ansarishakil.ismail/building-a-simple-calculator-app-with-flutter-using-statemanagement-provider-8e4c21d2e842?source=rss-e5b194d67f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e4c21d2e842</guid>
            <dc:creator><![CDATA[Shakil Ansari]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 01:50:26 GMT</pubDate>
            <atom:updated>2025-01-29T17:52:13.014Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*ZUBOrm5FyulKILh4jQmnxA.jpeg" /></figure><p>I hope you might be interested in building your own calculator using Flutter. In this blog, I’ll guide you through the process of creating a basic calculator app from scratch. Before we dive into the coding section, it is important to check whether Flutter and Dart are properly installed in the machine.</p><h3>Step 1: Creating the Project</h3><p>Open your terminal and run the following command to create a new Flutter project:</p><pre>flutter create calculator_app</pre><p>This will create a new Flutter project named mycalculator_app</p><h3>Step 2: Writing the Calculator Package in pubspec.yaml</h3><pre>dependencies:<br>  flutter:<br>    sdk: flutter<br>  cupertino_icons: ^1.0.8<br>  math_expressions: ^2.6.0<br>  provider: ^6.1.2</pre><h3>Step 3: Writing the Calculator Logic in Provider</h3><p>Navigate to the lib directory of your project and replace the contents of calculate_provider.dart with the following code:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:math_expressions/math_expressions.dart&#39;;<br><br>class CalculateProvider with ChangeNotifier {<br>  late String userInput = &quot;&quot;;<br>  String result = &quot;0&quot;;<br><br>  List&lt;String&gt; buttonList = [<br>    &#39;AC&#39;,<br>    &#39;(&#39;,<br>    &#39;)&#39;,<br>    &#39;/&#39;,<br>    &#39;7&#39;,<br>    &#39;8&#39;,<br>    &#39;9&#39;,<br>    &#39;x&#39;,<br>    &#39;4&#39;,<br>    &#39;5&#39;,<br>    &#39;6&#39;,<br>    &#39;+&#39;,<br>    &#39;1&#39;,<br>    &#39;2&#39;,<br>    &#39;3&#39;,<br>    &#39;-&#39;,<br>    &#39;%&#39;,<br>    &#39;0&#39;,<br>    &#39;.&#39;,<br>    &#39;=&#39;<br>  ];<br><br>  Color getColor(String text, BuildContext context) {<br>    if (text == &quot;/&quot; ||<br>        text == &quot;x&quot; ||<br>        text == &quot;-&quot; ||<br>        text == &quot;%&quot; ||<br>        text == &quot;(&quot; ||<br>        text == &quot;)&quot; ||<br>        text == &quot;+&quot; ||<br>        text == &quot;=&quot;) {<br>      return const Color.fromARGB(225, 252, 100, 100);<br>    }<br>    return Colors.white;<br>  }<br><br>  Color getBgColor(String text, BuildContext context) {<br>    if (text == &quot;AC&quot;) {<br>      return const Color.fromARGB(255, 252, 100, 100);<br>    }<br>    if (text == &quot;=&quot;) {<br>      return const Color.fromARGB(255, 104, 204, 159);<br>    }<br><br>    return const Color(0xFF1d2630);<br>  }<br><br>  void handleButton(String text, BuildContext context) {<br>    if (text == &quot;AC&quot;) {<br>      userInput = &quot;&quot;;<br>      result = &quot;0&quot;;<br>    } else if (text == &quot;=&quot;) {<br>      result = calculate(context);<br>      // userInput = result;<br>      if (userInput.endsWith(&quot;.0&quot;)) {<br>        result = result.replaceAll(&quot;.0&quot;, &quot;&quot;);<br>      }<br>    } else if (text == &quot;%&quot;) {<br>      if (userInput.isNotEmpty &amp;&amp;<br>          !isOperator(userInput[userInput.length - 1])) {<br>        userInput += text;<br>      }<br>    } else if (text == &quot;backspace&quot;) {<br>      if (userInput.isNotEmpty) {<br>        userInput = userInput.substring(<br>            0, userInput.length - 1);<br>      }<br>    } else {<br>      userInput += text;<br>    }<br><br>    notifyListeners();<br>  }<br><br>  bool isOperator(String text) {<br>    return text == &quot;/&quot; ||<br>        text == &quot;x&quot; ||<br>        text == &quot;+&quot; ||<br>        text == &quot;-&quot; ||<br>        text == &quot;%&quot;;<br>  }<br><br>  String calculate(BuildContext context) {<br>    try {<br>      var formattedInput =<br>          userInput.replaceAll(&#39;x&#39;, &#39;*&#39;).replaceAll(&#39;%&#39;, &#39;/100&#39;);<br>      var exp = Parser().parse(formattedInput);<br>      var evaluate = exp.evaluate(EvaluationType.REAL, ContextModel());<br>      return evaluate.toString();<br>    } catch (e) {<br>      return &quot;Wrong Calculate ${e.toString().toLowerCase()}&quot;;<br>    }<br>  }<br>}</pre><h3>Step 4: Writing the Calculator Styling and UI</h3><p>Navigate to the lib directory of your project and replace the contents of home_screen.dart with the following code:</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:font_awesome_flutter/font_awesome_flutter.dart&#39;;<br>import &#39;package:mycalculator/calculater_screens/advanced_calculate_screen.dart&#39;;<br>import &#39;package:mycalculator/calculator_provider/calclute_provider.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;<br><br>class CalculateScreen extends StatelessWidget {<br>  const CalculateScreen({super.key});<br><br>  @override<br>  Widget build(BuildContext context) {<br>    var calculatorProvider = Provider.of&lt;CalculateProvider&gt;(context);<br>    return<br>      Scaffold(<br>      backgroundColor: const Color(0xFF1d2630),<br>      body: SafeArea(<br>        child: Column(<br>          mainAxisAlignment: MainAxisAlignment.end,<br>          children: [<br>            SingleChildScrollView(<br>              scrollDirection: Axis.vertical,<br>              child: SizedBox(<br>                height: MediaQuery.of(context).size.height / 3.35,<br>                child: Column(<br>                  children: [<br>                    Row(<br>                      mainAxisAlignment: MainAxisAlignment.end,<br>                      children: [<br>                        Padding(<br>                          padding:  const EdgeInsets.only(top: 0, right: 5),<br>                          child: IconButton(<br>                              onPressed: () {<br>                                Navigator.push(context, MaterialPageRoute(builder: (context) =&gt; const AdvancedCalculateScreen(),));<br>                              },<br>                              icon: const FaIcon(<br>                                FontAwesomeIcons.squareRootVariable,<br>                                color: Colors.white,<br>                                size: 20,<br>                              ),),<br>                        ),<br>                        Padding(<br>                          padding: const EdgeInsets.only(top: 0, right: 10),<br>                          child: IconButton(<br>                              onPressed: () {},<br>                              icon: const Icon(<br>                                Icons.history,<br>                                color: Colors.white,<br>                                size: 20,<br>                              )),<br>                        ),<br>                      ],<br>                    ),<br>                    Container(<br>                      padding: const EdgeInsets.all(20),<br>                      alignment: Alignment.bottomRight,<br>                      child: SingleChildScrollView(<br>                        scrollDirection: Axis.horizontal,<br>                        child: Padding(<br>                          padding: const EdgeInsets.only(top: 2, right: 2),<br>                          child: Row(<br>                            mainAxisAlignment: MainAxisAlignment.end,<br>                            children: [<br>                              Text(<br>                                calculatorProvider.userInput,<br>                                maxLines: 2,<br>                                style: const TextStyle(<br>                                  fontSize: 32,<br>                                  color: Colors.white,<br>                                ),<br>                              ),<br>                            ],<br>                          ),<br>                        ),<br>                      ),<br>                    ),<br>                    Container(<br>                      padding: const EdgeInsets.only(top: 15, right: 2),<br>                      alignment: Alignment.bottomRight,<br>                      child: Row(<br>                        mainAxisAlignment: MainAxisAlignment.end,<br>                        children: [<br>                          Padding(<br>                            padding: const EdgeInsets.only(right: 10),<br>                            child: Text(<br>                              calculatorProvider.result,<br>                              style: const TextStyle(<br>                                  fontSize: 48,<br>                                  color: Colors.white,<br>                                  fontWeight: FontWeight.bold),<br>                            ),<br>                          ),<br>                        ],<br>                      ),<br>                    ),<br>                  ],<br>                ),<br>              ),<br>            ),<br>            const Divider(<br>              color: Colors.white70,<br>            ),<br>            Column(<br>              crossAxisAlignment: CrossAxisAlignment.start,<br>              mainAxisAlignment: MainAxisAlignment.start,<br>              children: [<br>                Row(<br>                  mainAxisAlignment: MainAxisAlignment.end,<br>                  children: [<br>                    Padding(<br>                      padding: const EdgeInsets.only(right: 10),<br>                      child: IconButton(<br>                          onPressed: () {<br>                            calculatorProvider.handleButton(&quot;backspace&quot;, context);<br>                          },<br>                          icon: const Icon(<br>                            Icons.backspace,<br>                            color: Colors.red,<br>                            size: 18,<br>                          )),<br>                    )<br>                  ],<br>                ),<br>              ],<br>            ),<br>            Expanded(<br>              child: Container(<br>                padding: const EdgeInsets.all(5.0),<br>                child: GridView.builder(<br>                  itemCount: calculatorProvider.buttonList.length,<br>                  gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(<br>                      crossAxisCount: 4,<br>                      crossAxisSpacing: 10,<br>                      mainAxisSpacing: 10),<br>                  itemBuilder: (BuildContext context, int index) {<br>                    return customButton(<br>                        calculatorProvider.buttonList[index], context);<br>                  },<br>                ),<br>              ),<br>            ),<br>          ],<br>        ),<br>      ),<br>    );<br>  }<br><br>  Widget customButton(String text, BuildContext context) {<br>    var calculatorProvider = Provider.of&lt;CalculateProvider&gt;(context);<br>    return InkWell(<br>      splashColor: const Color(0xFF1d2630),<br>      onTap: () {<br>        calculatorProvider.handleButton(text, context);<br>      },<br>      child: Container(<br>        decoration: BoxDecoration(<br>          color: calculatorProvider.getBgColor(text, context),<br>          borderRadius: BorderRadius.circular(10),<br>          boxShadow: [<br>            BoxShadow(<br>              color: Colors.white.withOpacity(0.2),<br>              blurRadius: 4,<br>              offset: const Offset(-3, -3),<br>            ),<br>          ],<br>        ),<br>        child: Center(<br>          child: Text(<br>            text,<br>            style: TextStyle(<br>                fontSize: 30,<br>                fontWeight: FontWeight.bold,<br>                color: calculatorProvider.getColor(text, context)),<br>          ),<br>        ),<br>      ),<br>    );<br>  }<br>}</pre><h3>Step 4 Go to main.dart</h3><p>main.dart</p><pre>import &#39;package:flutter/material.dart&#39;;<br>import &#39;package:hive_flutter/adapters.dart&#39;;<br>import &#39;package:mycalculator/calculator_provider/advanced_calculater_provider.dart&#39;;<br>import &#39;package:mycalculator/calculator_provider/calclute_provider.dart&#39;;<br>import &#39;package:mycalculator/screens/user_screens.dart&#39;;<br>import &#39;package:provider/provider.dart&#39;;<br><br>import &#39;calculator_provider/user_provider.dart&#39;;<br><br>void main() async{<br>  WidgetsFlutterBinding.ensureInitialized();<br> await Hive.initFlutter();<br>  await Hive.openBox(&quot;UserBox&quot;);<br><br>  runApp(const MyApp());<br>}<br>class MyApp extends StatelessWidget {<br>  const MyApp({super.key});<br><br>  @override<br>  Widget build(BuildContext context) {<br>    return MultiProvider(<br>      providers: [<br>        ChangeNotifierProvider(create: (context) =&gt; CalculateProvider()),<br>        ChangeNotifierProvider(create: (context) =&gt; AdvancedCalculatorProvider(),),<br>       <br>      ],<br>      child: MaterialApp(<br>        title: &#39;Flutter Demo&#39;,<br>        theme: ThemeData(<br>          colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),<br>          useMaterial3: true,<br>        ),<br>        home:   const UserScreens(),<br>        debugShowCheckedModeBanner: false,<br>      ),<br>    );<br>  }<br>}</pre><h3>Step 5: Testing and Running</h3><p>Run your calculator app using the following command in your terminal:</p><pre>flutter run</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*ZUBOrm5FyulKILh4jQmnxA.jpeg" /></figure><p>Never Give Up in this Life</p><p><a href="https://www.instagram.com/reel/DDjZHufSD8dYcGaOM1p90p7comsgWlLRgylwqI0/?igsh=MXAzNHhiaGY1bzl1Mw==">https://www.instagram.com/reel/DDjZHufSD8dYcGaOM1p90p7comsgWlLRgylwqI0/?igsh=MXAzNHhiaGY1bzl1Mw==</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e4c21d2e842" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Crude Simple List in Kotlin Android]]></title>
            <link>https://medium.com/@ansarishakil.ismail/crude-simple-list-in-kotlin-android-8af41785ceba?source=rss-e5b194d67f18------2</link>
            <guid isPermaLink="false">https://medium.com/p/8af41785ceba</guid>
            <category><![CDATA[android-kotlin-basic]]></category>
            <dc:creator><![CDATA[Shakil Ansari]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 18:52:19 GMT</pubDate>
            <atom:updated>2025-01-21T16:05:01.258Z</atom:updated>
            <content:encoded><![CDATA[<p>Crude(Add ,Remove ,Update ,fetch And Search Data) Simple List With Model Using Kotlin in Android.</p><p>Hi all!</p><p>Today I’d like to share with you how we can create a <a href="https://en.wikipedia.org/wiki/Create,_read,_update_and_delete">CRUD</a> design for our apps’ access to (local) database resources.</p><p>Let’s assume we’re going to implement this in simple list add fetch delete and update Data learn Kotlin app.</p><p>Easy to implement and use<br>Good performance<br>Good support documentation<br>As for the coding part, we’re going to use Kotlin for this tutorial.</p><p>The first thing we need to do is to configure the project to include ObjectBox. To prevent deviating from this article’s aim, please follow the steps listed here.</p><p>For simplicity, let’s just consider learn Simple Crude With ListView</p><p>Xml File</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;RelativeLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;<br>    xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot;<br>    xmlns:tools=&quot;http://schemas.android.com/tools&quot;<br>    android:layout_width=&quot;match_parent&quot;<br>    android:orientation=&quot;vertical&quot;<br>    android:layout_height=&quot;match_parent&quot;<br>    tools:context=&quot;.MainActivity&quot;&gt;<br>    &lt;androidx.appcompat.widget.Toolbar<br>        android:layout_width=&quot;match_parent&quot;<br>        android:background=&quot;#034E06&quot;<br>        style=&quot;@style/Widget.MaterialComponents.Toolbar.Primary&quot;<br>        app:menu=&quot;@menu/list_menu&quot;<br>        android:layout_height=&quot;wrap_content&quot;&gt;<br>        &lt;ImageView<br>            android:layout_width=&quot;60dp&quot;<br>            android:id=&quot;@+id/backButton_ImageView&quot;<br>            android:src=&quot;@drawable/backbutton&quot;<br>            android:layout_height=&quot;40dp&quot;/&gt;<br>        &lt;TextView<br>            android:layout_width=&quot;wrap_content&quot;<br>            android:textStyle=&quot;bold&quot;<br>            android:textColor=&quot;@color/white&quot;<br>            android:textSize=&quot;25dp&quot;<br>            android:text=&quot;All Students&quot;<br>            android:layout_height=&quot;wrap_content&quot;/&gt;<br>        &lt;androidx.cardview.widget.CardView<br>            android:layout_width=&quot;30dp&quot;<br>            android:layout_gravity=&quot;center&quot;<br>            android:layout_marginLeft=&quot;80dp&quot;<br>            app:cardCornerRadius=&quot;100dp&quot;<br>            android:layout_height=&quot;30dp&quot;&gt;<br>            &lt;ImageView<br>                android:layout_width=&quot;30sp&quot;<br>                android:id=&quot;@+id/imageLogo_ImageView&quot;<br>                android:src=&quot;@drawable/logo_school&quot;<br>                android:layout_height=&quot;30sp&quot;/&gt;<br>        &lt;/androidx.cardview.widget.CardView&gt;<br><br>    &lt;/androidx.appcompat.widget.Toolbar&gt;<br>    &lt;androidx.cardview.widget.CardView<br>        android:layout_width=&quot;match_parent&quot;<br>        android:layout_marginTop=&quot;60dp&quot;<br>        app:cardCornerRadius=&quot;40dp&quot;<br>        android:layout_marginHorizontal=&quot;20dp&quot;<br>        android:layout_height=&quot;wrap_content&quot;&gt;<br><br>        &lt;androidx.appcompat.widget.SearchView<br>            android:id=&quot;@+id/idBaseSearch_SearchView&quot;<br>            android:layout_width=&quot;match_parent&quot;<br>            android:layout_height=&quot;match_parent&quot;<br>            android:layout_marginHorizontal=&quot;20dp&quot;<br>            android:gravity=&quot;end&quot;<br>            app:iconifiedByDefault=&quot;false&quot;<br>            app:queryHint=&quot;Search Student Name&quot;/&gt;<br>        &lt;ImageView<br>            android:layout_width=&quot;50dp&quot;<br>            android:layout_marginStart=&quot;250dp&quot;<br>            android:id=&quot;@+id/speak_ImageView&quot;<br>            android:layout_marginTop=&quot;15dp&quot;<br>            android:layout_gravity=&quot;end&quot;<br>            android:src=&quot;@drawable/baseline_mic_24&quot;<br>            android:layout_height=&quot;30dp&quot;/&gt;<br>    &lt;/androidx.cardview.widget.CardView&gt;<br>    &lt;TextView<br>        android:layout_width=&quot;match_parent&quot;<br>        android:id=&quot;@+id/noData_textView&quot;<br>        android:layout_height=&quot;wrap_content&quot;/&gt;<br><br>    &lt;LinearLayout<br>        android:layout_width=&quot;match_parent&quot;<br>        android:orientation=&quot;vertical&quot;<br>        android:layout_marginTop=&quot;120dp&quot;<br>        android:layout_height=&quot;wrap_content&quot;&gt;<br>        &lt;androidx.recyclerview.widget.RecyclerView<br>            android:layout_width=&quot;match_parent&quot;<br>            android:layout_height=&quot;match_parent&quot;<br>            android:id=&quot;@+id/mRecycler_RecycleView&quot;/&gt;<br>    &lt;/LinearLayout&gt;<br><br>    &lt;com.google.android.material.floatingactionbutton.FloatingActionButton<br>        android:id=&quot;@+id/addingBtn_FlottingButton&quot;<br>        android:layout_width=&quot;wrap_content&quot;<br>        android:layout_height=&quot;wrap_content&quot;<br>        android:layout_alignParentEnd=&quot;true&quot;<br>        android:layout_alignParentBottom=&quot;true&quot;<br>        android:layout_marginStart=&quot;15dp&quot;<br>        android:layout_marginTop=&quot;15dp&quot;<br>        android:layout_marginEnd=&quot;15dp&quot;<br>        android:layout_marginBottom=&quot;15dp&quot;<br>        android:src=&quot;@drawable/baseline_add_circle_24&quot;<br>        android:tint=&quot;@color/white&quot; /&gt;<br>&lt;/RelativeLayout&gt;</pre><pre>Show Home Screen with List User List And FlottingActionButton <br></pre><p>Models<br>Our entities will represent each of the database tables considered for this exercise.</p><p>User<br>The UserEntity is responsible for representing the user information in our SimpleListView.</p><p>UserModel</p><pre>package com.example.adddatalistviewnew<br><br>import android.view.Menu<br><br>data class User_Model(<br>    val name:String,<br>    val number:String<br><br>)</pre><pre>User Model with User Name And Number </pre><p>User_Adapter.kt</p><pre>package com.example.adddatalistviewnew<br><br>import android.annotation.SuppressLint<br>import android.content.ClipData<br>import android.content.Context<br>import android.view.LayoutInflater<br>import android.view.Menu<br>import android.view.MenuItem<br>import android.view.View<br>import android.view.ViewGroup<br>import android.widget.EditText<br>import android.widget.TextView<br>import android.widget.Toast<br>import androidx.appcompat.app.AlertDialog<br>import androidx.appcompat.widget.AppCompatButton<br>import androidx.appcompat.widget.Toolbar<br>import androidx.drawerlayout.widget.DrawerLayout<br>import androidx.recyclerview.widget.RecyclerView<br>import androidx.recyclerview.widget.RecyclerView.ViewHolder<br><br><br>class User_Adadpter(val context: Context, var userlist: ArrayList&lt;User_Model&gt;) :<br>    RecyclerView.Adapter&lt;User_Adadpter.Myholder&gt;() {<br><br><br>    class Myholder(itemview: View) : ViewHolder(itemview) {<br><br>        var names = itemview.findViewById&lt;TextView&gt;(R.id.mTitle_TextView)<br>        var number = itemview.findViewById&lt;TextView&gt;(R.id.nSubTitle_TextView)<br><br>      <br>        val toolbar = itemview.findViewById&lt;Toolbar&gt;(R.id.list_toolbar)<br>    }<br><br>    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): Myholder {<br>        var layout = LayoutInflater.from(parent.context).inflate(R.layout.list_itom, parent, false)<br>        return Myholder(layout)<br>    }<br><br>    override fun getItemCount(): Int {<br>        return userlist.size<br>    }<br><br>    fun searchResult(searchData: List&lt;User_Model&gt;) {<br>        userlist = searchData as ArrayList&lt;User_Model&gt;<br>        notifyDataSetChanged()<br><br>    }<br><br>    @SuppressLint(&quot;NotifyDataSetChanged&quot;, &quot;MissingInflatedId&quot;)<br>    override fun onBindViewHolder(holder: Myholder, position: Int) {<br>        holder.names.text = userlist[position].name<br>        holder.number.text = userlist[position].number<br><br><br>        holder.toolbar.setOnMenuItemClickListener { menuItem -&gt;<br>            when (menuItem.itemId) {<br>                R.id.delete_Menu -&gt; {<br>                    userlist.removeAt(position)<br>                    notifyDataSetChanged() <br>                    Toast.makeText(context, &quot;Item deleted&quot;, Toast.LENGTH_SHORT).show()<br>                    true <br>                }<br><br>                R.id.update_Menu -&gt; {<br><br>                    val layout =<br>                        LayoutInflater.from(context).inflate(R.layout.add_itom, null, false)<br>                    val editTextName = layout.findViewById&lt;EditText&gt;(R.id.userName_EditText)<br>                    val number: EditText = layout.findViewById(R.id.number_EditText)<br>                    val button: AppCompatButton = layout.findViewById(R.id.submit)<br>                    val dialog = AlertDialog.Builder(context).create()<br>                    dialog.setView(layout)<br><br>                    editTextName.setText(userlist[position].name)<br>                    number.setText(userlist[position].number)<br><br><br>                    button.setOnClickListener {<br>                        userlist[position] =<br>                            User_Model(editTextName.text.toString(), number.text.toString())<br>                        notifyDataSetChanged()<br>                        Toast.makeText(context, &quot;item Update&quot;, Toast.LENGTH_SHORT).show()<br><br>                        dialog.dismiss()<br>                    }<br>                    dialog.show()<br><br>                    true<br>                }<br><br>                else -&gt; false <br>            }<br>        }<br><br>    }<br>}</pre><pre>Binding Data and Show Data Base</pre><p>MainActivity.kt</p><pre>package com.example.adddatalistviewnew<br><br>import android.annotation.SuppressLint<br>import android.graphics.Color<br>import androidx.appcompat.app.AppCompatActivity<br>import android.os.Bundle<br>import android.view.LayoutInflater<br>import android.view.View<br>import android.widget.EditText<br>import android.widget.ImageView<br>import android.widget.TextView<br>import android.widget.Toast<br>import androidx.appcompat.app.AlertDialog<br>import androidx.appcompat.widget.AppCompatButton<br>import androidx.appcompat.widget.SearchView<br>import androidx.recyclerview.widget.LinearLayoutManager<br>import androidx.recyclerview.widget.RecyclerView<br>import com.google.android.material.floatingactionbutton.FloatingActionButton<br>import java.util.Locale<br><br><br>class MainActivity : AppCompatActivity() {<br><br>    lateinit var recyclerView: RecyclerView<br>    lateinit var adpater: User_Adadpter<br>    private val userlist = ArrayList&lt;User_Model&gt;()<br><br>    lateinit var addButton: FloatingActionButton<br>    lateinit var searchView: SearchView<br><br><br>  <br>    lateinit var nodata: TextView<br>    lateinit var backButton: ImageView<br>    private lateinit var speakvoice:ImageView<br><br>    @SuppressLint(&quot;MissingInflatedId&quot;)<br>    override fun onCreate(savedInstanceState: Bundle?) {<br>        super.onCreate(savedInstanceState)<br>        setContentView(R.layout.activity_main)<br>        window.statusBarColor = (Color.GREEN)<br><br>        recyclerView = findViewById(R.id.mRecycler_RecycleView)<br>        addButton = findViewById(R.id.addingBtn_FlottingButton)<br>        backButton = findViewById(R.id.backButton_ImageView)<br><br>        searchView = findViewById(R.id.idBaseSearch_SearchView)<br>        nodata = findViewById(R.id.noData_textView)<br><br>        speakvoice = findViewById(R.id.speak_ImageView)<br><br><br>        val imageLogo = findViewById&lt;ImageView&gt;(R.id.imageLogo_ImageView)<br><br>        speakvoice.setOnClickListener {<br>            voicefunction()<br>        }<br><br>        imageLogo.setOnClickListener {<br>            Toast.makeText(this, &quot;My Home Tiwision Name&quot;, Toast.LENGTH_SHORT).show()<br>        }<br><br>        backButton.setOnClickListener {<br>            onBackPressed()<br>            Toast.makeText(this, &quot;Back Home&quot;, Toast.LENGTH_SHORT).show()<br>        }<br>        userlist.add(User_Model(&quot;Shakil Ansari&quot;, &quot;6206731117&quot;))<br>        userlist.add(User_Model(&quot;MD Wakil Ansari&quot;, &quot;966110154&quot;))<br>        userlist.add(User_Model(&quot;Rausan Kumar&quot;, &quot;......&quot;))<br>        userlist.add(User_Model(&quot;Rausani Kumari&quot;, &quot;......&quot;))<br>        userlist.add(User_Model(&quot;Sonam Kumari&quot;, &quot;2548415511&quot;))<br>        userlist.add(User_Model(&quot;Indrjit Kumar&quot;, &quot;5556415152&quot;))<br>        userlist.add(User_Model(&quot;Gunga Kumari&quot;,&quot;10/01/2024&quot;))<br>        userlist.add(User_Model(&quot;Pawan Kumar&quot;, &quot;916244699212&quot;))<br>        userlist.add(User_Model(&quot;Kawlesh Kumar&quot;, &quot;447411441&quot;))<br>        userlist.add(User_Model(&quot;Sanoj Kumar&quot;, &quot;8558525&quot;))<br>        userlist.add(User_Model(&quot;Sandeep Kumar&quot;, &quot;7479797523&quot;))<br>        userlist.add(User_Model(&quot;Pintu Kumar&quot;, &quot;581445125&quot;))<br>        userlist.add(User_Model(&quot;Anshu Kumar&quot;, &quot;1551451&quot;))<br><br>        adpater = User_Adadpter(this, userlist)<br>        recyclerView.layoutManager = LinearLayoutManager(this)<br>        recyclerView.adapter = adpater<br><br>        addButton.setOnClickListener {<br>            addInform()<br>        }<br>        searchView.setOnQueryTextListener(object :<br>            androidx.appcompat.widget.SearchView.OnQueryTextListener {<br>            override fun onQueryTextSubmit(query: String?): Boolean {<br>                return false<br>            }<br><br>            @SuppressLint(&quot;SuspiciousIndentation&quot;)<br>            override fun onQueryTextChange(newText: String?): Boolean {<br>                val searchData = ArrayList&lt;User_Model&gt;()<br><br>                    if (newText?.isNotEmpty() == true) {<br>                        for (search in userlist) {<br>                            if (search.name.lowercase(Locale.ROOT).contains(newText.lowercase()) || search.name.uppercase().contains(newText)<br>                            ) {<br>                                searchData.add(search)<br>                            }<br>                            else{<br>                                Toast.makeText(this@MainActivity, &quot;No Data Found&quot;,Toast.LENGTH_SHORT).show()<br>                            }<br><br>                        }<br>                        if (searchData.isEmpty()) {<br>                            adpater.searchResult(searchData)<br>                            nodata.visibility = View.VISIBLE<br>                            recyclerView.visibility = View.GONE<br><br>                        } else {<br>                            adpater.searchResult(searchData)<br>                            nodata.visibility = View.GONE<br>                            recyclerView.visibility = View.VISIBLE<br><br>                        }<br><br>                    } else {<br>                        adpater.searchResult(userlist)<br>                        nodata.visibility = View.GONE<br>                         recyclerView.visibility = View.VISIBLE<br>                    }<br>                return true<br>            }<br><br>        })<br><br>    }<br><br>    @SuppressLint(&quot;MissingInflatedId&quot;, &quot;NotifyDataSetChanged&quot;)<br>    private fun addInform() {<br>        val dialog = AlertDialog.Builder(this)<br>        val view = LayoutInflater.from(this).inflate(R.layout.add_itom, null, false)<br><br>        val nameUsre : EditText = view.findViewById(R.id.userName_EditText)<br>        val userNumber : EditText = view.findViewById(R.id.number_EditText)<br><br>        var submitButton: AppCompatButton = view.findViewById(R.id.submit)<br><br>        val alert = dialog.create()<br>        alert.setView(view)<br>        alert.show()<br>        submitButton.setOnClickListener {<br>            userlist.add(User_Model(nameUsre.text.toString(), userNumber.text.toString()))<br><br>            adpater.notifyDataSetChanged()<br>            alert.dismiss()<br><br>        }<br>    }<br>    fun voicefunction(){<br><br>        val dilogBox = AlertDialog.Builder(this)<br>        val layoutVoice = LayoutInflater.from(this).inflate(R.layout.speak_layoutdilog,null,false)<br>        val alert = dilogBox.create()<br><br>       alert.setView(layoutVoice)<br><br>       alert.show()<br>    }<br><br>}</pre><pre>Add Delete Update And remove Filter Data With Function </pre><p>build_gradel.kts</p><pre>plugins {<br>    id(&quot;com.android.application&quot;)<br>    id(&quot;org.jetbrains.kotlin.android&quot;)<br>}<br><br>android {<br>    namespace = &quot;com.example.adddatalistviewnew&quot;<br>    compileSdk = 34<br><br>    defaultConfig {<br>        applicationId = &quot;com.example.adddatalistviewnew&quot;<br>        minSdk = 28<br>        targetSdk = 34<br>        versionCode = 1<br>        versionName = &quot;1.0&quot;<br><br>        testInstrumentationRunner = &quot;androidx.test.runner.AndroidJUnitRunner&quot;<br>    }<br><br>    buildTypes {<br>        release {<br>            isMinifyEnabled = false<br>            proguardFiles(<br>                getDefaultProguardFile(&quot;proguard-android-optimize.txt&quot;),<br>                &quot;proguard-rules.pro&quot;<br>            )<br>        }<br>    }<br>    compileOptions {<br>        sourceCompatibility = JavaVersion.VERSION_1_8<br>        targetCompatibility = JavaVersion.VERSION_1_8<br>    }<br>    kotlinOptions {<br>        jvmTarget = &quot;1.8&quot;<br>    }<br>}<br><br>dependencies {<br><br>    implementation(&quot;androidx.core:core-ktx:1.12.0&quot;)<br>    implementation(&quot;androidx.appcompat:appcompat:1.6.1&quot;)<br>    implementation(&quot;com.google.android.material:material:1.11.0&quot;)<br>    implementation(&quot;androidx.constraintlayout:constraintlayout:2.1.4&quot;)<br>    testImplementation(&quot;junit:junit:4.13.2&quot;)<br>    androidTestImplementation(&quot;androidx.test.ext:junit:1.1.5&quot;)<br>    androidTestImplementation(&quot;androidx.test.espresso:espresso-core:3.5.1&quot;)<br>}</pre><pre>Note: For simplicity, there are no input validations and the business logic might seem random, but we’re just focused on the CRUD part.<br><br>Note 2: The UserList implementation is not relevant for this topic, but please read<br> more on that here.<br></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*tIeJsaKQUynIy5J-s78Vqw.jpeg" /></figure><h3>Never Give Up in this Life</h3><p><a href="https://www.instagram.com/reel/DDjZHufSD8dYcGaOM1p90p7comsgWlLRgylwqI0/?igsh=MXAzNHhiaGY1bzl1Mw==">https://www.instagram.com/reel/DDjZHufSD8dYcGaOM1p90p7comsgWlLRgylwqI0/?igsh=MXAzNHhiaGY1bzl1Mw==</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8af41785ceba" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>