From fb9f2e1519c12bd57423dfafcb2fd137c4669623 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Tue, 1 Feb 2022 22:46:05 +0530 Subject: [PATCH 01/11] Migrate bloc to v8 and change various implementations --- lib/bloc/dashboard_bloc/dashboard_bloc.dart | 23 +++-- lib/bloc/process_bloc/process_bloc.dart | 104 +++++++++++--------- lib/bloc/settings_bloc/settings_bloc.dart | 34 ++++--- lib/bloc/updater_bloc/updater_bloc.dart | 16 +-- lib/main.dart | 21 ++-- pubspec.yaml | 7 +- 6 files changed, 110 insertions(+), 95 deletions(-) diff --git a/lib/bloc/dashboard_bloc/dashboard_bloc.dart b/lib/bloc/dashboard_bloc/dashboard_bloc.dart index c15408d..9393da7 100644 --- a/lib/bloc/dashboard_bloc/dashboard_bloc.dart +++ b/lib/bloc/dashboard_bloc/dashboard_bloc.dart @@ -3,15 +3,18 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; +import 'package:bloc_concurrency/bloc_concurrency.dart'; part 'dashboard_event.dart'; part 'dashboard_state.dart'; /// Handles selecting and removing files. class DashboardBloc extends Bloc { - DashboardBloc() : super(DashboardState(files: [], alreadyPresent: false)); - @override - Stream mapEventToState(DashboardEvent event) async* { + DashboardBloc() : super(DashboardState(files: [], alreadyPresent: false)){ + on (_onEvent,transformer: sequential()); + } + FutureOr _onEvent(DashboardEvent event, Emitter emit) async { + // TODO: logic goes here... if (event is NewFileAdded) { List finalEventList = List.from(event.files); bool alreadyPresent = false; @@ -25,21 +28,21 @@ class DashboardBloc extends Bloc { } } if (alreadyPresent) { - yield state.copyWith( + emit( state.copyWith( files: List.from(state.files)..addAll(finalEventList), - alreadyPresent: true); + alreadyPresent: true)); } else { - yield state.copyWith( + emit( state.copyWith( files: List.from(state.files)..addAll(event.files), - alreadyPresent: false); + alreadyPresent: false)); ; } } else if (event is FileRemoved) { - yield state.copyWith( + emit( state.copyWith( files: List.from(state.files)..remove(event.file), - alreadyPresent: false); + alreadyPresent: false)); } else if (event is RemoveAllFiles) { - yield state.copyWith(files: [], alreadyPresent: false); + emit( state.copyWith(files: [], alreadyPresent: false)); } } } diff --git a/lib/bloc/process_bloc/process_bloc.dart b/lib/bloc/process_bloc/process_bloc.dart index 4046499..077b309 100644 --- a/lib/bloc/process_bloc/process_bloc.dart +++ b/lib/bloc/process_bloc/process_bloc.dart @@ -1,7 +1,11 @@ +import 'dart:async'; + import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pedantic/pedantic.dart'; +import 'package:bloc_concurrency/bloc_concurrency.dart'; + import 'package:ccxgui/repositories/ccextractor.dart'; @@ -13,18 +17,21 @@ class ProcessBloc extends Bloc { ProcessBloc() : super(ProcessState( - orignalList: [], - queue: [], - processed: [], - log: [], - videoDetails: [], - started: false, - progress: '0', - current: null, - version: '0', - )); + orignalList: [], + queue: [], + processed: [], + log: [], + videoDetails: [], + started: false, + progress: '0', + current: null, + version: '0', + )){ + on (_onEvent,transformer: sequential()); - Stream _extractNext() async* { + } + + Stream _extractNext(Emitter emit) async* { if (!state.started || state.current != null || state.queue.isEmpty) { if (state.queue.isEmpty) { // We need to show user that all files have finished processing @@ -65,7 +72,7 @@ class ProcessBloc extends Bloc { add(ProcessFileVideoDetails(videoDetails)), ) .then( - (value) { + (value) { if (value != 0) { add(ProcessError(value)); } @@ -76,7 +83,7 @@ class ProcessBloc extends Bloc { } Stream _extractOnNetwork( - String type, String location, String tcppassword, String tcpdesc) async* { + String type, String location, String tcppassword, String tcpdesc, Emitter emit) async* { unawaited( _extractor .extractFileOverNetwork( @@ -91,7 +98,7 @@ class ProcessBloc extends Bloc { add(ProcessFileVideoDetails(videoDetails)), ) .then( - (value) { + (value) { if (value != 0) { add(ProcessError(value)); } @@ -100,7 +107,7 @@ class ProcessBloc extends Bloc { ); } - Stream _extractFilesInSplitMode() async* { + Stream _extractFilesInSplitMode(Emitter emit) async* { unawaited( _extractor .extractFilesInSplitMode( @@ -112,7 +119,7 @@ class ProcessBloc extends Bloc { add(ProcessFileVideoDetails(videoDetails)), ) .then( - (value) { + (value) { if (value != 0) { add(ProcessError(value)); } @@ -122,10 +129,9 @@ class ProcessBloc extends Bloc { ); } - @override - Stream mapEventToState(ProcessEvent event) async* { + FutureOr _onEvent(ProcessEvent event, Emitter emit) async{ if (event is StartAllProcess) { - yield state.copyWith( + emit( state.copyWith( current: state.current, // This equality checks if the queue and originalList are same which // means that the user has not added any new y files or they have been @@ -137,39 +143,39 @@ class ProcessBloc extends Bloc { // proccessed x files as it is. processed: state.queue == state.orignalList ? [] : state.processed, started: true, - ); - yield* _extractNext(); + )); + _extractNext(emit); } else if (event is StartProcessInSplitMode) { - yield state.copyWith(current: state.current, started: true); - yield* _extractFilesInSplitMode(); + emit( state.copyWith(current: state.current, started: true)); + _extractFilesInSplitMode(emit); } else if (event is StopAllProcess) { // stops everything try { _extractor.cancelRun(); } catch (_) {} - yield state.copyWith( + emit( state.copyWith( current: null, queue: state.orignalList, processed: [], // We don't need ticks when we stop so discard processed files list. progress: '0', started: false, - ); + )); } else if (event is ProcessKill) { try { _extractor.cancelRun(); } catch (_) {} - yield state.copyWith( + emit( state.copyWith( current: state.current, orignalList: state.orignalList .where((element) => element != event.file) .toList(), queue: state.queue.where((element) => element != event.file).toList(), - ); + )); } else if (event is ProcessRemoveAll) { try { _extractor.cancelRun(); } catch (_) {} - yield state.copyWith( + emit( state.copyWith( current: null, progress: '0', processed: [], @@ -179,36 +185,36 @@ class ProcessBloc extends Bloc { exitCode: null, log: [], videoDetails: [], - ); + )); } else if (event is ProcessFileExtractorProgress) { - yield state.copyWith(current: state.current, progress: event.progress); + emit( state.copyWith(current: state.current, progress: event.progress)); } else if (event is ProcessFileVideoDetails) { - yield state.copyWith( - current: state.current, videoDetails: event.videoDetails); + emit( state.copyWith( + current: state.current, videoDetails: event.videoDetails)); } else if (event is ProcessFileExtractorOutput) { - yield state.copyWith( + emit( state.copyWith( current: state.current, log: state.log.followedBy([event.log]).toList(), - ); + )); } else if (event is ProcessFileComplete) { if (state.current == event.file) { - yield state.copyWith( + emit( state.copyWith( current: null, log: state.queue.isNotEmpty ? [] : state.log, processed: state.processed.followedBy([event.file]).toList(), exitCode: null, - ); - yield* _extractNext(); + )); + _extractNext(emit); } } else if (event is SplitModeProcessComplete) { - yield state.copyWith( + emit( state.copyWith( current: null, log: state.log, exitCode: null, started: false, - progress: '100'); + progress: '100')); } else if (event is ProcessFilesSubmitted) { - yield state.copyWith( + emit( state.copyWith( current: state.current, orignalList: List.from(state.orignalList)..addAll(event.files), processed: state.processed, @@ -234,28 +240,28 @@ class ProcessBloc extends Bloc { queue: state.started || state.processed.isEmpty ? state.queue.followedBy(event.files).toList() : event.files, - ); + )); } else if (event is ProcessFileRemoved) { - yield state.copyWith( + emit( state.copyWith( current: state.current, orignalList: state.orignalList .where((element) => element != event.file) .toList(), queue: state.queue.where((element) => element != event.file).toList(), - ); + )); } else if (event is GetCCExtractorVersion) { String ccxVersion = await _extractor.getCCExtractorVersion; - yield state.copyWith( + emit( state.copyWith( current: state.current, version: ccxVersion, - ); + )); } else if (event is ProcessError) { - yield state.copyWith(current: state.current, exitCode: event.exitCode); + emit( state.copyWith(current: state.current, exitCode: event.exitCode)); } else if (event is ResetProcessError) { - yield state.copyWith(current: state.current, exitCode: null); + emit( state.copyWith(current: state.current, exitCode: null)); } else if (event is ProcessOnNetwork) { - yield* _extractOnNetwork( - event.type, event.location, event.tcppassword, event.tcpdesc); + _extractOnNetwork( + event.type, event.location, event.tcppassword, event.tcpdesc,emit); } } } diff --git a/lib/bloc/settings_bloc/settings_bloc.dart b/lib/bloc/settings_bloc/settings_bloc.dart index 46f99d1..65edd31 100644 --- a/lib/bloc/settings_bloc/settings_bloc.dart +++ b/lib/bloc/settings_bloc/settings_bloc.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; +import 'package:bloc_concurrency/bloc_concurrency.dart'; import 'package:ccxgui/models/settings_model.dart'; import 'package:ccxgui/repositories/settings_repository.dart'; @@ -11,50 +12,51 @@ part 'settings_state.dart'; class SettingsBloc extends Bloc { final SettingsRepository _settingsRepository; - SettingsBloc(this._settingsRepository) : super(SettingsInitial()); - - @override - Stream mapEventToState( - SettingsEvent event, - ) async* { + SettingsBloc(this._settingsRepository) : super(SettingsInitial()) { + on (_onEvent,transformer: sequential()); + } + FutureOr _onEvent(SettingsEvent event, Emitter emit) async { + // TODO: logic goes here... if (event is CheckSettingsEvent) { bool settingsStatus = await _settingsRepository.checkValidJSON(); if (settingsStatus) { add(GetSettingsEvent()); } else { - yield SettingsErrorState("Couldn't parse json file"); + emit(SettingsErrorState("Couldn't parse json file")); } } else if (event is GetSettingsEvent) { try { final _settings = await _settingsRepository.getSettings(); - yield CurrentSettingsState(_settings); + emit(CurrentSettingsState(_settings)); } catch (e) { - yield SettingsErrorState('Error getting settings.'); + emit( SettingsErrorState('Error getting settings.')); } } else if (event is ResetSettingsEvent) { await _settingsRepository.resetSettings(); final _settings = await _settingsRepository.getSettings(); - yield CurrentSettingsState(_settings); + emit( CurrentSettingsState(_settings)); } else if (event is SettingsUpdatedEvent) { - yield CurrentSettingsState(event.settingsModel); + emit( CurrentSettingsState(event.settingsModel)); add(SaveSettingsEvent(event.settingsModel)); // improve } else if (event is SaveSettingsEvent) { - if (await _settingsRepository.checkValidJSON()) { + if (await _settingsRepository.checkValidJSON () + ) { try { await _settingsRepository.saveSettings(event.settingsModel); final _settings = await _settingsRepository.getSettings(); - yield CurrentSettingsState(_settings); + emit( CurrentSettingsState(_settings)); } catch (e) { - yield SettingsErrorState('Error saving settings.'); + emit( SettingsErrorState('Error saving settings.')); } } else { // only possible when app is open and use manually messes up config.json. - yield SettingsErrorState('Corrupted config.json detected, rewriting.'); + emit( SettingsErrorState('Corrupted config.json detected, rewriting.')); final _settings = await _settingsRepository.getSettings(); - yield CurrentSettingsState(_settings); + emit( CurrentSettingsState(_settings)); } } } + } diff --git a/lib/bloc/updater_bloc/updater_bloc.dart b/lib/bloc/updater_bloc/updater_bloc.dart index 32555da..2703b95 100644 --- a/lib/bloc/updater_bloc/updater_bloc.dart +++ b/lib/bloc/updater_bloc/updater_bloc.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:bloc/bloc.dart'; +import 'package:bloc_concurrency/bloc_concurrency.dart'; import 'package:equatable/equatable.dart'; import 'package:http/http.dart' as http; import 'package:url_launcher/url_launcher.dart'; @@ -10,13 +11,12 @@ part 'updater_event.dart'; part 'updater_state.dart'; class UpdaterBloc extends Bloc { - UpdaterBloc() : super(UpdaterState('0.0', '0.0', false, '', '')); + UpdaterBloc() : super(UpdaterState('0.0', '0.0', false, '', '')){ + on (_onEvent,transformer: sequential()); + } static const URL = 'https://api.github.com/repos/CCExtractor/ccextractor/releases'; - @override - Stream mapEventToState( - UpdaterEvent event, - ) async* { + FutureOr _onEvent(UpdaterEvent event, Emitter emit) async{ if (event is CheckForUpdates) { var url = Uri.parse(URL); String changelog = ''; @@ -34,17 +34,17 @@ class UpdaterBloc extends Bloc { } String latestVersion = data[0]['tag_name'].toString().substring(1); String downloadURL = - data[0]['assets'][0]['browser_download_url'].toString(); + data[0]['assets'][0]['browser_download_url'].toString(); bool updateAvailable = double.parse(latestVersion) > double.parse(event.currentVersion); - yield state.copyWith( + emit( state.copyWith( currentVersion: event.currentVersion, latestVersion: latestVersion, updateAvailable: updateAvailable, downloadURL: downloadURL, changelog: changelog, - ); + )); } if (event is DownloadUpdate) { await launch(event.downloadURl); diff --git a/lib/main.dart b/lib/main.dart index 270a111..0803795 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,14 +16,17 @@ import 'bloc_observer.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - Bloc.observer = SimpleBlocObserver(); - if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { - setWindowTitle('CCExtractor'); - setWindowMinSize(const Size(800, 800)); - setWindowMaxSize(const Size(10000, 10000)); - } - runApp( - MyApp(), + BlocOverrides.runZoned(() { + if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { + setWindowTitle('CCExtractor'); + setWindowMinSize(const Size(800, 800)); + setWindowMaxSize(const Size(10000, 10000)); + } + runApp( + MyApp(), + ); + }, + blocObserver: SimpleBlocObserver(), ); } @@ -47,7 +50,7 @@ class MyApp extends StatelessWidget { ), BlocProvider( create: (context) => - SettingsBloc(SettingsRepository())..add(CheckSettingsEvent()), + SettingsBloc(SettingsRepository())..add(CheckSettingsEvent()), ), BlocProvider( create: (context) => UpdaterBloc(), diff --git a/pubspec.yaml b/pubspec.yaml index 26b0ab2..0adb08a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,8 +8,9 @@ environment: sdk: ">=2.12.0 <3.0.0" dependencies: - bloc: ^7.0.0 - bloc_test: ^8.1.0 + bloc: ^8.0.0 + bloc_concurrency: ^0.2.0 + bloc_test: cupertino_icons: ^1.0.2 equatable: ^2.0.3 expandable: ^5.0.1 @@ -19,7 +20,7 @@ dependencies: file_selector_windows: ^0.0.2+1 flutter: sdk: flutter - flutter_bloc: ^7.1.0 + flutter_bloc: flutter_markdown: ^0.6.3 flutter_svg: ^0.22.0 http: ^0.13.3 From cbb1a9fbf54014a1b7abb57581d3a76055f9b02d Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Thu, 3 Feb 2022 15:59:46 +0530 Subject: [PATCH 02/11] Fix formatting issues --- test/widget_test.dart | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 test/widget_test.dart diff --git a/test/widget_test.dart b/test/widget_test.dart new file mode 100644 index 0000000..aff363c --- /dev/null +++ b/test/widget_test.dart @@ -0,0 +1,30 @@ +// This is a basic Flutter widget test. +// +// To perform an interaction with a widget in your test, use the WidgetTester +// utility that Flutter provides. For example, you can send tap and scroll +// gestures. You can also use WidgetTester to find child widgets in the widget +// tree, read text, and verify that the values of widget properties are correct. + +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; + +import 'package:ccxgui/main.dart'; + +void main() { + testWidgets('Counter increments smoke test', (WidgetTester tester) async { + // Build our app and trigger a frame. + await tester.pumpWidget(MyApp()); + + // Verify that our counter starts at 0. + expect(find.text('0'), findsOneWidget); + expect(find.text('1'), findsNothing); + + // Tap the '+' icon and trigger a frame. + await tester.tap(find.byIcon(Icons.add)); + await tester.pump(); + + // Verify that our counter has incremented. + expect(find.text('0'), findsNothing); + expect(find.text('1'), findsOneWidget); + }); +} From 03159eb9789e53a20a31904441be66503923513b Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Thu, 3 Feb 2022 20:21:20 +0530 Subject: [PATCH 03/11] Specify versions of dependencies --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pubspec.yaml b/pubspec.yaml index 0adb08a..23ac2c5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ environment: dependencies: bloc: ^8.0.0 bloc_concurrency: ^0.2.0 - bloc_test: + bloc_test: ^9.0.2 cupertino_icons: ^1.0.2 equatable: ^2.0.3 expandable: ^5.0.1 @@ -20,7 +20,7 @@ dependencies: file_selector_windows: ^0.0.2+1 flutter: sdk: flutter - flutter_bloc: + flutter_bloc: ^8.0.1 flutter_markdown: ^0.6.3 flutter_svg: ^0.22.0 http: ^0.13.3 From 5a956edcd24eb45c29bc4a4f161cbbbd4044d776 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Thu, 3 Feb 2022 20:35:52 +0530 Subject: [PATCH 04/11] try to fix fomatting failure --- lib/bloc/dashboard_bloc/dashboard_bloc.dart | 15 +++-- lib/bloc/process_bloc/process_bloc.dart | 72 ++++++++++----------- lib/bloc/settings_bloc/settings_bloc.dart | 23 ++++--- lib/bloc/updater_bloc/updater_bloc.dart | 11 ++-- lib/main.dart | 23 +++---- 5 files changed, 73 insertions(+), 71 deletions(-) diff --git a/lib/bloc/dashboard_bloc/dashboard_bloc.dart b/lib/bloc/dashboard_bloc/dashboard_bloc.dart index 9393da7..969693e 100644 --- a/lib/bloc/dashboard_bloc/dashboard_bloc.dart +++ b/lib/bloc/dashboard_bloc/dashboard_bloc.dart @@ -10,10 +10,11 @@ part 'dashboard_state.dart'; /// Handles selecting and removing files. class DashboardBloc extends Bloc { - DashboardBloc() : super(DashboardState(files: [], alreadyPresent: false)){ - on (_onEvent,transformer: sequential()); + DashboardBloc() : super(DashboardState(files: [], alreadyPresent: false)) { + on(_onEvent, transformer: sequential()); } - FutureOr _onEvent(DashboardEvent event, Emitter emit) async { + FutureOr _onEvent( + DashboardEvent event, Emitter emit) async { // TODO: logic goes here... if (event is NewFileAdded) { List finalEventList = List.from(event.files); @@ -28,21 +29,21 @@ class DashboardBloc extends Bloc { } } if (alreadyPresent) { - emit( state.copyWith( + emit(state.copyWith( files: List.from(state.files)..addAll(finalEventList), alreadyPresent: true)); } else { - emit( state.copyWith( + emit(state.copyWith( files: List.from(state.files)..addAll(event.files), alreadyPresent: false)); ; } } else if (event is FileRemoved) { - emit( state.copyWith( + emit(state.copyWith( files: List.from(state.files)..remove(event.file), alreadyPresent: false)); } else if (event is RemoveAllFiles) { - emit( state.copyWith(files: [], alreadyPresent: false)); + emit(state.copyWith(files: [], alreadyPresent: false)); } } } diff --git a/lib/bloc/process_bloc/process_bloc.dart b/lib/bloc/process_bloc/process_bloc.dart index 077b309..a38df77 100644 --- a/lib/bloc/process_bloc/process_bloc.dart +++ b/lib/bloc/process_bloc/process_bloc.dart @@ -6,7 +6,6 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pedantic/pedantic.dart'; import 'package:bloc_concurrency/bloc_concurrency.dart'; - import 'package:ccxgui/repositories/ccextractor.dart'; part 'process_event.dart'; @@ -17,18 +16,17 @@ class ProcessBloc extends Bloc { ProcessBloc() : super(ProcessState( - orignalList: [], - queue: [], - processed: [], - log: [], - videoDetails: [], - started: false, - progress: '0', - current: null, - version: '0', - )){ - on (_onEvent,transformer: sequential()); - + orignalList: [], + queue: [], + processed: [], + log: [], + videoDetails: [], + started: false, + progress: '0', + current: null, + version: '0', + )) { + on(_onEvent, transformer: sequential()); } Stream _extractNext(Emitter emit) async* { @@ -72,7 +70,7 @@ class ProcessBloc extends Bloc { add(ProcessFileVideoDetails(videoDetails)), ) .then( - (value) { + (value) { if (value != 0) { add(ProcessError(value)); } @@ -82,8 +80,8 @@ class ProcessBloc extends Bloc { ); } - Stream _extractOnNetwork( - String type, String location, String tcppassword, String tcpdesc, Emitter emit) async* { + Stream _extractOnNetwork(String type, String location, + String tcppassword, String tcpdesc, Emitter emit) async* { unawaited( _extractor .extractFileOverNetwork( @@ -98,7 +96,7 @@ class ProcessBloc extends Bloc { add(ProcessFileVideoDetails(videoDetails)), ) .then( - (value) { + (value) { if (value != 0) { add(ProcessError(value)); } @@ -107,7 +105,8 @@ class ProcessBloc extends Bloc { ); } - Stream _extractFilesInSplitMode(Emitter emit) async* { + Stream _extractFilesInSplitMode( + Emitter emit) async* { unawaited( _extractor .extractFilesInSplitMode( @@ -119,7 +118,7 @@ class ProcessBloc extends Bloc { add(ProcessFileVideoDetails(videoDetails)), ) .then( - (value) { + (value) { if (value != 0) { add(ProcessError(value)); } @@ -129,9 +128,10 @@ class ProcessBloc extends Bloc { ); } - FutureOr _onEvent(ProcessEvent event, Emitter emit) async{ + FutureOr _onEvent( + ProcessEvent event, Emitter emit) async { if (event is StartAllProcess) { - emit( state.copyWith( + emit(state.copyWith( current: state.current, // This equality checks if the queue and originalList are same which // means that the user has not added any new y files or they have been @@ -146,14 +146,14 @@ class ProcessBloc extends Bloc { )); _extractNext(emit); } else if (event is StartProcessInSplitMode) { - emit( state.copyWith(current: state.current, started: true)); + emit(state.copyWith(current: state.current, started: true)); _extractFilesInSplitMode(emit); } else if (event is StopAllProcess) { // stops everything try { _extractor.cancelRun(); } catch (_) {} - emit( state.copyWith( + emit(state.copyWith( current: null, queue: state.orignalList, processed: [], // We don't need ticks when we stop so discard processed files list. @@ -164,7 +164,7 @@ class ProcessBloc extends Bloc { try { _extractor.cancelRun(); } catch (_) {} - emit( state.copyWith( + emit(state.copyWith( current: state.current, orignalList: state.orignalList .where((element) => element != event.file) @@ -175,7 +175,7 @@ class ProcessBloc extends Bloc { try { _extractor.cancelRun(); } catch (_) {} - emit( state.copyWith( + emit(state.copyWith( current: null, progress: '0', processed: [], @@ -187,18 +187,18 @@ class ProcessBloc extends Bloc { videoDetails: [], )); } else if (event is ProcessFileExtractorProgress) { - emit( state.copyWith(current: state.current, progress: event.progress)); + emit(state.copyWith(current: state.current, progress: event.progress)); } else if (event is ProcessFileVideoDetails) { - emit( state.copyWith( + emit(state.copyWith( current: state.current, videoDetails: event.videoDetails)); } else if (event is ProcessFileExtractorOutput) { - emit( state.copyWith( + emit(state.copyWith( current: state.current, log: state.log.followedBy([event.log]).toList(), )); } else if (event is ProcessFileComplete) { if (state.current == event.file) { - emit( state.copyWith( + emit(state.copyWith( current: null, log: state.queue.isNotEmpty ? [] : state.log, processed: state.processed.followedBy([event.file]).toList(), @@ -207,14 +207,14 @@ class ProcessBloc extends Bloc { _extractNext(emit); } } else if (event is SplitModeProcessComplete) { - emit( state.copyWith( + emit(state.copyWith( current: null, log: state.log, exitCode: null, started: false, progress: '100')); } else if (event is ProcessFilesSubmitted) { - emit( state.copyWith( + emit(state.copyWith( current: state.current, orignalList: List.from(state.orignalList)..addAll(event.files), processed: state.processed, @@ -242,7 +242,7 @@ class ProcessBloc extends Bloc { : event.files, )); } else if (event is ProcessFileRemoved) { - emit( state.copyWith( + emit(state.copyWith( current: state.current, orignalList: state.orignalList .where((element) => element != event.file) @@ -251,17 +251,17 @@ class ProcessBloc extends Bloc { )); } else if (event is GetCCExtractorVersion) { String ccxVersion = await _extractor.getCCExtractorVersion; - emit( state.copyWith( + emit(state.copyWith( current: state.current, version: ccxVersion, )); } else if (event is ProcessError) { - emit( state.copyWith(current: state.current, exitCode: event.exitCode)); + emit(state.copyWith(current: state.current, exitCode: event.exitCode)); } else if (event is ResetProcessError) { - emit( state.copyWith(current: state.current, exitCode: null)); + emit(state.copyWith(current: state.current, exitCode: null)); } else if (event is ProcessOnNetwork) { _extractOnNetwork( - event.type, event.location, event.tcppassword, event.tcpdesc,emit); + event.type, event.location, event.tcppassword, event.tcpdesc, emit); } } } diff --git a/lib/bloc/settings_bloc/settings_bloc.dart b/lib/bloc/settings_bloc/settings_bloc.dart index 65edd31..dff67ec 100644 --- a/lib/bloc/settings_bloc/settings_bloc.dart +++ b/lib/bloc/settings_bloc/settings_bloc.dart @@ -13,9 +13,10 @@ part 'settings_state.dart'; class SettingsBloc extends Bloc { final SettingsRepository _settingsRepository; SettingsBloc(this._settingsRepository) : super(SettingsInitial()) { - on (_onEvent,transformer: sequential()); + on(_onEvent, transformer: sequential()); } - FutureOr _onEvent(SettingsEvent event, Emitter emit) async { + FutureOr _onEvent( + SettingsEvent event, Emitter emit) async { // TODO: logic goes here... if (event is CheckSettingsEvent) { bool settingsStatus = await _settingsRepository.checkValidJSON(); @@ -29,34 +30,32 @@ class SettingsBloc extends Bloc { final _settings = await _settingsRepository.getSettings(); emit(CurrentSettingsState(_settings)); } catch (e) { - emit( SettingsErrorState('Error getting settings.')); + emit(SettingsErrorState('Error getting settings.')); } } else if (event is ResetSettingsEvent) { await _settingsRepository.resetSettings(); final _settings = await _settingsRepository.getSettings(); - emit( CurrentSettingsState(_settings)); + emit(CurrentSettingsState(_settings)); } else if (event is SettingsUpdatedEvent) { - emit( CurrentSettingsState(event.settingsModel)); + emit(CurrentSettingsState(event.settingsModel)); add(SaveSettingsEvent(event.settingsModel)); // improve } else if (event is SaveSettingsEvent) { - if (await _settingsRepository.checkValidJSON () - ) { + if (await _settingsRepository.checkValidJSON()) { try { await _settingsRepository.saveSettings(event.settingsModel); final _settings = await _settingsRepository.getSettings(); - emit( CurrentSettingsState(_settings)); + emit(CurrentSettingsState(_settings)); } catch (e) { - emit( SettingsErrorState('Error saving settings.')); + emit(SettingsErrorState('Error saving settings.')); } } else { // only possible when app is open and use manually messes up config.json. - emit( SettingsErrorState('Corrupted config.json detected, rewriting.')); + emit(SettingsErrorState('Corrupted config.json detected, rewriting.')); final _settings = await _settingsRepository.getSettings(); - emit( CurrentSettingsState(_settings)); + emit(CurrentSettingsState(_settings)); } } } - } diff --git a/lib/bloc/updater_bloc/updater_bloc.dart b/lib/bloc/updater_bloc/updater_bloc.dart index 2703b95..3474d98 100644 --- a/lib/bloc/updater_bloc/updater_bloc.dart +++ b/lib/bloc/updater_bloc/updater_bloc.dart @@ -11,12 +11,13 @@ part 'updater_event.dart'; part 'updater_state.dart'; class UpdaterBloc extends Bloc { - UpdaterBloc() : super(UpdaterState('0.0', '0.0', false, '', '')){ - on (_onEvent,transformer: sequential()); + UpdaterBloc() : super(UpdaterState('0.0', '0.0', false, '', '')) { + on(_onEvent, transformer: sequential()); } static const URL = 'https://api.github.com/repos/CCExtractor/ccextractor/releases'; - FutureOr _onEvent(UpdaterEvent event, Emitter emit) async{ + FutureOr _onEvent( + UpdaterEvent event, Emitter emit) async { if (event is CheckForUpdates) { var url = Uri.parse(URL); String changelog = ''; @@ -34,11 +35,11 @@ class UpdaterBloc extends Bloc { } String latestVersion = data[0]['tag_name'].toString().substring(1); String downloadURL = - data[0]['assets'][0]['browser_download_url'].toString(); + data[0]['assets'][0]['browser_download_url'].toString(); bool updateAvailable = double.parse(latestVersion) > double.parse(event.currentVersion); - emit( state.copyWith( + emit(state.copyWith( currentVersion: event.currentVersion, latestVersion: latestVersion, updateAvailable: updateAvailable, diff --git a/lib/main.dart b/lib/main.dart index 0803795..b2813dd 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,16 +16,17 @@ import 'bloc_observer.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - BlocOverrides.runZoned(() { - if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { - setWindowTitle('CCExtractor'); - setWindowMinSize(const Size(800, 800)); - setWindowMaxSize(const Size(10000, 10000)); - } - runApp( - MyApp(), - ); - }, + BlocOverrides.runZoned( + () { + if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { + setWindowTitle('CCExtractor'); + setWindowMinSize(const Size(800, 800)); + setWindowMaxSize(const Size(10000, 10000)); + } + runApp( + MyApp(), + ); + }, blocObserver: SimpleBlocObserver(), ); } @@ -50,7 +51,7 @@ class MyApp extends StatelessWidget { ), BlocProvider( create: (context) => - SettingsBloc(SettingsRepository())..add(CheckSettingsEvent()), + SettingsBloc(SettingsRepository())..add(CheckSettingsEvent()), ), BlocProvider( create: (context) => UpdaterBloc(), From 67ddb6b51db4c0ec73b0985d9c354a2529ec496d Mon Sep 17 00:00:00 2001 From: Akash Rajoria <59030114+rajoriaakash@users.noreply.github.com> Date: Thu, 3 Feb 2022 23:03:11 +0530 Subject: [PATCH 05/11] Delete widget_test.dart --- test/widget_test.dart | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 test/widget_test.dart diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index aff363c..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility that Flutter provides. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:ccxgui/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} From b83e89e0c732b9a93e885f8f25f02e972d3d7f60 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Fri, 4 Feb 2022 14:23:37 +0530 Subject: [PATCH 06/11] Sort imports --- lib/bloc/dashboard_bloc/dashboard_bloc.dart | 2 +- lib/bloc/process_bloc/process_bloc.dart | 2 +- lib/bloc/settings_bloc/settings_bloc.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bloc/dashboard_bloc/dashboard_bloc.dart b/lib/bloc/dashboard_bloc/dashboard_bloc.dart index 969693e..a70eb9b 100644 --- a/lib/bloc/dashboard_bloc/dashboard_bloc.dart +++ b/lib/bloc/dashboard_bloc/dashboard_bloc.dart @@ -1,9 +1,9 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; +import 'package:bloc_concurrency/bloc_concurrency.dart'; import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; -import 'package:bloc_concurrency/bloc_concurrency.dart'; part 'dashboard_event.dart'; part 'dashboard_state.dart'; diff --git a/lib/bloc/process_bloc/process_bloc.dart b/lib/bloc/process_bloc/process_bloc.dart index a38df77..3194e36 100644 --- a/lib/bloc/process_bloc/process_bloc.dart +++ b/lib/bloc/process_bloc/process_bloc.dart @@ -1,10 +1,10 @@ import 'dart:async'; +import 'package:bloc_concurrency/bloc_concurrency.dart'; import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:pedantic/pedantic.dart'; -import 'package:bloc_concurrency/bloc_concurrency.dart'; import 'package:ccxgui/repositories/ccextractor.dart'; diff --git a/lib/bloc/settings_bloc/settings_bloc.dart b/lib/bloc/settings_bloc/settings_bloc.dart index dff67ec..215eaad 100644 --- a/lib/bloc/settings_bloc/settings_bloc.dart +++ b/lib/bloc/settings_bloc/settings_bloc.dart @@ -1,8 +1,8 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; -import 'package:equatable/equatable.dart'; import 'package:bloc_concurrency/bloc_concurrency.dart'; +import 'package:equatable/equatable.dart'; import 'package:ccxgui/models/settings_model.dart'; import 'package:ccxgui/repositories/settings_repository.dart'; From cc63adc3bbc6c12b07220276c3aeb858b6da0088 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Fri, 4 Feb 2022 14:41:22 +0530 Subject: [PATCH 07/11] Remove if condition out of runZoned --- lib/main.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index b2813dd..a323869 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -16,13 +16,13 @@ import 'bloc_observer.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); + if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { + setWindowTitle('CCExtractor'); + setWindowMinSize(const Size(800, 800)); + setWindowMaxSize(const Size(10000, 10000)); + } BlocOverrides.runZoned( () { - if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) { - setWindowTitle('CCExtractor'); - setWindowMinSize(const Size(800, 800)); - setWindowMaxSize(const Size(10000, 10000)); - } runApp( MyApp(), ); From 32254d4d7354f78795b7d9a44e9534201e4a8309 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Thu, 10 Feb 2022 22:59:42 +0530 Subject: [PATCH 08/11] Pass flutter tests --- pubspec.lock | 208 +++++++++++------- .../flutter/generated_plugin_registrant.cc | 6 +- 2 files changed, 128 insertions(+), 86 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index e902447..68bc92e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,21 +7,21 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "21.0.0" + version: "31.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "1.5.0" + version: "2.8.0" args: dependency: transitive description: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.3.0" async: dependency: transitive description: @@ -35,14 +35,21 @@ packages: name: bloc url: "https://pub.dartlang.org" source: hosted - version: "7.0.0" + version: "8.0.2" + bloc_concurrency: + dependency: "direct main" + description: + name: bloc_concurrency + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" bloc_test: dependency: "direct main" description: name: bloc_test url: "https://pub.dartlang.org" source: hosted - version: "8.1.0" + version: "9.0.2" boolean_selector: dependency: transitive description: @@ -56,7 +63,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.2.1" build_config: dependency: transitive description: @@ -70,42 +77,42 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.6" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.7" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "7.2.3" built_collection: dependency: transitive description: name: built_collection url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "5.1.1" built_value: dependency: transitive description: name: built_value url: "https://pub.dartlang.org" source: hosted - version: "8.0.4" + version: "8.1.4" characters: dependency: transitive description: @@ -133,7 +140,7 @@ packages: name: cli_util url: "https://pub.dartlang.org" source: hosted - version: "0.3.0" + version: "0.3.5" clock: dependency: transitive description: @@ -147,7 +154,7 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.1.0" collection: dependency: transitive description: @@ -161,7 +168,7 @@ packages: name: convert url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" coverage: dependency: transitive description: @@ -175,7 +182,7 @@ packages: name: cross_file url: "https://pub.dartlang.org" source: hosted - version: "0.3.1+1" + version: "0.3.2" crypto: dependency: transitive description: @@ -189,14 +196,21 @@ packages: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" dart_style: dependency: transitive description: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.2.1" + diff_match_patch: + dependency: transitive + description: + name: diff_match_patch + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1" equatable: dependency: "direct main" description: @@ -224,21 +238,21 @@ packages: name: ffi url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.2" file: dependency: transitive description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.0" + version: "6.1.2" file_selector: dependency: "direct main" description: name: file_selector url: "https://pub.dartlang.org" source: hosted - version: "0.8.2" + version: "0.8.2+1" file_selector_linux: dependency: "direct main" description: @@ -259,14 +273,14 @@ packages: name: file_selector_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.4" file_selector_web: dependency: transitive description: name: file_selector_web url: "https://pub.dartlang.org" source: hosted - version: "0.8.1" + version: "0.8.1+3" file_selector_windows: dependency: "direct main" description: @@ -292,14 +306,14 @@ packages: name: flutter_bloc url: "https://pub.dartlang.org" source: hosted - version: "7.1.0" + version: "8.0.1" flutter_markdown: dependency: "direct main" description: name: flutter_markdown url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.9" flutter_svg: dependency: "direct main" description: @@ -323,49 +337,49 @@ packages: name: frontend_server_client url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" glob: dependency: transitive description: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" graphs: dependency: transitive description: name: graphs url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" hive: dependency: transitive description: name: hive url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" hive_generator: dependency: "direct dev" description: name: hive_generator url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.2" http: dependency: "direct main" description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.3" + version: "0.13.4" http_multi_server: dependency: transitive description: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.0.1" http_parser: dependency: transitive description: @@ -386,7 +400,7 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.3" js: dependency: transitive description: @@ -400,13 +414,13 @@ packages: name: json_annotation url: "https://pub.dartlang.org" source: hosted - version: "4.0.1" + version: "4.4.0" localstorage: dependency: "direct main" description: path: "." ref: HEAD - resolved-ref: "08a12e657de9ee43159f01abb79135e54ad82546" + resolved-ref: "13d667d5022b9e5d88b8585481f77016e31fe63d" url: "git://github.com/Techno-Disaster/flutter_localstorage.git" source: git version: "4.0.0+1" @@ -416,14 +430,14 @@ packages: name: logging url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" markdown: dependency: transitive description: name: markdown url: "https://pub.dartlang.org" source: hosted - version: "4.0.0" + version: "4.0.1" matcher: dependency: transitive description: @@ -431,6 +445,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -444,14 +465,14 @@ packages: name: mime url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" mocktail: dependency: transitive description: name: mocktail url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.0" navigation_rail: dependency: "direct main" description: @@ -481,7 +502,7 @@ packages: name: package_config url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path: dependency: transitive description: @@ -495,7 +516,7 @@ packages: name: path_drawing url: "https://pub.dartlang.org" source: hosted - version: "0.5.1" + version: "0.5.1+1" path_parsing: dependency: transitive description: @@ -509,70 +530,77 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "2.0.8" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.11" + path_provider_ios: + dependency: transitive + description: + name: path_provider_ios + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.7" path_provider_linux: dependency: transitive description: name: path_provider_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.5" path_provider_macos: dependency: transitive description: name: path_provider_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.5" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.3" path_provider_windows: dependency: transitive description: name: path_provider_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.0" + version: "2.0.5" percent_indicator: dependency: "direct main" description: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "3.3.0-nullsafety.1" + version: "3.4.0" petitparser: dependency: transitive description: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "4.0.2" + version: "4.4.0" platform: dependency: transitive description: name: platform url: "https://pub.dartlang.org" source: hosted - version: "3.0.0" + version: "3.1.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.2" pool: dependency: transitive description: @@ -586,35 +614,35 @@ packages: name: process url: "https://pub.dartlang.org" source: hosted - version: "4.2.1" + version: "4.2.4" provider: dependency: transitive description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "6.0.2" pub_semver: dependency: transitive description: name: pub_semver url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" pubspec_parse: dependency: transitive description: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.2.0" shelf: dependency: transitive description: name: shelf url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" shelf_packages_handler: dependency: transitive description: @@ -628,7 +656,7 @@ packages: name: shelf_static url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.1.0" shelf_web_socket: dependency: transitive description: @@ -647,14 +675,14 @@ packages: name: source_gen url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.2.1" source_helper: dependency: transitive description: name: source_helper url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.3.1" source_map_stack_trace: dependency: transitive description: @@ -717,21 +745,21 @@ packages: name: test url: "https://pub.dartlang.org" source: hosted - version: "1.17.12" + version: "1.19.5" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.8" test_core: dependency: transitive description: name: test_core url: "https://pub.dartlang.org" source: hosted - version: "0.4.2" + version: "0.4.9" timing: dependency: transitive description: @@ -759,42 +787,56 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.9" + version: "6.0.19" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + url: "https://pub.dartlang.org" + source: hosted + version: "6.0.15" url_launcher_linux: dependency: transitive description: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.3" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.3" url_launcher_platform_interface: dependency: transitive description: name: url_launcher_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.4" + version: "2.0.5" url_launcher_web: dependency: transitive description: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.8" url_launcher_windows: dependency: transitive description: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" vector_math: dependency: transitive description: @@ -808,21 +850,21 @@ packages: name: vm_service url: "https://pub.dartlang.org" source: hosted - version: "6.2.0" + version: "7.5.0" watcher: dependency: transitive description: name: watcher url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.1" web_socket_channel: dependency: transitive description: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" webkit_inspection_protocol: dependency: transitive description: @@ -836,13 +878,13 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.0.5" + version: "2.3.11" window_size: dependency: "direct main" description: path: "plugins/window_size" ref: HEAD - resolved-ref: "3da6d7b8011be38412c815c6a1832377b7d47a78" + resolved-ref: "89c350f787e1d7bff12b3517e5671146211ee70e" url: "git://github.com/google/flutter-desktop-embedding.git" source: git version: "0.1.0" @@ -852,14 +894,14 @@ packages: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0" + version: "0.2.0+1" xml: dependency: transitive description: name: xml url: "https://pub.dartlang.org" source: hosted - version: "5.0.2" + version: "5.3.1" yaml: dependency: transitive description: @@ -868,5 +910,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.15.0 <3.0.0" + flutter: ">=2.10.0" diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index c0376c6..0e70fe4 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,14 +7,14 @@ #include "generated_plugin_registrant.h" #include -#include +#include #include void RegisterPlugins(flutter::PluginRegistry* registry) { FileSelectorPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("FileSelectorPlugin")); - UrlLauncherPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("UrlLauncherPlugin")); + UrlLauncherWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("UrlLauncherWindows")); WindowSizePluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("WindowSizePlugin")); } From d4f66442ab36c867b0305f8be5e768a7b3105441 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Fri, 11 Feb 2022 22:58:28 +0530 Subject: [PATCH 09/11] Changes to pass ci tests --- lib/bloc/process_bloc/process_bloc.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/bloc/process_bloc/process_bloc.dart b/lib/bloc/process_bloc/process_bloc.dart index 3194e36..5dc0306 100644 --- a/lib/bloc/process_bloc/process_bloc.dart +++ b/lib/bloc/process_bloc/process_bloc.dart @@ -4,7 +4,6 @@ import 'package:bloc_concurrency/bloc_concurrency.dart'; import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:pedantic/pedantic.dart'; import 'package:ccxgui/repositories/ccextractor.dart'; From 4cda63d8f48314d0e55ce861b6bb86d3e455a977 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Tue, 15 Feb 2022 14:36:51 +0530 Subject: [PATCH 10/11] Fix ProcessException error --- lib/bloc/process_bloc/process_bloc.dart | 2 ++ pubspec.lock | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/bloc/process_bloc/process_bloc.dart b/lib/bloc/process_bloc/process_bloc.dart index 5dc0306..6b1b90c 100644 --- a/lib/bloc/process_bloc/process_bloc.dart +++ b/lib/bloc/process_bloc/process_bloc.dart @@ -1,6 +1,8 @@ import 'dart:async'; import 'package:bloc_concurrency/bloc_concurrency.dart'; +import 'dart:async'; + import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; diff --git a/pubspec.lock b/pubspec.lock index 68bc92e..7b6d467 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -379,7 +379,7 @@ packages: name: http_multi_server url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.2.0" http_parser: dependency: transitive description: @@ -530,7 +530,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "2.0.8" + version: "2.0.9" path_provider_android: dependency: transitive description: @@ -787,7 +787,7 @@ packages: name: url_launcher url: "https://pub.dartlang.org" source: hosted - version: "6.0.19" + version: "6.0.20" url_launcher_android: dependency: transitive description: @@ -808,14 +808,14 @@ packages: name: url_launcher_linux url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "3.0.0" url_launcher_macos: dependency: transitive description: name: url_launcher_macos url: "https://pub.dartlang.org" source: hosted - version: "2.0.3" + version: "3.0.0" url_launcher_platform_interface: dependency: transitive description: @@ -836,7 +836,7 @@ packages: name: url_launcher_windows url: "https://pub.dartlang.org" source: hosted - version: "2.0.2" + version: "3.0.0" vector_math: dependency: transitive description: @@ -878,7 +878,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "2.3.11" + version: "2.4.0" window_size: dependency: "direct main" description: From 2ed46879f32e3436ba9573f0db2c49c3dfd7ee13 Mon Sep 17 00:00:00 2001 From: rajoriaakash Date: Tue, 15 Feb 2022 14:43:26 +0530 Subject: [PATCH 11/11] Format files and sort imports --- lib/bloc/process_bloc/process_bloc.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/bloc/process_bloc/process_bloc.dart b/lib/bloc/process_bloc/process_bloc.dart index 6b1b90c..5dc0306 100644 --- a/lib/bloc/process_bloc/process_bloc.dart +++ b/lib/bloc/process_bloc/process_bloc.dart @@ -1,8 +1,6 @@ import 'dart:async'; import 'package:bloc_concurrency/bloc_concurrency.dart'; -import 'dart:async'; - import 'package:equatable/equatable.dart'; import 'package:file_selector/file_selector.dart'; import 'package:flutter_bloc/flutter_bloc.dart';