Last active
September 26, 2022 17:39
-
-
Save haashem/f1b006f31d0af05bc181404d0ff83a5b to your computer and use it in GitHub Desktop.
MaterialApp Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:appleid_dashboard/router/routes.dart'; | |
import 'package:flutter/material.dart'; | |
void main() => runApp(const MyApp()); | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
final colorScheme = ColorScheme.fromSeed(seedColor: Colors.blue); | |
final theme = ThemeData.from( | |
colorScheme: colorScheme, | |
); | |
final textTheme = theme.textTheme.apply( | |
bodyColor: colorScheme.onSurface, | |
displayColor: colorScheme.onSurface, | |
); | |
return MaterialApp.router( | |
routerConfig: AppRouter.router, | |
title: 'Manage your Apple ID', | |
theme: theme.copyWith( | |
textTheme: textTheme, | |
iconTheme: IconThemeData(color: colorScheme.primary)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment