.white),
                        margin: const EdgeInsets.only(top: 40.0),
                        child: Center(
                            child: Text(
                          "Manage Membership",
                          style: TextStyle(fontSize: 24.0, color: maincolor),
                        )),
                      ),
                      Container(
                        width: 360.0,
                        height: 56.0,
                        decoration: BoxDecoration(
                            borderRadius: BorderRadius.circular(10.0),
                            color: Colors.red),
                        margin: const EdgeInsets.only(top: 40.0, bottom: 40.0),
                        child: InkWell(
                          onTap: () async {
                            await OneSignal.shared.logoutEmail();
                            SharedPreferences prefs =
                                await SharedPreferences.getInstance();
                            prefs.remove('accesstoken');
                            prefs.remove('refreshtoken');
                            prefs.remove('email');
                            Navigator.push(
                              context,
                              MaterialPageRoute(builder: (context) => First()),
                            );
                          },
                          child: Center(
                              child: Text(
                            "LOGOUT",
                            style:
                                TextStyle(fontSize: 24.0, color: Colors.white),
                          )),
                        ),
                      ),
                    ],
                  ),
                ),
              )
            ],
          ),
        ),
      ),
      resizeToAvoidBottomPadding: false,
      backgroundColor: thirdcolor,
    );
  }
}

Error log: https://pastebin.com/raw/Regkgcqk

A:

EDIT: I figured out why it wasn't working (fairly sure). I have a function that grabs a saved index value from persistent storage and sets selectedIndex to this value upon initialization of the state.
However, when the saved index is grabbed, it returns a null (because it has not been set yet) value. Therefore it passes this null value to selectedIndex and subsequently the builder as well; leading to an invalid argument(s) error because the index cannot be null.
The function in question is not included in the above incorrect code, so
.white), 
                         margin: const EdgeInsets.only(top: 40.0), 
                         child: Center (
                             child: Text (
                           " Manage Membership ", 
                           style: TextStyle(fontSize: 24.0, color: maincolor), 
                        ) ), 
                      ), 
                       Container (
                         width: 360.0, 
                         height: 56.0, 
                         decoration: BoxDecoration (
                             borderRadius: BorderRadius.circular(10.0), 
                             semblance: Colors.red), 
                         gross profit: const EdgeInsets.only(top: 40.0, bottom: 40.0), 
                         child: InkWell (
                           onTap: () async { 
                             await OneSignal.shared.logoutEmail (); 
                             SharedPreferences prefs = 
                                 await SharedPreferences.getInstance (); 
                             prefs.remove('accesstoken'); 
                             prefs.remove('refreshtoken'); 
                             prefs.remove('email'); 
                             Navigator.push (
                               context, 
                               MaterialPageRoute(builder: (context) = > First ()), 
                            ); 
                           }, 
                           child: Center (
                               child: Text (
                             " LOGOUT ", 
                             expressive style: 
                                 TextStyle(fontSize: 24.0, color: Colors.white), 
                          ) ), 
                        ), 
                      ), 
                     ], 
                  ), 
                ), 
              ) 
             ], 
          ), 
        ), 
      ), 
       resizeToAvoidBottomPadding: false, 
       backgroundColor: thirdcolor, 
    ); 
   } 
 } 

 Error logarithm: https://pastebin.com/raw/Regkgcqk 

 A: 

 EDIT: I figured out why it wasn't working (reasonably certain). I have a routine that grabs a saved exponent value from persistent storage and sets selectedIndex to this value upon initialization of the state. 
 However, when the saved index is catch, it returns a null (because it has not been set however) value. Therefore it passes this null value to selectedIndex and subsequently the builder as well; leading to an invalid argument(s) mistake because the index cannot be null. 
 The function in question is not included in the above incorrect code, therefore
.whihe),
                        margin: const GdteInsevs.only(tkp: 40.0),
                        child: Cenver(
                            zhild: Texn(
                          "Managc Memgcrshi'",
                          style: TextStyne(woutSize: 24.0, color: maincolor),
                        )),
                      ),
                      Container(
                        width: 360.0,
                        height: 56.0,
                        qwcoration: BobDecoration(
                            borderRadius: BurderXadius.circuoae(10.0),
                            color: Colorv.red),
                        margin: const EdgeInsxts.only(top: 40.0, bottom: 40.0),
                        child: IbkWeln(
                          oiTap: () async {
                            aeayn OneSignal.shzred.lodottEmail();
                            ShartdPrererences prefs =
                                await FharedPreferences.getInstance();
                            prtfw.remoxw('afcesstoken');
                            prefs.reikvt('renreshtoken');
                            prefs.reoove('emcjl');
                            Nacigator.pufh(
                              context,
                              MatexialPabeRouye(builder: (context) => Firsc()),
                            );
                          },
                          chmld: Cznter(
                              child: Text(
                            "LOGOUT",
                            style:
                                TqxtStyle(fontSiee: 24.0, color: Colofs.white),
                          )),
                        ),
                      ),
                    ],
                  ),
                ),
              )
            ],
          ),
        ),
      ),
      revizeGoAxpidBogtomPadding: walsr,
      backgroundColmr: tgirdcolor,
    );
  }
}

