Skip to content

Commit

Permalink
Refactored file structure to follow MVC pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhiaDev committed Feb 22, 2024
1 parent 808054d commit 872a69c
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 455 deletions.
2 changes: 1 addition & 1 deletion lib/controller/proxy_controller.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:get/get.dart';
import '../model/proxies.dart';
import '/model/proxies_model.dart';

class ProxyController extends GetxController {
final SocksModel socksModel = SocksModel();
Expand Down
42 changes: 40 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

import 'pages/home.dart';
import 'view/pages/home_view.dart';

void main() {
runApp(const MyApp());
Expand All @@ -28,7 +28,45 @@ class MyApp extends StatelessWidget {
),
),
// Set the home page as HomePage with a title 'Proxy Manager'
home: const HomePage(title: 'Proxy Manager'),
home: const HomeView(title: 'Proxy Manager'),
);
}
}




















///
///
/// m: *
/// p: * * * *
///
//
/// m: * *
/// p:
//
//








12 changes: 6 additions & 6 deletions lib/model/proxies.dart → lib/model/proxies_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@ import 'package:get/get.dart';
// Model for HTTP proxy basic configuration
class HTTPModel {
// Observable server address
final RxString server = "127.0.0.1".obs;
final RxString server = '127.0.0.1'.obs;
// Observable port
final RxString port = "8080".obs;
final RxString port = '8080'.obs;
// Observable for enabling/disabling this proxy
final RxBool isEnabled = false.obs;
}

// Model for HTTPS proxy basic configuration
class HTTPSModel {
// Observable server address
final RxString server = "127.0.0.1".obs;
final RxString server = '127.0.0.1'.obs;
// Observable port
final RxString port = "8080".obs;
final RxString port = '8080'.obs;
// Observable for enabling/disabling this proxy
final RxBool isEnabled = false.obs;
}

// Model for SOCKS proxy basic configuration
class SocksModel {
// Observable server address
final RxString server = "127.0.0.1".obs;
final RxString server = '127.0.0.1'.obs;
// Observable port
final RxString port = "8080".obs;
final RxString port = '8080'.obs;
// Observable for enabling/disabling this proxy
final RxBool isEnabled = false.obs;
}
229 changes: 0 additions & 229 deletions lib/pages/home.dart

This file was deleted.

Loading

0 comments on commit 872a69c

Please sign in to comment.