import 'package:billing/billing.dart';
import 'package:client_home/client_home.dart';
import 'package:client_coverage/client_coverage.dart';
import 'package:flutter/material.dart';
import 'package:flutter_modular/flutter_modular.dart';
import 'package:view_orders/view_orders.dart';

import 'presentation/blocs/client_main_cubit.dart';
import 'presentation/pages/client_main_page.dart';
import 'presentation/pages/placeholder_page.dart';

class ClientMainModule extends Module {
  @override
  void binds(Injector i) {
    i.addSingleton(ClientMainCubit.new);
  }

  @override
  void routes(RouteManager r) {
    r.child(
      '/',
      child: (BuildContext context) => const ClientMainPage(),
      children: <ParallelRoute<dynamic>>[
        ModuleRoute<dynamic>('/home', module: ClientHomeModule()),
        ModuleRoute<dynamic>('/coverage', module: CoverageModule()),
        ModuleRoute<dynamic>('/billing', module: BillingModule()),
        ModuleRoute<dynamic>('/orders', module: ViewOrdersModule()),
        ChildRoute<dynamic>(
          '/reports',
          child: (BuildContext context) =>
              const PlaceholderPage(title: 'Reports'),
        ),
      ],
    );
  }
}
