Home Blog Page 19

What is a JWT (JSON Web Token)?

0
What is a JWT JSON Web Token
What is a JWT (JSON Web Token)

JWT Stands for (JSON Web Token) it a popular mechanism by which we can implementing authentication and authorization of a users in web applications, so basically in JWT token we store user data and the token expire time which will be in encrypted, It can be used in any application to authenticate users. Here’s how we can use JWT Web tokens in ReactJS application:

How Frontend and backend works with JWT Token

  • From Frontend Application we send the login credentials using login form to the backend API server.
  • Then backend API will verify the credentials passed by users exist of database, if exist then backend will generate a JWT token by storing all the user data into the token.
  • Then backend API respond the JWT token back to the frontend.
  • Now to keep user logged into the web application, we need to store the JWT token in browser local storage or as a cookie.
  • Now whenever frontend wants some data from backend, it sends JWT token with request parameter to the backend.
  • The backend verifies if the JWT token passed is valid or no, if JWT token is not expired and is valid then backend will pass the requested data back to the frontend.

Flutter Dart Fold Method to Calculate Sum, Find Smallest & Largest number in a given list

0
Flutter Dart fold method
Flutter Dart fold method

Hi Guy’s Welcome to Proto Coders Point. In this Flutter dart article let’s checkout How to calculate sum of array list, Find the smallest & largest number in a given list by using list fold method.

Dart fold Syntax

Future<S> fold<S>(initialValue,<function>( S previous, T element ){
// your operation here
})

In Flutter dart fold method, accept 2 parameters i.e. first-> initialValue & second -> a function that content 2 parameter (Previous & a element from the list). Here the previous value will be initialValue & will only change when programmer wants to & element will item from a list basically it keep changing in a loop.

Let’s Understand the Fold Method using below Examples

1. Calculate the Sum of List Element

In below code, The initial value will be first item from the list i.e. 3, Now in first loop value of sums = 3 and ele = 3 so 3+3=6, then in next iteration sums = 6 and ele = second item from the list i.e. 4, so 6 + 4 = 10, and then in third iteration value of sums get updated to sums = 10 and ele = next item i.e. ele = 5, so 10 + 5 = 15. like this the loop gets iterating until the end of the list item and we get addition of list as 18.

void main(){
  final numbers = [3,4,5,1,2];
 
  final sum = numbers.fold(numbers.first,(sums,ele){
    
   return sums + ele;
  });
  
  print(sum);  // 36
}

2. Find the largest number in list using fold method

In below code, To find the greatest number from a given list. Here initialValue is the first item from the list and it automatically assumed a max i.e. the largest element, and ele = 3 that keep are changing on each iteration, In the loop we check if the max < ele, if true then max is set to ele and thus we get the largest number from the given list.

void main(){
  final numbers = [3,4,5,1,2,4,2,1,4,7,0];
 
  final largest = numbers.fold(numbers.first,(max,ele){
    
   if (max < ele){
     max = ele;
   }
    
    return max;
  });
  
  print(largest);  // 7 
}

3. Find the smallest number in list using fold method

In below code, To find the lowest number from a given list. Here initialValue is the first item from the list and it automatically assumed a min i.e. the smallest element, and ele = 3 that keep are changing on each iteration, In the loop we check if the min > ele, if true then min is set to ele and thus we get the smallest number from the given list.

void main(){
  final numbers = [3,4,5,1,2,4,2,1,4,7,-1];
 
  final smallest = numbers.fold(numbers.first,(min,ele){
    
   if (min > ele){
     min= ele;
   }
    
    return min;
  });
  
  print(smallest);  // -1
}

Introduction of Flutter flow

0
flutter flow
Now build a complete flutter using online flutter flow

Two former Google engineers who looked to make .  it simpler for designers, developers, business owners to create mobile apps established  Flutterflow. You can create a fully functional application using our straightforward drag-and-drop interface in as little as an hour .

Everything you need to know about FlutterFlow. including its definition, features, advantages, disadvantages ,cost and will be covered in this article. But first , let’s take a quick look at our favourite Flutter to provide you with some context.

What is flutter flow?

Users may construct native cross-platform applications with FlutterFlow, an online browser-based app builder With the help of this third-party visual app builder for the Flutter framework, app developers may greatly speed up the procedure. The fact that it can be created with virtually minimal code is. however, its most crucial component. This app builder’s extremely user-friendly design aids firms in cutting the time required to release an app to the market. Abel Mengistu and Alex Greaves, two former Google engineers, developed the product. The 2.0 edition of FlutterFlow which included new functionality was released in October 2022. Here is a summary of what to expect.

Two former Google engineers founded FlutterFlow to serve as a third-party visual app builder for Flutter framework architecture . It was showcased at Google I/O and is supported by Y Combinator.

flutterflow.io
flutterflow.io

As we have already mentioned  FlutterFlow is a drag-and-drop mobile app development tool. that runs in the any browser. This implies that you don’t need to write any code in order to create amazing custom apps in less than hour.

Features:

1) UI components and templates – For time-saving convenience, you can select from more than 50 screen templates, over 40 pre-built widgets, and a wide range of third-party connectors (such as Braintree and Google AdMob) 

2) Authenticating users only requires dragging a button to integrate Facebook, Google, and Firebase logins.

3) Development for both iOS and Android – Without writing any code, you can simultaneously develop applications for iOS and Android.

Although it may seem obvious the ability to create apps without writing any code is by far FlutterFlow most alluring feature.

4) Guided troubleshooting – With real-time feedback and error correction, you can quickly identify and resolve potential problems.

How to Use FlutterFlow : A Quick Guide

To get started Flutterflow , you will need the  following :

1) Project Dashboard

2) Navigation Menu

3) UI Builder

Create project in flutter flow

Yes…. you can follow these steps to create your first application in FlutterFlow :

1): Launch a new project after making an account on the FlutterFlow website (https://flutterflow.io).

2): The project will show up on the right side of the screen once you are inside. You may drag and drop different widgets onto this canvas to build your application’s user interface (UI). Drag a widget from the left-side panel onto the canvas to launch your user interface.

3): Following the addition of a few widgets. you may edit them by choosing them and using the options in the Properties panel on the right side of the screen. by choosing the Add Page option , from the screen’s top-left corner.  Additionally you may add more pages to your app.

4): To add functionality to your app use the Actions panel on the left side of the screen. Here you can include operations like visiting another page, submitting a form, invoking an API etc……

5): You can view a preview of your app at any time by clicking the “Preview” button in the top-right corner of the screen. When you do this a new tab will appear where you can see how your app works and looks.

6): To make your app visible to the public after you are satisfied with it. click the “Publish” button in the top-right corner of the screen. The generated code for your app will then be available for download or direct upload to a hosting platform .

7): Congrats on finishing your first FlutterFlow app setup !

NOTE ::

Because FlutterFlow is a no-code and low-code platform you can create apps without knowing any programming languages. However having a basic understanding of concepts like UI design and app functionality can be useful. FlutterFlow does provide a variety of tutorials and documentation to assist you in getting started.

Project Dashboard

Project management is aided by FlutterFlow’s Dashboard page.

From this screen, you can add new projects, duplicate existing ones and get rid of them.

flutter flow dashboard

make flutter project

A) : Project

Any project you’ve created on FlutterFlow can be easily accessed from here. To begin a brand-new project, click the Create Project button.

B) : Resource

You can find a number of helpful resources that can help you when creating apps in FlutterFlow by selecting the Resources icon. You can use video lessons to learn about any concept, and if you encounter any difficulties, feel free to use the community forum.

C) : Account

If you want to check your account information or upgrade to a different FlutterFlow Plan to get access to more features. the Account page can be helpful.

