pacifio / route_transitions

A flutter library containing useful animations and friendly functions for routing 🚦

Home Page:https://pub.dev/packages/route_transitions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

type 'PageRouteTransition' is not a subtype of type 'Widget'

mzl1988 opened this issue · comments

import 'package:flutter/material.dart';
import 'package:route_transitions/route_transitions.dart';
import '../pages/tabs_page/tabs_page.dart';

final routes = {
'/': (context) => PageRouteTransition(
animationType: AnimationType.slide_down,
builder: (context) => TabsPage()),
// '/search':(context,{arguments})=>SearchPage(arguments:arguments),
};

Your method of using this plugin is wrong ..
your code should be

import 'package:route_transitions/route_transitions.dart';
import '../pages/tabs_page/tabs_page.dart';

final routes = {
  '/': (context) => c(),
  // '/search':(context,{arguments})=>SearchPage(arguments:arguments),
};

and the code should be like this
suppose you are going to the '/' page
then the code should be

Navigator.of(context).push(PageRouteTransition(
      animationType: AnimationType.slide_up,
      builder: (context) => TabsPage()));