Skip to content

Commit

Permalink
android ui 1
Browse files Browse the repository at this point in the history
  • Loading branch information
timzaak committed Aug 12, 2023
1 parent cbf3cc7 commit bf0cba4
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 16 deletions.
13 changes: 0 additions & 13 deletions app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';

import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/material.dart';
import 'package:for_net_ui/mobile_app.dart';
import 'package:for_net_ui/pc_app.dart';
Expand All @@ -14,16 +13,4 @@ void main() {
}
}

void pcRun() {
runApp(const PCApp());
doWhenWindowReady(() {
final win = appWindow;
const initialSize = Size(400, 160);
win.minSize = initialSize;
win.size = initialSize;
win.alignment = Alignment.center;
//win.show();
//win.hide();
});
}

5 changes: 4 additions & 1 deletion app/lib/mobile_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:for_net_ui/native/extra_ffi.dart';
import 'package:for_net_ui/native/ffi.dart';
import 'package:for_net_ui/page/mobile/main_page.dart';
import 'package:path_provider/path_provider.dart';
import 'package:path/path.dart' as p;
import 'package:permission_handler/permission_handler.dart';

void mobileRun() {

runApp(MaterialApp(
title: 'ForNet',
theme: ThemeData.light(useMaterial3: true),
home: const MobileApp(),
//home: const MobileApp(),
home: const MainPage()
));
}

Expand Down
20 changes: 20 additions & 0 deletions app/lib/page/mobile/join_network_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

import 'package:flutter/material.dart';

class JoinNetworkPage extends StatelessWidget {
const JoinNetworkPage({super.key});


@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Join Network'),
),
body: Column(children: [
ElevatedButton(onPressed: () => {}, child: const Text('Scan QRCode')),
ElevatedButton(onPressed: () => {}, child: const Text('KeyCloak'))
],),
);
}
}
28 changes: 28 additions & 0 deletions app/lib/page/mobile/main_page.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
import 'package:for_net_ui/page/mobile/join_network_page.dart';

class MainPage extends StatelessWidget {
const MainPage({super.key});


@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('ForNet'),
leading: IconButton(
icon: const Icon(Icons.add),
onPressed: () async {
await Navigator.push(context, MaterialPageRoute(builder: (_) => const JoinNetworkPage()));
},
),
),
body: Column(
children: [
ElevatedButton(onPressed: ()=> {}, child: const Text('Hello World!'))
],
)
);
}
}

File renamed without changes.
File renamed without changes.
17 changes: 15 additions & 2 deletions app/lib/pc_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:for_net_ui/native/ffi.dart';
import 'package:for_net_ui/page/login_page.dart';
import 'package:for_net_ui/page/welcome_page.dart';
import 'package:for_net_ui/page/pc/login_page.dart';
import 'package:for_net_ui/page/pc/welcome_page.dart';
import 'package:launch_at_startup/launch_at_startup.dart';
import 'package:system_tray/system_tray.dart';
import 'package:package_info_plus/package_info_plus.dart';
Expand All @@ -29,6 +29,19 @@ class PCApp extends StatefulWidget {

bool initSuccess = false;


void pcRun() {
runApp(const PCApp());
doWhenWindowReady(() {
final win = appWindow;
const initialSize = Size(400, 160);
win.minSize = initialSize;
win.size = initialSize;
win.alignment = Alignment.center;
//win.show();
//win.hide();
});
}
class _PCAppState extends State<PCApp> {
final AppWindow _appWindow = AppWindow();
final SystemTray _systemTray = SystemTray();
Expand Down
2 changes: 2 additions & 0 deletions app/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import FlutterMacOS
import Foundation

import bitsdojo_window_macos
import mobile_scanner
import package_info_plus
import path_provider_foundation
import system_tray

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
BitsdojoWindowPlugin.register(with: registry.registrar(forPlugin: "BitsdojoWindowPlugin"))
MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin"))
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SystemTrayPlugin.register(with: registry.registrar(forPlugin: "SystemTrayPlugin"))
Expand Down
8 changes: 8 additions & 0 deletions app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
mobile_scanner:
dependency: "direct main"
description:
name: mobile_scanner
sha256: "2fbc3914fe625e196c64ea8ffc4084cd36781d2be276d4d5923b11af3b5d44ff"
url: "https://pub.dev"
source: hosted
version: "3.4.1"
package_config:
dependency: transitive
description:
Expand Down
1 change: 1 addition & 0 deletions app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies:
path_provider: ^2.0.15
path: ^1.8.3
permission_handler: ^10.4.3
mobile_scanner: ^3.4.1
# provider: ^6.0.1
# functional_data: ^1.0.0

Expand Down

0 comments on commit bf0cba4

Please sign in to comment.