Posts

Showing posts with the label Dart

Remove HTML tags from String in Flutter/Dart with RegEx

Image
In this Example we are going to remove HTML Tags from string. It's important to remove tags from html when some API provides us HTML content as string. Remove All HTML tags using RegEx String html = '<h2>Articles:</h2> <div class="subtitle">This is orkitt.com <br/><span>Its more than Blog</span></div>'; RegExp exp = RegExp(r"<[^>]*>",multiLine: true,caseSensitive: true);String parsedhtml = html.replaceAll(exp, ' ');print(parsedhtml);//output with spaceString parsedstring1 = html.replaceAll(exp, '');print(parsedstring1);//output without space Check the Output Using this regular Expression you can remove any html tags from string. Hope this helpful for you.

Flutter Dart Constructor Method with Example

Image
The constructor is like a function with or without parameter but it doesn’t have a return type. That's why you can create new object using this constructor. In this tutorial we will discuss about how to use constructor and as a bonus we also provide you a great tool to generate constructor. Constructor in Dart There are many types of Constructors that you will need to know when working with Dart class. For example, this is Student class with constructor that has the same name: class Student { String name; int age; String location; // constructor Customer(String name, int age, String location) { this.name = name; this.age = age; this.location = location; } } Now you can create new object using this Student constructor. var student = Student("Jhon Wick", 26, "US"); Constructor in Flutter We know constructor dosen't have any return type , that's why it can be used to transfer variable from one widget to another. You can also pass va...

Dart Basic Function For Flutter Developer

Image
Dart is not from Netflix Stranger Things. Dart is an open-source programming language by Google. It supports application development in both client side and server-side. But it is widely used for the developing cross platform application using the Flutter Framework. In this sort tutorial we will give you the most important concept about dart programming and it's most used functions. It will help you guys if you are a beginner. Dart Basic Dart is very easy to learn. It's not only about learning the programming language, but also, the terminologies related to it and  its ecosystem. You don't need to setup code editor for learning this programming language. You can just get started with  DartPad  online dart code compiler to practice this examples. For best practice, we don't provide you the source code. Type and practice on your own with this code editor. Dart For Each Function Sort Function in Dart Dart Skip Function Dart To-SET Function Dart Any Function Shuffle in D...