mirrored_repositories/ToktikApp
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:toktik/config/theme/app_theme.dart';
import 'package:toktik/infrastructure/datasources/local_video_datasource_imp.dart';
import 'package:toktik/infrastructure/repositories/video_post_repository_imp.dart';
import 'package:toktik/presentation/providers/discover_provider.dart';
import 'package:toktik/presentation/screens/discover/discover_screen.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    final videoPostsRepository = VideoPostsRepositoryImplementation(
        videosDataSource: LocalVideoDataSource());
    return MultiProvider(
        providers: [
          ChangeNotifierProvider(
              lazy: false,
              create: (_) =>
                  DiscoverProvider(videoPostsRepository: videoPostsRepository)
                    ..loadNextPage())
        ],
        child: MaterialApp(
            title: "Hi",
            debugShowCheckedModeBanner: false,
            theme: AppTheme().getTheme(),
            home: const DiscoverScreen()));
  }
}
