Posts

Showing posts from September, 2023

Flutter - Firebase Connection to Flutter App

  Flutter - Firebase Connection to Flutter App   Create a project: flutter create --org com.name appname  Install Node.js in your system: https://nodejs.org/en Open Cmd and install: npm install -g firebase-tools Install Firebase CLI: https://firebase.google.com/docs/cli#install-cli-windows Copy and past the .exe file in your project  run the .exe file type the command to login firebase: firebase login  Create a firebase project in the login account  Run the 2 command in your firebase-cli.exe Command prompt:          dart pub global activate flutterfire_cli          flutterfire configure --project= <projectID> ---------------------------------------THE END------------------------------------------

How to create a Flutter Hello World App

Image
 How to create a Flutter Hello World App   import 'package:flutter/material.dart' ; void main () {   runApp ( AppMain ()); } class AppMain extends StatelessWidget {   @ override   Widget build ( BuildContext context ) {     return MaterialApp (       home : Scaffold (         appBar : AppBar (           title : const Text ( 'Hello, World App' ),         ),         body : const Center (           child : Text ( 'Hello, World!' ),         ),       ),     );   } }     Output:  

ReactNative (Setup)

    Step 1: Install Node.js using https://nodejs.org/en Step 2: run npm install -g expo-cli in terminal Step 3: Create a new project                     npx create-expo-app Weather                    cd Weather                   expo start  Step 4: install Expo app in your mobile   Step 5: Scan the QR code.  npm install @react-native-cummunity/eslint-config --save-dev npm install --save-dev --save-exact prettier touch .prettierrc.js module.exports = {     backetSpacing: true,     singleQuote:true,     tabWidth: 2,     useTabs: false,     trailingComma: "none",     semi: false }; 

Dart Programming (Conditional and Looping and Control Statements in Dart)

  Control flow statements in Dart are used to manage the flow of execution in your code. Dart supports common control flow statements found in most programming languages. These include: Conditional Statements: if Statements: Used to execute code block(s) conditionally based on a boolean expression. dart if (condition) { // Code to execute if condition is true } else { // Code to execute if condition is false } else-if Ladder: Allows you to test multiple conditions one by one until one of them is true. dart if (condition1) { // Code to execute if condition1 is true } else if (condition2) { // Code to execute if condition2 is true } else { // Code to execute if none of the conditions are true } switch Statement: Used for multi-branch decision-making based on the value of an expression. dart switch (expression) { case value1: // Code to execute if expression equals value1 break; case value2: // Code to execute if expression equals value2 break; defau...

Dart Programming (Variables in Dart)

Variables in Dart  In Dart, variables are used to store and manipulate data. Dart is a statically typed language, which means that each variable has a declared type that is known at compile-time. Here are the key aspects of variables in Dart: 1. Variable Declaration:    To declare a variable in Dart, you use the `var`, `final`, or `const` keyword followed by the variable's name and an optional initializer (a value assigned to the variable when it's declared). For example:       var name = 'John'; // var declares a variable with type inference    final age = 30;    // final declares an immutable variable    const pi = 3.14;    // const declares a compile-time constant    2. Type Inference:    Dart can infer the type of a variable based on its initializer. You can use `var` for type inference, and the variable's type will be determined from the assigned value. Once the type is inferre...

Dart Programming (Data Type in Dart)

Image
  Dart Programming   DartPad is an online, interactive code editor and playground for the Dart programming language. It allows developers to write, run, and experiment with Dart code directly in a web browser without needing to install any software locally. DartPad is a convenient tool for quickly prototyping, sharing code snippets, and learning Dart without the need for a full development environment setup. It's often used for educational purposes, code sharing, and trying out Dart features and libraries. Link: https://dartpad.dev/? Write Your Dart Code: Create a new file with a .dart extension (e.g., my_program.dart ) using a text editor or integrated development environment (IDE). You can use any text editor like VSCode, Sublime Text, or even a basic one like Notepad. Here's a simple Dart program that prints "Hello, World!" to the console:   void main() {   print("Hello, World!"); }  Save the File:  Save your Dart code in the .dart file you created. R...