Search packages, repositories and app categories

coast cover
Package detailsv2.0.2

coast

PageView wrapper that supports Hero-like animations

AndroidiOSWebmacOSWindowsLinux
30-day downloads
875
Likes
96
Pub points
140

Install package

flutter pub add coast

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Coast is a Flutter package that extends PageView to enable Hero-like animations between pages, providing smooth and visually engaging transitions. It simplifies the implementation of shared element transitions across page boundaries by managing the animation lifecycle automatically. Ideal for apps with card-based navigation or content-heavy interfaces where continuity between screens enhances user experience. The package supports all major platforms, ensuring consistent behavior across devices.

Use cases

  • Card-based navigation
  • Content-heavy app interfaces
  • Smooth screen transitions
  • Hero-like animations in PageView
  • Cross-page shared element animations

Key features

  • Automatic Hero-like animation handling
  • Seamless integration with PageView
  • Cross-platform support
  • Minimal boilerplate code
  • Supports shared element transitions

Suitable for

  • Developers seeking smooth page transitions
  • Apps with dynamic content flows
  • UI-focused applications
  • Flutter projects requiring visual continuity
  • Teams prioritizing animation consistency

Considerations

  • May impact performance with heavy widgets
  • Requires careful widget structure for optimal results
  • Limited customization compared to manual Hero setup
  • Best suited for moderate complexity transitions
  • Not ideal for highly complex animation chains

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

coast

build

PageView wrapper supporting Hero-like animations

img/example

Example

Create a Coast with a number of Beaches and add a CrabController as observer to the Coast. Wrap a widget that you want to animate between beaches with a Crab widget with the same tag.

class CoastExampleApp extends StatefulWidget {
  @override
  _CoastExampleAppState createState() => _CoastExampleAppState();
}

class _CoastExampleAppState extends State<CoastExampleApp> {
  final _beaches = [
    Beach(builder: (context) => Cadzand()),
    Beach(builder: (context) => Westkapelle()),
    Beach(builder: (context) => Zoutelande()),
  ];

  final _coastController = CoastController();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Coast(
        beaches: _beaches,
        controller: _coastController,
        observers: [
          CrabController(),
        ],
      ),
    );
  }
}


class Cadzand extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      title: Text("Cadzand"),
      backgroundColor: Colors.deepOrange,
    ),
    body: Stack(
      children: [
        Positioned(
          top: 40,
          left: 40,
          child: Crab(
            tag: "container",
            child: Container(
              color: Colors.green,
              width: 80,
              height: 60,
            ),
          ),
        ),
      ],
    ),
  );
}

class Westkapelle extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      title: Text("Westkapelle"),
      backgroundColor: Colors.amber,
    ),
    body: Stack(
      children: [
        Positioned(
          top: 80,
          right: 40,
          child: Crab(
            tag: "container",
            child: Container(
              color: Colors.green,
              width: 200,
              height: 100,
            ),
          ),
        ),
      ],
    ),
  );
}

class Zoutelande extends StatelessWidget {
  @override
  Widget build(BuildContext context) => Scaffold(
    appBar: AppBar(
      title: Text("Zoutelande"),
      backgroundColor: Colors.deepPurple,
    ),
    body: Stack(
      children: [
        Positioned(
          bottom: 40,
          left: 20,
          child: Crab(
            tag: "container",
            child: Container(
              color: Colors.green,
              width: 100,
              height: 200,
            ),
          ),
        ),
      ],
    ),
  );
}

Categories

Source repository

Projects using this package

No data available yet.