full_screen_back_gesture 0.0.2 copy "full_screen_back_gesture: ^0.0.2" to clipboard
full_screen_back_gesture: ^0.0.2 copied to clipboard

A Flutter package supports full screen swipe back gesture, without scrolling conflicts.

example/main.dart

import 'package:flutter/material.dart';
import 'package:full_screen_back_gesture/full_screen_back_gesture.dart';

void main() => runApp(App());

/// Sample app with [FullScreenBackGesturePageTransitionsBuilder] configuration
class App extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        pageTransitionsTheme: PageTransitionsTheme(
          builders: {
            TargetPlatform.android:
                FullScreenBackGesturePageTransitionsBuilder(),
            TargetPlatform.iOS: FullScreenBackGesturePageTransitionsBuilder(),
          },
        ),
      ),
      home: MainPage(),
    );
  }
}

/// A common sample page
class MainPage extends StatelessWidget {
  const MainPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Back Gesture'),
      ),
      body: Center(
        child: ElevatedButton(
          child: Text('Push next page'),
          onPressed: () => Navigator.of(context).push(
            // only [MaterialPageRoute] supports custom [pageTransitionsTheme]
            MaterialPageRoute(builder: (context) => ScrollPage()),
          ),
        ),
      ),
    );
  }
}

/// A sample page with horizontal scrollable widget
class ScrollPage extends StatelessWidget {
  const ScrollPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Scrollable'),
      ),
      body: Align(
        alignment: Alignment.topCenter,
        child: SizedBox(
          height: 100.0,
          child: GridView.count(
            crossAxisCount: 1,
            scrollDirection: Axis.horizontal,
            children: List.generate(
              10,
              (index) => Card(
                child: InkWell(
                  child: Center(child: Text('$index')),
                  onTap: () => Navigator.of(context).push(
                    MaterialPageRoute(builder: (context) => MainPage()),
                  ),
                ),
              ),
            ),
          ),
        ),
      ),
    );
  }
}
4
likes
120
pub points
64%
popularity

Publisher

unverified uploader

A Flutter package supports full screen swipe back gesture, without scrolling conflicts.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on full_screen_back_gesture