five_page_navigation 1.0.6 copy "five_page_navigation: ^1.0.6" to clipboard
five_page_navigation: ^1.0.6 copied to clipboard

This package allows you to navigate between screen from one central page. You can swipe up, down, left and right with ease.

example/lib/main.dart

import 'package:example/pages/bottom_page.dart';
import 'package:example/pages/center_page.dart';
import 'package:example/pages/left_page.dart';
import 'package:example/pages/right_page.dart';
import 'package:example/pages/top_page.dart';
import 'package:five_page_navigation/five_page_navigation.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: BasePage(),
    );
  }
}

class BasePage extends StatelessWidget {
  const BasePage({super.key});

  @override
  Widget build(BuildContext context) {
    return FivePageNavigator(
      centerPage: CenterPage(),
      leftPage: LeftPage(),
      rightPage: RightPage(),
      topPage: TopPage(),
      bottomPage: BottomPage(),
      enableLeftPageSwipeBack: true,
      enableBottomPageSwipeBack: true,
      enableRightPageSwipeBack: true,
      enableTopPageSwipeBack: true,

      /// Initial wait duration before the first page is shown.
      /// All screens will seen for a wait duration before
      /// the first page (CenterPage) is shown.
      initialWaitDuration: const Duration(milliseconds: 500),

      /// Initial view scale of the center page.
      /// Defaults 1.0, no scaling. If initial view scale is set to 1.0,
      /// initialWaitDuration is unnecessary to use.
      initialViewScale: .5,

      /// You can control swiping feature of the CenterPage. Default, enabled.
      canSwipeFromCenter: () {
        return true;
      },
    );
  }
}
4
likes
0
points
15
downloads

Publisher

verified publishertorchingale.com

Weekly Downloads

This package allows you to navigate between screen from one central page. You can swipe up, down, left and right with ease.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on five_page_navigation