{"id":14,"date":"2021-09-16T08:23:00","date_gmt":"2021-09-16T08:23:00","guid":{"rendered":""},"modified":"2023-08-20T01:27:15","modified_gmt":"2023-08-20T01:27:15","slug":"migrating-to-darts-null-safety","status":"publish","type":"post","link":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/","title":{"rendered":"Migrating to Dart&#8217;s Null Safety"},"content":{"rendered":"<\/p>\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png\" style=\"clear: right; float: right; margin-bottom: 1em; margin-left: 1em;\"><img loading=\"lazy\" decoding=\"async\" border=\"0\" data-original-height=\"720\" data-original-width=\"742\" height=\"194\" src=\"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety-300x291.png\" width=\"200\" \/><\/a><\/div>\n<div>Prior to starting on my 4th Flutter mobile app, and because it seems that every plugin now supports it, I decided to give <b>migrating to Dart&#8217;s null safety<\/b> a go.<\/div>\n<\/p>\n<blockquote style=\"border: none; margin: 0px 0px 0px 40px; padding: 0px;\">\n<p style=\"text-align: left;\"><i><a href=\"https:\/\/dart.dev\/null-safety#enable-null-safety\" target=\"_blank\" rel=\"noopener\">Sound null safety is available<\/a> in Dart 2.12 and Flutter 2.<\/i><\/p>\n<\/blockquote>\n<p>In reading through the migration documentation, it appears the migration tool may pose as much time and effort as migrating by hand. And being I&#8217;m in this to learn the code, <b>migrating by hand<\/b> is the path I&#8217;ve opted for. I&#8217;m currently on Step 2.4 of the <a href=\"https:\/\/dart.dev\/null-safety\/migration-guide#migrating-by-hand\" target=\"_blank\" rel=\"noopener\">Migration Guide<\/a>.<\/p>\n<\/p>\n<div style=\"text-align: right;\">\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/lh3.googleusercontent.com\/-56YzHxkgYHI\/YUJ-UG2HWII\/AAAAAAAAeKE\/h2-PM6Mb1XoaXypiwn08rqjHsIz-r7NzACLcBGAsYHQ\/image.png\" style=\"margin-left: 1em; margin-right: 1em;\"><\/a><\/p>\n<div style=\"clear: both; text-align: center;\">\n<div style=\"clear: both; text-align: center;\"><a href=\"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/image.png\" style=\"margin-left: 1em; margin-right: 1em;\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" data-original-height=\"23\" data-original-width=\"880\" height=\"16\" src=\"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/image-300x8.png\" width=\"640\" \/><\/a><\/div>\n<p><\/div>\n<\/div>\n<\/div>\n<p>Because each of my reminder apps is setup with a similar code base, I also decided to migrate all three apps at the same time. Thus far I&#8217;ve got one app down to 500 critical errors, while the other two are down to 396 and 393.<\/p>\n<table align=\"center\" style=\"clear: both; text-align: center; width: 300px;\">\n<tbody>\n<tr>\n<th style=\"font-weight: normal; text-align: left;\"><a href=\"https:\/\/kdrecall.com\/\" target=\"_blank\" rel=\"noopener\">Mobile Apps<\/a><\/th>\n<th>Critical<\/th>\n<th style=\"font-weight: normal;\">Warn<\/th>\n<th style=\"font-weight: normal;\">Info<\/th>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">B4-I-Go<\/td>\n<td>500<\/td>\n<td>10<\/td>\n<td>64<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Hungry-on_Hand<\/td>\n<td>396<\/td>\n<td>8<\/td>\n<td>56<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Xpired To Be<\/td>\n<td>393<\/td>\n<td>10<\/td>\n<td>58<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Having started at over 600 critical errors on the <a href=\"https:\/\/kdrecall.com\/\" target=\"_blank\" rel=\"noopener\">B4-I-Go app<\/a>, the migration thus far has been tedious, but informative and enlightening\u2014to both Dart, and my app&#8217;s own code.<\/p>\n<p>I&#8217;m sure a pattern of migrating will emerge, but currently the most time-consuming aspect comes in having to analyze the <i>context<\/i> of each error to determine if a variable&nbsp;<b><i><span style=\"color: #cc0000;\">can<\/span><\/i><\/b> be null, or if it <b><i><span style=\"color: #cc0000;\">will never<\/span><\/i><\/b>&nbsp;be null. It seems a small distinction between the two when <a href=\"https:\/\/dart.dev\/guides\/language\/language-tour#important-concepts\" target=\"_blank\" rel=\"noopener\">reading about them<\/a>, but <i>in context<\/i>, the decision seems quite important for each case.<\/p>\n<table align=\"center\" style=\"width: 90%;\">\n<tbody>\n<tr>\n<td rowspan=\"2\" style=\"text-align: center; width: 40px;\"><b><span style=\"font-size: x-large;\">?<\/span><\/b><\/td>\n<td rowspan=\"2\" style=\"text-align: center; width: 20px;\">|=&gt;<\/td>\n<td>\n<ul style=\"margin: 0px;\">\n<li>\n\t\t\tIndicates an object member&#8217;s leftmost operand can be null; <a href=\"https:\/\/dart.dev\/guides\/language\/language-tour#other-operators\" target=\"_blank\" rel=\"noopener\">example<\/a>: <span style=\"font-family: courier;\">foo?.bar<\/span> selects property <span style=\"font-family: courier;\">bar<\/span> from expression <span style=\"font-family: courier;\">foo<\/span> unless <span style=\"font-family: courier;\">foo<\/span> is <span style=\"font-family: courier;\">null<\/span> (in which case the value of <span style=\"font-family: courier;\">foo?.bar<\/span> is <span style=\"font-family: courier;\">null<\/span>).\n          <\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<ul style=\"margin: 0px;\">\n<li>\n\t\t\tYou can make a variable nullable by putting a question mark (<span style=\"font-family: courier;\"><b>?<\/b><\/span>) at the end of its type.<br \/>\n\t\t\tFor example, a variable of type <span style=\"font-family: courier;\">int?<\/span> might be an <span style=\"font-family: courier;\">integer<\/span>, or it might be <span style=\"font-family: courier;\">null<\/span>.\n\t\t<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td rowspan=\"3\" style=\"margin-top: 10px; text-align: center; width: 40px;\"><b><span style=\"font-size: x-large;\">!<\/span><\/b><\/td>\n<td rowspan=\"3\" style=\"text-align: center; width: 20px;\">|=&gt;<\/td>\n<td style=\"padding-top: 15px;\">\n<ul style=\"margin: 0px;\">\n<li>If you know that an expression never evaluates to null but Dart disagrees.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<ul style=\"list-style: none; margin: 0px;\">\n<li><code><br \/>\n\t\t\tMap&lt;String, List&lt;String&gt;&gt; _dataMap = {};<br \/>\n\t\t\t_dataMap.putIfAbsent('message', () =&gt; []);<br \/>\n\t\t\t_dataMap['message']!.add('Welcome!');<br \/>\n\t\t<\/code><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<ul style=\"margin: 0px;\">\n<li>\n\t\t\t\/\/ ^^^ &#8216;<b>!<\/b>&#8216; means we know the message key will never be null because we added it on the line above.\n\t\t<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The other two prominent null safe keywords are <span style=\"font-family: courier;\">required<\/span> and <span style=\"font-family: courier;\">late<\/span>. While <span style=\"font-family: courier;\">required<\/span> was introduced before I began learning Flutter via the <span style=\"font-family: courier;\">@required<\/span> annotation, which is easily remedied by removing the `@`, I&#8217;ve come across ample variables that have made good of the <a href=\"https:\/\/dart.dev\/guides\/language\/language-tour#late-variables\" target=\"_blank\" rel=\"noopener\">new <b><span style=\"font-family: courier;\">late<\/span><\/b> modifier<\/a>, which simply indicates the variable <b><i><span style=\"color: #cc0000;\">will be<\/span><\/i><\/b> initialized later.<\/p>\n<\/p>\n<blockquote style=\"border: none; margin: 0px 0px 0px 40px; padding: 0px;\">\n<p style=\"text-align: left;\"><span style=\"font-style: normal;\">&#x26a0;<\/span> <span style=\"font-size: medium;\">If you fail to initialize a <span style=\"font-family: courier;\">late<\/span> variable, a runtime error occurs when the variable is used.<\/span><\/p>\n<\/blockquote>\n<p>Fortunately, should errors prevail when the migration is complete, I should also get a good look at <a href=\"https:\/\/flutter.dev\/docs\/development\/tools\/sdk\/release-notes\/release-notes-2.5.0\" target=\"_blank\" rel=\"noopener\">Flutter&#8217;s new debugging updates<\/a>.<\/p>\n<p>Happy migrating!<\/p>\n<p>&#8211; Keith | <a href=\"https:\/\/keithdc.com\/\">https:\/\/keithdc.com<\/a><\/p>\n<p><\/p>\n<div>\n<hr \/>\n<p><\/p>\n<h2 style=\"text-align: left;\">Converting nullable dynamic Lists inside Maps<\/h2>\n<div>As a last-minute add, below is a null-safe approach used to convert a <span style=\"font-family: courier;\">dynamic<\/span> List inside a Map, such as when using <span style=\"font-family: courier;\">json.decode<\/span>, into a List of <span style=\"font-family: courier;\">String<\/span>s.<\/div>\n<div><\/div>\n<div>If anyone knows if anything is incorrect or can be done better, please comment. Always looking to learn proper methodologies and better approaches.<\/div>\n<div><\/div>\n<div><b>Two scenarios:<\/b> A key exists in a Map, or it doesn&#8217;t (is null).<\/div>\n<\/div>\n<blockquote style=\"border: none; margin: 0px 0px 0px 40px; padding: 0px;\">\n<div>\n<div style=\"text-align: left;\"><span style=\"font-family: courier; font-size: medium;\">Map&lt;String, <b>List&lt;dynamic&gt;<\/b>&gt; _statusObj = {&#8216;message&#8217;: [&#8216;Hello!&#8217;]};<\/span><\/div>\n<\/div>\n<\/blockquote>\n<blockquote style=\"border: none; margin: 0px 0px 0px 40px; padding: 0px;\">\n<div>\n<div style=\"text-align: left;\"><span style=\"font-family: courier; font-size: medium;\">Map&lt;String, <b>List&lt;dynamic&gt;<\/b>&gt; _statusObj = {};<\/span><\/div>\n<\/div>\n<\/blockquote>\n<div>\n<div><\/div>\n<div><b>A null-safe solution:<\/b><\/div>\n<\/div>\n<blockquote style=\"border: none; margin: 0px 0px 0px 40px; padding: 0px;\">\n<div>\n<div style=\"text-align: left;\"><span style=\"font-family: courier; font-size: medium;\"><b>List&lt;String&gt;<\/b> _alertMsgs = <b>List&lt;String&gt;.from(<\/b>_statusObj[&#8220;message&#8221;]<b>?<\/b>.toList() <b>??<\/b> &lt;String&gt;[]<b>)<\/b>;<\/span><\/div>\n<\/div>\n<\/blockquote>\n<div>\n<div><\/div>\n<div><b>Reference notes with comments<\/b> and some approaches that didn&#8217;t work:<\/div>\n<div>\n<ul style=\"text-align: left;\">\n<li>Gist: <a href=\"https:\/\/gist.github.com\/KDCinfo\/f329655032b7b189dfdd9e82e97010e3\">https:\/\/gist.github.com\/KDCinfo\/f329655032b7b189dfdd9e82e97010e3<\/a><\/li>\n<\/ul>\n<\/div>\n<div>\n<ul style=\"text-align: left;\">\n<li>DartPad (runs the ^^^ Gist): <a href=\"https:\/\/dartpad.dev\/f329655032b7b189dfdd9e82e97010e3\">https:\/\/dartpad.dev\/f329655032b7b189dfdd9e82e97010e3<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div><\/div>\n<div>&#8212;<br \/>\nKeith D Commiskey<br \/>\nhttps:\/\/keithdc.com<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Prior to starting on my 4th Flutter mobile app, and because it seems that every plugin now supports it, I decided to give migrating to<\/p>\n","protected":false},"author":1,"featured_media":138,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3,5],"tags":[],"class_list":["post-14","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dart","category-flutter","category-null-safety"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Migrating to Dart&#039;s Null Safety - App Development: Odds and Ends<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Migrating to Dart&#039;s Null Safety - App Development: Odds and Ends\" \/>\n<meta property=\"og:description\" content=\"Prior to starting on my 4th Flutter mobile app, and because it seems that every plugin now supports it, I decided to give migrating to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/\" \/>\n<meta property=\"og:site_name\" content=\"App Development: Odds and Ends\" \/>\n<meta property=\"article:published_time\" content=\"2021-09-16T08:23:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-20T01:27:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Keith D Commiskey\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Keith D Commiskey\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/\"},\"author\":{\"name\":\"Keith D Commiskey\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/#\\\/schema\\\/person\\\/87980b154db7bd0cd7c569ca09328bac\"},\"headline\":\"Migrating to Dart&#8217;s Null Safety\",\"datePublished\":\"2021-09-16T08:23:00+00:00\",\"dateModified\":\"2023-08-20T01:27:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/\"},\"wordCount\":607,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/#\\\/schema\\\/person\\\/87980b154db7bd0cd7c569ca09328bac\"},\"image\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/blog_for_null_safety.png\",\"articleSection\":[\"dart\",\"flutter\",\"null safety\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/\",\"url\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/\",\"name\":\"Migrating to Dart's Null Safety - App Development: Odds and Ends\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/blog_for_null_safety.png\",\"datePublished\":\"2021-09-16T08:23:00+00:00\",\"dateModified\":\"2023-08-20T01:27:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/blog_for_null_safety.png\",\"contentUrl\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/09\\\/blog_for_null_safety.png\",\"width\":742,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/2021\\\/09\\\/16\\\/migrating-to-darts-null-safety\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Migrating to Dart&#8217;s Null Safety\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/\",\"name\":\"App Development: Odds and Ends\",\"description\":\"Providing insights into a career of apps and utilities that I&#039;ve conceptualized, designed, and developed; complemented with developmental journeys, findings, observations, and challenges encountered along the way.\",\"publisher\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/#\\\/schema\\\/person\\\/87980b154db7bd0cd7c569ca09328bac\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/#\\\/schema\\\/person\\\/87980b154db7bd0cd7c569ca09328bac\",\"name\":\"Keith D Commiskey\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/keith-sac-01.jpg\",\"url\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/keith-sac-01.jpg\",\"contentUrl\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/keith-sac-01.jpg\",\"width\":113,\"height\":117,\"caption\":\"Keith D Commiskey\"},\"logo\":{\"@id\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/keith-sac-01.jpg\"},\"description\":\"Web App Creator; Former Flutter Developer; Former Front End Developer; Former Technical Graphics.\",\"sameAs\":[\"https:\\\/\\\/kdcinfo.com\\\/blog\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/commiskey\"],\"url\":\"https:\\\/\\\/kdcinfo.com\\\/blog\\\/author\\\/kdc4wp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Migrating to Dart's Null Safety - App Development: Odds and Ends","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/","og_locale":"en_US","og_type":"article","og_title":"Migrating to Dart's Null Safety - App Development: Odds and Ends","og_description":"Prior to starting on my 4th Flutter mobile app, and because it seems that every plugin now supports it, I decided to give migrating to","og_url":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/","og_site_name":"App Development: Odds and Ends","article_published_time":"2021-09-16T08:23:00+00:00","article_modified_time":"2023-08-20T01:27:15+00:00","og_image":[{"width":742,"height":720,"url":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png","type":"image\/png"}],"author":"Keith D Commiskey","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Keith D Commiskey","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#article","isPartOf":{"@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/"},"author":{"name":"Keith D Commiskey","@id":"https:\/\/kdcinfo.com\/blog\/#\/schema\/person\/87980b154db7bd0cd7c569ca09328bac"},"headline":"Migrating to Dart&#8217;s Null Safety","datePublished":"2021-09-16T08:23:00+00:00","dateModified":"2023-08-20T01:27:15+00:00","mainEntityOfPage":{"@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/"},"wordCount":607,"commentCount":1,"publisher":{"@id":"https:\/\/kdcinfo.com\/blog\/#\/schema\/person\/87980b154db7bd0cd7c569ca09328bac"},"image":{"@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#primaryimage"},"thumbnailUrl":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png","articleSection":["dart","flutter","null safety"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/","url":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/","name":"Migrating to Dart's Null Safety - App Development: Odds and Ends","isPartOf":{"@id":"https:\/\/kdcinfo.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#primaryimage"},"image":{"@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#primaryimage"},"thumbnailUrl":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png","datePublished":"2021-09-16T08:23:00+00:00","dateModified":"2023-08-20T01:27:15+00:00","breadcrumb":{"@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#primaryimage","url":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png","contentUrl":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2021\/09\/blog_for_null_safety.png","width":742,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/kdcinfo.com\/blog\/2021\/09\/16\/migrating-to-darts-null-safety\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kdcinfo.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Migrating to Dart&#8217;s Null Safety"}]},{"@type":"WebSite","@id":"https:\/\/kdcinfo.com\/blog\/#website","url":"https:\/\/kdcinfo.com\/blog\/","name":"App Development: Odds and Ends","description":"Providing insights into a career of apps and utilities that I&#039;ve conceptualized, designed, and developed; complemented with developmental journeys, findings, observations, and challenges encountered along the way.","publisher":{"@id":"https:\/\/kdcinfo.com\/blog\/#\/schema\/person\/87980b154db7bd0cd7c569ca09328bac"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kdcinfo.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/kdcinfo.com\/blog\/#\/schema\/person\/87980b154db7bd0cd7c569ca09328bac","name":"Keith D Commiskey","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2023\/08\/keith-sac-01.jpg","url":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2023\/08\/keith-sac-01.jpg","contentUrl":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2023\/08\/keith-sac-01.jpg","width":113,"height":117,"caption":"Keith D Commiskey"},"logo":{"@id":"https:\/\/kdcinfo.com\/blog\/wp-content\/uploads\/2023\/08\/keith-sac-01.jpg"},"description":"Web App Creator; Former Flutter Developer; Former Front End Developer; Former Technical Graphics.","sameAs":["https:\/\/kdcinfo.com\/blog","https:\/\/www.linkedin.com\/in\/commiskey"],"url":"https:\/\/kdcinfo.com\/blog\/author\/kdc4wp\/"}]}},"_links":{"self":[{"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/posts\/14","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/comments?post=14"}],"version-history":[{"count":1,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/posts\/14\/revisions\/140"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/media\/138"}],"wp:attachment":[{"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/media?parent=14"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/categories?post=14"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kdcinfo.com\/blog\/wp-json\/wp\/v2\/tags?post=14"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}