Line data Source code
1 : import 'package:flutter/foundation.dart'; 2 : import 'package:flutter/widgets.dart'; 3 : import 'route_dart.dart'; 4 : 5 : class RoutemasterParser extends RouteInformationParser<RouteData> { 6 9 : const RoutemasterParser(); 7 : 8 9 : @override 9 : Future<RouteData> parseRouteInformation(RouteInformation routeInformation) { 10 27 : return SynchronousFuture(RouteData(routeInformation.location!)); 11 : } 12 : 13 : /// Route object -> RouteInformation (URL) 14 9 : @override 15 : RouteInformation restoreRouteInformation(RouteData routeData) { 16 18 : return RouteInformation(location: routeData.path); 17 : } 18 : }