type 'PageRouteTransition' is not a subtype of type 'Widget'
mzl1988 opened this issue · comments
李蘭國 commented
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),
};
Adib Mohsin commented
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()));