Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
Fixed small issues
Browse files Browse the repository at this point in the history
  • Loading branch information
HarryDeKat committed Jun 18, 2023
1 parent e149c03 commit 98be4d0
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 60 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.8.22'
repositories {
google()
mavenCentral()
Expand Down
115 changes: 59 additions & 56 deletions lib/screens/post_login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,62 +23,65 @@ class _SettingsReminder extends State<SettingsReminder> {
title: Text(AppLocalizations.of(context)!.settings),
),
body: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 640),
child: SingleChildScrollView(
padding: const EdgeInsets.only(bottom: 8),
child: Column(children: [
SwitchListTile(
title: Text(AppLocalizations.of(context)!.notifications),
secondary: const Icon(Icons.notifications_active),
subtitle: Text(AppLocalizations.of(context)!.notificationsExpl),
value: config.enableNotifications,
onChanged: (bool value) async {
config.enableNotifications = value;
config.save();
FlutterLocalNotificationsPlugin
flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
final bool? androidResult =
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestPermission();
final bool? iOSResult = await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
if (androidResult == true || iOSResult == true) {
if (!(await Permission
.ignoreBatteryOptimizations.isGranted)) {
Permission.ignoreBatteryOptimizations.request();
}
setState(() {});
WidgetsBinding.instance.addPostFrameCallback((_) {
Silvio.of(context).update();
});
}
},
),
PersonConfigCarousel(
profiles: widget.account.profiles,
simpleView: true,
widgetsNextToIndicator: [
FilledButton.icon(
icon: const Icon(Icons.navigate_next),
onPressed: () => Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const Start(),
)),
label: Text(AppLocalizations.of(context)!.gContinue)),
],
),
])
child: SafeArea(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 640),
child: SingleChildScrollView(
padding: const EdgeInsets.only(bottom: 8),
child: Column(children: [
SwitchListTile(
title: Text(AppLocalizations.of(context)!.notifications),
secondary: const Icon(Icons.notifications_active),
subtitle:
Text(AppLocalizations.of(context)!.notificationsExpl),
value: config.enableNotifications,
onChanged: (bool value) async {
config.enableNotifications = value;
config.save();
FlutterLocalNotificationsPlugin
flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
final bool? androidResult =
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestPermission();
final bool? iOSResult =
await flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
if (androidResult == true || iOSResult == true) {
if (!(await Permission
.ignoreBatteryOptimizations.isGranted)) {
Permission.ignoreBatteryOptimizations.request();
}
setState(() {});
WidgetsBinding.instance.addPostFrameCallback((_) {
Silvio.of(context).update();
});
}
},
),
PersonConfigCarousel(
profiles: widget.account.profiles,
simpleView: true,
widgetsNextToIndicator: [
FilledButton.icon(
icon: const Icon(Icons.navigate_next),
onPressed: () => Navigator.pushReplacement(
context,
MaterialPageRoute(
builder: (context) => const Start(),
)),
label: Text(AppLocalizations.of(context)!.gContinue)),
],
),
])),
),
),
),
Expand Down
5 changes: 4 additions & 1 deletion lib/screens/settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class _SettingsView extends State<SettingsView> {
};

checkMaterialYou() async {
hasMaterialYou = (await DynamicColorPlugin.getCorePalette() != null);
var color = await DynamicColorPlugin.getCorePalette();
setState(() {
hasMaterialYou = (color != null);
});
}

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/year.dart
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class _SchoolYearStatisticsView extends State<SchoolYearStatisticsView> {
child: SilvioCard(
title: Text(AppLocalizations.of(context)!.monthlyAverage),
child: Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
padding: const EdgeInsets.fromLTRB(8, 0, 8, 8),
child: MonthlyLineChartGrades(
grades: grades,
showAverage: true,
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/charts/linechart_monthly_average.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MonthlyLineChartGrades extends StatelessWidget {
})
: [];
return SizedBox(
height: 250 - 64,
height: 250 - 56,
child: LineChart(
swapAnimationDuration: const Duration(milliseconds: 150),
swapAnimationCurve: Curves.linear,
Expand Down

0 comments on commit 98be4d0

Please sign in to comment.