Skip to content

Commit

Permalink
chore: update sdk version, yaru and add CI and release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Feichtmeier committed Oct 28, 2024
1 parent 43902a3 commit 159ad69
Show file tree
Hide file tree
Showing 25 changed files with 453 additions and 240 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
pull_request:
branches: [master]

env:
FLUTTER_VERSION: '3.24.3'

jobs:
analyze:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{env.FLUTTER_VERSION}}
- run: flutter pub get
- run: flutter analyze --fatal-infos

format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{env.FLUTTER_VERSION}}
- run: flutter pub get
- run: dart format --set-exit-if-changed .

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{env.FLUTTER_VERSION}}
- run: flutter test

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{env.FLUTTER_VERSION}}
- run: sudo apt update
- run: sudo apt install -y clang cmake curl libgtk-3-dev ninja-build pkg-config unzip libunwind-dev libmpv-dev
- run: flutter pub get
- run: flutter build linux -v
19 changes: 19 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release

on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
release-type: dart
2 changes: 0 additions & 2 deletions clipboard_viewer/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
include: package:flutter_lints/flutter.yaml

analyzer:
enable-experiment:
- records

linter:
rules:
4 changes: 4 additions & 0 deletions clipboard_viewer/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class _MyHomePageState extends State<MyHomePage> {
itemCount: items.length,
itemBuilder: (context, index) {
final item = items[index];
// TODO(@HrX03) is this needed?
// ignore: unused_local_variable
final rawReader = item.$1.rawReader;

return ListTile(
Expand All @@ -60,6 +62,8 @@ class _MyHomePageState extends State<MyHomePage> {
onPressed: () async {
await Pasteboard.writeFiles(["/home/davide"]);
return;
// TODO(@HrX03) is this needed?
// ignore: unused_local_variable, dead_code
final data = await ClipboardReader.readClipboard();
final value = await data.readValue(linuxFileUri);

Expand Down
76 changes: 54 additions & 22 deletions clipboard_viewer/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: transitive
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
Expand Down Expand Up @@ -37,10 +37,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
url: "https://pub.dev"
source: hosted
version: "1.17.1"
version: "1.18.0"
crypto:
dependency: transitive
description:
Expand Down Expand Up @@ -120,6 +120,30 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.6.7"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05"
url: "https://pub.dev"
source: hosted
version: "10.0.5"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806"
url: "https://pub.dev"
source: hosted
version: "3.0.5"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints:
dependency: transitive
description:
Expand All @@ -132,26 +156,26 @@ packages:
dependency: transitive
description:
name: matcher
sha256: c94db23593b89766cda57aab9ac311e3616cf87c6fa4e9749df032f66f30dcb8
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
url: "https://pub.dev"
source: hosted
version: "0.12.14"
version: "0.12.16+1"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: "12307e7f0605ce3da64cf0db90e5fcab0869f3ca03f76be6bb2991ce0a55e82b"
sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7
url: "https://pub.dev"
source: hosted
version: "1.9.0"
version: "1.15.0"
pasteboard:
dependency: "direct main"
description:
Expand All @@ -164,10 +188,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
Expand All @@ -185,26 +209,26 @@ packages:
dependency: transitive
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.10.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
version: "1.11.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
url: "https://pub.dev"
source: hosted
version: "2.1.1"
version: "2.1.2"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -241,10 +265,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "6182294da5abf431177fccc1ee02401f6df30f766bc6130a0852c6b6d7ee6b2d"
sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb"
url: "https://pub.dev"
source: hosted
version: "0.4.18"
version: "0.7.2"
typed_data:
dependency: transitive
description:
Expand All @@ -269,6 +293,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d"
url: "https://pub.dev"
source: hosted
version: "14.2.5"
sdks:
dart: ">=3.0.0-313.0.dev <4.0.0"
flutter: ">=3.0.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
2 changes: 1 addition & 1 deletion lib/backend/entity_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class EntityInfo {
}

@override
bool operator ==(Object? other) {
bool operator ==(Object other) {
if (other is EntityInfo) {
return _equals(other);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/backend/folder_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import 'package:files/backend/utils.dart';
import 'package:flutter/material.dart';
import 'package:windows_path_provider/windows_path_provider.dart';
import 'package:xdg_directories/xdg_directories.dart';
import 'package:yaru_icons/yaru_icons.dart';
import 'package:yaru/yaru.dart';

class FolderProvider {
final List<BuiltinFolder> _folders;
Expand Down
2 changes: 1 addition & 1 deletion lib/backend/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:files/backend/providers.dart';
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:mime/mime.dart';
import 'package:yaru_icons/yaru_icons.dart';
import 'package:yaru/yaru.dart';

class Utils {
Utils._();
Expand Down
5 changes: 2 additions & 3 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import 'package:files/widgets/tab_strip.dart';
import 'package:files/widgets/workspace.dart';
import 'package:flutter/material.dart';
import 'package:yaru/yaru.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

Future<void> main(List<String> args) async {
WidgetsFlutterBinding.ensureInitialized();
Expand All @@ -40,7 +39,7 @@ ThemeData? _applyThemeValues(ThemeData? theme) {
outlinedButtonTheme: OutlinedButtonThemeData(
style: theme.outlinedButtonTheme.style?.merge(
OutlinedButton.styleFrom(
backgroundColor: theme.colorScheme.surfaceVariant,
backgroundColor: theme.colorScheme.surfaceContainerHighest,
),
),
),
Expand Down Expand Up @@ -93,7 +92,7 @@ class _FilesHomeState extends State<FilesHome> {
@override
Widget build(BuildContext context) {
return Material(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
child: Column(
children: [
GestureDetector(
Expand Down
6 changes: 4 additions & 2 deletions lib/widgets/breadcrumbs_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ class _BreadcrumbsBarState extends State<BreadcrumbsBar> {
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Material(
color: Theme.of(context).colorScheme.surfaceVariant,
color:
Theme.of(context).colorScheme.surfaceContainerHighest,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
side: !focusNode.hasFocus
Expand Down Expand Up @@ -200,7 +201,8 @@ class _BreadcrumbChip extends StatelessWidget {
return SizedBox(
height: double.infinity,
child: DragTarget<FileSystemEntity>(
onAccept: (data) => Utils.moveFileToDest(data, path.toPath()),
onAcceptWithDetails: (details) =>
Utils.moveFileToDest(details.data, path.toPath()),
builder: (context, candidateData, rejectedData) {
return InkWell(
child: Row(
Expand Down
10 changes: 3 additions & 7 deletions lib/widgets/context_menu.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:yaru_icons/yaru_icons.dart';
import 'package:yaru_widgets/yaru_widgets.dart';
import 'package:yaru/yaru.dart';

class ContextMenu extends StatefulWidget {
final List<BaseContextMenuItem> entries;
Expand Down Expand Up @@ -105,7 +104,7 @@ class SubmenuMenuItem extends BaseContextMenuItem {
leadingIcon: buildLeading(context),
trailingIcon: buildTrailing(context),
style: const ButtonStyle(
padding: MaterialStatePropertyAll(
padding: WidgetStatePropertyAll(
EdgeInsets.symmetric(horizontal: 16),
),
),
Expand Down Expand Up @@ -142,7 +141,7 @@ class ContextMenuItem extends BaseContextMenuItem {
onPressed: onTap,
shortcut: shortcut,
style: const ButtonStyle(
padding: MaterialStatePropertyAll(
padding: WidgetStatePropertyAll(
EdgeInsets.symmetric(horizontal: 16),
),
),
Expand Down Expand Up @@ -216,13 +215,10 @@ class CheckboxMenuItem extends ContextMenuItem {
switch (value) {
case false:
onChanged!.call(true);
break;
case true:
onChanged!.call(tristate ? null : false);
break;
case null:
onChanged!.call(false);
break;
}
};

Expand Down
2 changes: 0 additions & 2 deletions lib/widgets/double_scrollbars.dart
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,8 @@ class ScrollProxy extends StatelessWidget {
switch (direction) {
case Axis.vertical:
provider = VerticalScrollReceiver.of(context);
break;
case Axis.horizontal:
provider = HorizontalScrollReceiver.of(context);
break;
}

provider.notify(notification);
Expand Down
Loading

0 comments on commit 159ad69

Please sign in to comment.