Search
 
SCRIPT & CODE EXAMPLE
 

DART

carousel in flutter curved images onpressed

class BuildCarousel extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(borderRadius: BorderRadius.circular(10)),
      child: CarouselSlider(
        options: CarouselOptions(
          height: 200,
          initialPage: 2,
          enableInfiniteScroll: false,
          reverse: false,
          autoPlay: true,
          autoPlayInterval: Duration(seconds: 3),
          autoPlayAnimationDuration: Duration(milliseconds: 800),
          enlargeCenterPage: true,
          scrollDirection: Axis.horizontal,
        ),
        items: [
          'https://charlielawrance.com/wp-content/uploads/2017/10/13-Ad-Examples.jpg',
          'https://webcdn-adespressoinc.netdna-ssl.com/wp-content/uploads/2019/09/fb-collection-ads-2019-1024x536.jpg',
        ].map((i) {
          return Builder(
            builder: (BuildContext context) {
              return Container(
                decoration:
                    BoxDecoration(borderRadius: BorderRadius.circular(10)),
                padding: EdgeInsets.all(0.0),
                height: MediaQuery.of(context).size.height * 0.30,
                width: MediaQuery.of(context).size.width,
                child: GestureDetector(
                  child: CachedNetworkImage(
                    imageUrl: i,
                    placeholder: (context, url) => CupertinoActivityIndicator(),
                    errorWidget: (context, url, error) => Icon(Icons.error),
                  ),
                  onTap: () => Navigator.push<Widget>(
                    context,
                    CupertinoPageRoute(
                      builder: (context) =>
                          CollectionToProduct(category: 'watch'),
                    ),
                  ),
                ),
              );
            },
          );
        }).toList(),
      ),
    );
  }
Comment

PREVIOUS NEXT
Code Example
Dart :: flutter container with custom shape 
Dart :: DateFormat local fr flutter 
Dart :: dart array remove 
Dart :: dart string to int 
Dart :: most used extentions for flutter 
Dart :: Flutter - FlutterLogo Widget 
Dart :: dart get return value of future function 
Dart :: dart fixed length list 
Dart :: dart list of objects to json 
Dart :: flutter unhandled exception 
Dart :: flutter build async 
Dart :: how to use same bloc in multiple widgets in flutter 
Dart :: Dart simple program 
Dart :: create and validate flutter forms 
Dart :: dart language asynchronous ?? 
Dart :: android emulator black screen flutter 
Dart :: flutter conditional parent widget 
Dart :: Using Navigator.popUntil and route without fixed name 
Dart :: glowing buttons in flutter 
Dart :: dart uzunlikni olish 
Swift :: Split a String into an array in Swift 
Swift :: swift first where 
Swift :: swiftui padding one line 
Swift :: get request swift 
Swift :: array length swift 
Swift :: button in swiftui 
Swift :: print an array in swift 
Swift :: and in swift6 
Swift :: swift string to dictionary 
Swift :: changing color of background swift 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =