diff --git a/lib/main.dart b/lib/main.dart index 8bc201c..d30ae35 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,7 +35,7 @@ void main() async { brightness: Brightness.dark, )) .theme, - home: Scaffold(body: Bar()), + home: Scaffold(body: Bar(), backgroundColor: Colors.transparent), ), ), ), diff --git a/lib/widgets/bar.dart b/lib/widgets/bar.dart index 564ec28..98d5390 100644 --- a/lib/widgets/bar.dart +++ b/lib/widgets/bar.dart @@ -13,38 +13,73 @@ class Bar extends ConsumerWidget { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Row( - spacing: 4, - children: [ - Icon(Icons.circle), - Icon(Icons.circle_outlined), - Icon(Icons.circle_outlined), - ], - ), - Row( - children: [ - Text( - DateFormat.Hm().format( - ref - .watch(TimeController.provider) - .when( - data: (time) => time, - loading: DateTime.now, - error: (_, _) => DateTime.now(), + children: + [ + [ + Icon(Icons.circle), + Icon(Icons.circle_outlined), + Icon(Icons.circle_outlined), + ].map((e) => IconButton(onPressed: () {}, icon: e)).toList(), + // ref + // .watch(WorkspacesController.provider) + // .whenOrNull( + // data: (value) => value + // .map( + // (element) => IconButton( + // onPressed: () {}, + // icon: Icon( + // element.active + // ? Icons.circle + // : Icons.circle_outlined, + // ), + // ), + // ) + // .toList(), + // ) ?? + // [], + [ + TextButton( + onPressed: () {}, + child: Text( + DateFormat.Hm().format( + ref + .watch(TimeController.provider) + .when( + data: (time) => time, + loading: DateTime.now, + error: (_, _) => DateTime.now(), + ), + ), ), - ), - ), - ], - ), - Row( - children: [ - IconButton(onPressed: () {}, icon: Icon(Icons.wifi)), - IconButton(onPressed: () {}, icon: Icon(Icons.bluetooth)), - IconButton(onPressed: () {}, icon: Icon(Icons.volume_off)), - ], - ), - ], + ), + ], + [ + IconButton(onPressed: () {}, icon: Icon(Icons.wifi)), + IconButton(onPressed: () {}, icon: Icon(Icons.bluetooth)), + IconButton(onPressed: () {}, icon: Icon(Icons.volume_off)), + ], + ] + .map( + (children) => Padding( + padding: EdgeInsetsGeometry.directional(bottom: 6), + child: Container( + height: 42, + padding: EdgeInsets.symmetric(horizontal: 12), + decoration: BoxDecoration( + color: Theme.of( + context, + ).colorScheme.surfaceContainerLow, + borderRadius: BorderRadius.circular(999), + ), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: children, + ), + ), + ), + ) + .toList(), ), ), ); diff --git a/linux/nix/devshell.nix b/linux/nix/devshell.nix index ba171a2..d1987ea 100644 --- a/linux/nix/devshell.nix +++ b/linux/nix/devshell.nix @@ -4,6 +4,9 @@ pkgs.mkShell { cairo gtk-layer-shell + flutter_rust_bridge_codegen + (pkgs.writeShellScriptBin "rustup" (builtins.readFile ./fake-rustup.sh)) + (flutter.override { extraPkgConfigPackages = [ gtk-layer-shell diff --git a/linux/nix/fake-rustup.sh b/linux/nix/fake-rustup.sh new file mode 100644 index 0000000..7884c05 --- /dev/null +++ b/linux/nix/fake-rustup.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash +# Fake rustup for nix-managed Rust toolchains + +case "$1" in + run) + if [[ "$2" == "stable" ]]; then + shift 2 + if [[ $# -eq 0 ]]; then + echo "fake rustup: no command given" >&2 + exit 1 + fi + exec "$@" + exit 0 + fi + ;; + + toolchain) + if [[ "$2" == "list" ]]; then + echo "stable (default)" + exit 0 + fi + ;; + + target) + if [[ "$2" == "list" && "$3" == "--toolchain" && "$4" == "stable" && "$5" == "--installed" ]]; then + echo "x86_64-unknown-linux-gnu" + exit 0 + fi + ;; +esac + +echo "fake rustup: the command:" >&2 +echo " rustup $*" >&2 +echo "…is not mocked yet" >&2 +exit 1 \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index c6293d9..0a30293 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -9,38 +9,14 @@ packages: url: "https://pub.dev" source: hosted version: "91.0.0" - analysis_server_plugin: - dependency: transitive - description: - name: analysis_server_plugin - sha256: "44adba4d74a2541173bad4c11531d2a4d22810c29c5ddb458a38e9f4d0e5eac7" - url: "https://pub.dev" - source: hosted - version: "0.3.4" analyzer: - dependency: "direct overridden" + dependency: transitive description: name: analyzer sha256: f51c8499b35f9b26820cfe914828a6a98a94efd5cc78b37bb7d03debae3a1d08 url: "https://pub.dev" source: hosted version: "8.4.1" - analyzer_buffer: - dependency: transitive - description: - name: analyzer_buffer - sha256: "5fcd06b0715ebeee99f03e3f437b3412249969d8d12b191ea8a1d76e42a4e4a1" - url: "https://pub.dev" - source: hosted - version: "0.3.1" - analyzer_plugin: - dependency: transitive - description: - name: analyzer_plugin - sha256: "6645a029da947ffd823d98118f385d4bd26b54eb069c006b22e0b94e451814b5" - url: "https://pub.dev" - source: hosted - version: "0.13.11" args: dependency: transitive description: @@ -145,14 +121,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.4" - ci: - dependency: transitive - description: - name: ci - sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" - url: "https://pub.dev" - source: hosted - version: "0.1.0" cli_config: dependency: transitive description: @@ -161,14 +129,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.0" - cli_util: - dependency: transitive - description: - name: cli_util - sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c - url: "https://pub.dev" - source: hosted - version: "0.4.2" clock: dependency: transitive description: @@ -217,38 +177,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.7" - custom_lint: - dependency: "direct dev" - description: - name: custom_lint - sha256: "751ee9440920f808266c3ec2553420dea56d3c7837dd2d62af76b11be3fcece5" - url: "https://pub.dev" - source: hosted - version: "0.8.1" - custom_lint_core: - dependency: transitive - description: - name: custom_lint_core - sha256: "85b339346154d5646952d44d682965dfe9e12cae5febd706f0db3aa5010d6423" - url: "https://pub.dev" - source: hosted - version: "0.8.1" - custom_lint_visitor: - dependency: transitive - description: - name: custom_lint_visitor - sha256: e466d17856197cf9bce7ca03804d784fddab809db7bda787f3d2799ac89faadd - url: "https://pub.dev" - source: hosted - version: "1.0.0+9.0.0" dart_style: dependency: transitive description: name: dart_style - sha256: a4c1ccfee44c7e75ed80484071a5c142a385345e658fd8bd7c4b5c97e7198f98 + sha256: a9c30492da18ff84efe2422ba2d319a89942d93e58eb0b73d32abe822ef54b7b url: "https://pub.dev" source: hosted - version: "3.1.8" + version: "3.1.3" dbus: dependency: transitive description: @@ -304,7 +240,7 @@ packages: source: sdk version: "0.0.0" flutter_hooks: - dependency: "direct overridden" + dependency: transitive description: name: flutter_hooks sha256: "8ae1f090e5f4ef5cfa6670ce1ab5dddadd33f3533a7f9ba19d9f958aa2a89f42" @@ -319,6 +255,11 @@ packages: url: "https://pub.dev" source: hosted version: "6.0.0" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" flutter_riverpod: dependency: "direct main" description: @@ -332,8 +273,16 @@ packages: description: flutter source: sdk version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: "13065f10e135263a4f5a4391b79a8efc5fb8106f8dd555a9e49b750b45393d77" + url: "https://pub.dev" + source: hosted + version: "3.2.3" freezed_annotation: - dependency: transitive + dependency: "direct main" description: name: freezed_annotation sha256: "7294967ff0a6d98638e7acb774aac3af2550777accd8149c90af5b014e6d44d8" @@ -413,13 +362,21 @@ packages: source: hosted version: "0.7.2" json_annotation: - dependency: transitive + dependency: "direct main" description: name: json_annotation - sha256: cb09e7dac6210041fad964ed7fbee004f14258b4eca4040f72d1234062ace4c8 + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" url: "https://pub.dev" source: hosted - version: "4.11.0" + version: "4.9.0" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: c5b2ee75210a0f263c6c7b9eeea80553dbae96ea1bf57f02484e806a3ffdffa3 + url: "https://pub.dev" + source: hosted + version: "6.11.2" leak_tracker: dependency: transitive description: @@ -564,30 +521,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.1" - riverpod_analyzer_utils: - dependency: transitive - description: - name: riverpod_analyzer_utils - sha256: e55bc08c084a424e1bbdc303fe8ea75daafe4269b68fd0e0f6f1678413715b66 - url: "https://pub.dev" - source: hosted - version: "1.0.0-dev.9" - riverpod_lint: - dependency: "direct dev" - description: - name: riverpod_lint - sha256: "64e8debf5b719a37d48b9785dd595d34133fdcd84b8fd07157a621c54ab2156f" - url: "https://pub.dev" - source: hosted - version: "3.1.3" - rxdart: - dependency: transitive - description: - name: rxdart - sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" - url: "https://pub.dev" - source: hosted - version: "0.28.0" shelf: dependency: transitive description: @@ -626,13 +559,21 @@ packages: source: sdk version: "0.0.0" source_gen: - dependency: "direct overridden" + dependency: transitive description: name: source_gen sha256: "732792cfd197d2161a65bb029606a46e0a18ff30ef9e141a7a82172b05ea8ecd" url: "https://pub.dev" source: hosted version: "4.2.2" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6a3c6cc82073a8797f8c4dc4572146114a39652851c157db37e964d9c7038723" + url: "https://pub.dev" + source: hosted + version: "1.3.8" source_map_stack_trace: dependency: transitive description: @@ -737,14 +678,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.4.0" - uuid: - dependency: transitive - description: - name: uuid - sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" - url: "https://pub.dev" - source: hosted - version: "4.5.3" vector_math: dependency: transitive description: @@ -825,14 +758,6 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.3" - yaml_edit: - dependency: transitive - description: - name: yaml_edit - sha256: "07c9e63ba42519745182b88ca12264a7ba2484d8239958778dfe4d44fe760488" - url: "https://pub.dev" - source: hosted - version: "2.2.4" sdks: - dart: ">=3.10.4 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" + dart: ">=3.9.2 <4.0.0" + flutter: ">=3.32.0" diff --git a/pubspec.yaml b/pubspec.yaml index 0a16e33..705b1d1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,33 +1,32 @@ name: flight description: "A Flutter bar" publish_to: 'none' -version: 1.0.0+1 +version: 0.1.0 environment: - sdk: ^3.10.4 - -dependency_overrides: - analyzer: ^8.4.0 - source_gen: ^4.0.2 - flutter_hooks: ^0.21.2 + sdk: "^3.9.2" dependencies: + flutter: + sdk: flutter + flutter_localizations: + sdk: flutter flutter_riverpod: ^3.3.1 hooks_riverpod: ^3.3.1 audio_service_mpris: ^0.2.1 dynamic_system_colors: git: url: https://github.com/hasali19/flutter_dynamic_system_colors - flutter: - sdk: flutter wayland_layer_shell: ^1.0.1 intl: ^0.20.2 + freezed_annotation: ^3.1.0 + json_annotation: ^4.9.0 dev_dependencies: - build_runner: ^2.4.11 - custom_lint: ^0.8.0 + build_runner: ^2.13.1 flutter_lints: ^6.0.0 - riverpod_lint: ^3.1.3 + freezed: ^3.2.3 + json_serializable: ^6.11.1 flutter: uses-material-design: true \ No newline at end of file