Page Turn Widget - Add a page turn effect to widgets in your app. Maintainer: @rodydavis

Overview

Flutter Community: page_turn

Page Turn Widget

pub package github pages

Add a page turn effect to widgets in your app.

Created by Simon Lightfoot @slightfoot

Screenshots

info info info

Example

import 'package:flutter/material.dart';

import 'package:page_turn/page_turn.dart';

import '../common/index.dart';

class HomeScreen extends StatefulWidget {
  const HomeScreen({
    Key key,
  }) : super(key: key);

  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  final _controller = GlobalKey<PageTurnState>();
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: PageTurn(
        key: _controller,
        backgroundColor: Colors.white,
        showDragCutoff: false,
        lastPage: Container(child: Center(child: Text('Last Page!'))),
        children: <Widget>[
          for (var i = 0; i < 20; i++) AlicePage(page: i),
        ],
      ),
      floatingActionButton: FloatingActionButton(
        child: Icon(Icons.search),
        onPressed: () {
          _controller.currentState.goToPage(2);
        },
      ),
    );
  }
}
Comments
  • Flutter web support

    Flutter web support

    I can't get this working on web. Both the example website and when I compile it jump to the last page and throws an exception:

    Debug service listening on ws://127.0.0.1:53824/Ao0v8w6pq20=
    
    ════════ Exception caught by scheduler library ═════════════════════════════════
    The following assertion was thrown during a scheduler callback:
    Assertion failed: org-dartlang-sdk:///flutter_web_sdk/lib/_engine/engine/surface/scene_builder.dart:267:12
    retainedSurface.isActive || retainedSurface.isReleased
    is not true
    
    When the exception was thrown, this was the stack
    throw_ (package:build_web_compilers/src/dev_compiler/C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart:196:49)
    assertFailed (package:build_web_compilers/src/dev_compiler/C:/b/s/w/ir/cache/builder/src/out/host_debug/dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart:26:3)
    addRetained (package:build_web_compilers/src/dev_compiler/C:/b/s/w/ir/cache/builder/src/out/host_debug/flutter_web_sdk/lib/_engine/engine/surface/scene_builder.dart:267:55)
    [_addToSceneWithRetainedRendering]
    addChildrenToScene
    ...
    ════════════════════════════════════════════════════════════════════════════════
    

    I would love to use this on web. Is there any solution or is this an engine issue?

    opened by davystrong 5
  • Wait for boundary debug paint before capturing

    Wait for boundary debug paint before capturing

    opened by ShrJamal 1
  • Migration of the package to null safety

    Migration of the package to null safety

    Getting issues in the implementation of the package in null-safety project. A new version of the package migrated to null safety should be published in the pub.dev

    PR #15 should be merged!!!

    opened by sachin-dahal 0
  • works in debug but throws Unhandled in release build

    works in debug but throws Unhandled in release build

    Nice work - much appreciated however.. Compiling in release mode throws this: Unhandled Exception: LateInitializationError: Local 'result' has not been initialized.

    it seems to be related to the following line in builders/widget.dart WidgetsBinding.instance!.addPostFrameCallback(_captureImage);

    Symptom: perfect in debug, blank screen in release
    Fixing it is beyond my skill as I'm just learning.

    E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40) E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090) E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354) E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258) E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162) E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167) E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126) E/flutter (18180): E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized. E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208) E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112) E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40) E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090) E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354) E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258) E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162) E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167) E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126) E/flutter (18180): E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized. E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208) E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112) E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40) E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090) E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354) E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258) E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162) E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167) E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126) E/flutter (18180): E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized. E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208) E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112) E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40) E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090) E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354) E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258) E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162) E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167) E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126) E/flutter (18180): E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized. E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208) E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112) E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40) E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090) E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354) E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258) E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162) E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167) E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126) E/flutter (18180): E/flutter (18180): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: LateInitializationError: Local 'result' has not been initialized. E/flutter (18180): #0 LateError._throwLocalNotInitialized (dart:_internal-patch/internal_patch.dart:208) E/flutter (18180): #1 RenderObject.debugNeedsPaint (package:flutter/src/rendering/object.dart:2112) E/flutter (18180): #2 _PageTurnWidgetState._captureImage (package:ssv1/book_screen/builders/widget.dart:40) E/flutter (18180): #3 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144) E/flutter (18180): #4 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090) E/flutter (18180): #5 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:998) E/flutter (18180): #6 _rootRun (dart:async/zone.dart:1354) E/flutter (18180): #7 _CustomZone.run (dart:async/zone.dart:1258) E/flutter (18180): #8 _CustomZone.runGuarded (dart:async/zone.dart:1162) E/flutter (18180): #9 _invoke (dart:ui/hooks.dart:167) E/flutter (18180): #10 PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:259) E/flutter (18180): #11 _drawFrame (dart:ui/hooks.dart:126)

    opened by sidetraxaudio 4
  • Detect when the page has been changed

    Detect when the page has been changed

    I want to play an audio that reads the book whenever the page has been changed, but I am having a hard time figuring it out how to do that exactly. How would I detect when a page has been changed?

    opened by donkii 3
  • RangeError on first page.

    RangeError on first page.

    Screenshot (640)

    Whenever i am swiping for previous page on first page it gives this error. which seems right that i dont have any page before this. but problem is, app freezes for 10-15 seconds before normal execution. I was wondering if i need to handle this type of exeception or can you add a drag effect which can be seen in ListView when scrolling is over...

    opened by Pratiknarola 0
Owner
Flutter Community
A central place for all community made Flutter packages. To get started, see the README of the 'community' repository.
Flutter Community
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 6, 2023
Compact representation of a placeholder for an image. Encode a blurry image under 30 caracters for instant display like used by Medium. Maintainer: @Solido

Flutter BlurHash Compact representation of a placeholder for an image. Generation You can use https://blurha.sh/ for testing or use any official api o

Flutter Community 408 Dec 30, 2022
A Flutter plugin to retrieve and manage contacts on Android and iOS devices. Maintainer: @lukasgit

contacts_service A Flutter plugin to access and manage the device's contacts. Usage To use this plugin, add contacts_service as a dependency in your p

Lukas Dickie 166 Dec 28, 2022
Flutter ShopApp, you can see products and their prices, categories and their products, search for a product, add to favorite, add to cart, sign in and sign up.

shop_app_2 A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started i

Muhammed Rezk Rajab 10 Aug 7, 2022
Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainder to the task, set color to separate tasks and it allows to add URL with URL's informations.

Utility Manager Flutter Application! Utility Manager Flutter Application is made with Flutter and Supabase which allows user to add task, set remainde

Kathirvel Chandrasekaran 6 Jan 6, 2022
This app is a minimal TodoList app that functions like a whiteboard. You can add new tasks, keep track of your tasks to make your day more productive, and then delete it after it is done.

My First Mobile App _ Minimal TodoList Flutter A new Flutter project. Getting Started This project is a starting point for a Flutter application. A fe

null 0 Nov 23, 2021
About This is Personal Expenses Planner. You can add your expenses in to the app and manage your transaction. and you can see How much did you spend on which day. I developed this project using flutter.

expense_planner A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Darshit Rudani 5 Jul 6, 2022
Splash Screen with liquid swipe effect!

liquid_swipe_intro A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you start

Flutter Boy 21 Dec 30, 2022
An app to help you to add frame to your favorite screenshots from Nintendo Switch.

SwitchDecor An app to help you adding frame to your favorite screenshots from Nintendo Switch. This project is written in Flutter, supporting both iOS

JuniperPhoton 40 Aug 7, 2022
A Flutter package for building custom skeleton widgets to mimic the page's layout while loading.

Skeletons A Flutter package for building custom skeleton widgets to mimic the page's layout while loading. Examples Items ListView (Default) ListView

Moh Badjah 46 Dec 17, 2022
A mobile image uploader in which you can upload image to your personal gallery from either your camera or mobile gallery and it can detect your current geographic location and address using firebase firestore and storage.

Image Uploader In Flutter About It is an Image Uploader gallery which tracks your address from which you're uploading using Flutter and Image picker.

Prahen parija 6 Dec 20, 2022
Flutter - Blur Widgets - BackdropFilter Widget

blur_widgets Flutter - Blur Widgets - BackdropFilter Widget. Screenshot: Getting Started This project is a starting point for a Flutter application. A

Ulfhrafn 3 Dec 4, 2022
Kind of app that generally used to maintain our day-to-day tasks or list everything that we have to do.We can add more tasks at any time and delete a task that is completed.

todo_application A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Khaled Elnkhla 0 Nov 6, 2021
Submit Your CV Flutter App Page Contribution #Hacktoberfest2021 #Hacktoberfest

cv_flutter_contribution Hacktoberfest 2021 Contribution Contribute your best profile pages with flutter HOW TO CONTRIBUTE Fork Clone Add List Profile

null 6 Nov 6, 2022
This is a shop-app you can see the products and With prices and knowing if there are discounts and adding your favorite products to the favorite products page

This is a shop-app you can see the products and With prices and knowing if there are discounts and adding your favorite products to the favorite products page, you can search for a specific product and also modify personal information from the settings , I made it using REST APIs by using (Dio packedge) , (shared Preference) and state management (Bloc/cubit

null 2 Oct 27, 2022
Flutter Catalog is a very handy catalog of beautifully designed widgets to help ease your flutter journey.

davidcobbina.com Flutter Catalog Flutter Catalog is a very handy catalog of beautifully designed widgets to help ease your flutter journey. It is insp

David-Legend 299 Nov 20, 2022
An animated flutter UI for E-commerce product variant selection / add to cart developed by nonybrighto and designed by Akram Khalid.

Crate & Barrel - Dark Mobile App Concept Animated An animated flutter UI for E-commerce product variant selection / add to cart developed by nonybrigh

Nony Bright O 47 Mar 28, 2022
Any contributor is free to add his Project on Mobile development.

Any contributor is free to add his Project on Mobile development. This repository's sole aim is to increase the knowledge about Open Source Contribution and for beginners to understand Git and Github

Abhishek Dwibedy 0 Jan 30, 2022
A library of Flutter to add a new style in the navigation bar.

Navigation Dot Bar Una libreria de Flutter, el cual agrega un BottomNavigationBar con un mejor estilo. Inspirada en la aplicacion "Reflectly" Como usa

null 38 Oct 17, 2022