GeceGibi / marqueer

Marquee package for flutter
MIT License
9 stars 2 forks source link

[Feat Request] Can move on the same direction for every loop? Do Not just pick random direction and move on. #14

Open yfming93 opened 6 months ago

yfming93 commented 6 months ago

[Feat Request] Can move on the same direction for every loop? Do Not just pick random direction and move on. Please add a parameter to set the same direction for every loop

GeceGibi commented 6 months ago

Hi @yfming93

I don't understand what you mean. Can you give an code example please. Thanks for feedback.

yfming93 commented 6 months ago

I don't understand what you mean. Can you give an code example please. Thanks for feedback.

Marqueer.builder(
      itemCount: ls!.length,
      autoStart: ls!.length > 2,
      restartAfterInteraction: ls!.length > 2,
      direction : MarqueerDirection.ttb,
      itemBuilder: (context, index) {
        WaitList mo = ls![index];
        return  _todoCell(mo.total, mo.title);
      },
    )

Widget _todoCell (int num, String text){
    return Container(
      padding: EdgeInsets.symmetric(vertical: 2.r),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Container(
            decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(16.r/2),
                color: Color(0xFFFD7660)
            ),
            width: 16.r,
            height: 16.r,
            child: Center(
              child:  MainText(num.toString(),fontSize: 10.sp,fontWeight: AppFont.medium,color: C.white,),
            ),
          ),
          SizedBox(width: 10.r,),
          Expanded(child: Text(text,textAlign: TextAlign.left,overflow: TextOverflow.ellipsis,maxLines: 1,style: TextStyle(fontSize: 12.sp,fontWeight: AppFont.medium,color: C.black,),)),
          SizedBox(width: 10.r,),
        ],
      ),
    );
  }

Look the video demo show . The first loop. Its from bottom scroll to top. But the second loop. Its from top scroll to bottom. I want to from bottom scroll to top at every loop all the time. Do not different direction. https://github.com/GeceGibi/marqueer/assets/18211498/03633db6-699c-4961-8b93-95e1d802dfed