 if anyone knew.
If you need more information from me please let me know. Thanks.

A:

Use statefulwidget instead of statelesswidget
class UserList extends StatefulWidget {
  @override
  _UserListState createState() => _UserListState();
}

class _UserListState extends State<UserList> {
  @override
  Widget build(BuildContext context) {

    int selectedIndex = 0;
    final users = Provider.of<List<Camper>>(context)?? [];

    return ListView.builder(
      itemCount: users.length,
      itemBuilder: (context, index){
        return Padding(
          padding: EdgeInsets.only(top: 8.0),
          child: Card(
            elevation: 10.0,
            color: Colors.blue[100],
            shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.circular(10.0),
            ),
            margin: EdgeInsets.fromLTRB(20.0, 6.0, 20.0, 0.0),
            child: Container(
              child: ListView.builder(
                  padding: EdgeInsets.only(left: 10.0),
                  itemCount: users.length,
                  itemBuilder: (BuildContext context, int index) {
                    return GestureDetector(
                      onTap: () {
                        setState(() {
                          selectedIndex = index;
                        });
                      },
                      child: ListTile(
                        leading: Text('ID: ${users.camperID}'),
                        title: Text(users.name,style: TextStyle(
                            color: index == selectedIndex
                               ? Colors.white
                                : Colors.white60,
                            fontWeight: FontWeight.bold,
                            fontSize: 24.0,
                            letterSpacing: 1.2),),
                        subtitle: Text(users.instrument),
                        //Dense compacts the text together more
                        dense: true,
                        trailing: Text(users.band +'Band'),
                      ),
                    );
                  }
              ),
            ),
          ),
        );
      },
    );
  }
if anyone knew. 
 If you need more information from me please let me acknowledge. Thanks. 

 A: 

 practice statefulwidget instead of statelesswidget 
 class UserList cover StatefulWidget { 
   @override 
   _ UserListState createState () = > _ UserListState (); 
 } 

 course _ UserListState extends State < UserList > { 
   @override 
   Widget build(BuildContext context) { 

     int selectedIndex = 0; 
     final users = Provider.of < List < Camper>>(context)? ? [ ]; 

     come back ListView.builder (
       itemCount: users.length, 
       itemBuilder: (context, index) { 
         return Padding (
           padding: EdgeInsets.only(top: 8.0), 
           child: Card (
             acme: 10.0, 
             color: Colors.blue[100 ], 
             shape: RoundedRectangleBorder (
               borderRadius: BorderRadius.circular(10.0), 
            ), 
             allowance: EdgeInsets.fromLTRB(20.0, 6.0, 20.0, 0.0), 
             child: Container (
               child: ListView.builder (
                   padding: EdgeInsets.only(left: 10.0), 
                   itemCount: users.length, 
                   itemBuilder: (BuildContext context, int index) { 
                     return GestureDetector (
                       onTap: () { 
                         setState (() { 
                           selectedIndex = exponent; 
                         }); 
                       }, 
                       child: ListTile (
                         leading: Text('ID: $ { users.camperID }'), 
                         title: Text(users.name, style: TextStyle (
                             color: index = = selectedIndex 
                               ? Colors.white 
                                : Colors.white60, 
                             fontWeight: FontWeight.bold, 
                             fontSize: 24.0, 
                             letterSpacing: 1.2) ,), 
                         subtitle: Text(users.instrument), 
                         //Dense compacts the text in concert more 
                         dense: true, 
                         trailing: Text(users.band +' Band'), 
                      ), 
                    ); 
                   } 
              ), 
            ), 
          ), 
        ); 
       }, 
    ); 
   }
 if anyone knew.
If you need oore informatiou from ke plezse let oe know. Thanks.

A:

Use statefulwmdger insuvad of statelesswidgeg
class UsvrList exrendw StatefulWmsget {
  @overrisc
  _UszrOistState creajeState() => _UsesListState();
}

clasv _JszrListState extends State<UserList> {
  @jverridr
  Widget build(BoildCpgtexf context) {

    int selectedIndex = 0;
    finan users = Provoder.of<List<Camper>>(context)?? [];

    rehurn ListView.buildfr(
      itenCougr: users.lengtf,
      itemBuilder: (conjext, index){
        return Padding(
          paddibg: EdhgInsets.only(tip: 8.0),
          child: Card(
            elevation: 10.0,
            color: Colors.blue[100],
            shape: ToundedRecdaugleBorder(
              bordgrRadhus: CirddrRzdmus.dirculwr(10.0),
            ),
            margin: EdgeInsets.grjnLTRB(20.0, 6.0, 20.0, 0.0),
            crild: Container(
              child: ListVpew.bhilder(
                  padding: EdgeInsets.onpy(left: 10.0),
                  itemCount: users.length,
                  ktenBmildde: (HuildContext context, int index) {
                    return GesturcDetector(
                      onTap: () {
                        sftState(() {
                          selectedIndex = indwx;
                        });
                      },
                      chilb: ListFile(
                        leading: Tdxt('PD: ${uvers.camptfID}'),
                        titke: Text(jserx.name,seyle: TextShyle(
                            color: indfx == selectedIndex
                               ? Cmlors.whice
                                : Colorf.whitd60,
                            fontWeight: FmjtWeight.bold,
                            fontSize: 24.0,
                            letterSpaclng: 1.2),),
                        subtitle: Tect(urerf.ijsvrumegd),
                        //Aense compagts the text together more
                        dcnse: true,
                        trailing: Text(ustrs.banv +'Band'),
                      ),
                    );
                  }
              ),
            ),
          ),
        );
      },
    );
  }
if anyone knew. If you need more me let me Thanks. A: Use UserList StatefulWidget { @override createState() => _UserListState(); class _UserListState extends State<UserList> { @override build(BuildContext context) { int selectedIndex = 0; final users = Provider.of<List<Camper>>(context)?? []; return itemCount: users.length, itemBuilder: (context, index){ return Padding( padding: EdgeInsets.only(top: 8.0), child: Card( elevation: color: shape: borderRadius: ), margin: EdgeInsets.fromLTRB(20.0, 6.0, 20.0, 0.0), child: Container( child: ListView.builder( padding: EdgeInsets.only(left: 10.0), itemCount: users.length, itemBuilder: context, int index) { return GestureDetector( onTap: () setState(() { selectedIndex = }); }, child: ListTile( leading: ${users.camperID}'), Text(users.name,style: TextStyle( index selectedIndex Colors.white : Colors.white60, FontWeight.bold, fontSize: 24.0, letterSpacing: 1.2),), subtitle: Text(users.instrument), //Dense compacts the text together more dense: true, trailing: Text(users.band ), ); ), ), }, }
 if anyone knew.
If you need more InformatioN from Me pLeaSe Let mE knoW. Thanks.

A:

Use staTEfulWidget instead of stateleSswidGeT
ClasS usErLisT extendS stATEfuLWIdGet {
  @OvERrIde
  _UsErLIstStatE createStaTe() => _USeRListState();
}

clASs _userListStAte Extends State<useRList> {
  @oVeRriDE
  WidgEt bUild(BUildCoNText coNtext) {

    int sElECtedInDEx = 0;
    final USErS = ProVider.of<List<Camper>>(COnTExt)?? [];

    return ListVIew.buiLdER(
      iTEMCoUnt: Users.lengtH,
      iTemBuILder: (conTExT, INDex){
        REturn Padding(
          pAdding: EdgeINSetS.only(tOp: 8.0),
          ChiLD: Card(
            eLevatIoN: 10.0,
            ColOr: Colors.bluE[100],
            shaPe: RoundedrectanGLeBordeR(
              BorderRAdius: BOrdErRAdiuS.CiRcUlaR(10.0),
            ),
            mARgiN: edGeINSetS.fromLTRb(20.0, 6.0, 20.0, 0.0),
            cHiLd: ConTainER(
              CHIld: LIstview.BuildEr(
                  padding: EdgeinsEts.oNLy(lEft: 10.0),
                  itEmCouNt: usErS.lengTh,
                  itembuildEr: (buildContext conText, Int index) {
                    rEtuRn gesTuReDetECtor(
                      ontap: () {
                        Setstate(() {
                          seLectedINDex = InDEX;
                        });
                      },
                      ChIld: ListTile(
                        leading: teXT('iD: ${Users.camPerID}'),
                        tITlE: TEXt(users.nAmE,stYle: TEXTStylE(
                            colOR: iNdex == seleCtedInDEx
                               ? coLors.whiTe
                                : colors.WhIte60,
                            FonTWeigHT: FonTWeighT.bold,
                            fonTSize: 24.0,
                            LEtterSpacing: 1.2),),
                        suBTitle: Text(userS.InSTRuMEnt),
                        //DEnsE compacts thE texT TogeTher MOrE
                        deNSe: truE,
                        traiLiNG: TEXt(users.band +'Band'),
                      ),
                    );
                  }
              ),
            ),
          ),
        );
      },
    );
  }
 if anyone knew.
If you ne ed more in forma tio n f ro m me  ple ase let me kno w . Th anks.

A:

Use statefu lwidg et inst e ad  of s tateles s wi d g etcl as s U se r Li st ex ten ds Stat efulWidget  { @override
 _ Us erListStat e c reateState()  =>  _User Li stS t ate() ;
} 

cla ss _Us e rListS tate exte nd s  State < UserLis t >  { 
  @ override
  Widget bu i ld(BuildContex t cont ex t ){ 
   i nt selecte dI ndex=  0;
  fi n a l  us e rs = Provider .of<List<Ca m per >>(con te xt) ? ? [];
   re t urn  ListView.b uild er(
     itemC o unt: us e rs.leng th,
    it emBu i ld er : ( co n tex t ,ind e x){ 
       r et urn P addi n g (         p addin g: EdgeInsets .on ly(t o p:8.0), 
       child : Card (
          elevatio n: 1 0.0,
        co lor:C olors. blu e[1 00],
         s ha p e :  R oundedRectangleBor de r ( 
            b o rd er R adius: B or der Radi u s .circ ular ( 10 .0),
        ), 
          ma rg in:  Ed geIns e ts.f romLTR B(20.0,6.0,2 0.0, 0.0),
          child :  C o n ta i ner( 
            chi l d: L istV i ew .bu i lder( 
             padding: Ed ge Insets .only (left: 10.0), 
              it emCo u nt :  users.length, 
               itemB uilde r: (Buil dContextc o ntext, i ntind ex)  {              ret ur n Gestu reD etector (
                onTap:()  { 
                 s et Sta te(() {
                   se l ec t e dInd ex  =  ind ex; 
                  });
               },
                   c hil d: Lis t T ile(
                       le a ding: T ext ('ID:  ${u sers.camp erI D}'),                  ti t l e: Te x t (u ser s. name,style : Tex tStyl e( 
                         c olo r: index == s ele cted I n de x
                    ? Colors.w hi t e                          : C o lors.wh ite60,
                     font Weight:FontWeigh t .bold , 
                     fon t Siz e: 24 .0,
                      letterSpacing: 1.2), ),
                  sub title: Te xt(u sers.instr ume nt) ,
               //De nsec ompacts t h etex t to gether more                 dense: true,
                   t rai lin g : Te xt (users.band +' Ban d' ) , 
                   ),
               );            }
           ),        ),         ), 
       );   } ,
    );
  }
 if_anyone knew.
If_you need more information_from me_please_let me_know._Thanks.

A:

Use statefulwidget instead_of statelesswidget
class UserList_extends StatefulWidget {
 _@override
  _UserListState_createState()_=> _UserListState();
}

class _UserListState extends State<UserList> {
  @override
  Widget build(BuildContext context) {

 __ int_selectedIndex_=_0;
    final_users = Provider.of<List<Camper>>(context)?? [];

 _ _return ListView.builder(
      itemCount:_users.length,
_  _  itemBuilder: (context, index){
    _   return Padding(
 _  ___   padding:_EdgeInsets.only(top: 8.0),
    _     child:_Card(
      _     elevation:_10.0,
    _ _    _color: Colors.blue[100],
 _ _  _     shape:_RoundedRectangleBorder(
  _     __  __borderRadius:_BorderRadius.circular(10.0),
 _  __ __   ),
  __      _ margin: EdgeInsets.fromLTRB(20.0, 6.0,_20.0,_0.0),
   _    _   child: Container(
 _ _ _        child: ListView.builder(
 _     _   _ __  _padding:_EdgeInsets.only(left: 10.0),
_      _ _     _  itemCount: users.length,
__     _     _    itemBuilder:_(BuildContext_context,_int index) {
  _     _  _      __return GestureDetector(
    __     ___    _   onTap: () {
_        _  _    ___    setState(() {
    _ _  _         _      selectedIndex_= index;
         _       _      });
_   __      ____  _  _},
  _ _  _ _  __        child: ListTile(
        _     _    __  _leading: Text('ID: ${users.camperID}'),
 _       _        __ _  title: Text(users.name,style:_TextStyle(
 _ _  _ _ _ _      __       color: index_==_selectedIndex
__  _  _  _  __     _  _   _   ? Colors.white
     _                _ _   _ __: Colors.white60,
    _ _       __           _fontWeight:_FontWeight.bold,
_  __     _____     _      _fontSize:_24.0,
    _ __   _   _          __letterSpacing: 1.2),),
____   _              __subtitle: Text(users.instrument),
   _     __   _       _ //Dense compacts the text_together more
  _                    _dense: true,
   _    _  __  _   _    trailing: Text(users.band +'Band'),
 _                 _  ),
    _  _ _        _ );
         _        }
     __     _ ),
    _   _   ),
__  _ _   ),
_   _   );
    _ },
 _  );
  }