Skip to main content

Posts

Inheritance In Dart

So now continuing to the Blog series I will talk about the inheritance concept in this post. In previous blogs, we have seen how to create classes and objects and we can create as many classes as we want. But sometimes we observe that many classes have some properties same as another class. We should keep in mind a fact that creation of an object in memory is a very expensive task and we have to minimize it so one of the methods to do so is Inheritance.   So there are two terms: Parent Class and Child Class. The parent class has some features and the child class has similar features along with some extra specific features and the child can be inherited from the parent class so that there is no redundancy. Image source Google So talking about the above image we can see that the vehicle is the parent class and then the car, motorcycle, truck are child class of vehicle and following that again station wagon, jeep are the child class of car and so on. ...
Recent posts

Constructors In Dart Language

In the previous post, I have discussed Classes and Objects and continuing to that in this post I will cover Constructors. So what a constructor is? As in the previous post, we have created an object car inside the main function using the new keyword, it only creates a generic object without any properties or we can say it is just a spot in memory. And in the next few lines when we assign values to their attributes then it is completely constructed. Although, constructing directly inside the main function is a good idea but there is another way also by which we can form a constructor inside the class itself. But stop I am forgetting something. Before we go deep into constructors I want to tell you something about a very important thing this . this is used to denote the current value. Maybe it is not making sense at this time but it will be clear once we use it. Now coming back to constructors, it is a function or method like entity but without any return type. There are thr...

Object-Oriented Programming In Dart : Introduction

So far we have discussed the basics of dart programming language and now we will move to the more important concept which will be used in our app development process. Yes, it is Object-oriented programming concepts. "The first and foremost important thing is that everything in dart is an object " You have heard the terms Class and Objects and might be thinking what are they? So let me explain you these terms using some analogy. Let us assume that you are working at a car manufacturing company and you have to manufacture a certain model of car. So the first thing that you have is the Blueprint of the car of that model, and then by using that model, you will manufacture as many cars as you want. Here the Blueprint is analogous to the Class and the actual car that is made from that blueprint is analogous to Object. As the blueprint can be used as many times as we wish to make the actual car so we can say that Classes are the templates for creating objects . Now we w...

IC Recognition from a Printed Circuit Board

In this post, I will tell you about a project that I and my friend did last year. That was IC detection from a printed circuit board and then recognize it using optical character recognition. This is the application of Open Computer Vision (OpenCV). First of all, I will show you a flowchart that will describe our methodology and then I will discuss in detail. There are two main parts of our algorithm: Localizing each IC on the PCB, extracting and saving it. Then we use Tesseract OCR engine to read the labels of each detected IC. A. PREPROCESSING Before we apply any algorithms to our image we have to process it to obtain a proper  image. To save processing time we will resize the image maintaining the aspect ratio.  After that remove noise from the image using Gaussian Blur. B. SEGMENTATION First, we convert the RGB image to HSV (Hue, Saturation, Value) color space. The H channel creates a mask for all the integrated circuits on the board. We...

The Entry Point ( Basics of Dart)

I will not focus very deeply on very basic things like variable declaration and keywords etc. You can find all of this basic syntax on the website of dart so, I will tell you only some important point about the basic syntax, and then we will move to more important Object-Oriented Concepts of Dart which will be useful in creating Apps using Flutter. So let's start with the step-by-step coverage of the syntax which is of C style. Any Dart program has the entry point at its main( )  function. So for any program to run, there must be the main function. main () { //Here goes your code } So now let's enter the program and discuss further. Next thing that we need is variables. When we declare variable then we are doing nothing but allocating some space in memory or think of it as a box which can hold some item in it. So next question that comes to mind is how we declare variables. So there are different methods to declare variables. If we don't know which ty...

Introduction to Dart as a Language with Possibilities

Dart is originally developed by Google for the purpose of building web servers, mobile applications etc. It is open source software. I am building the foundation in this language because I will be using this language as a language for Flutter to develop Android apps in no time. There are many features of Dart Language, some of these are: This is an object-oriented language and everything in dart is an object. Dart is very productive language as its syntax is clear and concise and also it has full-fledged packages along with powerful ecosystems.  Dart provides optimizing ahead-of-time compilation to get predictably high performance and fast startup across mobile devices and the web. (We will see in upcoming posts, how it is beneficial for hot reload in flutter development.) Dart compiles to ARM and x86 code so that Dart mobile apps can run natively on iOS, Android, and beyond. Hence it adds to languages portability. For programming in Dart, we can use a...