Skip to content

Commit

Permalink
Uniform styling in settings.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinkey04 committed Nov 29, 2021
1 parent fc38026 commit e1eb1d7
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 52 deletions.
6 changes: 3 additions & 3 deletions lib/model/SharedPreferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ class Preferences {
return prefs.getBool(key) ?? false;
}

void setString (String key, String value) async {
void setString(String key, String value) async {
prefs = await SharedPreferences.getInstance();
prefs.setString(key, value);
}

Future<String> getString (String key) async {
Future<String> getString(String key) async {
prefs = await SharedPreferences.getInstance();
return prefs.getString(key);
}
}
}
2 changes: 1 addition & 1 deletion lib/view/download_music.dart
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class _DownloadMusicState extends State<DownloadMusic> {
: SystemUiOverlayStyle.light,
elevation: 0,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios_outlined),
icon: Icon(Icons.arrow_back_ios_rounded),
onPressed: () => Navigator.pop(context)),
title: Text(
downloadMusicString,
Expand Down
6 changes: 4 additions & 2 deletions lib/view/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Settings extends StatelessWidget {
SliverAppBar(
expandedHeight: screenHeight * 0.3,
toolbarHeight: screenHeight * 0.08,
collapsedHeight: screenHeight * 0.1,
collapsedHeight: screenHeight * 0.15,
systemOverlayStyle: themeProvider.darkTheme
? SystemUiOverlayStyle.light
: SystemUiOverlayStyle.dark,
Expand All @@ -31,7 +31,9 @@ class Settings extends StatelessWidget {
title: Text(settings,
style: Theme.of(context).textTheme.headline1),
),
),
leading: IconButton(
icon: Icon(Icons.arrow_back_ios_rounded),
onPressed: () => Navigator.pop(context)), ),
SliverList(
delegate: SliverChildListDelegate([
SizedBox(height: screenHeight * 0.05),
Expand Down
8 changes: 2 additions & 6 deletions lib/widgets/download_location_button_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ class DownloadLocationButton extends StatelessWidget {
if (provider.appStorage != false) {
provider.appStorage = false;
Fluttertoast.showToast(
msg:
willBeStored,
toastLength: Toast.LENGTH_LONG);
msg: willBeStored, toastLength: Toast.LENGTH_LONG);
} else {
Fluttertoast.showToast(
msg: y,
toastLength: Toast.LENGTH_LONG);
Fluttertoast.showToast(msg: y, toastLength: Toast.LENGTH_LONG);
provider.appStorage = true;
}
},
Expand Down
4 changes: 3 additions & 1 deletion lib/widgets/refresh_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ class RefreshButton extends StatelessWidget {
},
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(children: [
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.all(8.0),
child: Icon(
Expand Down
77 changes: 38 additions & 39 deletions lib/widgets/theme_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:provider/provider.dart';
import 'package:raag/provider/settings_provider.dart';
import 'package:raag/provider/theme.dart';
import 'package:raag/model/strings.dart';

class ThemeButton extends StatefulWidget {
@override
_ThemeButtonState createState() => _ThemeButtonState();
Expand Down Expand Up @@ -41,45 +42,43 @@ class _ThemeButtonState extends State<ThemeButton>
provider.darkTheme ? controller.forward() : controller.reverse();
}

return Container(
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height * 0.1,
child: Card(
elevation: 3,
child: InkWell(
splashColor: Colors.transparent,
onTap: () => changeTheme(),
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Row(
children: [
AnimatedIconButton(
size: screenWidth * 0.08,
animationController: controller,
initialIcon: (provider.darkTheme) ? 1:0,
icons: [
AnimatedIconItem(icon: nightIcon),
AnimatedIconItem(icon: dayIcon),
],
onPressed: () {},
),
SizedBox(
width: screenWidth * 0.04,
),
Text(
darktheme,
style: Theme.of(context).textTheme.headline3,
),
SizedBox(
width: screenWidth * 0.3,
),
Switch(
activeColor: Theme.of(context).colorScheme.secondary,
value: !provider.darkTheme,
onChanged: (bool value) => changeTheme(),
)
],
),
return Card(
elevation: 3,
child: InkWell(
splashColor: Colors.transparent,
onTap: () => changeTheme(),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
AnimatedIconButton(
padding: EdgeInsets.all(8.0),
size: screenWidth * 0.08,
animationController: controller,
initialIcon: (provider.darkTheme) ? 1 : 0,
icons: [
AnimatedIconItem(icon: nightIcon),
AnimatedIconItem(icon: dayIcon),
],
onPressed: () => changeTheme(),
),
SizedBox(
width: screenWidth * 0.01,
),
Text(
darktheme,
style: Theme.of(context).textTheme.headline3,
),
SizedBox(
width: screenWidth * 0.3,
),
Switch(
activeColor: Theme.of(context).colorScheme.secondary,
value: !provider.darkTheme,
onChanged: (bool value) => changeTheme(),
)
],
),
),
),
Expand Down

0 comments on commit e1eb1d7

Please sign in to comment.