forked from firka/student-legacy
quick actions
This commit is contained in:
parent
a68dd759d8
commit
1f39bdc301
BIN
filcnaplo/android/app/src/main/res/drawable/ic_absences.png
Normal file
BIN
filcnaplo/android/app/src/main/res/drawable/ic_absences.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.0 KiB |
BIN
filcnaplo/android/app/src/main/res/drawable/ic_grades.png
Normal file
BIN
filcnaplo/android/app/src/main/res/drawable/ic_grades.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
BIN
filcnaplo/android/app/src/main/res/drawable/ic_home.png
Normal file
BIN
filcnaplo/android/app/src/main/res/drawable/ic_home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.3 KiB |
BIN
filcnaplo/android/app/src/main/res/drawable/ic_messages.png
Normal file
BIN
filcnaplo/android/app/src/main/res/drawable/ic_messages.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
BIN
filcnaplo/android/app/src/main/res/drawable/ic_timetable.png
Normal file
BIN
filcnaplo/android/app/src/main/res/drawable/ic_timetable.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
52
filcnaplo/lib/helpers/quick_actions.dart
Normal file
52
filcnaplo/lib/helpers/quick_actions.dart
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
import 'package:filcnaplo_mobile_ui/screens/navigation/navigation_screen.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:quick_actions/quick_actions.dart';
|
||||||
|
|
||||||
|
const QuickActions quickActions = QuickActions();
|
||||||
|
|
||||||
|
void setupQuickActions() {
|
||||||
|
quickActions.setShortcutItems(<ShortcutItem>[
|
||||||
|
const ShortcutItem(
|
||||||
|
type: 'action_home',
|
||||||
|
localizedTitle: 'Home',
|
||||||
|
icon: 'ic_home'),
|
||||||
|
const ShortcutItem(
|
||||||
|
type: 'action_grades',
|
||||||
|
localizedTitle: 'Grades',
|
||||||
|
icon: 'ic_grades'),
|
||||||
|
const ShortcutItem(
|
||||||
|
type: 'action_timetable',
|
||||||
|
localizedTitle: 'Timetable',
|
||||||
|
icon: 'ic_timetable'),
|
||||||
|
const ShortcutItem(
|
||||||
|
type: 'action_messages',
|
||||||
|
localizedTitle: 'Messages',
|
||||||
|
icon: 'ic_messages'),
|
||||||
|
const ShortcutItem(
|
||||||
|
type: 'action_absences',
|
||||||
|
localizedTitle: 'Absences',
|
||||||
|
icon: 'ic_absences')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleQuickActions(BuildContext context, void Function(String) callback) {
|
||||||
|
quickActions.initialize((shortcutType) {
|
||||||
|
switch (shortcutType) {
|
||||||
|
case 'action_home':
|
||||||
|
callback("home");
|
||||||
|
break;
|
||||||
|
case 'action_grades':
|
||||||
|
callback("grades");
|
||||||
|
break;
|
||||||
|
case 'action_timetable':
|
||||||
|
callback("timetable");
|
||||||
|
break;
|
||||||
|
case 'action_messages':
|
||||||
|
callback("messages");
|
||||||
|
break;
|
||||||
|
case 'action_absences':
|
||||||
|
callback("absences");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
@ -37,6 +37,7 @@ dependencies:
|
|||||||
package_info_plus: ^1.0.6
|
package_info_plus: ^1.0.6
|
||||||
connectivity_plus: ^2.0.2
|
connectivity_plus: ^2.0.2
|
||||||
flutter_displaymode: ^0.3.2
|
flutter_displaymode: ^0.3.2
|
||||||
|
quick_actions: ^0.6.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user