mirror of
https://github.com/cupcakearmy/fight-of-the-mobiles.git
synced 2026-04-02 18:25:23 +00:00
26 lines
715 B
Dart
26 lines
715 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
import 'Screens/Home.dart';
|
|
import 'Screens/Scan.dart';
|
|
import 'Screens/Success.dart';
|
|
|
|
void main() => runApp(App());
|
|
|
|
class App extends StatelessWidget {
|
|
@override
|
|
Widget build(BuildContext context) => MaterialApp(
|
|
routes: {
|
|
'/': (context) => Home(),
|
|
'/scan': (context) => Scan(),
|
|
},
|
|
onGenerateRoute: (routeSettings) {
|
|
var path = routeSettings.name.split('/');
|
|
final number = path.length > 1 ? int.parse(path[2]) : null;
|
|
|
|
return MaterialPageRoute(
|
|
builder: (context) => Success(result: number),
|
|
settings: routeSettings,
|
|
);
|
|
});
|
|
}
|