Skip to content

Commit

Permalink
flutter: Rewrite flutter frontend to use only the KDDW layouting
Browse files Browse the repository at this point in the history
This greatly simplifies the flutter port. KDDW now only drives
the layouting and doesn't abstract tabs, windows and DnD anymore,
which will now be done in Dart.

The amount of over-engineered abstractions in C++ was causing it to be
a pain to even do simple bug fixes. The code is now very clean in dart,
without needing to go back and forth to C++ land for every mouse click.

Allows to get rid of dartagnan which broke whenever shiboken or LLVM
was updated.

Allows to get rid of qcoro co-routines as tests are no longer driven
by C++, no need to mix 2 event loops.

The state of the port is still dependent on flutter supporting
multi-window, but we're now in a position to move faster, as tons
of tech debt have been removed.
  • Loading branch information
iamsergio committed Dec 7, 2024
1 parent c3be04e commit c7fc4d1
Show file tree
Hide file tree
Showing 274 changed files with 2,051 additions and 74,480 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/flutter-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
#
# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only

# Builds the flutter frontend
# Doesn't run tests yet though

name: Flutter-dev

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
preset:
- name: dev-flutter
isAOT: false
args: []
# - name: dev-flutter-asan
# isAOT: false
# args: ["--asan"]
# - name: dev-flutter-aot
# isAOT: true
# args: ["--aot"]
# - name: dev-flutter-aot-asan
# isAOT: true
# args: ["--aot", "--asan"]

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Install dependencies on Ubuntu
run: |
sudo apt update -qq
sudo apt install libgtk-3-dev libglib2.0-dev ninja-build libspdlog-dev lld xvfb -y
- uses: subosito/flutter-action@v2
with:
flutter-version: "3.x"
channel: "stable"

- name: Configure project ${{ matrix.preset.name }}
run: cmake -S . -B ./build-${{ matrix.preset.name }} --preset ${{ matrix.preset.name }}

- name: Build Project ${{ matrix.preset.name }}
run: cmake --build ./build-${{ matrix.preset.name }}

- name: Build the example
run: |
cd examples/flutter
flutter build linux
- name: Run tests
run: |
cd src/flutter/dart
flutter pub get
xvfb-run flutter test
95 changes: 0 additions & 95 deletions .github/workflows/flutter-dev.yml_

This file was deleted.

78 changes: 0 additions & 78 deletions .github/workflows/flutter-gen-bindings.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@ name: (Scheduled) Runs flutter pub upgrade

on:
schedule:
- cron: '0 0 1 * *' # monthly
- cron: "0 0 1 * *" # monthly
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: true

steps:
- name: Checkout sources
Expand All @@ -31,32 +29,17 @@ jobs:
- name: Install Flutter SDK
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.6'
channel: 'stable'
flutter-version: "3.x"
channel: "stable"

- name: Setup git author name
uses: fregante/setup-git-user@v2

- name: pub upgrade on flutter_tests_embedder
run: |
cd tests/flutter_tests_embedder/
flutter pub upgrade

- name: pub upgrade on flutter_tests_embedder
run: |
cd tests/flutter_tests_embedder/
flutter pub upgrade --major-versions

- name: pub upgrade on examples
run: |
cd examples/flutter
flutter pub upgrade --major-versions
- name: pub upgrade on src/flutter
run: |
cd src/flutter
flutter pub upgrade --major-versions

- name: pub upgrade on src/flutter/dart
run: |
cd src/flutter/dart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,6 @@ jobs:
flutter_os: "macos"

steps:
- name: Install Qt
if: ${{ matrix.preset.name == 'release-flutter-qwindow' }}
uses: jurplel/install-qt-action@v3
with:
version: 6.7.2
cache: true

- name: Checkout sources
uses: actions/checkout@v4

Expand All @@ -58,8 +51,8 @@ jobs:

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.24.0'
channel: 'stable'
flutter-version: "3.x"
channel: "stable"

- name: MSVC into PATH
if: ${{ runner.os == 'Windows' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,4 @@ kddockwidgets_example.iml

/docs/book/book/
/book/
/src/flutter/dart/build/
Loading

0 comments on commit c7fc4d1

Please sign in to comment.