diff --git a/android/app/build.gradle b/android/app/build.gradle index f314154f..6cd87e7c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -47,7 +47,9 @@ android { applicationId "com.dwyl.app" // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. - minSdkVersion flutter.minSdkVersion + + // Changed because of `gallery_saver` of `flutter_quill`. Though, it will be switched with `gal` in a different PR. Change this back once that occurs + minSdkVersion 21 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName diff --git a/lib/blocs/cubit/app_cubit.dart b/lib/blocs/cubit/app_cubit.dart new file mode 100644 index 00000000..5f96b880 --- /dev/null +++ b/lib/blocs/cubit/app_cubit.dart @@ -0,0 +1,8 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:equatable/equatable.dart'; + +part 'app_state.dart'; + +class AppCubit extends Cubit { + AppCubit({required bool isWeb}) : super(AppInitial(isWeb: isWeb)); +} diff --git a/lib/blocs/cubit/app_state.dart b/lib/blocs/cubit/app_state.dart new file mode 100644 index 00000000..24b7ccc3 --- /dev/null +++ b/lib/blocs/cubit/app_state.dart @@ -0,0 +1,14 @@ +part of 'app_cubit.dart'; + +sealed class AppState extends Equatable { + final bool isWeb; + + const AppState({required this.isWeb}); + + @override + List get props => []; +} + +final class AppInitial extends AppState { + const AppInitial({required super.isWeb}); +} diff --git a/lib/main.dart b/lib/main.dart index 73d0a59d..d75d72f1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,4 +1,6 @@ +import 'package:dwyl_app/blocs/cubit/app_cubit.dart'; import 'package:dwyl_app/logging/logging.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:responsive_framework/responsive_framework.dart'; @@ -25,8 +27,11 @@ class MainApp extends StatelessWidget { Bloc.observer = GlobalLogBlocObserver(); putLumberdashToWork(withClients: [ColorizeLumberdash()]); - return BlocProvider( - create: (context) => TodoBloc()..add(TodoListStarted()), + return MultiBlocProvider( + providers: [ + BlocProvider(create: (context) => TodoBloc()..add(TodoListStarted())), + BlocProvider(create: (context) => AppCubit(isWeb: kIsWeb)), + ], child: MaterialApp( home: const HomePage(), builder: (context, child) => ResponsiveBreakpoints.builder(