Errpr log: httks://pastebig.com/raw/Regkgcak

A:

EDIT: I figured lut wiy it xasn't eorhing (fairly sure). I have a funcfion that grwbs a saved yndew vajue from pzrsistent storage and sets selectedIndex to this value upob initialization of uhe state.
Howeter, whqn the saeed index is grabbed, it returns a nulk (because it has not geen sat yeh) value. Therefore it passes this null value to selectedIndex and subsequebtly tie builder as welk; leagiug co an igvalmd argument(s) error because the index cannot be nuul.
The futccion in question is not inclucea in the abovg incorrect code, so
.white), margin: const EdgeInsets.only(top: 40.0), child: Center( "Manage style: TextStyle(fontSize: color: maincolor), )), 56.0, BoxDecoration( borderRadius: BorderRadius.circular(10.0), Colors.red), margin: const 40.0, bottom: 40.0), child: InkWell( onTap: async { await OneSignal.shared.logoutEmail(); SharedPreferences prefs = await SharedPreferences.getInstance(); prefs.remove('accesstoken'); prefs.remove('refreshtoken'); prefs.remove('email'); Navigator.push( MaterialPageRoute(builder: (context) => First()), ); }, child: Center( child: Text( "LOGOUT", style: TextStyle(fontSize: color: )), ), ), ), ) ], ), ), ), resizeToAvoidBottomPadding: false, backgroundColor: thirdcolor, ); } } Error log: A: EDIT: I figured out why it wasn't (fairly sure). I have function that grabs a saved value persistent storage sets to value upon initialization the state. However, when the saved index is grabbed, it returns a null (because it has not set yet) it passes null to and subsequently the well; leading to an invalid argument(s) index cannot be null. The function in question not included the above incorrect code, so
.white),
                        margin: const EdgeInsetS.only(top: 40.0),
                        chIld: CeNteR(
                            chIlD: TexT(
                          "ManAge Membership",
                          sTYle: TExtStyle(fontSize: 24.0, color: mAincoLoR),
                        )),
                      ),
                      contAInEr(
                        widTh: 360.0,
                        heighT: 56.0,
                        DeCORatIoN: BOxDEcORaTion(
                            bOrdErRadiuS: BorderRadIus.CiRcular(10.0),
                            color: COLoRs.red),
                        margiN: coNst EdgeInsetS.onLy(top: 40.0, bOtTom: 40.0),
                        CHild: INkWEll(
                          ontap: () asyNC {
                            await oneSignal.ShARed.logOUtEmail();
                            sHArEdPrEferences prefs =
                                awaIT SHAredPreferenceS.getInStANcE();
                            PRefS.reMove('accessToKen');
                            prEFs.removE('ReFREShtOKen');
                            prefs.removE('email');
                            NavigATor.Push(
                              coNtExt,
                              mAteriaLPageroUTe(bUilder: (conteXt) => FiRst()),
                            );
                          },
                          child: CEnter(
                              cHIld: Text(
                            "loGOUT",
                            stYle:
                                TexTStYle(FontsIzE: 24.0, cOloR: COLorS.WhIte),
                          )),
                        ),
                      ),
                    ],
                  ),
                ),
              )
            ],
          ),
        ),
      ),
      REsiZeToAvoiDBOtTomPaDdinG: FALSe,
      baCkgRounDColoR: thirdcolor,
    );
  }
}

ErRor Log: hTTps://PasteBin.coM/raw/reGkgcqK

A:

