Skip to content

Commit

Permalink
Remove Result class
Browse files Browse the repository at this point in the history
  • Loading branch information
enm10k committed Aug 11, 2024
1 parent 15d5dcb commit fb03628
Show file tree
Hide file tree
Showing 10 changed files with 227 additions and 318 deletions.
15 changes: 3 additions & 12 deletions lib/features/core/pages/sheet_selector.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,18 +124,9 @@ class SheetSelectorPage extends HookConsumerWidget {
logger.info('PageView.onPageChanged: $index');
tabController.animateTo(index);

final table = tables[index];
await api.dbTableRead(tableId: table.id).then((result) {
result.when(
ok: (table) async {
await selectTable(ref, table);
},
ng: (error, stackTrace) =>
notifyError(context, error, stackTrace),
);
}).onError(
(error, stackTrace) => notifyError(context, error, stackTrace),
);
final selectedTable = tables[index];
final table = await api.dbTableRead(tableId: selectedTable.id);
await selectTable(ref, table);
},
controller: pageController,
itemBuilder: _viewBuilder(
Expand Down
3 changes: 1 addition & 2 deletions lib/features/core/providers/fields_provider.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'package:collection/collection.dart';
import 'package:nocodb/common/logger.dart';
import 'package:nocodb/features/core/providers/providers.dart';
import 'package:nocodb/features/core/providers/utils.dart';
import 'package:nocodb/nocodb_sdk/client.dart';
import 'package:nocodb/nocodb_sdk/models.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
Expand All @@ -13,7 +12,7 @@ Future<List<NcViewColumn>> viewColumnList(
ViewColumnListRef ref,
String viewId,
) async =>
unwrap(await api.dbViewColumnList(viewId: viewId));
await api.dbViewColumnList(viewId: viewId);

@Riverpod()
class _FieldsBase extends _$FieldsBase {
Expand Down
Loading

0 comments on commit fb03628

Please sign in to comment.