Skip to content

Commit

Permalink
Merge pull request #451 from lahirulakruwan/main
Browse files Browse the repository at this point in the history
Toast message added for monthly leave dates picker
  • Loading branch information
YujithIsura authored Nov 6, 2024
2 parents 7a94f52 + 53d985c commit 965653e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
41 changes: 22 additions & 19 deletions campus/frontend/lib/avinya/attendance/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:gallery/auth.dart';
import 'package:gallery/data/campus_apps_portal.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:month_year_picker/month_year_picker.dart';
import 'package:oktoast/oktoast.dart';

// import 'auth.dart';
import 'routing.dart';
Expand Down Expand Up @@ -90,25 +91,27 @@ class _CampusAttendanceManagementSystemState
notifier: _routeState,
child: SMSAuthScope(
notifier: _auth,
child: MaterialApp.router(
routerDelegate: _routerDelegate,
routeInformationParser: _routeParser,
localizationsDelegates: [
GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
MonthYearPickerLocalizations.delegate,
],
// Revert back to pre-Flutter-2.5 transition behavior:
// https://github.com/flutter/flutter/issues/82053
theme: ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.linux: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.windows: FadeUpwardsPageTransitionsBuilder(),
},
child: OKToast(
child: MaterialApp.router(
routerDelegate: _routerDelegate,
routeInformationParser: _routeParser,
localizationsDelegates: [
GlobalWidgetsLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
MonthYearPickerLocalizations.delegate,
],
// Revert back to pre-Flutter-2.5 transition behavior:
// https://github.com/flutter/flutter/issues/82053
theme: ThemeData(
pageTransitionsTheme: const PageTransitionsTheme(
builders: {
TargetPlatform.android: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.linux: FadeUpwardsPageTransitionsBuilder(),
TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
TargetPlatform.windows: FadeUpwardsPageTransitionsBuilder(),
},
),
),
),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:ui';
import 'package:gallery/widgets/success_message.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';

Expand Down Expand Up @@ -202,6 +203,7 @@ Future<void> createMonthlyLeaveDates({
);

if (response.statusCode >= 200 && response.statusCode < 300) {
showSuccessToast("Monthly Leave Dates Added Successfully!");
print("Leave dates created successfully: ${response.body}");
} else {
throw Exception(
Expand Down Expand Up @@ -244,6 +246,7 @@ Future<void> updateMonthlyLeaveDates({
);

if (response.statusCode >= 200 && response.statusCode < 300) {
showSuccessToast("Monthly Leave Dates Updated Successfully!");
print("Leave dates updated successfully: ${response.body}");
} else {
throw Exception(
Expand Down
2 changes: 1 addition & 1 deletion campus/frontend/lib/avinya/attendance/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies:
flutter_svg:
fl_chart: 0.60.0
month_year_picker: ^0.3.0+1

oktoast: ^3.4.0
pdf: ^3.6.4

dev_dependencies:
Expand Down

0 comments on commit 965653e

Please sign in to comment.