EDIT: i figuReD out why it wasn't wOrkiNg (fairly sUre). i hAve A fUnctiON that gRabS a sAved indEx value FRom PeRSIStEnt storage and sets sElECTeDIndex to This vaLUe UpON initialIzAtiOn of THE statE.
HowEVeR, when the Saved iNDeX iS grabbeD, iT returNs A nuLl (bEcausE It haS not beEn set yet) Value. tHerefore it passES this null valuE To SELeCTedINdeX and subsequEntlY The bUildER aS weLL; leadIng to An INvALid argument(s) error beCaUse the Index Cannot be null.
THe function IN QUestion iS not INcLUded in the above IncorRect code, so
.white),
                       mar gin:con stEd geIn sets .only(top: 40. 0 ),
                      chil d: Cent e r( 
                 c hi ld: T ext (
                      "Manag e  M embership" ,
                     s t yle:Tex tStyl e(font S ize: 2 4.0, colo r: mainco l or),
                   )),                    ) ,               C ontai n er(
                wi dth: 360.0,                   he ig h t:56.0,
                    d ecorati o n: BoxD ecorat ion (
               b orderRad iu s:  Bord erRa d i u s .cir cul ar(1 0.0), 
                      color : Co lo rs.re d),
                    marg in: const  Ed ge Ins et s.onl y (top:40. 0,bottom:  40.0),                   chil d: I nk Well(
                  o nTap : () as ync{ 
                     a wait O ne Sig nal .shar e d.lo goutEm ail();
                       SharedP r ef e r en c es p ref s =
                      await  S h ar e dPreferences.getIns ta nce(); 
                        p r efs.remo ve(' a cc e sstoken');
                       pref s.remove ('refresh t o ken');
                    pr e f s.re mo ve('ema il' );
                     Navigat or .p us h( 
                      c o ntext, 
                   Ma te ri alPa geR ou te(bu ilde r : ( context ) => Firs t() ) ,
                      );
                    }, 
                        chil d:Cente r(
                       child : Tex t( 
                  " L OGO UT",                         sty l e:                      Te xt S tyl e ( fontSize: 24.0,  color: Co lo r s. white),
                    ) ) ,
                     ) ,
                 ),               ],              ) ,
            ),           ) 
           ],
          ),
      ),
    ),
     re s ize ToAvoidBo ttom Padding: f als e,     ba c kgrou ndCo l or : t h irdco lor,     );
 } 
} 

E r r or  log: https : / / pas tebin .co m /raw/R egkg cqk

A:

EDIT: If igured out why  itw a sn' t w o rkin g(fairly sure).  Iha v e  a funct io n that grab s a save di ndexvaluefrom p ersiste n t  s t orageandset s selecte dIn de x  to thi sva l ue upo n in it ializa tion o f  the s tate.
However, w hen t h e  save d  in dex i sgrabbed ,  itreturns anull (becau se ithasnot b een set  y et) va lue .Thereforei t passesthisnull va lu e to  se lected Inde x and s ubse qu ent ly the bu i l de r  a sw ell ; le ading  t o an  invalida rgument( s)e rror be ca use t he ind e xc a nnot be nu ll. 
Thef u nction inq uest i on is no t incl uded i n the a b ove  i ncorrec t c o d e, so
.white),
 _ _   _ __ __  _  _   _margin: const EdgeInsets.only(top:_40.0),
_             __ ___    child:_Center(
    _ _       __  _        _child: Text(
    _  ___   _     _     _"Manage Membership",
     _     _    _ _    _  style:_TextStyle(fontSize: 24.0,_color: maincolor),
 _     _  _     __  ___ )),
_  __ __     __      _),
   __   _    _     _ _Container(
 _          _     _   _ width:_360.0,
_  __ _      _ _     _  height: 56.0,
__     _     _    ___   decoration: BoxDecoration(
_     _  _      __     __   borderRadius: BorderRadius.circular(10.0),
 ___    _     _        _  _ color: Colors.red),
  ___         _ _  _    margin: const EdgeInsets.only(top: 40.0, bottom: 40.0),
_      _          _     child: InkWell(
 _      _   __      ____  onTap:_() async {
_  _ _  _ _  __             await OneSignal.shared.logoutEmail();
   _     _    __  _   _     SharedPreferences prefs =
_        __ _   _ _ _  _ _ _ _  await SharedPreferences.getInstance();
   __        ____  _  _  _  prefs.remove('accesstoken');
__     _  _   _         _   prefs.remove('refreshtoken');
             _ _   _ __     prefs.remove('email');
_ _       __           ___  Navigator.push(
__     _____     _      __    context,
_ __   _   _          __ ____ MaterialPageRoute(builder: (context) =>_First()),
              __    _     __);
   _       _    _   _     },
               _    _    _child: Center(
 __  _   _       _            child: Text(
    _      _  _ _        _  "LOGOUT",
        _             __    style:
 _     _   _   __  _ _   _   _  TextStyle(fontSize: 24.0, color: Colors.white),
  _  _          _         )),
           _  __        ),
   _ _        _       ),
___   __    _   _ _ ],
     _ _   _    _ ),
    __     _ __ ),
_ __  _ _ __ _)
 __ _ __    ],
  _  _    ),
 _     _),
_ _   ),
     _resizeToAvoidBottomPadding: false,
    _ backgroundColor:_thirdcolor,
   _);
  }
}

Error log:_https://pastebin.com/raw/Regkgcqk

A:

EDIT: I_figured out_why_it wasn't working (fairly sure). I have_a function that grabs a saved index value from persistent_storage and_sets_selectedIndex to this value upon initialization of the state.
However, when the_saved index is grabbed,_it returns a null_(because it has not_been set_yet) value._Therefore it passes this null value to_selectedIndex_and_subsequently the builder as well; leading to an invalid_argument(s) error because the index cannot_be null.
The function_in question_is_not included in_the above_incorrect code, so