D) : Logout

You can check your account information on the Account page or upgrade to a more feature. rich FlutterFlow Plan by doing so.

Navigation Menu

The leftmost menu on your FlutterFlow project page is the Navigation Menu.

It offers navigation to pages for adding project features like the Firestore database, setting up API calls, uploading image assets, integrating as well as access to the project’s user interface builder and widget tree .

UI Builder using flutterflow

You can build and customize your application using FlutterFlow in left side panel UI Builder tab. The UI elements , that you can use to create the layout of your application are all listed on this post .

Flutter flow project UI builder

1) It displays the user interface for a mobile device where elements can be dropped onto the canvas to be added there.

2)  Widget :

It displays the user interface for a mobile device, where elements can be dropped onto the canvas to be added there.

3) Properties Panel :

You can modify the selected Widget’s appearance in the Properties Panel by changing like visibility, padding, alignment and other widget-specific properties.

4) Toolbar :

The tool bar includes some helpful information like  canvas size, as well as a button labeled Project problems , that indicates any issues brought on by the design and settings of your project.

What is FlutterFlow used for?

With FlutterFlow , you can create visual mobile apps without writing any code. It is a browser based UI toolkit just drag and drop interface. The most well-liked cross platform developer framework Google’s. Flutter is built upon by a visual builder that enables .to create apps more quickly, simply and with less code.

Pricing

You may use the platform’s free version to get started, and it also has premium options available that start at $12 per month.

FlutterFlow offers three different plans based on your needs and financial situation. Let’s look at them now:

Free Plan

this flutter flow plan give to us 14 days free trial , is this cool.. let’s , see flutter flow more  plan

Standard Plan

All of the features from the free FlutterFlow plan are also included in the standard plan along with sample apps. the ability to create and download an APK and the ability to download the source code for the mobile application you create. This programme costs $30 per month.

Pro Plan

All of the aforementioned features as well as unique APIs, GitHub and Codemagic integration and the Firebase Content Manager all are included in the pro plan. This plan has monthly fee is $70.

Both of the premium choices provide a free trial , so that you may determine which is the best match for your flutterFlow project.’

Thanks for reading……

Have a wonderful day!!!!!!!!!

How to calculate sum of list elements in dart – flutter

0
Sum of Array Element in flutter Dart
Sum of Array Element in flutter Dart.

In this Flutter dart article, Let’s go through different way through which we can calculate sum of array element. In dart array are called as list, let’s checkout how to perform addition of all the elements in a given dart list.

There are many ways by which we can get sum of array element in dart i.e by using normal loop like for loop or by using dart inbuild functions.

Sum of list using dart for loop

void main(){
  final numbers = [1,4,2,3,6,4,2,1,4,5,0];
  
  var sum = 0;
  
  for(var i=0;i<numbers.length;i++){
    sum += numbers[i];
  }
  print(sum);
}

Sum addition of array element using dart forEach loop

void main(){
  final numbers = [3,4,5,1,2,4,2,1,4,7,0];
  
  var sum = 0;
  
  numbers.forEach((val){
      sum += val;
  });
  print(sum);
}

Sum of array list using reduce function

void main(){
  final numbers = [3,4,5,1,2,4,2,1,4,7,0];
 
  var sum = numbers.reduce((a,b)=>a+b);
  
  print(sum);
}

Addition of all element in dart list using collection package sum function

import 'package:collection/collection.dart';

void main() {
  final numbers = [1, 150, 10, 134, 5, 8];
  var sum = numbers.sum;
  print(sum);
}

Flutter Text TypeWritter Typing Animation Effect

0
Type Writter Text Typing Animation Effect

Hi Guy’s, Welcome to Proto Coders Point. In this Flutter Article let’s learn how to apply typewritter typing animation effect to flutter text widget.

The Typewriter text effect is an animation where a text is been typed automatically letter by letter, and it feels like the text is been typed one by one.

