import 'package:flutter/material.dart';

import 'package:provider/provider.dart';

import 'package:pshared/config/constants.dart';
import 'package:pshared/provider/locale.dart';

import 'package:pweb/app/router/router.dart';

import 'package:pshared/generated/i18n/ps_localizations.dart';
import 'package:pweb/generated/i18n/app_localizations.dart';


final _router = createRouter(); 

class PayApp extends StatelessWidget {
  const PayApp({super.key});

  @override
  Widget build(BuildContext context) => MaterialApp.router(
    title: 'Sendico',
    theme: ThemeData(
      colorScheme: ColorScheme.fromSeed(
        seedColor: Constants.themeColor,
        dynamicSchemeVariant: DynamicSchemeVariant.monochrome,
      ),
      useMaterial3: true,
    ),
    routerConfig: _router,
    localizationsDelegates: [
      ...PSLocalizations.localizationsDelegates,
      ...AppLocalizations.localizationsDelegates,
    ],
    supportedLocales: AppLocalizations.supportedLocales,
    locale: context.watch<LocaleProvider>().locale,
  );
}
