Skip to content

Commit

Permalink
Please analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
dhzdhd committed Mar 17, 2023
1 parent cdf4409 commit 062bc4f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
5 changes: 0 additions & 5 deletions lib/src/cloud/providers/cloud_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@ class _CloudNotifier extends AsyncNotifier<CloudModel> {
await CloudDatabase.fetch(supabase.auth.currentUser!.email!);
return response.match(
(l) {
print('left');
print(l);
final model = CloudModel(
settings: ref.read(settingsProvider),
snippets: ref.read(snippetBarStateProvider),
);
print(model.toJson());
return model;
},
(r) {
print('right');
print(r);
return r;
},
);
Expand Down
3 changes: 0 additions & 3 deletions lib/src/cloud/services/supabase_db.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class CloudDatabase {
} on RangeError catch (_) {
return const Left('Data could not be sent to the cloud!');
} catch (ex) {
print(ex);
return Left(ex.toString());
}
}
Expand All @@ -36,7 +35,6 @@ class CloudDatabase {
.filter('email', 'eq', email);

if (response.hasError) {
print(response.error!.message);
return Left(response.error!.message);
}

Expand All @@ -47,7 +45,6 @@ class CloudDatabase {
} on RangeError catch (_) {
return const Left('Data not present on the cloud!');
} catch (ex) {
print(ex);
return const Left('error');
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/src/factory.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Future<void> initFileStorage() async {
appDocumentsDirectory =
Some(await Directory(docDir.path + '/ExCode').create());
} catch (e) {
print(e);
appDocumentsDirectory = const None();
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/src/home/providers/editor_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ class _EditorContentModel extends StateNotifier<String> {
}

Future<void> saveContent(String lang, String content) async {
print(content);
ref.watch(activeFileProvider).match(
() async => await box.put('${lang}code', content),
(t) async => await ref
Expand Down
5 changes: 1 addition & 4 deletions lib/src/home/services/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import 'package:excode/src/factory.dart';
import 'package:excode/src/home/models/output_model.dart';
import 'package:excode/src/home/services/input_service.dart';
import 'package:excode/src/home/services/language.dart';
import 'package:fpdart/fpdart.dart';
import 'package:sentry_flutter/sentry_flutter.dart';

enum Language {
bash,
Expand Down Expand Up @@ -123,7 +121,6 @@ class ApiHandler {
};

try {
print(data);
res = await dio.post(_executeUrl, data: data);
} on DioError catch (err) {
return OutputModel(
Expand All @@ -132,7 +129,7 @@ class ApiHandler {
);
}

print(res.data);
// print(res.data);

if (res.data!['run']['stdout'].isEmpty) {
res.data!['run']['stdout'] = 'No output';
Expand Down
13 changes: 7 additions & 6 deletions lib/src/home/widgets/text_selection_controls.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:excode/src/home/providers/editor_provider.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'dart:math' as math;

import 'package:hooks_riverpod/hooks_riverpod.dart';
Expand Down Expand Up @@ -41,11 +40,13 @@ class CustomTextSelectionControls extends TextSelectionControls {
endpoints: endpoints,
delegate: delegate,
clipboardStatus: clipboardStatus,
handleCut: canCut(delegate) ? () => handleCut(delegate) : null,
handleCopy: canCopy(delegate) ? () => handleCopy(delegate) : null,
handlePaste: canPaste(delegate) ? () => handlePaste(delegate) : null,
handleSelectAll:
canSelectAll(delegate) ? () => handleSelectAll(delegate) : null,
handleCut: null, // canCut(delegate) ? () => handleCut(delegate) : null,
handleCopy:
null, // canCopy(delegate) ? () => handleCopy(delegate) : null,
handlePaste:
null, // canPaste(delegate) ? () => handlePaste(delegate) : null,
handleSelectAll: null,
// canSelectAll(delegate) ? () => handleSelectAll(delegate) : null,
);
}

Expand Down
5 changes: 3 additions & 2 deletions lib/src/settings/widgets/auth_dropdown.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,15 @@ class AuthDropDownWidget extends ConsumerWidget {
final user = supabase.auth.currentUser;
if (ref.watch(settingsProvider).isSaveToCloud &&
user != null) {
final res = await CloudDatabase.upsert(
// final res =
await CloudDatabase.upsert(
CloudModel(
settings: ref.watch(settingsProvider),
snippets: ref.watch(snippetBarStateProvider),
),
user.email!,
);
res.match((l) => print(l), (r) => print(r));
// res.match((l) => print(l), (r) => print(r));
}

context.showSuccessSnackBar(
Expand Down

0 comments on commit 062bc4f

Please sign in to comment.