Template Snips for Laravel .Blade files
<?php 

@php
  echo "<pre style='color:#fff;'>";
    print_r($data);
  echo "</pre style='color:#fff;'>";
@endphp

@php
  echo "<pre>";
    print_r($data);
  echo "</pre>";
@endphp

@php
  echo "<pre style='color:#fff;'>";
    print_r($data);
  echo "</pre style='color:#fff;'>";
@endphp

@php
  echo "<pre>";
    print_r($data);
  echo "</pre>";
@endphp
DropdownButtonFormField & Validation from API

Requirements :
API Service
Object Model
Developer Recommendation : NB!!! – Use QuickType for your model.
(You need an already working api with a JSON response for quicktype) https://app.quicktype.io/
DropDownMenuItem
NB!!! – The DropDownMenuItem must be wrapped in a form widget to implement validation.

HINT : Avoid casting variable types such as <String> or <List> or <Object> until your list is actually working. In the DropdownButtonFormField Snippet, you will see no types are declared.

Step 1 :
Configuration :
(On your page.dart or screen.dart)

You need to include these.
1 : Your Model from QuickType

// Model
import './model/support_fields_model.dart';
// API
import 'package:project_name/api/support_fields_service.dart';
// Includes
import 'package:flutter/material.dart';

DropdownButtonFormField Snippet :

child: Form(
  key: globalFormKey,
    Container(
      child: DropdownButtonFormField(
        hint: Text("-- Select Query --"),
        value: querySelect,
        validator: (querySelect) =>
            querySelect ==
                    "-- Select Query --"
                ? 'Select Query Required'
                : null,
        onChanged: (newValue) {
          setState(() {
            dropDownButtonCallback(
                newValue, "select_query");
          });
        },
        items: querySelectOptions
            .map<DropdownMenuItem>((map) {
          return DropdownMenuItem(
            value: map.name,
            child: Text(map.name),
          );
        }).toList(),
      ), // DropdownButtonFormField
    ), // Container
  ), // Form
Excell Calculations for Text after and Before Space

Excel give characters after space

If you want to extract the text after space only, use this formula 
=MID(A1,FIND(" ",A1)+1,256)

Excel give characters before space

Extract text before or after space with formula in ExcelYou can quickly extract the text before space from the list only by using formula. Select a blank cell, and type this formula 
=LEFT(A1,(FIND(" ",A1,1)-1)) 
(A1 is the first cell of the list you want to extract text) , and press Enter button.

Search

Your Favourite Posts

  • Your favorites will be here.

Latest Content

© Garth Baker 2024 All rights reserved.

Pin It on Pinterest

Share This