From 77c67dc6a76e4dc2d5ca16e95d5ca2d8dc8e3f6f Mon Sep 17 00:00:00 2001 From: Slava Kuryaev <92830706+necrosskull@users.noreply.github.com> Date: Tue, 11 Apr 2023 12:01:32 +0300 Subject: [PATCH 01/16] fix: vector android 13 themed icon (#304) --- .../src/main/res/drawable/monochrome_icon.png | Bin 15902 -> 0 bytes .../src/main/res/drawable/monochrome_icon.xml | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+) delete mode 100644 android/app/src/main/res/drawable/monochrome_icon.png create mode 100644 android/app/src/main/res/drawable/monochrome_icon.xml diff --git a/android/app/src/main/res/drawable/monochrome_icon.png b/android/app/src/main/res/drawable/monochrome_icon.png deleted file mode 100644 index 6e2474bf3c782e420921c9edf0a945e5b82bce34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15902 zcmeHu2RzmP|L^+@duC*FLQxq9$6m)CWhSY_F^-X$oq1%H6s0Mvl9oi0G7n0rgp81# z$|z))aNnQPcm3}D-^c&{?!Eu}c-+UM503ZewO`NI>pec72Pdp8P1u+PnE?Q7W~PR= z0AS$|3mEC)uQ-vN2>@&|i?nkHv2_W@1qKCpc>9uZAx8trIC6xy2LKU$AF~dINp86IFx_$D4pi^$$?uF{)`a|Ez z*B<2tydD}FPoIeKo!J&CckcDI7pHWjCR_9_*`rTUJhuX2( zHIh$)>n!Kimt`WXSUC2iX(o*wwb-u1YPyu^DALXU;R4`uL_M-TrjzmWiCqsj0<|&vNHluLm94c=hs$_RQ!^>uN;A+wb9n z6?wrAbE-VU6oQ_0Ek3z@@m{}Xlf{LS8&?`1PA26w@C4Oq4xK7;D!LK-y?L2g+pr;2 zpIy*c&1GncnT0#JUyfN-q4?5t;|0m3$Nv2fVp6!bE*9M0^e(h9cTaTr)_!u8^K@~y z!+wl`8|eYnq;~CV?P`2*5s&`t*RFj%yw}x*lw^XIUgBLj-*nvmsIl^Kb?xFazdX6*DU4n?|aC>=# zE8g1NE-g*{hPm%8$qSz(xTf12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~wZa{Klz+J50+Quz;H0*#+w>FSI0nd87+cPTW zgKwg#oNN>}5sGg%a~p?YwB-Sx&OZdsy)B43g5xhh4B}X+q!dp&#D4=|4e{;&`MOFI z@Wg^1xf#|My$lfyl+|HTP=q{C92RlRVa4;0^rA>insO*mpSZetv?xTo=$P%8)k+l;umUIPtC2vgr^s_MjovF z%uFq016?PBZ1Y2%9hVE1jq+GXZdic16*b()P$wVhNRgj~JE22t$x5FUQ{BM}QPzpQ zDeI5F?LEo09_tL>68*k@Bk&u6-w6DFhQPW%2RmHk;l}neZXn~oCU~l)(#}>owI3D8 PnHQKDSsE7WlaBp2KY?KL diff --git a/android/app/src/main/res/drawable/monochrome_icon.xml b/android/app/src/main/res/drawable/monochrome_icon.xml new file mode 100644 index 00000000..32cf73c1 --- /dev/null +++ b/android/app/src/main/res/drawable/monochrome_icon.xml @@ -0,0 +1,18 @@ + + + + + + + \ No newline at end of file From 4f5d972c9cde1071e3b863d0cf7157099b5ba0e3 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Tue, 18 Apr 2023 00:19:16 +0300 Subject: [PATCH 02/16] ui: Fix max and min map scale values (#307) --- lib/presentation/pages/map/map_page.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/presentation/pages/map/map_page.dart b/lib/presentation/pages/map/map_page.dart index adbdf3cb..9280aa2a 100644 --- a/lib/presentation/pages/map/map_page.dart +++ b/lib/presentation/pages/map/map_page.dart @@ -24,8 +24,16 @@ class _MapPageState extends State { rotationFocusPoint: _controller.rotationFocusPoint, scale: defaultScale, ); - _controller.outputStateStream.listen((value) => - context.read().setMapScale(value.scale ?? maxScale)); + + _controller.outputStateStream.listen((value) { + double scale = value.scale ?? defaultScale; + if (scale > maxScale) { + _controller.scale = maxScale; + } else if (scale < minScale) { + _controller.scale = minScale; + } + context.read().setMapScale(scale); + }); } final _controller = PhotoViewController(); From c95000e47b713a6de8750185788071e1766840fd Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Wed, 19 Apr 2023 23:14:23 +0300 Subject: [PATCH 03/16] ui: Update attendance and fix null-error (#308) --- lib/data/datasources/user_remote.dart | 12 +- .../profile/profile_attendance_page.dart | 117 ++++++++++++++---- .../profile/widgets/attendance_card.dart | 2 +- 3 files changed, 100 insertions(+), 31 deletions(-) diff --git a/lib/data/datasources/user_remote.dart b/lib/data/datasources/user_remote.dart index 79c19270..ee757051 100644 --- a/lib/data/datasources/user_remote.dart +++ b/lib/data/datasources/user_remote.dart @@ -250,12 +250,16 @@ class UserRemoteDataImpl implements UserRemoteData { if (jsonResponse["ROWS"] != null) { Map.from(jsonResponse["ROWS"]).forEach((date, row) { if (row.containsKey("START")) { - attendance.add( - AttendanceModel.fromJson(row["START"]).copyWith(date: date)); + if (row["START"] != null) { + attendance.add( + AttendanceModel.fromJson(row["START"]).copyWith(date: date)); + } } if (row.containsKey("END")) { - attendance - .add(AttendanceModel.fromJson(row["END"]).copyWith(date: date)); + if (row["END"] != null) { + attendance.add( + AttendanceModel.fromJson(row["END"]).copyWith(date: date)); + } } }); } diff --git a/lib/presentation/pages/profile/profile_attendance_page.dart b/lib/presentation/pages/profile/profile_attendance_page.dart index 4cdf05aa..cc28155a 100644 --- a/lib/presentation/pages/profile/profile_attendance_page.dart +++ b/lib/presentation/pages/profile/profile_attendance_page.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:get/get.dart'; +import 'package:rtu_mirea_app/domain/entities/attendance.dart'; import 'package:rtu_mirea_app/presentation/bloc/attendance_bloc/attendance_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/user_bloc/user_bloc.dart'; import 'package:rtu_mirea_app/presentation/pages/profile/widgets/attendance_card.dart'; @@ -34,6 +36,94 @@ class _ProfileAttendancePageState extends State { return res; } + List> _groupAttendanceByDate(List attendance) { + final Map> groupedAttendance = {}; + for (var element in attendance) { + if (groupedAttendance.containsKey(element.date)) { + groupedAttendance[element.date]!.add(element); + } else { + groupedAttendance[element.date] = [element]; + } + } + + final List> result = []; + + final dateFormat = DateFormat('dd.MM.yyyy HH:mm:ss'); + + groupedAttendance.forEach((key, value) { + value.sort((a, b) { + final aDateTime = dateFormat.parse('${a.date} ${a.time}'); + final bDateTime = dateFormat.parse('${b.date} ${b.time}'); + + return aDateTime.compareTo(bDateTime); + }); + + final List entryExitAttendance = []; + + Attendance? entryAttendance; + Attendance? exitAttendance; + + for (final element in value) { + if (element.eventType == 'Вход' && entryAttendance == null) { + entryAttendance = element; + } else if (element.eventType == 'Выход') { + exitAttendance = element; + } + } + + if (entryAttendance != null) { + entryExitAttendance.add(entryAttendance!); + } + if (exitAttendance != null) { + entryExitAttendance.add(exitAttendance!); + } + result.add(entryExitAttendance); + }); + + return result; + } + + Widget _buildAttendanceList(List attendance) { + final List> groupedAttendance = + _groupAttendanceByDate(attendance); + return Expanded( + child: Column( + children: [ + const SizedBox(height: 8), + Text('Дней посещено: ${groupedAttendance.length}', + style: AppTextStyle.body), + const SizedBox(height: 8), + Expanded( + child: ListView.builder( + itemCount: groupedAttendance.length, + itemBuilder: (context, index) { + return Padding( + padding: + const EdgeInsets.symmetric(vertical: 16, horizontal: 24), + child: Column(children: [ + AttendanceCard( + type: groupedAttendance[index][0].eventType, + date: groupedAttendance[index][0].date, + time: groupedAttendance[index][0].time, + ), + if (groupedAttendance[index].length > 1) ...[ + const SizedBox(height: 8), + AttendanceCard( + type: groupedAttendance[index][1].eventType, + date: groupedAttendance[index][1].date, + time: groupedAttendance[index][1].time, + ), + ], + ]), + ); + }, + ), + ), + ], + ), + ); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -92,32 +182,7 @@ class _ProfileAttendancePageState extends State { child: Center(child: CircularProgressIndicator())) else if (state is AttendanceLoaded && state.attendance.isNotEmpty) - Expanded( - child: Column( - children: [ - const SizedBox(height: 8), - Text('Дней посещено: ${state.visitsCount}', - style: AppTextStyle.body), - const SizedBox(height: 8), - Expanded( - child: ListView.builder( - itemCount: state.attendance.length, - itemBuilder: (context, index) { - return Padding( - padding: const EdgeInsets.symmetric( - vertical: 16, horizontal: 24), - child: AttendanceCard( - type: state.attendance[index].eventType, - date: state.attendance[index].date, - time: state.attendance[index].time, - ), - ); - }, - ), - ), - ], - ), - ), + _buildAttendanceList(state.attendance), if (state is AttendanceLoaded && state.attendance.isEmpty) Expanded( child: Center( diff --git a/lib/presentation/pages/profile/widgets/attendance_card.dart b/lib/presentation/pages/profile/widgets/attendance_card.dart index 7213e159..d98ae016 100644 --- a/lib/presentation/pages/profile/widgets/attendance_card.dart +++ b/lib/presentation/pages/profile/widgets/attendance_card.dart @@ -54,7 +54,7 @@ class AttendanceCard extends StatelessWidget { alignment: Alignment.center, child: type == "Вход" ? const Icon(FontAwesomeIcons.rightToBracket, size: 15) - : const Icon(FontAwesomeIcons.rightToBracket, size: 15), + : const Icon(FontAwesomeIcons.rightFromBracket, size: 15), ), ), const SizedBox(width: 55.50), From 370359f9ab5cdeb007e7f9e524016f2e37eb338f Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Mon, 24 Apr 2023 14:05:40 +0300 Subject: [PATCH 04/16] ui: Update icons and add new Factory to button (#310) --- assets/icons/github.png | Bin 2330 -> 0 bytes assets/icons/telegram.png | Bin 1518 -> 0 bytes .../pages/profile/about_app_page.dart | 11 +++--- .../pages/profile/profile_page.dart | 4 +-- .../widgets/buttons/icon_button.dart | 33 ++++++++++++------ pubspec.yaml | 5 +++ 6 files changed, 37 insertions(+), 16 deletions(-) delete mode 100644 assets/icons/github.png delete mode 100644 assets/icons/telegram.png diff --git a/assets/icons/github.png b/assets/icons/github.png deleted file mode 100644 index 73db1f61f3aa55fcaecbca896dbea067706bb7bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2330 zcmaJ@dpy&7A0KVQT+TU3iOLKmvh6n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qzj=rNJpZI; z$vRbg>YS|lmxjj--{P0zyGBQ?yoS4%MX$EkOMqE$O+Pm%_1o-3WM-q=b4f2dQfTt> zOFR@zTq!4JBAQzKEZEFs#YOE+WUR@=e`!;~PCh-+ddeAuP%>I*Cd8Cb%!1YNZFKDIJTra-- zG#+}%TS;ZSZaqDK8^0CL=AU{B|LU>Hu0mU~}a9D5U= zlszxG=SokFC;8liaQHBlh z2BUO}iYG`REj!%$Xj-syeaVfwq3hF5*L>e!Jm^2?Jo?@}>G*`TrXZHmap&CnfJ4u^ zk68!bvsByruv+!zzl{#!R8}8y9^Ra-sENMbl68A9w_o}?z5eO*E&If08t#Rq+K#s{ zb}mq^_${jVjmeHhTXNWUoFMIe)lJ26`vXz zWvk~HR@whs?OF8cKV8YyEs1et|A`i*;GS`_+RH=ns17TKJg|lJv;Y(H<+2}hIXsat z5ANw;3-!HT?J@e?t>VkCV$sSaXTfoVh-!;h=kN@TPi^X~Dlo@yIP4fl2 z#pt2|1Jj>Ov$71^ei~h1H$uM|R6wY=ZG3Q99U>X|mV`BoS9`4vYw~J@(FazM_8hI9o-&aIo@yE| z6xi92RAt7!kM;6HVQV)mjXu!6Snn}L!YlYRm7CF)XL~-WsBd9Uk6GUDFm8S4@oR}s z!f_@&&0G2FHTy?nQd8F&@&}*SrC)xRgU!h6eepUXk}}=;?q@wX1aZ#AJc}avS@*XR MKo6o-Qerdz3wwRZj{pDw diff --git a/assets/icons/telegram.png b/assets/icons/telegram.png deleted file mode 100644 index 3bb99d8b7ae497df915e5b47669b1f31a4dcfd0c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1518 zcmYL}2~g5m9LF*9!nI8x%QVXs%g}LIwZk+GkCI9wqbZMWV6{87EW1{%rrKH+%>*&g ztW3?-Jku`i@Bo273Zh~psfnO?f{4QY(RP~oz2BSP_xJg}H}l?`cLx`=%?!F63V}e( zumOI-;JigQjP=2sRTVFTKo*4IcH;fP5<+1@3fhn;WN zu;(oEu6fHG47R`>b&G@LoJGga!~csvn4g$dtJP?=vl{J;Mx&n9OwVdmV9aQyW;9Cm z?AY|osA@(&H8VUlBU7rS3iY5uJuo@lKQY}mG2J^c{dG(w8ddR!mAoNk>yQGFDmYR_ zvt;69|9D;Bc&&J}Mm$8kPSvnHI*A*5M9JB{wU}$7)@{8Fb zTRVG)wJ1kt7gx7+8{NIUw_tpH{k9T_q=@4uPMtX$pK#-5QZhO9!NZJ#!WY#wwI4ry zZfI<3W-wb=9H6z0#}{<=h`;p?NCu@c`PlfRT0^k%a{yoScdQ=O>Ji0PYM%7}7Gpd$UvVBBno&2V&k?8F=S)pzd{SAs8F zn0uo)M~4Tos+kkRKG=E~-Vv$(AdR5dB zxa&AEU@U(xVnStO6VAG3mVDO_2M*Y)ht%N=<`qcPurW+bm#BHCobcV+icD>-vB4UXrU-^ILhEAj`uw}Mr~iDn z6c_ND?TX{~zZbYiNKd$(CV9)xIOL_E4WWTm7xtdz+}+{z`T)Cry#tY)Z15^6Y=7{$ z$;HaM`v3SuI+-{(z6obwtOoUj2U(bQdRkzDDfGIWUrZzwZ`8owKY*T|wAtQ)Bw$*U zGlX^CdVje(h4dtH_rpGK@r~x`(^ZQZvK!l1n@BiOxfU(!oMNGsi!DxQEq3Em? z3XA-R*}?eSpxmEhjtYWVpN??9Cfnq?FD?4LVSe=r1X?e2IX{c2`0_fesop04-ZMHr zBJyC_gNJSU_dNu1Yy2%74&lZd<9a|iQ2>J}ggkI=L#+(;vc6={BZ(u)cRBQtk>*FP zbc9`7h%!NzGW|AshtlyU?J0+IZ#W*5f83 + SocialIconButton( + icon: const Icon(Icons.add), + onClick: onClick, + text: text, + assetPath: assetPath, + ); @override Widget build(BuildContext context) { @@ -36,16 +51,14 @@ class SocialIconButton extends StatelessWidget { .copyWith(color: AppTheme.colors.active), ), const SizedBox(width: 8), - Image( - image: assetImage, - height: 16.0, - ), + assetPath != null + ? Image.asset(assetPath!, height: 16, width: 16) + : icon, ], ) - : Image( - image: assetImage, - height: 16.0, - ), + : assetPath != null + ? Image.asset(assetPath!, height: 16, width: 16) + : icon, onPressed: () { onClick(); }, diff --git a/pubspec.yaml b/pubspec.yaml index 33ab5a4e..0fc29de5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -198,6 +198,11 @@ dependencies: sentry_dio: ^6.20.1 logging: ^1.0.2 + # 1000+ beautiful icons to use in you dream project, with all the customization Flutter + # provides + # See https://pub.dev/packages/unicons + unicons: any + dev_dependencies: # The "flutter_lints" package below contains a set of recommended lints to From 04a8edf811e5978cd995ae3267f5a1d2232bf970 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Mon, 24 Apr 2023 14:06:07 +0300 Subject: [PATCH 05/16] ui: Fix Scroll Update Trigger on News Page (#309) --- lib/presentation/pages/news/news_page.dart | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/presentation/pages/news/news_page.dart b/lib/presentation/pages/news/news_page.dart index e0bb8a06..63f76827 100644 --- a/lib/presentation/pages/news/news_page.dart +++ b/lib/presentation/pages/news/news_page.dart @@ -275,12 +275,10 @@ class _NewsPageState extends State { void _setupScrollController(ScrollController controller) { controller.addListener(() { - if (controller.position.atEdge) { - if (controller.position.pixels != 0) { - context - .read() - .add(NewsLoadEvent(isImportant: _tabValueNotifier.value == 1)); - } + if (controller.position.pixels == controller.position.maxScrollExtent) { + context + .read() + .add(NewsLoadEvent(isImportant: _tabValueNotifier.value == 1)); } }); } From 00b2af43b857b243d728072023a5ac095f1bb210 Mon Sep 17 00:00:00 2001 From: Slava Kuryaev <92830706+necrosskull@users.noreply.github.com> Date: Thu, 27 Apr 2023 15:54:24 +0300 Subject: [PATCH 06/16] fix: themed icon original rounding (#311) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: vector android 13 themed icon * fix: themed icon original rounding Шрифт на векторной иконке максимально схож с оригинальным --- android/app/src/main/res/drawable/monochrome_icon.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/res/drawable/monochrome_icon.xml b/android/app/src/main/res/drawable/monochrome_icon.xml index 32cf73c1..155149cf 100644 --- a/android/app/src/main/res/drawable/monochrome_icon.xml +++ b/android/app/src/main/res/drawable/monochrome_icon.xml @@ -7,12 +7,12 @@ + android:pathData="M593.802 548.322C592.665 546.857 590.915 546 589.061 546H564C560.686 546 558 548.686 558 552V692C558 695.314 560.686 698 564 698H595C598.314 698 601 695.314 601 692V617.662L661.199 695.666C662.335 697.138 664.089 698 665.949 698H692C695.314 698 698 695.314 698 692V552C698 548.686 695.314 546 692 546H661C657.686 546 655 548.686 655 552V627.19L593.802 548.322Z" /> - \ No newline at end of file + android:pathData="M671.661 518.077C685.108 519.964 697.696 510.575 697.961 496.998C698.633 462.566 690.618 428.377 674.479 397.656C654.512 359.65 623.116 328.872 584.72 309.663C546.325 290.455 502.868 283.785 460.479 290.596C418.091 297.407 378.91 317.354 348.464 347.623C318.019 377.892 297.845 416.957 290.788 459.305C283.732 501.653 290.149 545.148 309.134 583.655C328.119 622.161 358.715 653.735 396.605 673.922C427.231 690.24 461.373 698.453 495.808 697.981C509.386 697.795 518.848 685.262 517.039 671.803C515.23 658.345 502.812 649.106 489.236 648.778C465.073 648.194 441.258 641.993 419.728 630.522C390.928 615.177 367.672 591.177 353.241 561.908C338.809 532.639 333.932 499.577 339.296 467.388C344.659 435.198 359.994 405.505 383.136 382.497C406.278 359.488 436.06 344.326 468.28 339.15C500.501 333.973 533.533 339.042 562.718 353.643C591.903 368.244 615.767 391.639 630.945 420.528C642.291 442.123 648.354 465.975 648.798 490.141C649.047 503.718 658.213 516.189 671.661 518.077Z" /> + From 2e06771078a193ae03261a689ed28cdc0b2ac6ad Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Wed, 10 May 2023 23:28:22 +0300 Subject: [PATCH 07/16] ui: Add types padding and update indicators sizes (#312) --- lib/presentation/pages/schedule/widgets/lesson_card.dart | 4 +++- .../pages/schedule/widgets/schedule_page_view.dart | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/presentation/pages/schedule/widgets/lesson_card.dart b/lib/presentation/pages/schedule/widgets/lesson_card.dart index 3c228585..e8347b3e 100644 --- a/lib/presentation/pages/schedule/widgets/lesson_card.dart +++ b/lib/presentation/pages/schedule/widgets/lesson_card.dart @@ -89,7 +89,9 @@ class LessonCard extends StatelessWidget { ], ), ), - Container(), + SizedBox( + width: 8, + ), Container( alignment: Alignment.topRight, child: Container( diff --git a/lib/presentation/pages/schedule/widgets/schedule_page_view.dart b/lib/presentation/pages/schedule/widgets/schedule_page_view.dart index 80620bcb..323c6ab4 100644 --- a/lib/presentation/pages/schedule/widgets/schedule_page_view.dart +++ b/lib/presentation/pages/schedule/widgets/schedule_page_view.dart @@ -190,6 +190,7 @@ class _SchedulePageViewState extends State { TableCalendar( // pageJumpingEnabled: true, weekendDays: const [DateTime.sunday], + calendarBuilders: CalendarBuilders( markerBuilder: (context, day, events) { return Row( @@ -231,6 +232,8 @@ class _SchedulePageViewState extends State { ), calendarStyle: CalendarStyle( rangeHighlightColor: AppTheme.colors.secondary, + cellAlignment: Alignment.center, + cellMargin: const EdgeInsets.all(10), ), daysOfWeekStyle: DaysOfWeekStyle( weekdayStyle: From d4dbd5020f27444c5e0325215da1e1e0011619bb Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Thu, 11 May 2023 14:55:29 +0300 Subject: [PATCH 08/16] ui: Fix status text overflow in profile (#306) --- .../pages/profile/profile_detail_page.dart | 24 +++++----- .../widgets/badged_container.dart | 48 +++++++++++-------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/lib/presentation/pages/profile/profile_detail_page.dart b/lib/presentation/pages/profile/profile_detail_page.dart index 6833a4ba..83014b1e 100644 --- a/lib/presentation/pages/profile/profile_detail_page.dart +++ b/lib/presentation/pages/profile/profile_detail_page.dart @@ -62,30 +62,30 @@ class ProfileDetailPage extends StatelessWidget { SizedBox( width: 160, child: BadgedContainer( - label: 'Группа', - text: student.academicGroup, - onClick: () {}), + label: 'Группа', + text: student.academicGroup, + ), ), SizedBox( width: 160, child: BadgedContainer( - label: 'Личный номер', - text: student.personalNumber, - onClick: () {}), + label: 'Личный номер', + text: student.personalNumber, + ), ), SizedBox( width: 160, child: BadgedContainer( - label: 'Курс', - text: student.course.toString(), - onClick: () {}), + label: 'Курс', + text: student.course.toString(), + ), ), SizedBox( width: 160, child: BadgedContainer( - label: 'Состояние', - text: student.status, - onClick: () {}), + label: 'Состояние', + text: student.status, + ), ), ]), ), diff --git a/lib/presentation/widgets/badged_container.dart b/lib/presentation/widgets/badged_container.dart index 4bee33a6..7a9e6317 100644 --- a/lib/presentation/widgets/badged_container.dart +++ b/lib/presentation/widgets/badged_container.dart @@ -5,42 +5,48 @@ import 'package:rtu_mirea_app/presentation/typography.dart'; class BadgedContainer extends StatelessWidget { final String label; final String text; - final VoidCallback? onClick; - const BadgedContainer( - {Key? key, required this.label, required this.text, this.onClick}) + const BadgedContainer({Key? key, required this.label, required this.text}) : super(key: key); @override Widget build(BuildContext context) { return SizedBox( - width: double.infinity, + width: 160, height: 90, child: Card( color: AppTheme.colors.background02, margin: const EdgeInsets.all(0), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), - child: InkWell( - borderRadius: BorderRadius.circular(10), - onTap: onClick, - child: Padding( - padding: const EdgeInsets.all(20.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - const SizedBox(height: 20), - Column( + child: Padding( + padding: const EdgeInsets.all(20.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const SizedBox(height: 20), + SizedBox( + width: 120, + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(label, - style: AppTextStyle.bodyBold - .copyWith(color: AppTheme.colors.deactive)), + Text( + label, + style: AppTextStyle.bodyBold.copyWith( + color: AppTheme.colors.deactive, + ), + ), const SizedBox(height: 5), - Text(text, style: AppTextStyle.title) + Text( + text, + style: AppTextStyle.title, + maxLines: 1, + textAlign: TextAlign.start, + overflow: TextOverflow.ellipsis, + ), ], - ) - ], - ), + ), + ) + ], ), ), ), From ef3afb0fbea62e80027462a69cb63eda73a5e1bc Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Sun, 14 May 2023 16:07:15 +0300 Subject: [PATCH 09/16] fix: Disable default auth on app start (#313) --- lib/data/datasources/user_local.dart | 2 +- pubspec.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/data/datasources/user_local.dart b/lib/data/datasources/user_local.dart index 20b2d20e..666a51a4 100644 --- a/lib/data/datasources/user_local.dart +++ b/lib/data/datasources/user_local.dart @@ -28,7 +28,7 @@ class UserLocalDataImpl implements UserLocalData { @override Future getTokenFromCache() async { - var token = await oauthHelper.getToken(); + var token = await oauthHelper.getTokenFromStorage(); if (token == null) throw CacheException('Auth token are not set'); return Future.value(token.accessToken); } diff --git a/pubspec.yaml b/pubspec.yaml index 0fc29de5..9d837195 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -173,11 +173,11 @@ dependencies: firebase_core_web: ^2.2.1 firebase_analytics: ^10.1.3 - oauth2_client: ^3.1.0 + oauth2_client: ^3.2.1 # Flutter Secure Storage provides API to store data in secure storage. # See https://pub.dev/packages/flutter_secure_storage - flutter_secure_storage: ^7.0.1 + flutter_secure_storage: ^8.0.0 # Flutter plugin providing detailed information about the device (make, model, etc.), # and Android or iOS version the app is running on. From 21b913ae91f424cbbe9fb30d5c57e93cc447e392 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Sun, 14 May 2023 16:17:18 +0300 Subject: [PATCH 10/16] refactor: Update pubspec.yaml --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 9d837195..77d8bb1c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -12,7 +12,7 @@ publish_to: 'none' # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.3.2+24 +version: 1.3.3+27 environment: sdk: ">=2.19.0 <3.0.0" From 737ddefc9577a54d74abb00ad1d4b69a5c9dad25 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Sun, 14 May 2023 18:14:34 +0300 Subject: [PATCH 11/16] Update README.md --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 61e1341f..56a6a50f 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,16 @@ # Скриншоты

- - - - + + + + +

+

+ + + +

# Самостоятельная сборка проекта From 04d21e3daadc6cd74644e2e9d9111f15e47d9a2c Mon Sep 17 00:00:00 2001 From: benzlokzik <121052717+benzlokzik@users.noreply.github.com> Date: Sun, 14 May 2023 21:17:03 +0300 Subject: [PATCH 12/16] DOCS: added NFC pass page's screenshots (#315) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 56a6a50f..2eb45f3f 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,14 @@ +

+

# Самостоятельная сборка проекта From 91ea7d169ff8522ae02a08daaa2c7eab3ac05a39 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Mon, 15 May 2023 00:00:58 +0300 Subject: [PATCH 13/16] fix: Outdated dependencies --- lib/presentation/pages/news/news_details_page.dart | 10 +++++----- .../pages/profile/profile_announces_page.dart | 4 ++-- pubspec.yaml | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/presentation/pages/news/news_details_page.dart b/lib/presentation/pages/news/news_details_page.dart index 3c664305..18b42a22 100644 --- a/lib/presentation/pages/news/news_details_page.dart +++ b/lib/presentation/pages/news/news_details_page.dart @@ -69,12 +69,12 @@ class NewsDetailsPage extends StatelessWidget { "body": Style( fontStyle: AppTextStyle.bodyRegular.fontStyle), }, - customRenders: { - // iframeRenderer to display the YouTube video player - iframeMatcher(): iframeRender(), - }, + extensions: const [ + // to display the YouTube video player + IframeHtmlExtension(), + ], onLinkTap: - (String? url, context, attributes, element) { + (String? url, Map attributes, _) { if (url != null) { launchUrlString(url); } diff --git a/lib/presentation/pages/profile/profile_announces_page.dart b/lib/presentation/pages/profile/profile_announces_page.dart index 7e65d20a..1fda002e 100644 --- a/lib/presentation/pages/profile/profile_announces_page.dart +++ b/lib/presentation/pages/profile/profile_announces_page.dart @@ -61,8 +61,8 @@ class ProfileAnnouncesPage extends StatelessWidget { margin: Margins.all(0), ), }, - onLinkTap: - (String? url, context, attributes, element) { + onLinkTap: (String? url, + Map attributes, _) { if (url != null) { launchUrlString(url); } diff --git a/pubspec.yaml b/pubspec.yaml index 77d8bb1c..9b9c14f6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -91,11 +91,11 @@ dependencies: # A Flutter widget rendering static HTML and CSS as Flutter widgets. # See https://pub.dev/packages/flutter_html - flutter_html: ^3.0.0-alpha.5 + flutter_html: ^3.0.0-beta.1 # Iframe widget for flutter_html # See https://pub.dev/packages/flutter_html_iframe - flutter_html_iframe: ^3.0.0-alpha.3 + flutter_html_iframe: ^3.0.0-beta.1 # The Font Awesome Icon pack available as Flutter Icons. # Provides 1600 additional icons to use in your apps. From 3c45e75a55338512af96f3724c336a69283d1f13 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Mon, 15 May 2023 00:24:30 +0300 Subject: [PATCH 14/16] fix: Change deps for newest flutter versions --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 9b9c14f6..0c4c463d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -31,7 +31,7 @@ dependencies: # Contains code to deal with internationalized/localized messages, date and number formatting # and parsing, bi-directional text, and other internationalization issues. # See https://pub.dev/packages/intl - intl: ^0.17.0 + intl: ^0.18.0 # Http client. # See https://pub.dev/packages/dio From 91c51602698e4ab601bf65b16aac97e98651ea23 Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Mon, 15 May 2023 21:02:41 +0300 Subject: [PATCH 15/16] fix: Migrate all to Flutter 3.12 --- lib/data/datasources/user_local.dart | 1 - lib/domain/entities/user.dart | 4 ++ lib/main.dart | 4 +- .../pages/news/widgets/news_item.dart | 4 +- .../profile/profile_attendance_page.dart | 5 +-- .../pages/profile/profile_lectors_page.dart | 2 +- .../pages/schedule/widgets/lesson_card.dart | 2 +- lib/service_locator.dart | 3 +- pubspec.yaml | 40 +++++++++---------- 9 files changed, 32 insertions(+), 33 deletions(-) diff --git a/lib/data/datasources/user_local.dart b/lib/data/datasources/user_local.dart index 666a51a4..4573e39f 100644 --- a/lib/data/datasources/user_local.dart +++ b/lib/data/datasources/user_local.dart @@ -3,7 +3,6 @@ import 'dart:core'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:oauth2_client/oauth2_helper.dart'; import 'package:rtu_mirea_app/common/errors/exceptions.dart'; -import 'package:rtu_mirea_app/common/oauth.dart'; import 'package:shared_preferences/shared_preferences.dart'; abstract class UserLocalData { diff --git a/lib/domain/entities/user.dart b/lib/domain/entities/user.dart index d7dae0b5..8257d88a 100644 --- a/lib/domain/entities/user.dart +++ b/lib/domain/entities/user.dart @@ -4,7 +4,11 @@ import 'student.dart'; class User extends Equatable { final int id; + + /// Email in edu-mirea.ru domain final String login; + + /// Personal email final String email; final String name; final String lastName; diff --git a/lib/main.dart b/lib/main.dart index fc98fcaa..ab04da22 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,8 +8,8 @@ import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:intl/intl.dart'; - import 'package:rtu_mirea_app/common/oauth.dart'; + import 'package:rtu_mirea_app/common/widget_data_init.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:rtu_mirea_app/presentation/bloc/about_app_bloc/about_app_bloc.dart'; @@ -104,8 +104,6 @@ Future main() async { // performance monitoring. options.tracesSampleRate = 0.2; - options.enableAutoPerformanceTracking = true; - options.attachScreenshot = true; options.addIntegration(LoggingIntegration()); diff --git a/lib/presentation/pages/news/widgets/news_item.dart b/lib/presentation/pages/news/widgets/news_item.dart index 22d760b9..d886d7de 100644 --- a/lib/presentation/pages/news/widgets/news_item.dart +++ b/lib/presentation/pages/news/widgets/news_item.dart @@ -86,9 +86,9 @@ class NewsItemWidget extends StatelessWidget { case LoadState.failed: return GestureDetector( - child: Stack( + child: const Stack( fit: StackFit.expand, - children: const [ + children: [ Positioned( bottom: 0.0, left: 0.0, diff --git a/lib/presentation/pages/profile/profile_attendance_page.dart b/lib/presentation/pages/profile/profile_attendance_page.dart index cc28155a..05bbcdc5 100644 --- a/lib/presentation/pages/profile/profile_attendance_page.dart +++ b/lib/presentation/pages/profile/profile_attendance_page.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:get/get.dart'; import 'package:rtu_mirea_app/domain/entities/attendance.dart'; import 'package:rtu_mirea_app/presentation/bloc/attendance_bloc/attendance_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/user_bloc/user_bloc.dart'; @@ -72,10 +71,10 @@ class _ProfileAttendancePageState extends State { } if (entryAttendance != null) { - entryExitAttendance.add(entryAttendance!); + entryExitAttendance.add(entryAttendance); } if (exitAttendance != null) { - entryExitAttendance.add(exitAttendance!); + entryExitAttendance.add(exitAttendance); } result.add(entryExitAttendance); }); diff --git a/lib/presentation/pages/profile/profile_lectors_page.dart b/lib/presentation/pages/profile/profile_lectors_page.dart index 7df99b87..31d8814f 100644 --- a/lib/presentation/pages/profile/profile_lectors_page.dart +++ b/lib/presentation/pages/profile/profile_lectors_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:material_floating_search_bar/material_floating_search_bar.dart'; +import 'package:material_floating_search_bar_2/material_floating_search_bar_2.dart'; import 'package:rtu_mirea_app/presentation/bloc/employee_bloc/employee_bloc.dart'; import 'package:rtu_mirea_app/presentation/bloc/user_bloc/user_bloc.dart'; import 'package:rtu_mirea_app/presentation/pages/profile/widgets/lector_search_card.dart'; diff --git a/lib/presentation/pages/schedule/widgets/lesson_card.dart b/lib/presentation/pages/schedule/widgets/lesson_card.dart index e8347b3e..6720c00b 100644 --- a/lib/presentation/pages/schedule/widgets/lesson_card.dart +++ b/lib/presentation/pages/schedule/widgets/lesson_card.dart @@ -89,7 +89,7 @@ class LessonCard extends StatelessWidget { ], ), ), - SizedBox( + const SizedBox( width: 8, ), Container( diff --git a/lib/service_locator.dart b/lib/service_locator.dart index 993e3653..5dbe4269 100644 --- a/lib/service_locator.dart +++ b/lib/service_locator.dart @@ -1,7 +1,6 @@ import 'package:device_info_plus/device_info_plus.dart'; import 'package:dio/dio.dart'; import 'package:get_it/get_it.dart'; -import 'package:oauth2_client/oauth2_helper.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:rtu_mirea_app/common/oauth.dart'; import 'package:rtu_mirea_app/common/utils/connection_checker.dart'; @@ -242,7 +241,7 @@ Future setup() async { // Common / Core // External Dependency - final dio = Dio(BaseOptions(receiveTimeout: 20000)); + final dio = Dio(BaseOptions(receiveTimeout: const Duration(seconds: 30))); getIt.registerLazySingleton(() => dio); final sharedPreferences = await SharedPreferences.getInstance(); getIt.registerLazySingleton(() => sharedPreferences); diff --git a/pubspec.yaml b/pubspec.yaml index 0c4c463d..2e13c298 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: # Http client. # See https://pub.dev/packages/dio - dio: ^4.0.0 + dio: ^5.1.2 # Simple no-sql local database. # See https://pub.dev/packages/shared_preferences @@ -51,7 +51,7 @@ dependencies: # SVG rendering widget for Flutter. # See https://pub.dev/packages/flutter_svg - flutter_svg: ^1.0.0 + flutter_svg: ^2.0.5 # Helps to implement value based equality without explicitly # override == and hashCode. @@ -67,13 +67,13 @@ dependencies: photo_view: ^0.14.0 # Animated floating search bar, also known as persistent search - # See https://pub.dev/packages/material_floating_search_bar - material_floating_search_bar: ^0.3.6 + # See https://pub.dev/packages/material_floating_search_bar_2 + material_floating_search_bar_2: ^0.5.0 # Flutter plugin for discovering the state of the network (WiFi & mobile/cellular) # connectivity on Android and iOS. # See https://pub.dev/packages/connectivity_plus - connectivity_plus: ^3.0.3 + connectivity_plus: ^4.0.0 # Functional Programming in Dart # See https://pub.dev/packages/dartz/versions/0.10.0-nullsafety.2 @@ -87,7 +87,7 @@ dependencies: # dates or a range of dates. It has four built-in views that allow quick # navigation to the desired date. # See https://pub.dev/packages/syncfusion_flutter_datepicker - syncfusion_flutter_datepicker: ^20.1.57 + syncfusion_flutter_datepicker: ^21.2.4 # A Flutter widget rendering static HTML and CSS as Flutter widgets. # See https://pub.dev/packages/flutter_html @@ -109,7 +109,7 @@ dependencies: # Creates page that is dismissed by swipe gestures, with Hero style # animations, Inspired by Facebook, Instagram stories. # See https://pub.dev/packages/dismissible_page - dismissible_page: ^1.0.1 + dismissible_page: ^1.0.2 # Instagram stories like UI with rich animations and customizability. # See https://pub.dev/packages/story @@ -121,7 +121,7 @@ dependencies: # Official extension image, support placeholder(loading)/ failed state, # cache network, zoom/pan, photo view, slide out page, # editor(crop,rotate,flip), painting etc. - extended_image: ^6.0.1 + extended_image: ^8.0.1 # A package provides an easy way to add shimmer effect in Flutter project # See https://pub.dev/packages/shimmer @@ -131,13 +131,13 @@ dependencies: # See https://pub.dev/packages/cached_network_image cached_network_image: ^3.2.0 - syncfusion_flutter_datagrid: ^20.1.57 - syncfusion_flutter_core: ^20.1.57 - syncfusion_flutter_sliders: ^20.1.57 - syncfusion_flutter_charts: ^20.1.57 - syncfusion_flutter_gauges: ^20.1.57 + syncfusion_flutter_datagrid: ^21.2.4 + syncfusion_flutter_core: ^21.2.4 + syncfusion_flutter_sliders: ^21.2.4 + syncfusion_flutter_charts: ^21.2.4 + syncfusion_flutter_gauges: ^21.2.4 - auto_route: ^5.0.3 + auto_route: ^5.0.4 url_launcher: ^6.0.17 @@ -182,7 +182,7 @@ dependencies: # Flutter plugin providing detailed information about the device (make, model, etc.), # and Android or iOS version the app is running on. # See https://pub.dev/packages/device_info_plus - device_info_plus: ^8.0.0 + device_info_plus: ^9.0.0 # Provide NFC functionality on Android, iOS & Web, including reading metadata, read & write # NDEF records, and transceive layer 3 & 4 data with NFC tags / cards @@ -193,9 +193,9 @@ dependencies: # See https://pub.dev/packages/app_settings app_settings: ^4.2.0 - sentry_flutter: ^6.20.1 - sentry_logging: ^6.20.1 - sentry_dio: ^6.20.1 + sentry_flutter: ^7.5.2 + sentry_logging: ^7.5.2 + sentry_dio: ^7.5.2 logging: ^1.0.2 # 1000+ beautiful icons to use in you dream project, with all the customization Flutter @@ -213,8 +213,8 @@ dev_dependencies: flutter_lints: ^2.0.1 flutter_test: sdk: flutter - flutter_launcher_icons: ^0.11.0 - auto_route_generator: ^5.0.2 + flutter_launcher_icons: ^0.13.1 + auto_route_generator: ^5.0.3 build_runner: # https://pub.dev/packages/freezed freezed: ^2.1.0+1 From 37ccfa955daed98378b517bc93455baa3ae673ee Mon Sep 17 00:00:00 2001 From: Sergey Dmitriev <51058739+0niel@users.noreply.github.com> Date: Mon, 15 May 2023 21:03:49 +0300 Subject: [PATCH 16/16] fix: Update workflows flutter version --- .github/workflows/main.yml | 2 +- .github/workflows/pre-release.yml | 2 +- .github/workflows/tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 98fa33d7..6d904d5f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.7.0' + flutter-version: '3.10.0' - run: flutter pub get - name: Run Tests run: flutter test diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index bea9766d..24bbd3d9 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Flutter uses: subosito/flutter-action@v2 with: - flutter-version: '3.7.0' + flutter-version: '3.10.0' - run: flutter pub get - name: Run Tests run: flutter test diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3698719f..4dbd72d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: java-version: '12.x' - uses: subosito/flutter-action@v1 with: - flutter-version: '3.7.0' + flutter-version: '3.10.0' channel: 'stable' # or: 'beta', 'dev' or 'master' - run: flutter pub get - run: flutter test ./test/mirea_test.dart