MVP #141
@@ -1,2 +1,24 @@
|
||||
/// Button types used for styling the [CustomWidthButton]
|
||||
enum ButtonType { primary, secondary, tertiary }
|
||||
|
||||
/// Result types for import operations in the [SettingsView]
|
||||
/// - [ImportResult.success]: The import operation was successful.
|
||||
/// - [ImportResult.canceled]: The import operation was canceled by the user.
|
||||
/// - [ImportResult.fileReadError]: There was an error reading the selected file.
|
||||
/// - [ImportResult.invalidSchema]: The JSON schema of the imported data is invalid.
|
||||
/// - [ImportResult.formatException]: A format exception occurred during import.
|
||||
/// - [ImportResult.unknownException]: An exception occurred during import.
|
||||
enum ImportResult {
|
||||
success,
|
||||
canceled,
|
||||
fileReadError,
|
||||
invalidSchema,
|
||||
formatException,
|
||||
unknownException,
|
||||
}
|
||||
|
||||
/// Result types for export operations in the [SettingsView]
|
||||
/// - [ExportResult.success]: The export operation was successful.
|
||||
/// - [ExportResult.canceled]: The export operation was canceled by the user.
|
||||
/// - [ExportResult.unknownException]: An exception occurred during export.
|
||||
enum ExportResult { success, canceled, unknownException }
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:game_tracker/core/custom_theme.dart';
|
||||
import 'package:game_tracker/core/enums.dart';
|
||||
import 'package:game_tracker/presentation/widgets/tiles/settings_list_tile.dart';
|
||||
import 'package:game_tracker/services/data_transfer_service.dart';
|
||||
import 'package:json_schema/json_schema.dart';
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'dart:typed_data';
|
||||
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:game_tracker/core/enums.dart';
|
||||
import 'package:game_tracker/data/db/database.dart';
|
||||
import 'package:game_tracker/data/dto/game.dart';
|
||||
import 'package:game_tracker/data/dto/group.dart';
|
||||
@@ -11,17 +12,6 @@ import 'package:game_tracker/data/dto/player.dart';
|
||||
import 'package:game_tracker/presentation/views/main_menu/settings_view.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
enum ImportResult {
|
||||
success,
|
||||
canceled,
|
||||
fileReadError,
|
||||
invalidSchema,
|
||||
formatException,
|
||||
unknownException,
|
||||
}
|
||||
|
||||
enum ExportResult { success, canceled, unknownException }
|
||||
|
||||
class DataTransferService {
|
||||
/// Deletes all data from the database.
|
||||
static Future<void> deleteAllData(BuildContext context) async {
|
||||
|
||||
Reference in New Issue
Block a user