<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>null safety Archives - scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/tag/null-safety/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/tag/null-safety/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Wed, 13 Apr 2022 16:30:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Typeof operator in JavaScripts</title>
		<link>https://www.scmgalaxy.com/tutorials/typeof-operator-in-javascripts/</link>
					<comments>https://www.scmgalaxy.com/tutorials/typeof-operator-in-javascripts/#respond</comments>
		
		<dc:creator><![CDATA[rajeshkumar]]></dc:creator>
		<pubDate>Mon, 02 Aug 2021 12:30:54 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[null safety]]></category>
		<category><![CDATA[Operators in PHP]]></category>
		<category><![CDATA[typeof]]></category>
		<category><![CDATA[Undefined]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=7268</guid>

					<description><![CDATA[<p>The typeof operator is used to get the data type (returns a string) of its operand. The operand can be [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/typeof-operator-in-javascripts/">Typeof operator in JavaScripts</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">The typeof operator is used to get the data type (returns a string) of its operand. The operand can be either a literal or a data structure such as a variable, a function, or an object.</p>



<p class="wp-block-paragraph">Syntax: &#8211;<br>typeof operand<br>typeof(operand)</p>



<p class="wp-block-paragraph">Ex: &#8211;<br>typeof “a”;</p>



<h2 class="wp-block-heading">Undefined</h2>



<p class="wp-block-paragraph">The undefined type is used for variable or object properties that either do not exist or have not been assigned a value. The only value an undefined type can have is <em>undefined</em>.</p>



<script src="https://gist.github.com/vijaypk376/5408ff76eae9503738ffb0c99bdce901.js"></script>



<h2 class="wp-block-heading">Null</h2>



<p class="wp-block-paragraph">The null value indicates an empty value; it is essentially a placeholder that represents “nothing”. The null value is defined as an empty object so using typeof operator on a variable holding null shows its type to be an object.</p>



<script src="https://gist.github.com/vijaypk376/3b8810255f257ca72da73faf3c4ee6a5.js"></script>



<h2 class="wp-block-heading">Undefined Vs Null</h2>



<p class="wp-block-paragraph">Undefined means the value hasn‟t been set, whereas null means the value has been set to be empty.</p>



<h2 class="wp-block-heading">var, let and const</h2>



<p class="wp-block-paragraph"><strong>var &#8211;</strong> The scope of a variable declared with var is its current execution context, which is either the enclosing function or, for variables declared outside any function, global.</p>



<p class="wp-block-paragraph"><strong>let &#8211;</strong> let allows you to declare variables that are limited in scope to the block, statement, or expression on which it is used.</p>



<p class="wp-block-paragraph"><strong>const &#8211; </strong>This declaration creates a constant whose scope can be either global or local to the block in which it is declared. Global constants do not become properties of the window object, unlike var variables. An initializer for a constant is required; that is, you must specify its value in the same statement in which it&#8217;s declared which can&#8217;t be changed later.</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/typeof-operator-in-javascripts/">Typeof operator in JavaScripts</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/typeof-operator-in-javascripts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[SOLVED] Flutter : NoSuchMethodError: The getter &#8216;isEmpty&#8217; was called on null.</title>
		<link>https://www.scmgalaxy.com/tutorials/flutter-nosuchmethoderror-the-getter-isempty-was-called-on-null/</link>
					<comments>https://www.scmgalaxy.com/tutorials/flutter-nosuchmethoderror-the-getter-isempty-was-called-on-null/#respond</comments>
		
		<dc:creator><![CDATA[Sushant K]]></dc:creator>
		<pubDate>Sat, 22 May 2021 06:33:36 +0000</pubDate>
				<category><![CDATA[Flutter]]></category>
		<category><![CDATA[flutter]]></category>
		<category><![CDATA[isEmpty]]></category>
		<category><![CDATA[isEmpty was called on null]]></category>
		<category><![CDATA[no sound null flutter]]></category>
		<category><![CDATA[NoSuchMethodError]]></category>
		<category><![CDATA[null safety]]></category>
		<category><![CDATA[null safety flutter]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=6339</guid>

					<description><![CDATA[<p>Problem I&#8217;m Calling An API and getting response in Variable Data ($data). When data is coming then there is no [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/flutter-nosuchmethoderror-the-getter-isempty-was-called-on-null/">[SOLVED] Flutter : NoSuchMethodError: The getter &#8216;isEmpty&#8217; was called on null.</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="has-text-align-center wp-block-heading"><strong><span class="has-inline-color has-vivid-red-color">Problem</span></strong></h2>



<p class="wp-block-paragraph">I&#8217;m Calling An API and getting response in Variable Data ($data). When data is coming then there is no Error but when I&#8217;m getting null as response then getting this error <strong>Unhandled Exception: NoSuchMethodError: The getter &#8216;isEmpty&#8217; was called on null.</strong></p>



<p class="wp-block-paragraph"> When I am using the below code then it is throwing me an error:</p>



<script src="https://gist.github.com/SushantSinghRajput03/794f41a5c997965d7d51719aab6811fa.js"></script>



<h2 class="has-text-align-center wp-block-heading"><span class="has-inline-color has-vivid-red-color">Solution</span></h2>



<p class="wp-block-paragraph">That is because <strong>$data</strong> returns&nbsp;<code>null</code>, So I&#8217;ve Used </p>



<pre class="wp-block-code"><code><code><span class="has-inline-color has-vivid-red-color">if(data?.isEmpty ?? true)</span></code>
</code></pre>



<p class="wp-block-paragraph"><code>?</code>&nbsp;prevents an error if the previous part of the expression results in&nbsp;<code>null</code>&nbsp;and&nbsp;<code>?? true</code>&nbsp;results in&nbsp;<code>true</code>&nbsp;if the previous part of the expression is&nbsp;<code>null</code>&nbsp;and therefore treats&nbsp;<code>== null</code>&nbsp;and&nbsp;<code>isEmpty</code>&nbsp;the same for the&nbsp;<code>if(...)</code>&nbsp;check.</p>



<p class="wp-block-paragraph">Now My Code is working Fine.</p>



<p class="wp-block-paragraph">Thanks for reading.</p>



<p class="wp-block-paragraph">Keep Coding.</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://professnow.com/blog/wp-content/uploads/2021/01/Keep_coding.gif" alt="" class="wp-image-26" width="75" height="75"/></figure>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/flutter-nosuchmethoderror-the-getter-isempty-was-called-on-null/">[SOLVED] Flutter : NoSuchMethodError: The getter &#8216;isEmpty&#8217; was called on null.</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/flutter-nosuchmethoderror-the-getter-isempty-was-called-on-null/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
