Skip to content

Commit

Permalink
first deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
eduhcastro committed Oct 28, 2023
1 parent df099cc commit 9d5e62f
Show file tree
Hide file tree
Showing 6 changed files with 1,141 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# FlutterFlow Windows

![FlutterFlow Windows Logo](https://i.ibb.co/hf9HvM2/Flutter-flow.png)

**FlutterFlow Windows** is an Electron-based application that allows you to use FlutterFlow on the Windows operating system.

## Descrição

FlutterFlow is an app development platform that lacks a native client for Windows. This project utilizes ElectronJS to create a desktop client for FlutterFlow, making it easier for Windows users to access this platform.

## Distribution:
- Win 32/64 Installer: [Click here](https://github.com/eduhcastro/flutterflow-windows/releases)

## How to Use

### Prerequisites

- Make sure you have Node.js installed on your system. You can download it from [nodejs.org](https://nodejs.org/).

### Installation

1. Clone this repository:

```shell
git clone https://github.com/eduhcastro/flutterflow-windows.git
2. Navigate to the project directory:

```shell
cd flutterflow-windows
3. Install the dependencies:
```shell
npm install

### Contributing

You are welcome to contribute to this project. If you encounter issues or have suggestions for improvement, feel free to open an issue or submit a pull request.


## Author

Eduardo Castro


## License

This project is licensed under the MIT License - see the LICENSE file for more details.

<b>Note:</b> This project is not affiliated with FlutterFlow. It is an independent initiative to bring the platform to Windows users.
Binary file added assets/icon.ico
Binary file not shown.
84 changes: 84 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
const { app, BrowserWindow, ipcMain } = require('electron');
const path = require('path');

// Flag to track if it's the first window load
let firstLoad = true;
let mainWindow;

// Function to create and configure the main window
function createMainWindow() {
mainWindow = new BrowserWindow({
width: 1280,
height: 720,
frame: false, // Remove window frame
show: true,
backgroundColor: '#202124',
webPreferences: {
nodeIntegration: true, // Allow Node.js integration
webviewTag: true,
plugins: true,
additionalArguments: ['filePath'],
preload: path.join(__dirname, 'preload.js'), // Path to preload script
}
});

mainWindow.loadURL('https://app.flutterflow.io/');
}

// Event handler for when Electron is ready
app.on("ready", () => {
createMainWindow();
});

// Event handler for when a new browser window is created
app.on("browser-window-created", function (event, window) {
// Configure new windows
if (!firstLoad) {
window.setMenu(null); // Remove the menu
window.removeMenu();
window.setMenuBarVisibility(false);
window.menuBarVisible = false;
window.autoHideMenuBar = true;
window.flashFrame(false);

window.webContents.on('dom-ready', () => {
// Handle new windows, such as setting custom headers
// You might want to set the preload for all new windows here.
});
}
firstLoad = false;
});

// Event handlers for window control
ipcMain.on('move-window', (event, deltaX, deltaY) => {
const currentWindow = BrowserWindow.getFocusedWindow();
if (currentWindow) {
const { x, y } = currentWindow.getBounds();
const newX = x + deltaX;
const newY = y + deltaY;
currentWindow.setPosition(newX, newY);
}
});

ipcMain.on('close-window', () => {
if (mainWindow) {
mainWindow.close();
}
});


ipcMain.on('minimize-window', () => {
if (mainWindow) {
mainWindow.minimize();
}
});

ipcMain.on('maximize-window', () => {
if (mainWindow) {
if (mainWindow.isMaximized()) {
mainWindow.unmaximize();
} else {
mainWindow.maximize();
}
}
});
Loading

0 comments on commit 9d5e62f

Please sign in to comment.