This kind of animation effect on text is used when you want to grab attention on your app user and make them focus on the Text that is appearing on the screen.

Video Tutorial

Flutter TypeWritter Text Effect – Source Code

import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      // Remove the debug banner
      debugShowCheckedModeBanner: false,
      title: 'Proto Coders Point',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const TypeWritterText(),
    );
  }
}

class TypeWritterText extends StatefulWidget {
  const TypeWritterText({Key? key}) : super(key: key);

  @override
  State<TypeWritterText> createState() => _TypeWritterTextState();
}

class _TypeWritterTextState extends State<TypeWritterText> {

  int _currentIndex = 0;
  int _currentCharIndex = 0;

  final List<String> _strings = [
    "Welcome to ProtoCodersPoint.com",
    "Get Programming Solution Here",
    "And more...",
  ];

  void _typeWrittingAnimation(){
     if(_currentCharIndex < _strings[_currentIndex].length){
       _currentCharIndex++;
     }else{
       _currentIndex = (_currentIndex+1)% _strings.length;
       _currentCharIndex = 0;
     }
     setState(() {

     });

     Future.delayed(const Duration(milliseconds: 50),(){
       _typeWrittingAnimation();
     });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text("Proto Coders Point"),
        ),
        body: Center(
          child: Container(
            padding: const EdgeInsets.all(20),
            width: double.infinity,
            child:  Align(
              alignment: Alignment.centerLeft,
              child: Text(
                  _strings[_currentIndex].substring(0,_currentCharIndex),
                style: TextStyle(
                    fontSize: 24,
                    fontStyle: FontStyle.italic,
                    fontWeight: FontWeight.bold),
              ),
            ),
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _typeWrittingAnimation,
          child: const Icon(Icons.play_arrow),
        ));
  }
}
flutter text typing animation effect
flutter text typing animation effect

The logic to make text to be typed letter by letter on the screen is by using substring() method.

Here we have a function _typeWrittingAnimation, that keeps on calling itself after every milliseconds say 100 milliseconds, We have 2 integer variable _currentIndex & _currentCharIndex. The _currentCharIndex gets incremented by 1 until it is not end of the string, once the currentCharIndex reaches the end of the string,The _currentIndex is set to next List Item String in the given list.

Hidden Website that many programmer don’t know

0
Website 90% of Programmer Don't Know
Website 90% of Programmer Don't Know

I am sure that almost 90% Software Developer / Programmers don’t know about the killer websites.

In this Blog, I will share those awesome websites that every software developer should know and use it.

1. devdocs.io

DevDocs provides a collection documentation of all the programming into one that can we easily searchable. You can access documentation pertaining to a multitude of programming languages and technologies in a centralized location.

https://devdocs.io/
https://devdocs.io/

2. css-tricks.com

css are used in web development, so if you want to get strong in website designing using CSS then css-tricks.com is the place where you can master web application development.

css tricks com
https://css-tricks.com/

3. overapi.com

OverAPI provides you a cheat sheets for majority of programming tips and tricks, This website is best for all software developers who want to to quickly find a solution and implement it in projects.

4. ray.so

If you are a programming content creator, you might be sharing your code on social media with your audience, By using ray.so website can can create a beautiful screenshots of your codes and share the image on your social media account.

ray.,so

5. daily.dev

This is a Website and share daily developer feeds, Here you get daily news articles related to technology. The tag line is Where Developers grow together, Using this you can make learning a daily habit.

daily dev

6. codebeautify.org

Code beautify is a website through which you can make your source code look more attractive and the code can be clear and readable.

code beautify

7. showwcase.com

Showwcase is a social media website specially for software developer who can build community and show case their projects and find new opportunities.

showwcase.com

8. roadmap.sh

This website provides roadmaps, guidelines, and other educational content to assist developers in choosing a path and directing their learning. It is very helpful for a beginner as well as a learner who needs guidance.

roadmap sh