Vertical swipe for next item example

This Article is posted by seven.srikanth at 10/27/2021 7:08:49 PM



Here is an example to get the next item on a vertical swipe.  
Here is the complete code from main.dart file. 

import 'package:flutter/material.dart';
main(List<String> args) {
  runApp(const MyApp());
}
class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @ override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Scaffold(body: MyverticalSwiper()),
    );
  }
}
class MyverticalSwiper extends StatelessWidget {
  const MyverticalSwiper({Key? key}) : super(key: key);
  @ override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 3,
      initialIndex: 0,
      child: RotatedBox(
        quarterTurns: 1,
        child: TabBarView(
          children: [
            Container(
              color: Colors.red,
            ),
            Container(
              color: Colors.green,
            ),
            Container(
              color: Colors.blue,
            ),
          ],
        ),
      ),
    );
  }
}
Thanks,
Srikanth

Tags:








0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.


© 2018 - Fluttercentral | Email to me - seven.srikanth@gmail.com