Skip to content

Instantly share code, notes, and snippets.

@haashem
Last active September 26, 2022 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haashem/f1b006f31d0af05bc181404d0ff83a5b to your computer and use it in GitHub Desktop.
Save haashem/f1b006f31d0af05bc181404d0ff83a5b to your computer and use it in GitHub Desktop.
MaterialApp Router
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