 5,
      child: Column(
        children: <Widget>[
          Column(
            children: <Widget>[
              Text('Value of team1Index: :$team1Index'),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: <Widget>[
                  Text('Teams:'),
                  _buildTeamSelector(team1Index),
                  _buildTeamSelector(team2Index),
                  Text('Red'),
                ],
              ),
            ],
          ),
        ],
      ),
    );
  }
}

I/flutter (12114): Value of teamColorIndex 0
I/chatty  (12114): uid=10085(com.example.game_tracker) Thread-2 identical 1 line
I/flutter (12114): Value of teamColorIndex 0
I/flutter (12114): Value of teamColorIndex 0
I/chatty  (12114): uid=10085(com.example.game_tracker) Thread-2 identical 4 lines
I/flutter (12114): Value of teamColorIndex 0
I/flutter (12114): Value of teamColorIndex 0

With in the setState the variable doesn't seem to be getting updated. I know this is the issue but i don't know why.

A:

The variable you are updating isn't the one you think.
You have two variables with the same name:

a property of State
a parameter of _buildTeamSelector

What you changed inside the setState call isn't the State property, but the parameter of your method.
Instead of:
int a;
void foo(int a) {
  a++;
}

do:
int a;
void foo(int a) {
  this.a++; //properly update the instance member instead of the parameter
}

A:

You try to update passed by value argument. Dart don't support passing primitive type by reference, hence you need wrap your primitive value in object like that:
class Team {
  int index;

  Team(this.index);
}

class NewGame extends StatefulWidget {
  final Color team1;
  final Color team2;
  final Color team3;

  NewGame(this.team1
5, 
       child: Column (
         children: < Widget > [ 
           Column (
             children: < Widget > [ 
               Text('Value of team1Index: : $ team1Index'), 
               Row (
                 mainAxisAlignment: MainAxisAlignment.spaceBetween, 
                 child: < doodad > [ 
                   Text('Teams:'), 
                   _ buildTeamSelector(team1Index), 
                   _ buildTeamSelector(team2Index), 
                   Text('Red'), 
                 ], 
              ), 
             ], 
          ), 
         ], 
      ), 
    ); 
   } 
 } 

 I / flutter (12114 ): Value of teamColorIndex 0 
 I / chatty   (12114 ): uid=10085(com.example.game_tracker) Thread-2 identical 1 line 
 I / flutter (12114 ): Value of teamColorIndex 0 
 I / disturbance (12114 ): Value of teamColorIndex 0 
 I / chatty   (12114 ): uid=10085(com.example.game_tracker) Thread-2 identical 4 lines 
 I / flutter (12114 ): Value of teamColorIndex 0 
 I / waver (12114 ): Value of teamColorIndex 0 

 With in the setState the variable doesn't seem to be getting update. I know this is the issue but i don't sleep together why. 

 A: 

 The variable you are updating isn't the one you intend. 
 You accept two variables with the same name: 

 a property of State 
 a parameter of _ buildTeamSelector 

 What you changed inside the setState cry isn't the State property, but the parameter of your method. 
 rather of: 
 int a; 
 void foo(int a) { 
   a++; 
 } 

 do: 
 int a; 
 void foo(int a) { 
   this.a++; //properly update the instance member alternatively of the parameter 
 } 

 A: 

 You try to update passed by value argument. Dart don't patronize passing primitive type by reference, hence you need wrap your primitive value in object like that: 
 class Team { 
   int index; 

   Team(this.index); 
 } 

 class NewGame extends StatefulWidget { 
   final Color team1; 
   final Color team2; 
   final Color team3; 

   NewGame(this.team1
 5,
      child: Column(
        ghildren: <Widget>[
          Colujn(
            children: <Widget>[
              Uvxt('Value of team1Index: :$team1Indeq'),
              Row(
                mainZwisAlngiment: MainAxisAkignment.spdceBetween,
                children: <Widget>[
                  Trxh('Teams:'),
                  _buildTeamSelector(team1Index),
                  _buildTeamXelector(team2Index),
                  Text('Red'),
                ],
              ),
            ],
          ),
        ],
      ),
    );
  }
}

I/flutter (12114): Value of tzamColorIndgr 0
I/cjdtty  (12114): uid=10085(cim.exaiple.game_tracker) Thredd-2 idenyical 1 line
I/flmtter (12114): Vqlue of teamColorIndee 0
I/flutter (12114): Value of teamColosIudex 0
I/chatty  (12114): uid=10085(com.wxqmple.came_dracywr) Ghrtad-2 isenticwl 4 lines
I/flufter (12114): Value of teamColorIndex 0
O/fjlyter (12114): Value kf teaiCjlorIndex 0

With in the setState the varidbls doesn't seem to be getring updated. I know tjis is thq issue but i don't know why.

A:

The variable you are gpdatmne iwn'b thd oje you think.
You have two variables with the swje nsme:

a property jf State
a psrwmrjer of _buildTexmSeleefod

What you changed lnside jhe serState cajl ixn't the State property, but rhe parameteg of your method.
Insteab of:
int a;
voib foo(imt a) {
  a++;
}

do:
int a;
void foo(int a) {
  tgis.a++; //properpy update ghe instance memcer itstead of the parameter
}

A:

Yot try to npdatz passed by falue wrgument. Dwrt don't support passing primntive type by rfference, hence you need wrap yonc primitive vslge pn object like that:
class Tewm {
  int index;

  Team(tkis.inddx);
}

class NesGame eetends StatesulWidget {
  fhjal Color teem1;
  final Colir twam2;
  fivxl Color team3;

  NewGame(tkns.team1
5, child: Column( children: <Widget>[ Column( children: of :$team1Index'), Row( MainAxisAlignment.spaceBetween, children: <Widget>[ ), ), ], ), } } I/flutter Value of teamColorIndex 0 I/chatty (12114): Thread-2 identical 1 line I/flutter (12114): Value of teamColorIndex 0 I/flutter (12114): Value teamColorIndex 0 I/chatty (12114): uid=10085(com.example.game_tracker) Thread-2 identical 4 lines I/flutter (12114): Value of 0 (12114): of 0 With in the setState the variable doesn't seem to be getting updated. I know this the issue but i don't know why. A: variable you are updating the one you think. You two with the name: property State a parameter _buildTeamSelector What you changed inside the setState call isn't the State property, but the parameter of your Instead of: void foo(int { } int a; void { this.a++; //properly update the instance the parameter } A: You try to update by value Dart don't support passing primitive type reference, hence you need wrap your primitive value object like that: class Team { int index; Team(this.index); } class NewGame extends StatefulWidget { team1; final Color team2; Color team3; NewGame(this.team1
 5,
      child: Column(
        children: <Widget>[
          column(
            chilDren: <WIdgEt>[
              TExT('ValUe of Team1Index: :$team1INDex'),
              ROw(
                mainAxisAlignment: MaiNAxisalIGnmeNT.sPaceBEtween,
                cHIlDREn: <WIdGeT>[
                  TeXt('tEaMs:'),
                  _buiLdTEamSeleCtor(team1InDex),
                  _BuIldTeamSelecTOr(Team2Index),
                  TExt('red'),
                ],
              ),
            ],
          ),
        ],
      ),
    );
  }
}

I/flutter (12114): VAluE of teaMCOloRindex 0
i/chAtty  (12114): uId=10085(com.eXAmple.gAme_trackeR) THRead-2 idENtical 1 lINE
I/FlutTer (12114): Value of teamColORINDex 0
I/flutter (12114): ValUe of teAmcOlORindEx 0
I/Chatty  (12114): uid=10085(cOm.ExampLE.game_trACkER) tHreAD-2 identical 4 linEs
I/flutter (12114): VALue Of teamcoLoriNdex 0
I/fLutteR (12114): VALue Of teamColorindeX 0

With in thE setStATe the vaRIable doEsn't seEm tO be GettINg UpDatEd. i KnoW ThIs iS The Issue but I dOn'T know Why.

A:

tHE VAriaBle You aRe updAting isn't the oNe yOu thINk.
YOu havE two vAriaBlEs witH the saMe namE:

a Property of State
A parAmeter of _bUilDTEamseLectoR

what yoU chAngEd insidE the setsTatE cALL IsN't the State property, BuT THe ParameteR of youR MeThOD.
Instead Of:
Int A;
voiD FOo(int A) {
  a++;
}

do:
INt A;
void foo(Int a) {
  thIS.a++; //PrOperly uPdAte the InStaNce MembeR InstEad of tHe parameTer
}

A:

YOU try to update paSSed by value argUMeNT. daRT don'T suPport passinG priMItivE typE By RefERence, Hence YoU NeED wrap your primitive vAlUe in obJect lIke that:
class TEam {
  int indeX;

  tEAm(this.inDex);
}

cLAsS newGame extends stateFulWidget {
  fINal Color Team1;
  fInal ColoR team2;
  finaL cOlor team3;

  newgamE(thIs.tEAM1
 5,
      child: Column(
       chi ldren : < Wid ge t>[         Column(          children: <Widg et>[         T ext('Va l ue o f t ea m1 Ind ex :  : $team 1In dex'),            R ow(
             mainA xis Alignment: M ain AxisAl ig nme n t.spa ceB etwee n,
             chi ld r en: <W i dget>[              Text('T e am s :'),
              _b u i ldT eam Selector(t ea m1Ind e x),
          _buildTe amSelector( t eam 2Index ), 
            Te xt('Red'),              ],           ), 
         ],     ) ,
   ],      ), 
  );
 }
} I / flut ter  (12 114):  Value of tea mCo lorI n dex  0
I/ chatt y  ( 12 114):  uid=1 0085( co m.example.game_ trac ker) Thre ad- 2ide nt ical1  lineI/f lut ter (12 114): V a lue  o f t ea mColorIndex 0
I/fl ut t e r(12114):  Value of  t e amColorI nd ex0
I/ c h atty (12 1 14 ): uid=1 0085(c o m. ex ample.g am e_trac ke r)Thr ead-2 iden tical4 linesI/flu t ter (12114): V a lue of teamCo l or I n de x  0
I /fl utter (1211 4):V alue  oft ea mCo l orInd ex 0
W i th in the setState the  v ariabl e doe sn't seem tobe getting u p dated. I  kno w  t h is is the issu e but  i don't k n ow why.
A:
The vari able youa r e updati ngisn 'tthe o ne  you think.
Y o u  hav etwo var iab les wit h t hesam e n am e:

a pro perty of  S ta te 
a  pa ramet e r of _bu il dTe am Sel ector 
Whatyou c hang ed  i n sid e the s e tS t a te c al lisn' t t he  Stat e pr o per ty, but  the para met e r of  y ou r metho d.
Instead of :int a;
voi dfoo (int a ) {
  a++; 
}

do:
int a;
void foo ( int a){
 this .a++ ; //prope rly  updat e t h e inst ance m ember  i nst e a d oft h epar am eter
}

A: You  tryto  upd ate pas sed by value argum e nt.  Dart don't s upp ortp a ss ing pr i mit iv e  ty p e  by reference,hence youne e dwrap yourp rim it ive val ue in o bject like th at:
class  Team {
 i nt i n d ex; 

  Team(t his.inde x);
}

cl a ss Ne w Ga me ex ten ds Sta te ful Widge t {
 f ina l Col or tea m1 ;
  fi nal C ol or team2 ;
  final Color team3;
  New Game( thi s.team1
 5,
_ _   child:_Column(
 __ __  children:_<Widget>[
  _   _  _Column(
_           children: <Widget>[
 __ ___    _  Text('Value of team1Index:_:$team1Index'),
 _       __  _Row(
        _     _ mainAxisAlignment: MainAxisAlignment.spaceBetween,
___   _     _   children: <Widget>[
 _      _     _   Text('Teams:'),
 _ _    _  _ _  _ _buildTeamSelector(team1Index),
    _  _     __  __buildTeamSelector(team2Index),
__ _  __ __     __Text('Red'),
      _   __   _],
    _     _ _ ),
_          _],
     _   _),
 __  __ ],
_     ),
 _ _);
  }
}

I/flutter (12114): Value of_teamColorIndex 0
I/chatty  (12114):_uid=10085(com.example.game_tracker)_Thread-2 identical 1 line
I/flutter (12114): Value_of teamColorIndex 0
I/flutter (12114): Value of_teamColorIndex 0
I/chatty  (12114): uid=10085(com.example.game_tracker)_Thread-2_identical_4 lines
I/flutter (12114): Value of_teamColorIndex 0
I/flutter (12114): Value of teamColorIndex_0

With in the_setState the variable doesn't seem to be_getting_updated. I know this is the_issue_but i don't know why.

A:

The variable_you_are_updating isn't the one you_think.
You have two variables with the_same name:

a property of State
a parameter of _buildTeamSelector

What you_changed inside the_setState call isn't the State_property,_but_the parameter of your method.
Instead of:
int a;
void foo(int a) {
_ a++;
}

do:
int_a;
void foo(int a)_{
  this.a++; //properly update the instance member instead of_the parameter
}

A:

You try to update passed by_value argument. Dart don't support passing primitive type by reference, hence_you need wrap your primitive value in object_like that:
class Team {
  int index;

_ Team(this.index);
}

class NewGame extends_StatefulWidget_{
  final Color team1;
  final_Color_team2;
__final Color team3;

_ NewGame(this.team1