Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
committed Nov 15, 2022
1 parent 18bfd80 commit ef01669
Show file tree
Hide file tree
Showing 20 changed files with 228 additions and 500 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
## 0.0.3
- add parameter hide window controller

## 0.0.2

- add example
58 changes: 58 additions & 0 deletions example/.pubignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
android/
ios/
linux/
macos/
web/
windows/
sceenshots/

# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release



dist/
lib/main.dart
screenshots/
33 changes: 15 additions & 18 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,36 +1,33 @@
// ignore_for_file: unused_local_variable, duplicate_ignore, non_constant_identifier_names
// ignore_for_file: unnecessary_brace_in_string_interps, non_constant_identifier_names

import 'dart:io';
import "package:terminal_flutter/terminal_flutter.dart";
import 'package:flutter/material.dart';
import 'package:flutter/material.dart';
import 'package:path_provider/path_provider.dart';
import 'package:terminal_flutter/terminal_flutter.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();
Directory app_dir = await getApplicationSupportDirectory();
runApp(
MaterialApp(
debugShowCheckedModeBanner: true,
title: "Azka Dev",
home: App(app_dir: app_dir,),
),
);
// debugRepaintRainbowEnabled = kDebugMode;
runApp(MyApp(
app_dir: app_dir,
));
}

class App extends StatefulWidget {
class MyApp extends StatelessWidget {
final Directory app_dir;
const App({
const MyApp({
super.key,
required this.app_dir,
});
@override
MyApp createState() => MyApp();
}

class MyApp extends State<App> {
@override
Widget build(BuildContext context) {
return TerminalPage(
app_dir: widget.app_dir,
return MaterialApp(
debugShowCheckedModeBanner: false,
home: TerminalPage(
app_dir: app_dir,
),
);
}
}
4 changes: 0 additions & 4 deletions example/linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@

#include "generated_plugin_registrant.h"

#include <bitsdojo_window_linux/bitsdojo_window_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) bitsdojo_window_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin");
bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar);
}
1 change: 0 additions & 1 deletion example/linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_linux
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
2 changes: 0 additions & 2 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
import FlutterMacOS
import Foundation

import bitsdojo_window_macos
import path_provider_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
BitsdojoWindowPlugin.register(with: registry.registrar(forPlugin: "BitsdojoWindowPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
37 changes: 1 addition & 36 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.9.0"
bitsdojo_window:
dependency: transitive
description:
name: bitsdojo_window
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
bitsdojo_window_linux:
dependency: transitive
description:
name: bitsdojo_window_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
bitsdojo_window_macos:
dependency: transitive
description:
name: bitsdojo_window_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
bitsdojo_window_platform_interface:
dependency: transitive
description:
name: bitsdojo_window_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
bitsdojo_window_windows:
dependency: transitive
description:
name: bitsdojo_window_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.5"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -316,7 +281,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.2"
version: "0.0.3"
test_api:
dependency: transitive
description:
Expand Down
3 changes: 0 additions & 3 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

#include "generated_plugin_registrant.h"

#include <bitsdojo_window_windows/bitsdojo_window_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
BitsdojoWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
}
1 change: 0 additions & 1 deletion example/windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_windows
)

list(APPEND FLUTTER_FFI_PLUGIN_LIST
Expand Down
3 changes: 1 addition & 2 deletions lib/core/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import 'package:xterm/xterm.dart';

part "terminal_client.dart";


bool get isDesktop {
if (kIsWeb) return false;
return [
TargetPlatform.windows,
TargetPlatform.linux,
TargetPlatform.macOS,
].contains(defaultTargetPlatform);
}
}
7 changes: 5 additions & 2 deletions lib/core/terminal_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ class TerminalClient {
);

// pty.output.cast<List<int>>().transform(const Utf8Decoder()).listen(terminal.write);
pty.output.cast<List<int>>().transform(const Utf8Decoder()).listen(terminal.write);

pty.output
.cast<List<int>>()
.transform(const Utf8Decoder())
.listen(terminal.write);

pty.exitCode.then((code) {
isActive = false;
terminal.write('the process exited with exit code $code');
Expand Down
108 changes: 0 additions & 108 deletions lib/main.dart

This file was deleted.

3 changes: 1 addition & 2 deletions lib/page/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ library terminal_page;

import 'dart:io';

import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:terminal_flutter/core/core.dart';
import 'package:terminal_flutter/widget/widget.dart';
import 'package:xterm/xterm.dart';
import "package:iconsax/iconsax.dart";
import "package:iconsax/iconsax.dart";
part "setting.dart";
part "terminal.dart";
Loading

0 comments on commit ef01669

Please sign in to comment.