Skip to content

Commit

Permalink
Merge pull request #37 from Pranjal2041/master
Browse files Browse the repository at this point in the history
Major Updates for v1
  • Loading branch information
Pranjal2041 authored Aug 15, 2021
2 parents 7d016e3 + c6e4eb8 commit e921952
Show file tree
Hide file tree
Showing 33 changed files with 802 additions and 580 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "Flutter",
"request": "launch",
"type": "dart"
"type": "dart",
}
]
}
34 changes: 33 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1,33 @@
include: package:pedantic/analysis_options.yaml
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

analyzer:
errors:
todo: ignore

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
31 changes: 23 additions & 8 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ import 'package:firebase_core/firebase_core.dart';
// import 'package:global_configuration/global_configuration.dart';
// import 'package:syncfusion_flutter_core/core.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:package_info/package_info.dart';
import 'package:pedantic/pedantic.dart';
import 'package:provider/provider.dart';
import 'package:IITDAPP/modules/discussionForum/discuss.dart';
// import 'package:IITDAPP/modules/discussionForum/discuss.dart';
import 'package:IITDAPP/modules/courses/screens/search.dart';

void main() async {
WidgetsFlutterBinding.ensureInitialized();


// try {
// await GlobalConfiguration().loadFromAsset('secrets');
// SyncfusionLicense.registerLicense(
Expand All @@ -32,7 +34,7 @@ void main() async {
// } catch (e) {
// print('secrets.json file is required');
// }

unawaited(extractAppVersion());
unawaited(initialiseNotifications());
unawaited(initialisePreferences());
await savedstate.init();
Expand All @@ -58,7 +60,6 @@ void main() async {
ChangeNotifierProvider(
create: (_) => EventsTabProvider(),
),

ChangeNotifierProvider(create: (_) => LoginStateProvider()),
], child: MyApp()));
}
Expand Down Expand Up @@ -96,15 +97,29 @@ initialisePreferences() async {
defaultScreen = res;
}

// ignore: always_declare_return_types
extractAppVersion() async =>
PackageInfo.fromPlatform().then((PackageInfo packageInfo) {
appName = packageInfo.appName;
packageName = packageInfo.packageName;
version = packageInfo.version;
buildNumber = packageInfo.buildNumber;
});

// ignore: always_declare_return_types
initialiseNotifications() async {
print('Initialising Notifications');
await Firebase.initializeApp();
print('Testing Push Notifications');
var pushNotificationsManager = PushNotificationsManager();
await pushNotificationsManager.init();
await Calendarnotificationprovider.setDescription(
start: 'Time:- ', end: '', text: DynamicTextEventKeys.RangeTime);
await Calendarnotificationprovider.setTitle(
start: 'Event:- ', text: DynamicTextEventKeys.Title);
try {
await Calendarnotificationprovider.setPackageName('com.example.IITDAPP');
await Calendarnotificationprovider.setDescription(
start: 'Time:- ', end: '', text: DynamicTextEventKeys.RangeTime);
await Calendarnotificationprovider.setTitle(
start: 'Event:- ', text: DynamicTextEventKeys.Title);
} on PlatformException {
print('Error Occured');
}
}
5 changes: 3 additions & 2 deletions lib/modules/about/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:IITDAPP/modules/about/privacyPolicy.dart';
import 'package:IITDAPP/modules/about/releaseNotes.dart';
import 'package:IITDAPP/modules/settings/widgets/SettingsTextWidgets.dart';
import 'package:IITDAPP/utility/UrlHandler.dart';
import 'package:IITDAPP/values/Constants.dart';
//import 'package:gradient_app_bar/gradient_app_bar.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -56,7 +57,7 @@ class AboutScreen extends StatelessWidget {
],
)),
Padding(padding: EdgeInsets.all(10)),
Text('1.2.3',
Text(version,
style: TextStyle(
fontSize:
Theme.of(context).primaryTextTheme.headline6.fontSize,
Expand Down Expand Up @@ -96,7 +97,7 @@ class AboutScreen extends StatelessWidget {
text: 'Feedback',
onTap: () {
UrlHandler.startEmail('[email protected]',
subject: 'App Feedback', body: 'App Version 1.2.3');
subject: 'App Feedback', body: 'App Version $version');
},
),
],
Expand Down
20 changes: 20 additions & 0 deletions lib/modules/calendar/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import 'dart:math';
import 'package:IITDAPP/modules/calendar/data/CalendarModel.dart';
import 'package:IITDAPP/modules/settings/data/SettingsHandler.dart';
import 'package:IITDAPP/ThemeModel.dart';
import 'package:IITDAPP/utility/UrlHandler.dart';
import 'package:IITDAPP/widgets/choice_alert.dart';
import 'package:IITDAPP/widgets/error_alert.dart';
import 'package:provider/provider.dart';
import 'package:IITDAPP/widgets/CustomAppBar.dart';
import 'package:IITDAPP/widgets/CustomSnackbar.dart';
Expand Down Expand Up @@ -202,6 +205,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
data.id,
RetrieveEventsParams(
startDate: startDate, endDate: endDate));

calendarModel.add(CalendarModel(
id: data.id,
name: data.name,
Expand Down Expand Up @@ -373,6 +377,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
dayFormat: 'EEE',
monthCellStyle: MonthCellStyle(
textStyle: TextStyle(fontSize: 17),
// ignore: deprecated_member_use
todayTextStyle: TextStyle(fontSize: 17),
),
),
Expand All @@ -392,6 +397,21 @@ class _CalendarScreenState extends State<CalendarScreen> {
key: scaffoldKey,
appBar: CustomAppBar(
title: Text('Calendar'),
actions: [
IconButton(
icon: Icon(Icons.calendar_today),
iconSize: 30,
color: Colors.white,
onPressed: () async {
var openExternalCalendar = await showChoiceAlert(
context,
'Open Calendar in Device Default',
'Are you sure you want to open events in Device Calendar?',
UrlHandler.launchDeviceCalendar);
if (openExternalCalendar == null) {}
// Navigator.pop(context);
}),
],
),
drawer: AppDrawer(tag: 'Calendar'),
floatingActionButton: Stack(
Expand Down
Loading

0 comments on commit e921952

Please sign in to comment.