diff --git a/.gitignore b/.gitignore index 766b7dd8..457b3325 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ .history .svn/ *.env - +.fvm # IntelliJ related *.iml *.ipr diff --git a/android/app/build.gradle b/android/app/build.gradle index 94263f61..35ae2301 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -32,6 +32,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { compileSdkVersion 32 + ndkVersion "26.1.10909125" lintOptions { disable 'InvalidPackage' @@ -99,4 +100,4 @@ dependencies { apply plugin: 'com.google.gms.google-services' //com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true -android.buildTypes.release.ndk.debugSymbolLevel = 'FULL' \ No newline at end of file +android.buildTypes.release.ndk.debugSymbolLevel = 'FULL' diff --git a/assets/login/login.html b/assets/login/login.html index 52d2c2e8..bfe6b7d8 100644 --- a/assets/login/login.html +++ b/assets/login/login.html @@ -1,167 +1,169 @@ - - - - - - - -
- -
InstiApp
-
- -
-
- -
-

- or -

- - LOG IN AS AN ALUMNUS - -

- or -
- - CONTINUE AS A GUEST - + + + + + + +
+ +
InstiApp
-
- - - - - \ No newline at end of file +
+ +
+ + + diff --git a/assets/login/login_dark.html b/assets/login/login_dark.html index e04eef28..4371899d 100644 --- a/assets/login/login_dark.html +++ b/assets/login/login_dark.html @@ -1,171 +1,171 @@ - + - - - + + - - - + +
- -
InstiApp
+ +
InstiApp
- +
- - - \ No newline at end of file + function showLoading() { + var loginLink = document.querySelector(".login"); + var loadingCircle = document.querySelector(".loading-circle"); + + loginLink.style.display = "none"; + loadingCircle.style.display = "block"; + + setTimeout(function () { + loginLink.style.display = "inline"; + loadingCircle.style.display = "none"; + }, 5000); + } + + + diff --git a/fonts/LostAndFoundIcon.ttf b/fonts/LostAndFoundIcon.ttf new file mode 100644 index 00000000..321cc64f Binary files /dev/null and b/fonts/LostAndFoundIcon.ttf differ diff --git a/lib/lost_and_found_icon.dart b/lib/lost_and_found_icon.dart new file mode 100644 index 00000000..36283fd4 --- /dev/null +++ b/lib/lost_and_found_icon.dart @@ -0,0 +1,25 @@ +/// Flutter icons MyFlutterApp +/// Copyright (C) 2023 by original authors @ fluttericon.com, fontello.com +/// This font was generated by FlutterIcon.com, which is derived from Fontello. +/// +/// To use this font, place it in your fonts/ directory and include the +/// following in your pubspec.yaml +/// +/// flutter: +/// fonts: +/// - family: MyFlutterApp +/// fonts: +/// - asset: fonts/LostAndFoundIcon.ttf +/// +/// +/// +import 'package:flutter/widgets.dart'; + +class LostAndFoundIcon { + LostAndFoundIcon._(); + + static const _kFontFam = 'LostAndFoundIcon'; + static const String? _kFontPkg = null; + + static const IconData lost_and_found_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); +} diff --git a/lib/src/api/apiclient.dart b/lib/src/api/apiclient.dart index 8a4fa461..b31934ba 100644 --- a/lib/src/api/apiclient.dart +++ b/lib/src/api/apiclient.dart @@ -49,7 +49,7 @@ part 'apiclient.g.dart'; //@rt.RestApi(baseUrl: "http://192.168.1.103:8000/api") // @rt.RestApi(baseUrl: "http://10.105.177.150/api") @rt.RestApi(baseUrl: "https://gymkhana.iitb.ac.in/instiapp/api") -// @rt.RestApi(baseUrl: "https://272c-2405-201-5004-3c2f-d836-b028-6ac-ad9.ngrok-free.app/api") +// @rt.RestApi(baseUrl: "https://dcae-2405-201-5004-30e9-a45d-9897-ea81-3414.ngrok-free.app/api") abstract class InstiAppApi { factory InstiAppApi(Dio dio, {String baseUrl}) = _InstiAppApi; diff --git a/lib/src/drawer.dart b/lib/src/drawer.dart index d911cafa..557c0723 100644 --- a/lib/src/drawer.dart +++ b/lib/src/drawer.dart @@ -10,6 +10,7 @@ import 'package:InstiApp/src/bloc_provider.dart'; import 'package:InstiApp/src/api/model/notification.dart' as ntf; import 'package:rxdart/rxdart.dart'; import 'package:upgrader/upgrader.dart'; +import '../lost_and_found_icon.dart'; // A Navigation Drawer class NavDrawer extends StatefulWidget { @@ -193,7 +194,8 @@ class _NavDrawerState extends State { selected: indexSnapshot.data == 17, ), 18: NavListTile( - icon: Icons.fmd_bad, + icon: LostAndFoundIcon.lost_and_found_icon, + custom_widget: true, title: "Lost And Found", onTap: () { changeSelection(9, drawerState!); @@ -515,20 +517,23 @@ class NavListTile extends StatelessWidget { final bool selected; final bool highlight; final Widget? trailing; - - NavListTile({ - // Key? key, - this.icon, - this.title, - this.onTap, - this.selected = false, - this.highlight = false, - this.trailing, - }); + final bool custom_widget; + + NavListTile( + { + // Key? key, + this.icon, + this.title, + this.onTap, + this.selected = false, + this.highlight = false, + this.trailing, + this.custom_widget = false}); @override Widget build(BuildContext context) { var theme = Theme.of(context); + ListTileThemeData listTileTheme = ListTileTheme.of(context); return Container( decoration: !highlight @@ -542,10 +547,19 @@ class NavListTile extends StatelessWidget { // key: Key(highlight.toString()), selected: selected, enabled: true, - leading: Icon( - this.icon, - color: theme.colorScheme.onSurface, - ), + leading: !this.custom_widget + ? Icon( + this.icon, + color: theme.colorScheme.onSurface, + ) + : Transform.translate( + offset: Offset(-3,3), + child: Icon( + //for lost and found icon + this.icon, + color: theme.colorScheme.onSurface, + size: 32), + ), dense: true, title: Text( this.title!, diff --git a/lib/src/routes/lostandfoundfeedpage.dart b/lib/src/routes/lostandfoundfeedpage.dart index 2f178af9..82a9ed84 100644 --- a/lib/src/routes/lostandfoundfeedpage.dart +++ b/lib/src/routes/lostandfoundfeedpage.dart @@ -5,7 +5,6 @@ import 'package:InstiApp/src/drawer.dart'; import 'package:InstiApp/src/utils/common_widgets.dart'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; - import '../api/model/lostandfoundPost.dart'; import '../utils/title_with_backbutton.dart'; @@ -91,6 +90,49 @@ class _LostpageState extends State { ], ), ), + floatingActionButtonLocation: FloatingActionButtonLocation.endDocked, + floatingActionButton: FloatingActionButton.extended( + icon: Icon(Icons.info), + label: Text("Info"), + onPressed: () => showDialog( + context: context, + builder: (BuildContext context) => AlertDialog( + title: Text('How to use Lost and Found'), + content: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + 'If you find a lost item:', + style: TextStyle(fontWeight: FontWeight.w600), + ), + Text( + 'Give the item to the nearest security office \n'), + Text( + 'If you want to claim your lost item:', + style: TextStyle(fontWeight: FontWeight.w600), + ), + Text( + 'Use the contact details provided to claim your item\n'), + Text( + 'Only the security offices can post items on Lost and Found, students can only claim items and report lost items to the security offices'), + ], + )), + actions: [ + Center( + child: TextButton( + onPressed: () => Navigator.pop(context), + child: Text( + 'OK', + style: TextStyle(color: Colors.white), + ), + style: TextButton.styleFrom( + backgroundColor: Colors.lightBlue), + ), + ) + ])), + ), body: SafeArea( child: !isLoggedIn ? Container( @@ -126,20 +168,34 @@ class _LostpageState extends State { stream: lnFPostBloc.lostAndFoundPosts, builder: (BuildContext context, AsyncSnapshot> snapshot) { - return ListView.builder( - primary: false, - shrinkWrap: true, - itemCount: snapshot.data?.length ?? 0, - itemBuilder: (_, index) { - if (!snapshot.hasData) { - return Center( - child: CircularProgressIndicatorExtended( - label: Text("Loading..."), - )); - } - return _buildContent(screen_h, screen_w, index, - myfont, context, snapshot); - }, + if (snapshot.data?.length != 0) { + return ListView.builder( + primary: false, + shrinkWrap: true, + itemCount: snapshot.data?.length ?? 0, + itemBuilder: (_, index) { + if (!snapshot.hasData) { + return Center( + child: + CircularProgressIndicatorExtended( + label: Text("Loading..."), + )); + } + + return _buildContent(screen_h, screen_w, + index, myfont, context, snapshot); + }, + ); + } + return Center( + child: Text( + 'No posts \n have been added yet', + style: TextStyle( + fontSize: 25.0, + color: Colors.grey[600], + fontWeight: FontWeight.w300), + textAlign: TextAlign.center, + ), ); }), ], @@ -155,157 +211,159 @@ class _LostpageState extends State { child: (SizedBox( height: screen_h * 0.7, width: screen_w * 1.2, - child: Stack(alignment: Alignment.center, children: [ - Card( - color: theme.cardColor, - margin: EdgeInsets.symmetric(horizontal: 25, vertical: 10), - child: InkWell( - onTap: () { - Navigator.of(context) - .pushNamed("/lostandfound/info" + (posts[index].id ?? "")); - }, - child: SizedBox( - child: Stack( - children: [ - ClipRRect( - borderRadius: BorderRadius.only( - topRight: Radius.circular(10), - topLeft: Radius.circular(10)), - child: Row( - children: [ - Center( - child: Container( - padding: EdgeInsets.fromLTRB(0, 0, 5, 0), - height: screen_h, - width: screen_h * 0.20 / 0.43, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topRight: Radius.circular(10), - bottomLeft: Radius.circular(10)), - ), - child: ClipRRect( - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(10), - topLeft: Radius.circular(10)), - child: CachedNetworkImage( - imageUrl: posts[index].imageUrl?[0] ?? '', - placeholder: (context, url) => Image.asset( - 'assets/buynsell/DevcomLogo.png', - fit: BoxFit.fill, - ), - errorWidget: (context, url, error) => - new Image.asset( - 'assets/buynsell/DevcomLogo.png', - fit: BoxFit.fill, + child: Container( + child: Stack(alignment: Alignment.center, children: [ + Card( + color: theme.cardColor, + margin: EdgeInsets.symmetric(horizontal: 25, vertical: 10), + child: InkWell( + onTap: () { + Navigator.of(context).pushNamed( + "/lostandfound/info" + (posts[index].id ?? "")); + }, + child: SizedBox( + child: Stack( + children: [ + ClipRRect( + borderRadius: BorderRadius.only( + topRight: Radius.circular(10), + topLeft: Radius.circular(10)), + child: Row( + children: [ + Center( + child: Container( + padding: EdgeInsets.fromLTRB(0, 0, 5, 0), + height: screen_h, + width: screen_h * 0.20 / 0.43, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topRight: Radius.circular(10), + bottomLeft: Radius.circular(10)), + ), + child: ClipRRect( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10), + topLeft: Radius.circular(10)), + child: CachedNetworkImage( + imageUrl: posts[index].imageUrl?[0] ?? '', + placeholder: (context, url) => Image.asset( + 'assets/buynsell/DevcomLogo.png', + fit: BoxFit.fill, + ), + errorWidget: (context, url, error) => + new Image.asset( + 'assets/buynsell/DevcomLogo.png', + fit: BoxFit.fill, + ), + fit: BoxFit.cover, ), - fit: BoxFit.cover, ), ), ), - ), - ], - ), - ), - Container( - padding: EdgeInsets.fromLTRB(0, 0, 10, 0), - margin: - EdgeInsets.fromLTRB(screen_h * 0.20 / 0.43, 11, 0, 50), - child: Text( - posts[index].name ?? "", - style: theme.textTheme.headline6, - overflow: TextOverflow.ellipsis, - maxLines: 1, - ), - ), - Container( - margin: - EdgeInsets.fromLTRB(screen_h * 0.20 / 0.43, 105, 10, 0), - child: Text( - (posts[index].foundAt ?? "").length <= 10 - ? posts[index].foundAt ?? "" - : (posts[index].foundAt ?? "").substring(0, 10) + - '...', - style: theme.textTheme.bodyText2, - maxLines: 1, - ), - ), - Container( - margin: EdgeInsets.fromLTRB( - screen_w * 0.7, 110, screen_h * 0.04 / 1.5, 1), - child: Row( - children: [ - Spacer(), - Text( - (posts[index].claimed == true - ? "Claimed" - : "Not\nclaimed"), - style: theme.textTheme.bodyText1, - textAlign: TextAlign.center, - ) ], - )), - Container( - // child: MyPosts - // ? Container() - child: Row(children: [ - Icon( - Icons.access_time, - size: ((myfont / 18 * 12).toInt()).toDouble(), ), - Text(' ' + (posts[index].timeBefore ?? ""), - style: theme.textTheme.bodyText1!.copyWith( - fontWeight: FontWeight.bold, - )) - ]), - - margin: - EdgeInsets.fromLTRB(screen_h * 0.20 / 0.43, 135, 0, 0), - ), - Container( + ), + Container( + padding: EdgeInsets.fromLTRB(0, 0, 10, 0), margin: EdgeInsets.fromLTRB( - screen_h * 0.20 / 0.43, 35, 0, 0)), - Container( - padding: EdgeInsets.fromLTRB(0, 13, 10, 0), + screen_h * 0.20 / 0.43, 11, 0, 50), child: Text( - (posts[index].description ?? ""), - maxLines: 2, + posts[index].name ?? "", + style: theme.textTheme.headline6, overflow: TextOverflow.ellipsis, + maxLines: 1, + ), + ), + Container( + margin: EdgeInsets.fromLTRB( + screen_h * 0.20 / 0.43, 105, 10, 0), + child: Text( + (posts[index].foundAt ?? "").length <= 10 + ? posts[index].foundAt ?? "" + : (posts[index].foundAt ?? "").substring(0, 10) + + '...', style: theme.textTheme.bodyText2, + maxLines: 1, ), + ), + Container( + margin: EdgeInsets.fromLTRB( + screen_w * 0.7, 110, screen_h * 0.04 / 1.5, 1), + child: Row( + children: [ + Spacer(), + Text( + (posts[index].claimed == true + ? "Claimed" + : "Not\nclaimed"), + style: theme.textTheme.bodyText1, + textAlign: TextAlign.center, + ) + ], + )), + Container( + // child: MyPosts + // ? Container() + child: Row(children: [ + Icon( + Icons.access_time, + size: ((myfont / 18 * 12).toInt()).toDouble(), + ), + Text(' ' + (posts[index].timeBefore ?? ""), + style: theme.textTheme.bodyText1!.copyWith( + fontWeight: FontWeight.bold, + )) + ]), + margin: EdgeInsets.fromLTRB( - screen_h * 0.20 / 0.43, 43, 0, 0)), - Row( - children: [ - Spacer(), - Container(), - ], - ) - ], - )), - ), - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(10), - side: BorderSide(color: Colors.blue), - ), - ), - if (posts[index].claimed == true) - Container( - width: screen_w * 0.15, - height: screen_w * 0.15, - decoration: new BoxDecoration( - color: Colors.green, - shape: BoxShape.circle, + screen_h * 0.20 / 0.43, 135, 0, 0), + ), + Container( + margin: EdgeInsets.fromLTRB( + screen_h * 0.20 / 0.43, 35, 0, 0)), + Container( + padding: EdgeInsets.fromLTRB(0, 13, 10, 0), + child: Text( + (posts[index].description ?? ""), + maxLines: 2, + overflow: TextOverflow.ellipsis, + style: theme.textTheme.bodyText2, + ), + margin: EdgeInsets.fromLTRB( + screen_h * 0.20 / 0.43, 43, 0, 0)), + Row( + children: [ + Spacer(), + Container(), + ], + ) + ], + )), + ), + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: BorderSide(color: Colors.blue), ), ), - if (posts[index].claimed == true) - Container( - child: Icon( - Icons.check, - color: Colors.white, - size: screen_w * 0.15, - )), - ]), + if (posts[index].claimed == true) + Container( + width: screen_w * 0.15, + height: screen_w * 0.15, + decoration: new BoxDecoration( + color: Colors.green, + shape: BoxShape.circle, + ), + ), + if (posts[index].claimed == true) + Container( + child: Icon( + Icons.check, + color: Colors.white, + size: screen_w * 0.15, + )), + ]), + ), )), ); } diff --git a/lib/src/routes/settingspage.dart b/lib/src/routes/settingspage.dart index d9c29e6e..4de48e29 100644 --- a/lib/src/routes/settingspage.dart +++ b/lib/src/routes/settingspage.dart @@ -172,7 +172,7 @@ class _SettingsPageState extends State { // "/complaints": "Complaints/Suggestions", "/map": "Map", // "/settings": "Settings", - "/groups": "Insight Discussion Forum", + "/groups": "Communities", //"/groups": "Communities", }.entries.map((entry) { return DropdownMenuItem( diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index c4dd34a7..b1073187 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,7 @@ import FlutterMacOS import Foundation import device_info_plus_macos +import file_selector_macos import firebase_core import firebase_messaging import flutter_local_notifications @@ -19,6 +20,7 @@ import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin")) FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) diff --git a/pubspec.yaml b/pubspec.yaml index 2c9dd81b..04cfe13e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -103,6 +103,9 @@ flutter: - asset: fonts/IBMPlexSans/IBMPlexSans-BoldItalic.ttf style: italic weight: 700 + - family: LostAndFoundIcon + fonts: + - asset: fonts/LostAndFoundIcon.ttf uses-material-design: true # targets: # $default: