transition_pages_jr 0.0.3 copy "transition_pages_jr: ^0.0.3" to clipboard
transition_pages_jr: ^0.0.3 copied to clipboard

This is my new Flutter Package that contains a Transitions Pages.

example/main.dart

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

void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Material App',
      initialRoute: 'page1',
      routes: {
        'page1': (_) => const Page1Page(),
        'page2': (_) => const Page2Page(),
      },
    );
  }
}

class Page1Page extends StatelessWidget {
  const Page1Page({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.blueGrey,
      appBar: AppBar(
        elevation: 0,
        backgroundColor: Colors.transparent,
        title: const Text('Page1Page'),
      ),
      body: Center(
        child: MaterialButton(
          onPressed: () {
            RouteTransitions(
              context: context,
              child: const Page2Page(),
              animation: AnimationType.fadeIn,
            );
          },
          child: const Text('Go to Page2Page'),
          color: Colors.white,
        ),
      ),
    );
  }
}

class Page2Page extends StatelessWidget {
  const Page2Page({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      backgroundColor: Colors.blueGrey,
      body: const Center(
        child: Text('Page2Page'),
      ),
    );
  }
}
2
likes
140
pub points
0%
popularity

Publisher

unverified uploader

This is my new Flutter Package that contains a Transitions Pages.

Homepage

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on transition_pages_jr