44 lines
1.0 KiB
Dart
44 lines
1.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
|
|
import 'package:pcastlivetv/globals.dart';
|
|
import 'package:pcastlivetv/routes.dart';
|
|
import 'package:pcastlivetv/stores/login_store.dart';
|
|
import 'package:velocity_x/velocity_x.dart';
|
|
|
|
void main() {
|
|
setUrlStrategy(NoHistoryUrlStrategy());
|
|
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
|
|
baseURL = 'https://api.pcastlivetv.com';
|
|
|
|
runApp(
|
|
VxState(
|
|
store: LoginStore(),
|
|
child: const MyApp(),
|
|
),
|
|
);
|
|
}
|
|
|
|
class MyApp extends StatelessWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp.router(
|
|
title: 'PCastLiveTV',
|
|
theme: ThemeData(
|
|
useMaterial3: true,
|
|
),
|
|
debugShowCheckedModeBanner: false,
|
|
routerConfig: router,
|
|
scaffoldMessengerKey: snackbarKey,
|
|
);
|
|
}
|
|
}
|
|
|
|
class NoHistoryUrlStrategy extends PathUrlStrategy {
|
|
@override
|
|
void pushState(Object? state, String title, String url) => replaceState(state, title, url);
|
|
}
|