Untitled
Container( decoration: BoxDecoration( color: hexToColor('#F6FAFC'), borderRadius: BorderRadius.circular(5), border: Border.all(color: hexToColor('#64788250'), width: 1), boxShadow: [ BoxShadow( color: Colors.blueGrey, spreadRadius: 1, blurRadius: 1, ), ], ), child: Column( children: [ SizedBox( height: 200, child: myReportsC.files.isNotEmpty ? Container( padding: EdgeInsets.all(3), decoration: BoxDecoration( borderRadius: BorderRadius.circular(5), ), child: PageView.builder( onPageChanged: shoutC.currentIndex, // padding: EdgeInsets.symmetric(horizontal: 5, vertical: 10), physics: BouncingScrollPhysics(), scrollDirection: Axis.horizontal, itemCount: myReportsC.files.length, itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { Get.to( () => GestureDetector( onTap: () => back(), child: Container( width: Get.width, child: PhotoView( minScale: .8, imageProvider: MemoryImage(myReportsC.files[index]!), ), decoration: BoxDecoration( color: Colors.white70, ), ), ), fullscreenDialog: true, opaque: false, ); }, child: AspectRatio( aspectRatio: 16 / 9, child: ClipRRect( borderRadius: BorderRadius.circular(10), child: PhotoView( imageProvider: MemoryImage(myReportsC.files[index]!), backgroundDecoration: BoxDecoration( color: Colors.white70, ), ), ), ), ); }, ) // child: PhotoViewGallery.builder( // itemCount: myReportsC.files.length, // builder: (BuildContext context, int index) { // return PhotoViewGalleryPageOptions( // imageProvider: MemoryImage(myReportsC.files[index]!), // // maxScale: PhotoViewComputedScale.covered, // // minScale: PhotoViewComputedScale.covered, // // tightMode: true, // ); // }, // scrollPhysics: BouncingScrollPhysics(), // backgroundDecoration: BoxDecoration( // color: Theme.of(context).canvasColor, // // color: Colors.transparent, // borderRadius: BorderRadius.circular(5)), // onPageChanged: (int index) { // shoutC.currentIndex.value = index; // }, // ), ) : Container( padding: EdgeInsets.all(3), child: ClipRRect( borderRadius: BorderRadius.circular(5), child: Image.asset( 'assets/images/no_image.png', fit: BoxFit.cover, // width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width - 20, ), ), ), ), SizedBox( height: 40, width: MediaQuery.of(context).size.width, child: myReportsC.files.length != 0 ? Row( mainAxisAlignment: MainAxisAlignment.center, children: [ ListView.builder( scrollDirection: Axis.horizontal, shrinkWrap: true, itemCount: myReportsC.files.length, itemBuilder: (BuildContext context, int index) { return Obx( () => Container( // padding: EdgeInsets.symmetric(horizontal: 5), padding: EdgeInsets.only(left: 5, right: 5), child: CircleAvatar( radius: 10, backgroundColor: index == shoutC.currentIndex.value ? hexToColor('#F2BA14') : hexToColor('#C8E0EA'), child: Text( (index + 1).toString(), style: TextStyle( fontFamily: 'Manrope', color: hexToColor('#000000'), fontSize: 13, fontWeight: FontWeight.w700, ), ), ), ), ); }, ), ], ) : Center( child: Text( 'No Image Available', style: TextStyle( fontFamily: 'Manrope', color: hexToColor('#000000'), fontSize: 15, fontWeight: FontWeight.w500, ), ), ), ), ], ), )
Leave a Comment