Skip to content

Commit

Permalink
Redid most of the file structure
Browse files Browse the repository at this point in the history
  • Loading branch information
TechnicJelle committed Sep 8, 2024
1 parent 6192229 commit df7834a
Show file tree
Hide file tree
Showing 18 changed files with 40 additions and 40 deletions.
8 changes: 4 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import "dart:io";
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "close_project_button.dart";
import "dual_pane.dart";
import "onboarding.dart";
import "main_menu/main_menu.dart";
import "prefs.dart";
import "project_view/close_project_button.dart";
import "project_view/project_view.dart";
import "tech_app.dart";

// == Hardcoded BlueMap CLI JAR download URL and hash ==
Expand Down Expand Up @@ -60,7 +60,7 @@ class MyHomePage extends ConsumerWidget {
if (projectDirectory != null) const CloseProjectButton(),
],
),
body: projectDirectory == null ? const Onboarding() : const DualPane(),
body: projectDirectory == null ? const MainMenu() : const ProjectView(),
);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "../prefs.dart";
import "../../prefs.dart";
import "radio_list_tile_custom_java_picker.dart";
import "radio_list_tile_system_java_picker.dart";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "../utils.dart";
import "../../utils.dart";
import "java_picker.dart";
import "util_for_checking_java_path_version.dart";

Expand Down
6 changes: 3 additions & 3 deletions lib/onboarding.dart → lib/main_menu/main_menu.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "../prefs.dart";
import "java/java_picker.dart";
import "path_picker_button.dart";
import "prefs.dart";

class Onboarding extends ConsumerWidget {
const Onboarding({super.key});
class MainMenu extends ConsumerWidget {
const MainMenu({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:path/path.dart" as p;
import "package:url_launcher/url_launcher_string.dart";

import "main.dart";
import "prefs.dart";
import "../main.dart";
import "../prefs.dart";

enum _PickingState {
nothing,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "confirmation_dialog.dart";
import "prefs.dart";
import "../confirmation_dialog.dart";
import "../prefs.dart";

class CloseProjectButton extends ConsumerWidget {
const CloseProjectButton({super.key});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import "package:re_editor/re_editor.dart";
import "package:re_highlight/languages/yaml.dart" show langYaml;
import "package:re_highlight/styles/ir-black.dart" show irBlackTheme;

import "dual_pane.dart";
import "utils.dart";
import "../utils.dart";
import "project_view.dart";

class ConfigEditor extends ConsumerStatefulWidget {
final File openConfig;
Expand Down
4 changes: 2 additions & 2 deletions lib/console.dart → lib/project_view/console.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import "package:animated_visibility/animated_visibility.dart";
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "../prefs.dart";
import "../utils.dart";
import "control_row.dart";
import "prefs.dart";
import "utils.dart";

class OutputNotifier extends Notifier<List<String>> {
@override
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions lib/control_row.dart → lib/project_view/control_row.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import "package:path/path.dart" as p;
import "package:rxdart/rxdart.dart";
import "package:url_launcher/url_launcher.dart";

import "main.dart";
import "prefs.dart";
import "../main.dart";
import "../prefs.dart";

final portExtractionRegex = RegExp(r"(?:port\s*|:)(\d{4,5})$");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:path/path.dart" as p;

import "dual_pane.dart";
import "prefs.dart";
import "utils.dart";
import "../prefs.dart";
import "../utils.dart";
import "project_view.dart";

final RegExp regexIDValidation = RegExp(r"^[a-zA-Z0-9_-]+$");

Expand Down
8 changes: 4 additions & 4 deletions lib/dual_pane.dart → lib/project_view/project_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "config_editor.dart";
import "config_tree.dart";
import "control_panel.dart";
import "sidebar/sidebar.dart";

class OpenFileNotifier extends Notifier<File?> {
@override
Expand All @@ -25,8 +25,8 @@ class OpenFileNotifier extends Notifier<File?> {
final openConfigProvider =
NotifierProvider<OpenFileNotifier, File?>(() => OpenFileNotifier());

class DualPane extends ConsumerWidget {
const DualPane({super.key});
class ProjectView extends ConsumerWidget {
const ProjectView({super.key});

@override
Widget build(BuildContext context, WidgetRef ref) {
Expand All @@ -37,7 +37,7 @@ class DualPane extends ConsumerWidget {
children: [
Container(
constraints: const BoxConstraints(maxWidth: 200),
child: const ConfigTree(),
child: const Sidebar(),
),
Expanded(
child: openConfig == null ? const ControlPanel() : ConfigEditor(openConfig),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:path/path.dart" as p;

import "dual_pane.dart";
import "utils.dart";
import "../../utils.dart";
import "../project_view.dart";

class ConfigTile extends ConsumerWidget {
final File configFile;
Expand Down
10 changes: 5 additions & 5 deletions lib/map_tile.dart → lib/project_view/sidebar/map_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:path/path.dart" as p;

import "confirmation_dialog.dart";
import "delete_icon.dart";
import "dual_pane.dart";
import "prefs.dart";
import "utils.dart";
import "../../confirmation_dialog.dart";
import "../../delete_icon.dart";
import "../../prefs.dart";
import "../../utils.dart";
import "../project_view.dart";

class MapTile extends ConsumerStatefulWidget {
final File configFile;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";

import "new_map_dialog.dart";
import "../new_map_dialog.dart";

class NewMapButton extends ConsumerWidget {
const NewMapButton({super.key});
Expand Down
12 changes: 6 additions & 6 deletions lib/config_tree.dart → lib/project_view/sidebar/sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import "package:flutter/material.dart";
import "package:flutter_riverpod/flutter_riverpod.dart";
import "package:path/path.dart" as p;

import "../../prefs.dart";
import "../project_view.dart";
import "config_tile.dart";
import "dual_pane.dart";
import "map_tile.dart";
import "new_map_button.dart";
import "prefs.dart";

///Group 1: Is commented?
///Group 2: Actual sorting value
Expand All @@ -18,14 +18,14 @@ final RegExp sortingRegex = RegExp(
multiLine: true,
);

class ConfigTree extends ConsumerStatefulWidget {
const ConfigTree({super.key});
class Sidebar extends ConsumerStatefulWidget {
const Sidebar({super.key});

@override
ConsumerState<ConfigTree> createState() => _ConfigTreeState();
ConsumerState<Sidebar> createState() => _ConfigTreeState();
}

class _ConfigTreeState extends ConsumerState<ConfigTree> {
class _ConfigTreeState extends ConsumerState<Sidebar> {
final List<File> configs = [];
final List<File> storages = [];
final List<File> maps = [];
Expand Down

0 comments on commit df7834a

Please sign in to comment.