From d9497d50c62edf108d89217557ddfa417f614934 Mon Sep 17 00:00:00 2001 From: Pierre Hubert Date: Thu, 24 Mar 2022 09:30:08 +0100 Subject: [PATCH] Use fluent icons --- lib/main.dart | 18 +++++++++++++----- pubspec.lock | 28 ++++++++++++++++++++++++++++ pubspec.yaml | 3 ++- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 521a3b4..9d87a91 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,10 +1,11 @@ // ignore_for_file: avoid_print +import 'package:fluent_ui/fluent_ui.dart' as fluent; import 'package:fluentui_system_icons/fluentui_system_icons.dart'; import 'package:flutter/material.dart'; -import 'package:music_web_player/ui/music_player.dart'; import 'package:music_web_player/api.dart'; import 'package:music_web_player/config.dart'; +import 'package:music_web_player/ui/music_player.dart'; void main() { loadConfig(); @@ -24,7 +25,10 @@ class PlayerApp extends StatelessWidget { primarySwatch: Colors.green, brightness: Brightness.dark, ), - home: const AppHome(), + home: fluent.FluentTheme( + child: const AppHome(), + data: fluent.ThemeData(), + ), ); } } @@ -68,11 +72,15 @@ class _AppHomeState extends State { child: IntrinsicHeight( child: Column( children: [ - const Icon(FluentIcons.warning_24_regular, size: 50), + const Icon( + FluentIcons.warning_24_regular, + size: 50, + color: Colors.white, + ), const SizedBox(height: 50), const Text("Failed to load musics list!"), const SizedBox(height: 50), - ElevatedButton( + fluent.FilledButton( onPressed: load, child: Text("Try again".toUpperCase()), ), @@ -82,7 +90,7 @@ class _AppHomeState extends State { } if (musics == null) { - return const Center(child: CircularProgressIndicator()); + return const Center(child: fluent.ProgressRing()); } if (musics!.isEmpty) { diff --git a/pubspec.lock b/pubspec.lock index cc73361..20d87af 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -106,6 +106,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "6.1.2" + fluent_ui: + dependency: "direct main" + description: + name: fluent_ui + url: "https://pub.dartlang.org" + source: hosted + version: "3.9.1" fluentui_system_icons: dependency: "direct main" description: @@ -158,6 +165,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.0" + intl: + dependency: transitive + description: + name: intl + url: "https://pub.dartlang.org" + source: hosted + version: "0.17.0" lints: dependency: transitive description: @@ -277,6 +291,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.2.4" + recase: + dependency: transitive + description: + name: recase + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" rxdart: dependency: transitive description: @@ -284,6 +305,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.27.3" + scroll_pos: + dependency: transitive + description: + name: scroll_pos + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" sky_engine: dependency: transitive description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 146e03a..6ad0f22 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,8 @@ dependencies: # HTTP client dio: ^4.0.4 - # Fluent icons + # Fluent ui + fluent_ui: ^3.9.1 fluentui_system_icons: ^1.1.162 # Image processing