Skip to content

Commit

Permalink
changelog:
Browse files Browse the repository at this point in the history
improved code
Material UI
  • Loading branch information
gokadzev committed Jul 30, 2022
1 parent 9b4992b commit 953022d
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 64 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
Download Support :arrow_down:<br>
Play Local / Downloaded Songs Support :open_file_folder: <br>
High Quality mp3 / m4a / flac Format :fire:<br>
Lyrics Support :pencil:<br>
Lyrics Support :pencil:<br>
No Ads :no_entry_sign:<br>
No Subscriptions :dollar:<br>
12 Supported Languages :us:<br>
Accent Colors :art: <br>
Material UI & Accent Colors :art: <br>


---
Expand Down
3 changes: 2 additions & 1 deletion fastlane/metadata/android/en-US/full_description.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
* Streaming Support
* Download Support
* Play Local / Downloaded Songs Supported
* High Quality m4a/ mp3 / flac Format
* High Quality m4a / mp3 / flac Format
* Lyrics Support
* No Ads
* No Subscriptions
* 12 Supported Languages
* Material UI & Accent Colors
21 changes: 21 additions & 0 deletions lib/helper/material_color_creator.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import 'package:flutter/material.dart';

MaterialColor createMaterialColor(Color color) {
final List strengths = <double>[.05];
final Map<int, Color> swatch = {};
final int r = color.red, g = color.green, b = color.blue;

for (int i = 1; i < 10; i++) {
strengths.add(0.1 * i);
}
for (var strength in strengths) {
final double ds = 0.5 - strength;
swatch[(strength * 1000).round()] = Color.fromRGBO(
r + ((ds < 0 ? r : (255 - r)) * ds).round(),
g + ((ds < 0 ? g : (255 - g)) * ds).round(),
b + ((ds < 0 ? b : (255 - b)) * ds).round(),
1,
);
}
return MaterialColor(color.value, swatch);
}
26 changes: 22 additions & 4 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get_it/get_it.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:musify/API/musify.dart';
import 'package:musify/helper/material_color_creator.dart';
import 'package:musify/helper/version.dart';
import 'package:musify/services/audio_handler.dart';
import 'package:musify/services/audio_manager.dart';
Expand Down Expand Up @@ -81,14 +82,31 @@ class _MyAppState extends State<MyApp> {
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
appBarTheme: const AppBarTheme(backgroundColor: Colors.black),
themeMode: ThemeMode.dark,
darkTheme: ThemeData(
scaffoldBackgroundColor: bgColor,
backgroundColor: bgColor,
primaryColor: const Color(0xFF000000),
canvasColor: bgColor,
appBarTheme: AppBarTheme(backgroundColor: bgColor),
colorScheme:
ColorScheme.fromSwatch(primarySwatch: createMaterialColor(accent)),
visualDensity: VisualDensity.adaptivePlatformDensity,
fontFamily: 'Ubuntu',
useMaterial3: true,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
},
),
),
theme: ThemeData(
scaffoldBackgroundColor: Colors.white,
canvasColor: Colors.white,
appBarTheme: const AppBarTheme(backgroundColor: Colors.white),
colorScheme:
ColorScheme.fromSwatch(primarySwatch: createMaterialColor(accent)),
visualDensity: VisualDensity.adaptivePlatformDensity,
fontFamily: 'Ubuntu',
useMaterial3: true,
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: ZoomPageTransitionsBuilder(),
Expand Down
4 changes: 0 additions & 4 deletions lib/ui/aboutPage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:musify/helper/version.dart';
import 'package:musify/style/appColors.dart';
Expand All @@ -10,10 +9,7 @@ class AboutPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: bgColor,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.about,
Expand Down
4 changes: 0 additions & 4 deletions lib/ui/homePage.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:musify/API/musify.dart';
Expand All @@ -20,8 +19,6 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
'Musify.',
Expand All @@ -31,7 +28,6 @@ class _HomePageState extends State<HomePage> {
fontWeight: FontWeight.w800,
),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(
Expand Down
14 changes: 6 additions & 8 deletions lib/ui/localSongsPage.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:math';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:musify/API/musify.dart';
Expand Down Expand Up @@ -72,10 +71,7 @@ class _LocalSongsPageState extends State<LocalSongsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.localSongs,
Expand All @@ -85,7 +81,6 @@ class _LocalSongsPageState extends State<LocalSongsPage> {
fontWeight: FontWeight.w700,
),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(
Expand Down Expand Up @@ -157,12 +152,15 @@ class _LocalSongsPageState extends State<LocalSongsPage> {
const Padding(
padding: EdgeInsets.only(top: 5, bottom: 5),
),
TextButton(
ElevatedButton(
onPressed: () => {
setActivePlaylist(localSongs),
},
style: TextButton.styleFrom(
backgroundColor: accent,
style: ElevatedButton.styleFrom(
primary: accent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Text(
AppLocalizations.of(context)!.playAll.toUpperCase(),
Expand Down
8 changes: 3 additions & 5 deletions lib/ui/player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'dart:async';
import 'package:audio_service/audio_service.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:just_audio/just_audio.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
Expand Down Expand Up @@ -54,11 +53,7 @@ class AudioAppState extends State<AudioApp> {
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
return Scaffold(
backgroundColor: bgColor,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
backgroundColor: bgColor,
elevation: 0,
centerTitle: true,
title: Text(
Expand Down Expand Up @@ -344,18 +339,21 @@ class AudioAppState extends State<AudioApp> {
icon: const Icon(MdiIcons.play),
iconSize: size.width * 0.1,
onPressed: play,
splashColor: Colors.transparent,
);
case MPlayerState.playing:
return IconButton(
icon: const Icon(MdiIcons.pause),
iconSize: size.width * 0.1,
onPressed: pause,
splashColor: Colors.transparent,
);
case MPlayerState.stopped:
return IconButton(
icon: const Icon(MdiIcons.play),
iconSize: size.width * 0.08,
onPressed: play,
splashColor: Colors.transparent,
);
}
},
Expand Down
14 changes: 6 additions & 8 deletions lib/ui/playlistPage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:math';

import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
Expand Down Expand Up @@ -76,10 +75,7 @@ class _PlaylistPageState extends State<PlaylistPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: bgColor,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.playlist,
Expand All @@ -96,7 +92,6 @@ class _PlaylistPageState extends State<PlaylistPage> {
),
onPressed: () => Navigator.pop(context, false),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(
Expand Down Expand Up @@ -179,7 +174,7 @@ class _PlaylistPageState extends State<PlaylistPage> {
),
),
const SizedBox(height: 5),
TextButton(
ElevatedButton(
onPressed: () => {
setActivePlaylist(
widget.playlist['list'] as List,
Expand All @@ -196,8 +191,11 @@ class _PlaylistPageState extends State<PlaylistPage> {
),
Navigator.pop(context, false)
},
style: TextButton.styleFrom(
backgroundColor: accent,
style: ElevatedButton.styleFrom(
primary: accent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Text(
AppLocalizations.of(context)!
Expand Down
5 changes: 0 additions & 5 deletions lib/ui/playlistsPage.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:musify/API/musify.dart';
Expand Down Expand Up @@ -36,10 +35,7 @@ class _PlaylistsPageState extends State<PlaylistsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.playlists,
Expand All @@ -49,7 +45,6 @@ class _PlaylistsPageState extends State<PlaylistsPage> {
fontWeight: FontWeight.w700,
),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(
Expand Down
5 changes: 0 additions & 5 deletions lib/ui/searchPage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:hive_flutter/hive_flutter.dart';
import 'package:musify/API/musify.dart';
Expand Down Expand Up @@ -42,10 +41,7 @@ class _SearchPageState extends State<SearchPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.search,
Expand All @@ -55,7 +51,6 @@ class _SearchPageState extends State<SearchPage> {
fontWeight: FontWeight.w700,
),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(
Expand Down
5 changes: 0 additions & 5 deletions lib/ui/settingsPage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
Expand All @@ -22,10 +21,7 @@ class _SettingsPageState extends State<SettingsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.settings,
Expand All @@ -35,7 +31,6 @@ class _SettingsPageState extends State<SettingsPage> {
fontWeight: FontWeight.w700,
),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(child: SettingsCards()),
Expand Down
14 changes: 6 additions & 8 deletions lib/ui/userLikedSongsPage.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
import 'package:musify/API/musify.dart';
Expand All @@ -17,10 +16,7 @@ class _UserLikedSongsState extends State<UserLikedSongs> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: bgColor,
appBar: AppBar(
systemOverlayStyle:
const SystemUiOverlayStyle(statusBarBrightness: Brightness.dark),
centerTitle: true,
title: Text(
AppLocalizations.of(context)!.userLikedSongs,
Expand All @@ -37,7 +33,6 @@ class _UserLikedSongsState extends State<UserLikedSongs> {
),
onPressed: () => Navigator.pop(context, false),
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SingleChildScrollView(
Expand Down Expand Up @@ -110,13 +105,16 @@ class _UserLikedSongsState extends State<UserLikedSongs> {
const Padding(
padding: EdgeInsets.only(top: 5, bottom: 5),
),
TextButton(
ElevatedButton(
onPressed: () => {
setActivePlaylist(userLikedSongsList),
Navigator.pop(context, false)
},
style: TextButton.styleFrom(
backgroundColor: accent,
style: ElevatedButton.styleFrom(
primary: accent,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Text(
AppLocalizations.of(context)!.playAll.toUpperCase(),
Expand Down
Loading

0 comments on commit 953022d

Please sign in to comment.