flutter_router 1.0.3 copy "flutter_router: ^1.0.3" to clipboard
flutter_router: ^1.0.3 copied to clipboard

outdated

Flutter routing library that adds flexible routing options like parameters and clear route definitions

example/lib/main.dart

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

void main() => runApp(MaterialApp(
  onGenerateRoute: Router({
    '/accounts/{id}': (context, match) => Account(match.parameters['id']),
    '/': (context, match) => Index(),
  }).get,
));

class Account extends StatelessWidget {
  final String id;

  Account(this.id);

  @override
  Widget build(BuildContext context) {
    return Scaffold(body: Center(child: Text(this.id)));
  }
}

class Index extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(body: Center(child: Text('Index')));
  }
}
5
likes
0
points
169
downloads

Publisher

verified publisherelita.si

Weekly Downloads

Flutter routing library that adds flexible routing options like parameters and clear route definitions

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, uri

More

Packages that depend on flutter_router