Skip to main content

Posts

Showing posts from December, 2023

How to create mixin class in dart language

 // void main() {    //Create an instance of the class Calculate a=Calculate(); print("Recursion of factorial:"+ a.factorial(4).toString()); print("Linear Search:"+ a.linearSearch([2,11,5,32,6,23],5)); } // output Result:24 Result:5 // Create  Calculate class class Calculate with LinearSearch {   factorial(int n){     if(n==0 || n==1){       return 1;     }else{       return n*factorial(n-1);     }   }    } //Create Linear search method using mixin class mixin LinearSearch {      // Linear search method      linearSearch(List<int>? list,int x){    int i=0; for( i; i<list!.length; i++){        if(list[i]==x){          print(list[i].toString());        }     }} }

How to create factorial program in dart language

//Create main() function of dart   void main(){ Factorial factorial=Factorial(); print("Is factorial:"+ factorial.factorial(4).toString()); } //output Result=> factorial:24 ************************************************************* //create a class of factorial  class Factorial{ //this is a method of factorial   factorial(int n){     if(n==0 || n==1){       return 1;     }else{       return n*factorial(n-1);     }   } }

Privacy Policy Of Free Learning Tech Point

  Thank you for visiting Free Learning Tech Point . You can use our website, services, and products with the awareness that this Privacy Policy describes how we gather, use, disclose, and protect your personal information. 1- Information We Collect: We may collect personal information that you provide directly to us, such as your name, email address, and any other information you choose to provide when using our Services. We may also collect non-personal information, such as aggregated data and usage patterns. 2- How We Use Your Information: We may use the information we collect for various purposes, including but not limited to: Providing and improving our Services. Responding to your inquiries and requests. Analyzing usage patterns and trends. Sending you updates, newsletters, and other communications. Personalizing your experience on our platform. 3- Cookies and Similar Technologies: We may use cookies and similar technologies to collect information about your interactions with...

About of Free Learning Tech Point

  Welcome to Free Learning Tech Point , where knowledge meets accessibility. Our platform is dedicated to providing high-quality educational resources and e-learning opportunities to learners around the world, completely free of charge. Our Mission: At Free Learning Tech Point, we believe that education is a fundamental right, and everyone should have access to valuable learning materials. Our mission is to break down barriers to education by offering a diverse range of courses, tutorials, and resources across various subjects and disciplines. What Sets Us Apart: - Free Access: Our commitment is to make learning accessible to all. No subscription fees, no hidden costs – just free, open access to knowledge.    - Quality Content: We curate and create content that is both engaging and informative. Whether you're a student, professional, or lifelong learner, our resources are designed to cater to various learning styles and levels. - Diverse Subjects: From tech and science...

How to write a code of Encode and Decode json data in Dart language

 Encode and decode JSON data in dart language import 'dart:convert'; void main() {   // Original data as a Dart map   Map<String, dynamic> originalData = {     'field1': 'value1',     'field2': 42,     'field3': true,   };   // Encode the Dart map to JSON string   String jsonString = jsonEncode(originalData);   print('Original JSON String:');   print(jsonString);   // Encode the JSON string to base64   String base64EncodedString = base64.encode(utf8.encode(jsonString));   print('\nBase64 Encoded String:');   print(base64EncodedString);   // Decode the base64 string to JSON string   String decodedJsonString = utf8.decode(base64.decode(base64EncodedString));   print('\nDecoded JSON String:');   print(decodedJsonString);   // Decode the JSON string to a Dart map   Map<String, dynamic> decodedData = jsonDecode(decodedJsonString);   print('\nDecoded Dart Ma...

How to find the third largest number in an array Dart language?

Find the third largest number in an Array  void main() {   List<int> numbers = [10, 5, 8, 20, 15];   // Ensure the array has at least three elements   if (numbers.length < 3) {     print("Array should have at least three elements");     return;   }   // Sort the array in descending order   numbers.sort((a, b) => b.compareTo(a));   // Get the third largest number   int thirdLargest = numbers[2];   print("The third largest number is: $thirdLargest"); } Thanks for reading the article ...

How to find the third largest number without sort() method in an array dart language ?

 Find the third largest number without sort() method // this the main() function of dart  void main() {   List<int> numbers = [10, 5, 8, 20, 15];   // Ensure the array has at least three elements   if (numbers.length < 3) {     print("Array should have at least three elements");     return;   }   int findThirdLargest (List<int> arr) {     int firstMax = arr.removeAt(arr.indexOf(arr.reduce((a, b) => a > b ? a : b)));     int secondMax = arr.removeAt(arr.indexOf(arr.reduce((a, b) => a > b ? a : b)));     int thirdMax = arr.reduce((a, b) => a > b ? a : b);     return thirdMax;   }   int thirdLargest = findThirdLargest(List.from(numbers));   print("The third largest number is: $thirdLargest"); }

How to create Singleton class in dart language

 // This Main() Function of Dart void main(){    //****************************************   MySingleton mS=MySingleton();   mS.doSomething();   mS.name="Surya Prakash";   mS.age="29";  //******************************************************  } //*********************** Singlton Class *********************************** class MySingleton {   // Private constructor to prevent external instantiation   MySingleton._privateConstructor();   // The single instance of the class   static final MySingleton _instance = MySingleton._privateConstructor();   // Factory constructor to provide access to the instance   factory MySingleton() {     return _instance;   }   // Add your methods and properties here   void doSomething() {     print('Singleton is doing something);   }   //  Create Varialbles     String? name;   String? age;     }