Tuesday, July 7, 2020

how to learn kodular creator app build for free smzeesoft.com

Kodular basic

we will be discussing some core Logical blocks available in Kodular, AppyBuilder and other platforms Today we are going to learn about the correct uses of Procedure Block And also learn some programming concepts related to it So without any further ado, let's get started! Procedural block, as the name suggests, is used to create a custom task which we can use again, and again in a screen Procedure Block is similar to a function or a method used in programming Well, the user procedure block is not absolutely necessary

 We can still make a fully functional app even without it But Using procedure block is a good practice as it highly reduces The number of blocks used and keeps the code clean So it is preferable to use Procedure Blocks when the task is carried out again and again in the app As you can see here, there are two types of Procedure blocks Let's bring them on the screen As you can simply notice the design: they are different for these two blocks Different types of blocks will be attached to each of them The first procedure block is the one which won't return any value It is simply used to carry out an action or event which we will define here And the second one is the one that will return a value after processing the blocks we enter here

 As you can simply see the call blocks for these procedures are also different Also if you click on the mutator You will find that this procedure blocks can take inputs as well These are like attributes to a function so we can add as many Inputs as we want in our task To understand them better Let's make a comparison The first procedure block can be compared to a car where the input is Petrol and the resultant output or output action is its movement and for the second procedure that returns a value We can compare the second procedure with a coffeemaker where the inputs are milk, sugar and coffee powder And the cup of coffee we get from it is the output or the resultant value it returns To better understand the use of procedure blocks let's create a simple app 

So this is the UI of the app we plan to create As you can see the app is divided into two parts In the first part tapping each of these buttons changes the colour of the car image Along with the title bar, status bar and the navigation bar In the second part, we have a payment form where we have to enter the customer's name and the amount paid and And clicking the submit button returns a confirmation message with customer name and the amount paid by him Now, let's see how we can use procedure blocks in this app So for that will first use a procedure to colour the car and other elements So here in this procedure, let's name it car paint So here we need to colour the car So let's take your car is not actually any image is actually a text a label For it

 I have simply used font awesome Font for the car icon So we have to change the colour of it As we know that clicking each of these buttons will change the colour of the car differently So, here we have to use an input So we'll use one. Let's name the input as "paint" And we'll use this input With the car text or car icon whatever you say t for the other things, Okay, so Our procedure is ready. Now we have to call this procedure to the button clicks So let's do that when red button clicks Do what? Just call this procedure the "car paint" procedure And here you see we are getting input for paint So we'll use the colour here needed i.e. red, as this is a red button Now we can simply duplicate it for the other two buttons

 Let's change this to green button, this to blue button and change the colour respectively So our first part is complete here so this is how you can use the procedure block first procedure block Here as you can see using this procedure because we had to use all these things here and here so It would have taken a lot more of blocks so as you can see it simply reduced it to the minimum and along with that the code looks very much clean and understandable and if the procedure is big enough then it will look very much messy if we don't use procedures with this And if our action is very much complex, then the code becomes also very much messy

 So that's why it's better to use the procedure with apps which require a repetitive action of the same kind So now let's move on to the second part In the second part we have two text box as you have seen And we'll return a just a message when the button clicks When submitting button clicks we'll simply return a message so let's add the button And message will come in this label: Confirm_msg at present it's simply empty But when button clicks it will set the text to something so We need a return value for this text. So for this, we can use this resulting procedure because...

 this action procedure won't fit with this block So we'll just use the second type of procedure which returns a value So let's name it as "confirm" As it will show a confirmation message Now let's use join block And add a few strings to it Strings means the text in programming language As you may be familiar So we'll add a string block. Let's type our message Then we have to import the name, customer name from textbox so we'll simply take it So Cust-name.text, we will simply use from the textbox now another Now we need the value, text value from the Amt.text now final message So our message is complete Now we have to call this block as you can see 

"call confirm" block for the procedure that returns a value can be attached to it. So this is how you use the second procedure, the second type of procedure that returns a value Well, in this case as you can see it will also be okay if you don't use the procedure block But I have used it to show you how it works But this block is, yes, useful as I said before if you have multiple labels where we want to feed the value, the same value when any button clicks, in that case, using this Return procedure is very much preferable So this is how you use Procedure blocks. I hope I was able to clear your concepts and teach you how to use Procedure Block So if you find any doubt or Didn't understand any part do let me know in the comments section I'll definitely reply to you and clear all your doubts or questions 

No comments:

Post a Comment