import 'package:flutter/material.dart';
import 'package:responsive_framework/responsive_framework.dart';
import 'route_generator.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  FlutterError.onError = (FlutterErrorDetails details) {
    print("Error :  ${details.exception}");
    print("StackTrace :  ${details.stack}");
  };
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      builder: (context, widget) => ResponsiveWrapper.builder(
        ClampingScrollWrapper.builder(context, widget!),
        maxWidth: 1000,
        minWidth: 450,
        defaultScale: true,
        defaultName: MOBILE,
        breakpoints: [
          ResponsiveBreakpoint.resize(450, name: MOBILE),
          ResponsiveBreakpoint.autoScale(800, name: TABLET),
          ResponsiveBreakpoint.autoScale(1000, name: TABLET)
        ],
      ),
      title: 'Demo Package UI Semantic',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      initialRoute: '/main_page',
      onGenerateRoute: RouteGenerator.generateRoute,
      debugShowCheckedModeBanner: false,
    );
  }
}