Created
January 9, 2024 01:53
-
-
Save brasizza/e8c97f59e0dd36d0fd338dae7f20d30a to your computer and use it in GitHub Desktop.
This file contains hidden or 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:deeplink_live/app/modules/posts/posts_route.dart'; | |
import 'package:deeplink_live/app/modules/splash/splash_route.dart'; | |
import 'package:dio/dio.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter_getit/flutter_getit.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); | |
@override | |
Widget build(BuildContext context) { | |
return FlutterGetIt( | |
bindingsBuilder: () => [ | |
Bind.lazySingleton( | |
(i) => Dio( | |
BaseOptions(baseUrl: 'https://jacodouhoje.dev/wp-json/wp/v2/'), | |
), | |
), | |
], | |
modules: [ | |
SplashRoute(), | |
PostsRoute(), | |
], | |
debugMode: true, | |
builder: (BuildContext context, Map<String, Widget Function(BuildContext)> routes, NavigatorObserver flutterGetItNavObserver) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), | |
useMaterial3: true, | |
), | |
routes: routes, | |
initialRoute: '/splash', | |
); | |
}, | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment