├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── example ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── ui_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── main.dart │ └── src │ │ ├── assets │ │ ├── assets.dart │ │ └── screen_size.dart │ │ └── ui │ │ ├── assignment_card_example.dart │ │ ├── bus_route_widget_example.dart │ │ ├── calendar_example.dart │ │ ├── deadline_card_example.dart │ │ ├── event_card_example.dart │ │ ├── featured_video_card_example.dart │ │ ├── grid_card.dart │ │ ├── highlighted_icon_example.dart │ │ ├── label_card_example.dart │ │ ├── nepali_calendar_example.dart │ │ ├── notice_card_example.dart │ │ ├── outlined_button_example.dart │ │ ├── profile_card_example.dart │ │ ├── routine_card_example.dart │ │ ├── school_location_widget_example.dart │ │ ├── school_toolkit_button.dart │ │ ├── school_toolkit_overlapping_card_example.dart │ │ ├── school_toolkit_role_button_example.dart │ │ ├── school_toolkit_text_field_example.dart │ │ ├── test.dart │ │ ├── ui_catalog.dart │ │ └── video_list_tile_card_example.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── lib ├── school_ui_toolkit.dart └── src │ ├── assignment_card │ ├── assignment_card.dart │ ├── assignment_card_file_element.dart │ └── file_wrapper.dart │ ├── calendar │ ├── calendar.dart │ ├── calendar_date_element.dart │ └── calendar_event.dart │ ├── colors │ └── school_toolkit_colors.dart │ ├── custom_circular_progress │ └── custom_circular_progress.dart │ ├── deadline_card │ └── deadline_card.dart │ ├── event_card │ └── event_card.dart │ ├── featured_video_card │ └── featured_video_card.dart │ ├── font_size │ └── font_size.dart │ ├── highlighted_icon │ └── highlighted_icon.dart │ ├── information_tile_widget │ └── information_tile_widget.dart │ ├── label_card │ └── label_card.dart │ ├── nepali_calendar │ ├── nepali_calendar.dart │ └── nepali_calendar_event.dart │ ├── notice_card │ └── notice_card.dart │ ├── outlined_button │ └── outlined_button.dart │ ├── overlapping_button_card │ └── overlapping_button_card.dart │ ├── profile_card │ └── profile_card.dart │ ├── routine_card │ └── routine_card.dart │ ├── school_location_widget │ └── school_location_widget.dart │ ├── school_toolkit_button │ └── school_toolkit_button.dart │ ├── school_toolkit_card │ └── school_toolkit_card.dart │ ├── school_toolkit_role_button │ └── school_toolkit_role_button.dart │ ├── school_toolkit_text_field │ └── school_toolkit_text_field.dart │ ├── utils │ ├── calendar_utils.dart │ └── screen_size.dart │ └── video_list_tile_card │ └── video_list_tile_card.dart ├── pubspec.lock ├── pubspec.yaml ├── screenshot └── screenshot.png └── test └── school_ui_toolkit_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 8af6b2f038c1172e61d418869363a28dffec3cb4 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # School UI Toolkit 2 | 3 | ## [5.0.0] 4 | 5 | - Breaking change: Added support for Screenutil v3.0.0 an above 6 | 7 | ## [4.0.0] 8 | 9 | - Breaking change: Assignment card now takes in a FileWrapper instead of fileName, fileSize and unSubmitHandler. 10 | 11 | ## [3.1.1] 12 | 13 | - Increased the hitbox size of the calendar element 14 | 15 | ## [3.1.0] 16 | 17 | - Adding info section in profile card 18 | 19 | ## [3.0.1] 20 | 21 | - Made the deadline text scrollable 22 | 23 | ## [3.0.0] 24 | 25 | - Breaking change: Calendar now takes an instance of CalendarEvent. 26 | - Calendar events can now have different color by the use of CalendarEvent. 27 | 28 | ## [2.4.7] 29 | 30 | - Updating ProfileCard: adding onPhoneNumberTap. 31 | 32 | ## [2.4.6] 33 | 34 | - Updating readme: adding example for each widget. 35 | 36 | ## [2.4.5] 37 | 38 | - Cleaned dangling semicolons and dangling imports. 39 | 40 | ## [2.4.4] 41 | 42 | - Bug fix: Fixed setHeight/setWidth being called on null issue. 43 | 44 | ## [2.4.3] 45 | 46 | - Updating pubspec description. 47 | 48 | ## [2.4.2] 49 | 50 | - Moving examples files. 51 | 52 | ## [2.4.1] 53 | 54 | - Updating readme. 55 | 56 | ## [2.4.0] 57 | 58 | - Prepared package for release with over 18 different reuseable widgets. 59 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 BugTheDebugger 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Basic UI Toolkit [Theme: School] 2 | 3 | ![Featured image](https://user-images.githubusercontent.com/9513691/88762659-541ef700-d191-11ea-8492-19acdc90e71c.png) 4 | 5 | ## Descrption 6 | 7 | A basic UI toolkit to get you started with flutter application development. 8 | 9 | **Widget List:** 10 | 11 | - **SchoolToolkitButton:** Button with a busy indicator 12 | - **SchoolLocationWidget:** Card to display school information 13 | - **OutlinedButton:** Button with only outline border with a busy indicator 14 | - **SchoolToolkitTextField:** Custom text field 15 | - **SchoolToolkitRoleButton:** Animated role selection button 16 | - **OverlappingButtonCard:** Overlapping container with a hovering button on the bottom 17 | - **Calendar:** Calendar with two view states: [expanded(shows the entire calendar), shrink(shows only a week)] 18 | - **NepaliCalendar:** Nepali Calendar with two view states: [expanded(shows the entire calendar), shrink(shows only a week)] 19 | - **EventCard:** Displays the time and event 20 | - **RoutineCard:** Displays the Name of class, Subject, Time and Professor. 21 | - **DeadlineCard:** Display a deadline 22 | - **AssignmentCard:** Displays the assignment, deadline, subject with optional parameters to handle upload 23 | - **HighlightedIcon:** Custom container that highlights the icon passed. Takes in an optional busy parameter to display loading indicator. 24 | - **FeaturedVideoCard:** Display a featured video thumbnail with a title. 25 | - **VideoListTileCard:** Display a listtile with thumbnail, title and author. 26 | - **ProfileCard:** Custom profile card. 27 | - **BusRouteWidget:** Display a bus route. Takes in title and a subtitle. 28 | - **NoticeCard:** Custom notice widget that takes in title, subtitle, formatted date string with exposed on tap handler. 29 | - **LabelCard:** Display a custom text label. Takes in label string, width, height, text style and color. 30 | 31 | ## Example 32 | 33 | The example file contains a catalog for all the available widgets. 34 | 35 | ### SchoolToolkitButton 36 | 37 | ```dart 38 | SchoolToolkitButton( 39 | onPressed: () { 40 | // handle on pressed 41 | }, 42 | busy: true, // defaults to false 43 | label: 'Text Label'.toUpperCase(), 44 | ), 45 | ``` 46 | 47 | ![toolkit button](https://user-images.githubusercontent.com/9513691/88875257-aec35c00-d240-11ea-958c-90a26ea70a6f.gif) 48 | 49 | ### SchoolLocationWidget 50 | 51 | ```dart 52 | SchoolLocationWidget( 53 | imageURL: 'http://via.placeholder.com/350x350', 54 | address: 'Area 69', 55 | name: 'Alien High School', 56 | ), 57 | ``` 58 | 59 | ![school location widget](https://user-images.githubusercontent.com/9513691/88875572-34470c00-d241-11ea-946b-f55ce8ff658f.gif) 60 | 61 | ### OutlinedButton 62 | 63 | ```dart 64 | OutlinedButton( 65 | onPressed: () { 66 | // handle on pressed 67 | }, 68 | busy: true, // defaults to false 69 | label: 'Edit Info'.toUpperCase(), 70 | ), 71 | ``` 72 | 73 | ![outlined button](https://user-images.githubusercontent.com/9513691/88875702-76704d80-d241-11ea-91bd-1f220675f221.gif) 74 | 75 | ### SchoolToolkitTextField 76 | 77 | ```dart 78 | SchoolToolkitTextField( 79 | hint: 'Custom text field', 80 | controller: ..., 81 | errorText: ..., 82 | key: ..., 83 | label: ..., 84 | obscureText: ..., 85 | onChanged: ..., 86 | onFieldSubmitted: ..., 87 | onSaved: ..., 88 | onTap: ..., 89 | ), 90 | ``` 91 | 92 | ![custom text field](https://user-images.githubusercontent.com/9513691/88875792-a91a4600-d241-11ea-8ce1-a879c142b3ee.gif) 93 | 94 | ### SchoolToolkitRoleButton 95 | 96 | ```dart 97 | SchoolToolkitRoleButton( 98 | iconData: FontAwesomeIcons.userGraduate, 99 | label: 'Student'.toUpperCase(), 100 | selected: true, // defaults to false 101 | ), 102 | ``` 103 | 104 | ![Role button](https://user-images.githubusercontent.com/9513691/88875948-ef6fa500-d241-11ea-9d48-f730113995ae.gif) 105 | 106 | ### OverlappingButtonCard 107 | 108 | ```dart 109 | OverlappingButtonCard( 110 | width: 354, 111 | height: 589, 112 | label: 'Button label'.toUpperCase(), 113 | onPressed: () { 114 | // handle on presssed 115 | }, 116 | chld: ..., 117 | padding: ..., // optional field 118 | ), 119 | ``` 120 | 121 | ![overlapping button card](https://user-images.githubusercontent.com/9513691/88876043-29d94200-d242-11ea-972d-1a137c4369f8.gif) 122 | 123 | ### Calendar 124 | 125 | ```dart 126 | Calendar( 127 | startExpanded: true, // set this to false if you need the calendar to be built shrinked (show only active week) 128 | onDateSelected: (date) { 129 | print('Selected date: $date'); 130 | // handle date selection 131 | }, 132 | onNextMonth: (date) { 133 | print('Next month: $date'); 134 | // handle on next month. 135 | }, 136 | onPreviousMonth: (date) { 137 | print('Previous month: $date'); 138 | // handle previous month 139 | }, 140 | calendarEvents: [ 141 | CalendarEvent.fromDateTime( 142 | dateTime: DateTime.now(), 143 | color: SchoolToolkitColors.red, 144 | ), 145 | ], 146 | recurringEventsByDay: [ 147 | CalendarEvent.fromDateTime( 148 | dateTime: DateTime(2020, 7, 1), 149 | color: SchoolToolkitColors.blue, 150 | ), 151 | CalendarEvent.fromDateTime( 152 | dateTime: DateTime(2020, 7, 2), 153 | color: SchoolToolkitColors.red, 154 | ), 155 | ], 156 | recurringEventsByWeekday: [ 157 | CalendarEvent.fromWeekDay( 158 | weekDay: DateTime.sunday, 159 | color: SchoolToolkitColors.green, 160 | holiday: true, 161 | ), 162 | ], 163 | ), 164 | ``` 165 | 166 | ![calendar](https://user-images.githubusercontent.com/9513691/88876207-80df1700-d242-11ea-8437-963039795c8f.gif) 167 | 168 | ### NepaliCalendar 169 | 170 | **Important:** Please note the date returned by the NepaliCalendar methods use the NepaliDateTime instead of DateTime class 171 | 172 | ```dart 173 | NepaliCalendar( 174 | startExpanded: true, // set this to false if you need the calendar to be built shrinked (show only active week) 175 | onDateSelected: (date) { 176 | print('Selected date: $date'); 177 | // handle date selection 178 | }, 179 | onNextMonth: (date) { 180 | print('Next month: $date'); 181 | // handle on next month. 182 | }, 183 | onPreviousMonth: (date) { 184 | print('Previous month: $date'); 185 | // handle previous month 186 | }, 187 | calendarEvents: [ 188 | NepaliCalendarEvent.fromDateTime( 189 | dateTime: NepaliDateTime.now(), 190 | color: SchoolToolkitColors.red, 191 | ), 192 | ], 193 | recurringEventsByDay: [ 194 | NepaliCalendarEvent.fromDateTime( 195 | dateTime: NepaliDateTime(2020, 7, 1), 196 | color: SchoolToolkitColors.green, 197 | ), 198 | ], 199 | recurringEventsByWeekday: [ 200 | NepaliCalendarEvent.fromWeekDay( 201 | weekDay: 1, 202 | color: SchoolToolkitColors.brown, 203 | ), 204 | ], 205 | ), 206 | ``` 207 | 208 | ![nepali calendar](https://user-images.githubusercontent.com/9513691/88877688-d832b680-d245-11ea-8c45-91276dd57fd1.gif) 209 | 210 | ### EventCard 211 | 212 | ```dart 213 | EventCard( 214 | event: 'Sports week Class 3 - Class 10', 215 | time: '1:00 - 3:00 PM', 216 | secondaryColor: SchoolToolkitColors.lighterGrey, 217 | primaryColor: SchoolToolkitColors.grey, 218 | ), 219 | ``` 220 | 221 | ![event card](https://user-images.githubusercontent.com/9513691/88877828-28aa1400-d246-11ea-8533-07d183c8876c.gif) 222 | 223 | ### RoutineCard 224 | 225 | ```dart 226 | RoutineCard( 227 | classTopic: 'Fundamentals of Mathematics', 228 | classType: 'Theory Class', 229 | subject: 'Mathematics', 230 | professor: 'Mr. Ram Prasad Yadav', 231 | time: '8:00 - 9:00 AM', 232 | ), 233 | ``` 234 | 235 | ![routine card](https://user-images.githubusercontent.com/9513691/88877905-542cfe80-d246-11ea-9f82-bae4ce51956c.gif) 236 | 237 | ### DeadlineCard 238 | 239 | ```dart 240 | DeadlineCard( 241 | deadline: DateTime.now(), 242 | secondaryColor: ..., // optional 243 | primaryColor: ..., // optional 244 | ), 245 | ``` 246 | 247 | ![deadline card](https://user-images.githubusercontent.com/9513691/88877949-7161cd00-d246-11ea-823d-0962184a6175.gif) 248 | 249 | ### AssignmentCard 250 | 251 | ```dart 252 | AssignmentCard( 253 | // optional, if deadline is not passed, deadline card will not be shown 254 | deadline: DateTime.now(), 255 | question: 256 | 'Chapter 3 - Q.no 1 - Q.no 10 (Please submit in word format with names attached)', 257 | subject: 'Mathematics', 258 | teacher: 'Dr. Stone', 259 | deadlineBackgroundColor: SchoolToolkitColors.red, 260 | onUploadHandler: () { 261 | print('Handle upload'); 262 | // optional, if null is passsed upload button will be hidden 263 | }, 264 | // optional 265 | fileList: [ 266 | FileWrapper( 267 | fileName: 'assignment-information.pdf', 268 | fileSize: '11.5 KB', 269 | onTap: () { 270 | print('Handle on tap'); 271 | }, 272 | ), 273 | ], 274 | ), 275 | 276 | ``` 277 | 278 | ![assignment card](https://user-images.githubusercontent.com/9513691/88878024-a66e1f80-d246-11ea-973d-c1c989b5fc67.gif) 279 | 280 | ### HighlightedIcon 281 | 282 | ```dart 283 | HighlightedIcon( 284 | icon: Icons.class_, 285 | busy: true, // optional. If busy is set to true, displays a loading indicator instead of the icons passed. 286 | ), 287 | ``` 288 | 289 | ![highlighted icon](https://user-images.githubusercontent.com/9513691/88878248-36ac6480-d247-11ea-9a45-9100fa874c6f.gif) 290 | 291 | ### FeaturedVideoCard 292 | 293 | ```dart 294 | FeaturedVideoCard( 295 | title: 'Professor KPR Lecture - Neuroscience Lecture 32', 296 | thumbnailURL: 297 | 'https://www.teachermagazine.com.au/files/ce-image/cache/1c03ffc10fd4ef6a/Cognitive_load_theory_-_teaching_strategies_855_513_60.jpg', 298 | onTap: () { 299 | print('Handling on tap'); 300 | }, 301 | ), 302 | ``` 303 | 304 | ![featured video card](https://user-images.githubusercontent.com/9513691/88878327-707d6b00-d247-11ea-9fe9-2a84c37e364d.gif) 305 | 306 | ### VideoListTileCard 307 | 308 | ```dart 309 | VideoListTileCard( 310 | author: 'Dr. Richard', 311 | title: 'The science of gamma radiation.', 312 | margin: EdgeInsets.all(5.0), 313 | thumbnailURL: 314 | 'https://www.teachermagazine.com.au/files/ce-image/cache/1c03ffc10fd4ef6a/Cognitive_load_theory_-_teaching_strategies_855_513_60.jpg', 315 | color: ..., // Optional. use to set the background color of the tile 316 | onTap: ..., // Optional. use to handle on tap 317 | padding: ..., // Optional. use to add desired padding 318 | showIcon: ..., // Optional. set this to flase if you don't want the icon besides the author. 319 | ), 320 | ``` 321 | 322 | ![video list tile card](https://user-images.githubusercontent.com/9513691/88878406-a3bffa00-d247-11ea-9407-9023189f7db7.gif) 323 | 324 | ### ProfileCard 325 | 326 | ```dart 327 | ProfileCard( 328 | imageURL: 329 | 'https://cdn1.iconfinder.com/data/icons/female-avatars-vol-1/256/female-portrait-avatar-profile-woman-sexy-afro-2-512.png', 330 | email: 'email@email.com', 331 | name: 'Dr. Steven Stones', 332 | phoneNumber: '9843XXXXXX', 333 | post: 'Sorceror', 334 | margin: EdgeInsets.all(5.0), // optional 335 | ), 336 | ``` 337 | 338 | ![profile card](https://user-images.githubusercontent.com/9513691/88878633-13ce8000-d248-11ea-8fb2-9f3435c884a7.gif) 339 | 340 | ### BusRouteWidget 341 | 342 | ```dart 343 | InformationTileWidget( 344 | margin: EdgeInsets.all(5.0), 345 | icon: FontAwesomeIcons.bus, 346 | biggerTitle: true, 347 | title: 'Bus Route 1', 348 | subTitle: 'Tinkune-Dhobhighat-NewRoad', 349 | iconColor: Colors.white, 350 | rounded: false, 351 | iconBackgroundColor: SchoolToolkitColors.blue, 352 | onTap: ..., // Optional. 353 | ), 354 | ``` 355 | 356 | ![bus route widget](https://user-images.githubusercontent.com/9513691/88878739-47110f00-d248-11ea-93d6-42661c37d324.gif) 357 | 358 | ### NoticeCard 359 | 360 | ```dart 361 | NoticeCard( 362 | date: DateFormat('yyyy-MM-dd').format(DateTime.now()), 363 | title: 'School Reopens', 364 | subTitile: 365 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', 366 | onTap: () { 367 | // Handle readmore 368 | }, 369 | ), 370 | ``` 371 | 372 | ![notice card](https://user-images.githubusercontent.com/9513691/88878862-948d7c00-d248-11ea-8dc3-58c390201458.gif) 373 | 374 | ### LabelCard 375 | 376 | ```dart 377 | LabelCard( 378 | label: 'Text label', 379 | color: SchoolToolkitColors.red, 380 | height: ..., // Optional 381 | width: ..., // Optional 382 | textStyle: ..., // Optional 383 | ), 384 | ``` 385 | 386 | ![label card](https://user-images.githubusercontent.com/9513691/88878914-b981ef00-d248-11ea-8a0e-a316b37d8948.gif) 387 | 388 | ## Support 389 | 390 | Like what you see? Support me by buying me a coffee :) 391 | 392 | Buy Me A Coffee 393 | 394 | ## License 395 | 396 | `MIT License` 397 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # ui_example 2 | 3 | A new Flutter project. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 28 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.ui_example" 42 | minSdkVersion 16 43 | targetSdkVersion 28 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 9 | 13 | 20 | 24 | 28 | 33 | 37 | 38 | 39 | 40 | 41 | 42 | 44 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/ui_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.ui_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:3.5.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Flutter Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | include ':app' 6 | 7 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 8 | def properties = new Properties() 9 | 10 | assert localPropertiesFile.exists() 11 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 12 | 13 | def flutterSdkPath = properties.getProperty("flutter.sdk") 14 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 15 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 16 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | ui_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_fonts/google_fonts.dart'; 3 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 4 | import 'package:ui_example/src/assets/assets.dart'; 5 | import 'package:ui_example/src/ui/ui_catalog.dart'; 6 | 7 | void main() => runApp(UIExample()); 8 | 9 | class UIExample extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | title: 'School UI Toolkit', 14 | theme: ThemeData( 15 | primaryColor: SchoolToolkitColors.blue, 16 | fontFamily: GoogleFonts.notoSans().fontFamily, 17 | ), 18 | builder: (context, child) { 19 | ScreenUtil.init( 20 | context, 21 | designSize: Size( 22 | ScreenSize.width, 23 | ScreenSize.height, 24 | ), 25 | allowFontScaling: true, 26 | ); 27 | return child; 28 | }, 29 | home: UICatalog(), 30 | ); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /example/lib/src/assets/assets.dart: -------------------------------------------------------------------------------- 1 | export 'screen_size.dart'; 2 | export 'package:flutter_screenutil/screenutil.dart'; 3 | export 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | -------------------------------------------------------------------------------- /example/lib/src/assets/screen_size.dart: -------------------------------------------------------------------------------- 1 | class ScreenSize { 2 | static const double width = 414.0; 3 | static const double height = 896.0; 4 | } 5 | -------------------------------------------------------------------------------- /example/lib/src/ui/assignment_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class AssignmentCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Assignment card'), 11 | centerTitle: true, 12 | ), 13 | body: Padding( 14 | padding: const EdgeInsets.all(8.0), 15 | child: Center( 16 | child: ListView( 17 | children: [ 18 | Padding( 19 | padding: EdgeInsets.all(ScreenUtil().setWidth(8.0)), 20 | child: AssignmentCard( 21 | deadline: DateTime.now(), 22 | question: 23 | 'Chapter 3 - Q.no 1 - Q.no 10 (Please submit in word format with names attached)', 24 | subject: 'Mathematics', 25 | teacher: 'Dr. Stone', 26 | onUploadHandler: () {}, 27 | ), 28 | ), 29 | Padding( 30 | padding: EdgeInsets.all(ScreenUtil().setWidth(8.0)), 31 | child: AssignmentCard( 32 | deadline: DateTime.now(), 33 | question: 34 | 'Chapter 3 - Q.no 1 - Q.no 10 (Please submit in word format with names attached)', 35 | subject: 'Mathematics', 36 | teacher: 'Dr. Stone', 37 | deadlineBackgroundColor: SchoolToolkitColors.darkYellow, 38 | onUploadHandler: () {}, 39 | ), 40 | ), 41 | Padding( 42 | padding: EdgeInsets.all(ScreenUtil().setWidth(8.0)), 43 | child: AssignmentCard( 44 | deadline: DateTime.now(), 45 | question: 46 | 'Chapter 3 - Q.no 1 - Q.no 10 (Please submit in word format with names attached)', 47 | subject: 'Mathematics', 48 | teacher: 'Dr. Stone', 49 | deadlineBackgroundColor: SchoolToolkitColors.red, 50 | onUploadHandler: () { 51 | print('Handle upload'); 52 | }, 53 | fileList: [ 54 | FileWrapper( 55 | fileName: 'assignment-information.pdf', 56 | fileSize: '11.5 KB', 57 | onTap: () { 58 | print('Handle on tap'); 59 | }, 60 | ), 61 | FileWrapper( 62 | fileName: 'assignment-information-2.pdf', 63 | fileSize: '11.5 KB', 64 | onTap: () { 65 | print('Handle on tap'); 66 | }, 67 | ), 68 | ], 69 | ), 70 | ), 71 | ], 72 | ), 73 | ), 74 | ), 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /example/lib/src/ui/bus_route_widget_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class BusRouteWidgetExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Bus Route Widget'), 11 | centerTitle: true, 12 | ), 13 | body: Padding( 14 | padding: const EdgeInsets.all(8.0), 15 | child: Center( 16 | child: ListView( 17 | children: [ 18 | Divider(), 19 | InformationTileWidget( 20 | margin: EdgeInsets.all(5.0), 21 | icon: FontAwesomeIcons.bus, 22 | biggerTitle: true, 23 | title: 'Bus Route 1', 24 | subTitle: 'Tinkune-Dhobhighat-NewRoad', 25 | iconColor: Colors.white, 26 | rounded: false, 27 | iconBackgroundColor: SchoolToolkitColors.blue, 28 | ), 29 | Divider(), 30 | InformationTileWidget( 31 | margin: EdgeInsets.all(5.0), 32 | icon: FontAwesomeIcons.bus, 33 | biggerTitle: true, 34 | title: 'Bus Route 2', 35 | subTitle: 'Tinkune-Dhobhighat-NewRoad', 36 | iconColor: Colors.white, 37 | rounded: false, 38 | iconBackgroundColor: SchoolToolkitColors.blue, 39 | ), 40 | Divider(), 41 | InformationTileWidget( 42 | margin: EdgeInsets.all(5.0), 43 | icon: FontAwesomeIcons.bus, 44 | biggerTitle: true, 45 | title: 'Bus Route 3', 46 | subTitle: 'Tinkune-Dhobhighat-NewRoad', 47 | iconColor: Colors.white, 48 | rounded: false, 49 | iconBackgroundColor: SchoolToolkitColors.blue, 50 | ), 51 | Divider(), 52 | ], 53 | ), 54 | ), 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /example/lib/src/ui/calendar_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class CalendarExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | backgroundColor: Colors.white, 9 | appBar: AppBar( 10 | title: Text('Calendar'), 11 | centerTitle: true, 12 | ), 13 | body: Calendar( 14 | startExpanded: true, 15 | onDateSelected: (date) { 16 | print('Selected date: $date'); 17 | }, 18 | onNextMonth: (date) { 19 | print('Next month: $date'); 20 | }, 21 | onPreviousMonth: (date) { 22 | print('Previous month: $date'); 23 | }, 24 | calendarEvents: [ 25 | CalendarEvent.fromDateTime( 26 | dateTime: DateTime.now(), 27 | color: SchoolToolkitColors.red, 28 | ), 29 | ], 30 | recurringEventsByDay: [ 31 | CalendarEvent.fromDateTime( 32 | dateTime: DateTime(2020, 7, 1), 33 | color: SchoolToolkitColors.blue, 34 | ), 35 | CalendarEvent.fromDateTime( 36 | dateTime: DateTime(2020, 7, 2), 37 | color: SchoolToolkitColors.red, 38 | ), 39 | ], 40 | recurringEventsByWeekday: [ 41 | CalendarEvent.fromWeekDay( 42 | weekDay: DateTime.sunday, 43 | color: SchoolToolkitColors.green, 44 | holiday: true, 45 | ), 46 | ], 47 | ), 48 | ); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /example/lib/src/ui/deadline_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class DeadlineCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Deadline card'), 11 | centerTitle: true, 12 | ), 13 | body: Padding( 14 | padding: const EdgeInsets.all(8.0), 15 | child: Center( 16 | child: Column( 17 | mainAxisAlignment: MainAxisAlignment.center, 18 | crossAxisAlignment: CrossAxisAlignment.center, 19 | children: [ 20 | DeadlineCard( 21 | deadline: DateTime.now(), 22 | ), 23 | SizedBox( 24 | height: ScreenUtil().setHeight(5), 25 | ), 26 | DeadlineCard( 27 | deadline: DateTime.now(), 28 | secondaryColor: SchoolToolkitColors.darkYellow, 29 | ), 30 | SizedBox( 31 | height: ScreenUtil().setHeight(5), 32 | ), 33 | DeadlineCard( 34 | deadline: DateTime.now(), 35 | secondaryColor: SchoolToolkitColors.red, 36 | ), 37 | ], 38 | ), 39 | ), 40 | ), 41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /example/lib/src/ui/event_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class EventCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Event card'), 11 | centerTitle: true, 12 | ), 13 | body: Center( 14 | child: Column( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | children: [ 17 | EventCard( 18 | event: 'Sports week Class 3 - Class 10', 19 | time: '1:00 - 3:00 PM', 20 | ), 21 | SizedBox( 22 | height: ScreenUtil().setHeight(10), 23 | ), 24 | EventCard( 25 | event: 'Sports week Class 3 - Class 10', 26 | time: '1:00 - 3:00 PM', 27 | primaryColor: SchoolToolkitColors.green, 28 | secondaryColor: SchoolToolkitColors.lightGreen, 29 | ), 30 | SizedBox( 31 | height: ScreenUtil().setHeight(10), 32 | ), 33 | EventCard( 34 | event: 'Sports week Class 3 - Class 10', 35 | time: '1:00 - 3:00 PM', 36 | secondaryColor: SchoolToolkitColors.lighterGrey, 37 | primaryColor: SchoolToolkitColors.grey, 38 | ), 39 | ], 40 | ), 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/lib/src/ui/featured_video_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class FeaturedVideoCardExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('Featured Video Card'), 10 | centerTitle: true, 11 | ), 12 | body: Center( 13 | child: FeaturedVideoCard( 14 | title: 'Professor KPR Lecture - Neuroscience Lecture 32', 15 | thumbnailURL: 16 | 'https://www.teachermagazine.com.au/files/ce-image/cache/1c03ffc10fd4ef6a/Cognitive_load_theory_-_teaching_strategies_855_513_60.jpg', 17 | onTap: () { 18 | print('Handling on tap'); 19 | }, 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/lib/src/ui/grid_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class GridCard extends StatelessWidget { 6 | final String title; 7 | final Widget screen; 8 | 9 | const GridCard({ 10 | Key key, 11 | this.title, 12 | @required this.screen, 13 | }) : super(key: key); 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return GestureDetector( 18 | onTap: () { 19 | Navigator.of(context).push( 20 | MaterialPageRoute( 21 | builder: (context) => screen, 22 | ), 23 | ); 24 | }, 25 | child: Container( 26 | margin: EdgeInsets.all(5.0), 27 | padding: EdgeInsets.all(10.0), 28 | alignment: Alignment.center, 29 | width: ScreenUtil().setWidth(200), 30 | height: ScreenUtil().setHeight(100), 31 | color: SchoolToolkitColors.blue, 32 | child: Text( 33 | '$title', 34 | textAlign: TextAlign.center, 35 | style: TextStyle( 36 | color: Colors.white, 37 | fontWeight: FontWeight.w500, 38 | fontSize: 16.0, 39 | ), 40 | ), 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/lib/src/ui/highlighted_icon_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class HighlightedIconExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('Highlighted Icon'), 10 | centerTitle: true, 11 | ), 12 | body: Center( 13 | child: Column( 14 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 15 | children: [ 16 | HighlightedIcon( 17 | icon: Icons.class_, 18 | busy: true, 19 | ), 20 | HighlightedIcon( 21 | icon: Icons.class_, 22 | ), 23 | ], 24 | ), 25 | ), 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /example/lib/src/ui/label_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class LabelCardExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('Label Card'), 10 | centerTitle: true, 11 | ), 12 | body: Padding( 13 | padding: const EdgeInsets.all(8.0), 14 | child: Center( 15 | child: LabelCard( 16 | label: 'Text label', 17 | color: SchoolToolkitColors.red, 18 | ), 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/lib/src/ui/nepali_calendar_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:nepali_date_picker/nepali_date_picker.dart'; 3 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 4 | 5 | class NepaliCalendarExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | print(DateTime.sunday); 9 | return Scaffold( 10 | backgroundColor: Colors.white, 11 | appBar: AppBar( 12 | title: Text('Nepali Calendar'), 13 | centerTitle: true, 14 | ), 15 | body: NepaliCalendar( 16 | startExpanded: true, 17 | onDateSelected: (date) { 18 | print('Selected date: $date'); 19 | }, 20 | onNextMonth: (date) { 21 | print('Next month: $date'); 22 | }, 23 | onPreviousMonth: (date) { 24 | print('Previous month: $date'); 25 | }, 26 | calendarEvents: [ 27 | NepaliCalendarEvent.fromDateTime( 28 | dateTime: NepaliDateTime.now(), 29 | color: SchoolToolkitColors.red, 30 | ), 31 | ], 32 | recurringEventsByDay: [ 33 | NepaliCalendarEvent.fromDateTime( 34 | dateTime: NepaliDateTime(2020, 7, 1), 35 | color: SchoolToolkitColors.green, 36 | ), 37 | ], 38 | recurringEventsByWeekday: [ 39 | NepaliCalendarEvent.fromWeekDay( 40 | weekDay: 1, 41 | color: SchoolToolkitColors.brown, 42 | ), 43 | ], 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /example/lib/src/ui/notice_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:intl/intl.dart'; 3 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 4 | 5 | class NoticeCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Notice Card'), 11 | centerTitle: true, 12 | ), 13 | body: Padding( 14 | padding: const EdgeInsets.all(8.0), 15 | child: Center( 16 | child: NoticeCard( 17 | date: DateFormat('yyyy-MM-dd').format(DateTime.now()), 18 | title: 'School Reopens', 19 | subTitile: 20 | 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.', 21 | onTap: () { 22 | // Handle readmore 23 | }, 24 | ), 25 | ), 26 | ), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/lib/src/ui/outlined_button_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart' as toolkit; 3 | 4 | class OutlinedButtonExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('Outlined Button'), 10 | centerTitle: true, 11 | ), 12 | body: Padding( 13 | padding: const EdgeInsets.all(8.0), 14 | child: Center( 15 | child: toolkit.OutlinedButton( 16 | label: 'Edit Info'.toUpperCase(), 17 | onPressed: () {}, 18 | busy: true, 19 | ), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/lib/src/ui/profile_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class ProfileCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Profile Card'), 11 | centerTitle: true, 12 | ), 13 | body: Padding( 14 | padding: EdgeInsets.all( 15 | ScreenUtil().setWidth(12.0), 16 | ), 17 | child: ListView( 18 | children: [ 19 | ProfileCard( 20 | imageURL: 21 | 'https://cdn1.iconfinder.com/data/icons/female-avatars-vol-1/256/female-portrait-avatar-profile-woman-sexy-afro-2-512.png', 22 | email: 'email@email.com', 23 | name: 'Dr. Steven Stones', 24 | phoneNumber: '9843XXXXXX', 25 | post: 'Sorceror', 26 | margin: EdgeInsets.all(5.0), 27 | ), 28 | ProfileCard( 29 | imageURL: 30 | 'https://cdn1.iconfinder.com/data/icons/female-avatars-vol-1/256/female-portrait-avatar-profile-woman-sexy-afro-2-512.png', 31 | email: 'email@email.com', 32 | name: 'Dr. Steven Stones', 33 | phoneNumber: '9843XXXXXX', 34 | post: 'Sorceror', 35 | margin: EdgeInsets.all(5.0), 36 | ), 37 | ], 38 | ), 39 | ), 40 | ); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /example/lib/src/ui/routine_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class RoutineCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | appBar: AppBar( 10 | title: Text('Routine Card'), 11 | centerTitle: true, 12 | ), 13 | body: Center( 14 | child: Column( 15 | mainAxisAlignment: MainAxisAlignment.center, 16 | crossAxisAlignment: CrossAxisAlignment.center, 17 | children: [ 18 | RoutineCard( 19 | classTopic: 'Fundamentals of Mathematics', 20 | classType: 'Theory Class', 21 | subject: 'Mathematics', 22 | professor: 'Mr. Ram Prasad Yadav', 23 | time: '8:00 - 9:00 AM', 24 | ), 25 | SizedBox( 26 | height: ScreenUtil().setHeight(10), 27 | ), 28 | RoutineCard( 29 | classTopic: 'Pully chain', 30 | classType: 'Practical Class', 31 | subject: 'Physics', 32 | professor: 'Mr. Ram Prasad Yadav', 33 | time: '10:00 - 11:00 AM', 34 | ), 35 | ], 36 | ), 37 | ), 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /example/lib/src/ui/school_location_widget_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class SchoolLocationWidgetExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('School location widget'), 10 | centerTitle: true, 11 | ), 12 | body: Center( 13 | child: SchoolLocationWidget( 14 | imageURL: 'http://via.placeholder.com/350x350', 15 | address: 16 | 'Sallaghari, Bhaktapur asdf ad asdf asdf asdf asdf asdf asdf asdf ', 17 | name: 18 | 'Nesfield int college asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf adf ', 19 | ), 20 | ), 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /example/lib/src/ui/school_toolkit_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class SchoolToolkitButtonExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('School toolkit button widget'), 10 | centerTitle: true, 11 | ), 12 | body: Padding( 13 | padding: const EdgeInsets.all(8.0), 14 | child: Center( 15 | child: SchoolToolkitButton( 16 | onPressed: () {}, 17 | busy: true, 18 | label: 'Text Label'.toUpperCase(), 19 | ), 20 | ), 21 | ), 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/lib/src/ui/school_toolkit_overlapping_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class SchoolToolkitOverlappingButtonCardExample extends StatelessWidget { 6 | @override 7 | Widget build(BuildContext context) { 8 | return Scaffold( 9 | backgroundColor: SchoolToolkitColors.blue, 10 | appBar: AppBar( 11 | title: Text('School toolkit overlapping button card'), 12 | centerTitle: true, 13 | ), 14 | body: Padding( 15 | padding: const EdgeInsets.all(8.0), 16 | child: Center( 17 | child: OverlappingButtonCard( 18 | width: ScreenUtil().setWidth(354), 19 | height: ScreenUtil().setHeight(589), 20 | label: 'Button label'.toUpperCase(), 21 | onPressed: () {}, 22 | ), 23 | ), 24 | ), 25 | ); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /example/lib/src/ui/school_toolkit_role_button_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | import 'package:ui_example/src/assets/assets.dart'; 4 | 5 | class SchoolToolkitRoleButtonExample extends StatefulWidget { 6 | @override 7 | _SchoolToolkitRoleButtonExampleState createState() => 8 | _SchoolToolkitRoleButtonExampleState(); 9 | } 10 | 11 | class _SchoolToolkitRoleButtonExampleState 12 | extends State { 13 | bool _selected = false; 14 | 15 | @override 16 | Widget build(BuildContext context) { 17 | return Scaffold( 18 | appBar: AppBar( 19 | title: Text('School toolkit role button'), 20 | centerTitle: true, 21 | ), 22 | body: Padding( 23 | padding: const EdgeInsets.all(8.0), 24 | child: Center( 25 | child: GestureDetector( 26 | onTap: () { 27 | setState(() { 28 | _selected = !_selected; 29 | }); 30 | }, 31 | child: SchoolToolkitRoleButton( 32 | iconData: FontAwesomeIcons.userGraduate, 33 | label: 'Student'.toUpperCase(), 34 | selected: _selected, 35 | ), 36 | ), 37 | ), 38 | ), 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /example/lib/src/ui/school_toolkit_text_field_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class SchoolToolkitTextFieldExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('School toolkit text field'), 10 | centerTitle: true, 11 | ), 12 | body: Padding( 13 | padding: const EdgeInsets.all(8.0), 14 | child: Center( 15 | child: SchoolToolkitTextField( 16 | hint: 'Custom text field', 17 | ), 18 | ), 19 | ), 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /example/lib/src/ui/test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class Test extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return ListView( 8 | children: [ 9 | ProfileCard( 10 | imageURL: 11 | 'https://cdn1.iconfinder.com/data/icons/female-avatars-vol-1/256/female-portrait-avatar-profile-woman-sexy-afro-2-512.png', 12 | email: 'email@email.com', 13 | name: 'Dr. Steven Stones', 14 | phoneNumber: '9843XXXXXX', 15 | post: 'Sorceror', 16 | margin: EdgeInsets.all(5.0), 17 | ), 18 | ], 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /example/lib/src/ui/ui_catalog.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:ui_example/src/assets/assets.dart'; 3 | import 'package:ui_example/src/ui/assignment_card_example.dart'; 4 | import 'package:ui_example/src/ui/bus_route_widget_example.dart'; 5 | import 'package:ui_example/src/ui/calendar_example.dart'; 6 | import 'package:ui_example/src/ui/deadline_card_example.dart'; 7 | import 'package:ui_example/src/ui/event_card_example.dart'; 8 | import 'package:ui_example/src/ui/featured_video_card_example.dart'; 9 | import 'package:ui_example/src/ui/grid_card.dart'; 10 | import 'package:ui_example/src/ui/highlighted_icon_example.dart'; 11 | import 'package:ui_example/src/ui/label_card_example.dart'; 12 | import 'package:ui_example/src/ui/nepali_calendar_example.dart'; 13 | import 'package:ui_example/src/ui/notice_card_example.dart'; 14 | import 'package:ui_example/src/ui/outlined_button_example.dart'; 15 | import 'package:ui_example/src/ui/profile_card_example.dart'; 16 | import 'package:ui_example/src/ui/routine_card_example.dart'; 17 | import 'package:ui_example/src/ui/school_location_widget_example.dart'; 18 | import 'package:ui_example/src/ui/school_toolkit_button.dart'; 19 | import 'package:ui_example/src/ui/school_toolkit_overlapping_card_example.dart'; 20 | import 'package:ui_example/src/ui/school_toolkit_role_button_example.dart'; 21 | import 'package:ui_example/src/ui/school_toolkit_text_field_example.dart'; 22 | import 'package:ui_example/src/ui/video_list_tile_card_example.dart'; 23 | 24 | class UICatalog extends StatelessWidget { 25 | @override 26 | Widget build(BuildContext context) { 27 | return Scaffold( 28 | appBar: AppBar( 29 | title: Text('UI Catalog'), 30 | centerTitle: true, 31 | ), 32 | body: GridView( 33 | padding: EdgeInsets.all( 34 | ScreenUtil().setWidth(10), 35 | ), 36 | gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( 37 | crossAxisCount: 2, 38 | childAspectRatio: 1.0, 39 | ), 40 | children: [ 41 | GridCard( 42 | title: 'School location widget', 43 | screen: SchoolLocationWidgetExample(), 44 | ), 45 | GridCard( 46 | title: 'School toolkit button widget', 47 | screen: SchoolToolkitButtonExample(), 48 | ), 49 | GridCard( 50 | title: 'Outlined Button', 51 | screen: OutlinedButtonExample(), 52 | ), 53 | GridCard( 54 | title: 'School toolkit text field', 55 | screen: SchoolToolkitTextFieldExample(), 56 | ), 57 | GridCard( 58 | title: 'School toolkit role button', 59 | screen: SchoolToolkitRoleButtonExample(), 60 | ), 61 | GridCard( 62 | title: 'School toolkit overlapping button card', 63 | screen: SchoolToolkitOverlappingButtonCardExample(), 64 | ), 65 | GridCard( 66 | title: 'Calendar', 67 | screen: CalendarExample(), 68 | ), 69 | GridCard( 70 | title: 'Nepali Calendar', 71 | screen: NepaliCalendarExample(), 72 | ), 73 | GridCard( 74 | title: 'Event Card', 75 | screen: EventCardExample(), 76 | ), 77 | GridCard( 78 | title: 'Routine Card', 79 | screen: RoutineCardExample(), 80 | ), 81 | GridCard( 82 | title: 'Deadline Card', 83 | screen: DeadlineCardExample(), 84 | ), 85 | GridCard( 86 | title: 'Assignment Card', 87 | screen: AssignmentCardExample(), 88 | ), 89 | GridCard( 90 | title: 'Highlighted Icon', 91 | screen: HighlightedIconExample(), 92 | ), 93 | GridCard( 94 | title: 'Featured Video Card', 95 | screen: FeaturedVideoCardExample(), 96 | ), 97 | GridCard( 98 | title: 'Video List Tile Card', 99 | screen: VideoListtileCardExample(), 100 | ), 101 | GridCard( 102 | title: 'Profile Card', 103 | screen: ProfileCardExample(), 104 | ), 105 | GridCard( 106 | title: 'Bus Route Widget', 107 | screen: BusRouteWidgetExample(), 108 | ), 109 | GridCard( 110 | title: 'Notice Card', 111 | screen: NoticeCardExample(), 112 | ), 113 | GridCard( 114 | title: 'Label Card', 115 | screen: LabelCardExample(), 116 | ), 117 | ], 118 | ), 119 | ); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /example/lib/src/ui/video_list_tile_card_example.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 3 | 4 | class VideoListtileCardExample extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('Video List Tile Card'), 10 | centerTitle: true, 11 | ), 12 | body: Padding( 13 | padding: const EdgeInsets.all(8.0), 14 | child: Center( 15 | child: ListView( 16 | children: [ 17 | VideoListTileCard( 18 | author: 'Dr. Stone', 19 | title: 'The dawn of the mankind.', 20 | margin: EdgeInsets.all(5.0), 21 | thumbnailURL: 22 | 'https://www.teachermagazine.com.au/files/ce-image/cache/1c03ffc10fd4ef6a/Cognitive_load_theory_-_teaching_strategies_855_513_60.jpg', 23 | ), 24 | VideoListTileCard( 25 | author: 'Dr. Richard', 26 | title: 'The science of gamma radiation.', 27 | margin: EdgeInsets.all(5.0), 28 | thumbnailURL: 29 | 'https://www.teachermagazine.com.au/files/ce-image/cache/1c03ffc10fd4ef6a/Cognitive_load_theory_-_teaching_strategies_855_513_60.jpg', 30 | ), 31 | VideoListTileCard( 32 | author: 'Dr. Strange', 33 | title: 'Dormamu I\'m coming for you', 34 | margin: EdgeInsets.all(5.0), 35 | thumbnailURL: 36 | 'https://www.teachermagazine.com.au/files/ce-image/cache/1c03ffc10fd4ef6a/Cognitive_load_theory_-_teaching_strategies_855_513_60.jpg', 37 | ), 38 | ], 39 | ), 40 | ), 41 | ), 42 | ); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.5.0-nullsafety.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0-nullsafety.1" 18 | cached_network_image: 19 | dependency: "direct main" 20 | description: 21 | name: cached_network_image 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.3" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.0-nullsafety.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.2.0-nullsafety.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0-nullsafety.1" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0-nullsafety.3" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.5" 67 | cupertino_icons: 68 | dependency: "direct main" 69 | description: 70 | name: cupertino_icons 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "0.1.3" 74 | fake_async: 75 | dependency: transitive 76 | description: 77 | name: fake_async 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "1.2.0-nullsafety.1" 81 | ffi: 82 | dependency: transitive 83 | description: 84 | name: ffi 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "0.1.3" 88 | file: 89 | dependency: transitive 90 | description: 91 | name: file 92 | url: "https://pub.dartlang.org" 93 | source: hosted 94 | version: "5.2.1" 95 | flutter: 96 | dependency: "direct main" 97 | description: flutter 98 | source: sdk 99 | version: "0.0.0" 100 | flutter_blurhash: 101 | dependency: transitive 102 | description: 103 | name: flutter_blurhash 104 | url: "https://pub.dartlang.org" 105 | source: hosted 106 | version: "0.5.0" 107 | flutter_cache_manager: 108 | dependency: transitive 109 | description: 110 | name: flutter_cache_manager 111 | url: "https://pub.dartlang.org" 112 | source: hosted 113 | version: "2.0.0" 114 | flutter_screenutil: 115 | dependency: "direct main" 116 | description: 117 | name: flutter_screenutil 118 | url: "https://pub.dartlang.org" 119 | source: hosted 120 | version: "3.2.0" 121 | flutter_test: 122 | dependency: "direct dev" 123 | description: flutter 124 | source: sdk 125 | version: "0.0.0" 126 | font_awesome_flutter: 127 | dependency: "direct main" 128 | description: 129 | name: font_awesome_flutter 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "8.10.0" 133 | google_fonts: 134 | dependency: "direct main" 135 | description: 136 | name: google_fonts 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "1.1.1" 140 | http: 141 | dependency: transitive 142 | description: 143 | name: http 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.12.2" 147 | http_parser: 148 | dependency: transitive 149 | description: 150 | name: http_parser 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "3.1.4" 154 | intl: 155 | dependency: "direct main" 156 | description: 157 | name: intl 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "0.16.1" 161 | matcher: 162 | dependency: transitive 163 | description: 164 | name: matcher 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "0.12.10-nullsafety.1" 168 | meta: 169 | dependency: transitive 170 | description: 171 | name: meta 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "1.3.0-nullsafety.4" 175 | nepali_date_picker: 176 | dependency: "direct main" 177 | description: 178 | name: nepali_date_picker 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "4.2.0+1" 182 | nepali_utils: 183 | dependency: transitive 184 | description: 185 | name: nepali_utils 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "2.2.1" 189 | octo_image: 190 | dependency: transitive 191 | description: 192 | name: octo_image 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "0.3.0" 196 | path: 197 | dependency: transitive 198 | description: 199 | name: path 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "1.8.0-nullsafety.1" 203 | path_provider: 204 | dependency: transitive 205 | description: 206 | name: path_provider 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "1.6.22" 210 | path_provider_linux: 211 | dependency: transitive 212 | description: 213 | name: path_provider_linux 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "0.0.1+2" 217 | path_provider_macos: 218 | dependency: transitive 219 | description: 220 | name: path_provider_macos 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "0.0.4+4" 224 | path_provider_platform_interface: 225 | dependency: transitive 226 | description: 227 | name: path_provider_platform_interface 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.0.3" 231 | path_provider_windows: 232 | dependency: transitive 233 | description: 234 | name: path_provider_windows 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "0.0.4+1" 238 | pedantic: 239 | dependency: transitive 240 | description: 241 | name: pedantic 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "1.9.2" 245 | platform: 246 | dependency: transitive 247 | description: 248 | name: platform 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "2.2.1" 252 | plugin_platform_interface: 253 | dependency: transitive 254 | description: 255 | name: plugin_platform_interface 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "1.0.3" 259 | process: 260 | dependency: transitive 261 | description: 262 | name: process 263 | url: "https://pub.dartlang.org" 264 | source: hosted 265 | version: "3.0.13" 266 | rxdart: 267 | dependency: transitive 268 | description: 269 | name: rxdart 270 | url: "https://pub.dartlang.org" 271 | source: hosted 272 | version: "0.24.1" 273 | school_ui_toolkit: 274 | dependency: "direct main" 275 | description: 276 | path: ".." 277 | relative: true 278 | source: path 279 | version: "5.0.0" 280 | sky_engine: 281 | dependency: transitive 282 | description: flutter 283 | source: sdk 284 | version: "0.0.99" 285 | source_span: 286 | dependency: transitive 287 | description: 288 | name: source_span 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "1.8.0-nullsafety.2" 292 | sqflite: 293 | dependency: transitive 294 | description: 295 | name: sqflite 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "1.3.2+1" 299 | sqflite_common: 300 | dependency: transitive 301 | description: 302 | name: sqflite_common 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.0.2+1" 306 | stack_trace: 307 | dependency: transitive 308 | description: 309 | name: stack_trace 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "1.10.0-nullsafety.4" 313 | stream_channel: 314 | dependency: transitive 315 | description: 316 | name: stream_channel 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "2.1.0-nullsafety.1" 320 | string_scanner: 321 | dependency: transitive 322 | description: 323 | name: string_scanner 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "1.1.0-nullsafety.1" 327 | synchronized: 328 | dependency: transitive 329 | description: 330 | name: synchronized 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "2.2.0+2" 334 | term_glyph: 335 | dependency: transitive 336 | description: 337 | name: term_glyph 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "1.2.0-nullsafety.1" 341 | test_api: 342 | dependency: transitive 343 | description: 344 | name: test_api 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "0.2.19-nullsafety.2" 348 | typed_data: 349 | dependency: transitive 350 | description: 351 | name: typed_data 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "1.3.0-nullsafety.3" 355 | uuid: 356 | dependency: transitive 357 | description: 358 | name: uuid 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "2.2.2" 362 | vector_math: 363 | dependency: transitive 364 | description: 365 | name: vector_math 366 | url: "https://pub.dartlang.org" 367 | source: hosted 368 | version: "2.1.0-nullsafety.3" 369 | win32: 370 | dependency: transitive 371 | description: 372 | name: win32 373 | url: "https://pub.dartlang.org" 374 | source: hosted 375 | version: "1.7.3" 376 | xdg_directories: 377 | dependency: transitive 378 | description: 379 | name: xdg_directories 380 | url: "https://pub.dartlang.org" 381 | source: hosted 382 | version: "0.1.2" 383 | sdks: 384 | dart: ">=2.10.2 <=2.11.0-229.0.dev" 385 | flutter: ">=1.22.2 <2.0.0" 386 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: ui_example 2 | description: A new Flutter project. 3 | 4 | # The following line prevents the package from being accidentally published to 5 | # pub.dev using `pub publish`. This is preferred for private packages. 6 | publish_to: "none" # Remove this line if you wish to publish to pub.dev 7 | 8 | # The following defines the version and build number for your application. 9 | # A version number is three numbers separated by dots, like 1.2.43 10 | # followed by an optional build number separated by a +. 11 | # Both the version and the builder number may be overridden in flutter 12 | # build by specifying --build-name and --build-number, respectively. 13 | # In Android, build-name is used as versionName while build-number used as versionCode. 14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 16 | # Read more about iOS versioning at 17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 18 | version: 1.0.0+1 19 | 20 | environment: 21 | sdk: ">=2.7.0 <3.0.0" 22 | 23 | dependencies: 24 | flutter: 25 | sdk: flutter 26 | 27 | # The following adds the Cupertino Icons font to your application. 28 | # Use with the CupertinoIcons class for iOS style icons. 29 | cupertino_icons: ^0.1.3 30 | # school_ui_toolkit package 31 | school_ui_toolkit: 32 | path: ../ 33 | 34 | flutter_screenutil: ^3.2.0 35 | cached_network_image: ^2.2.0+1 36 | font_awesome_flutter: ^8.8.1 37 | intl: ^0.16.1 38 | google_fonts: ^1.1.0 39 | nepali_date_picker: ^4.1.0 40 | 41 | dev_dependencies: 42 | flutter_test: 43 | sdk: flutter 44 | 45 | # For information on the generic Dart part of this file, see the 46 | # following page: https://dart.dev/tools/pub/pubspec 47 | 48 | # The following section is specific to Flutter. 49 | flutter: 50 | # The following line ensures that the Material Icons font is 51 | # included with your application, so that you can use the icons in 52 | # the material Icons class. 53 | uses-material-design: true 54 | # To add assets to your application, add an assets section, like this: 55 | # assets: 56 | # - images/a_dot_burr.jpeg 57 | # - images/a_dot_ham.jpeg 58 | # An image asset can refer to one or more resolution-specific "variants", see 59 | # https://flutter.dev/assets-and-images/#resolution-aware. 60 | # For details regarding adding assets from package dependencies, see 61 | # https://flutter.dev/assets-and-images/#from-packages 62 | # To add custom fonts to your application, add a fonts section here, 63 | # in this "flutter" section. Each entry in this list should have a 64 | # "family" key with the font family name, and a "fonts" key with a 65 | # list giving the asset and other descriptors for the font. For 66 | # example: 67 | # fonts: 68 | # - family: Schyler 69 | # fonts: 70 | # - asset: fonts/Schyler-Regular.ttf 71 | # - asset: fonts/Schyler-Italic.ttf 72 | # style: italic 73 | # - family: Trajan Pro 74 | # fonts: 75 | # - asset: fonts/TrajanPro.ttf 76 | # - asset: fonts/TrajanPro_Bold.ttf 77 | # weight: 700 78 | # 79 | # For details regarding fonts from package dependencies, 80 | # see https://flutter.dev/custom-fonts/#from-packages 81 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/school_ui_toolkit.dart: -------------------------------------------------------------------------------- 1 | library school_ui_toolkit; 2 | 3 | export 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | export 'package:school_ui_toolkit/src/school_location_widget/school_location_widget.dart'; 5 | export 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 6 | export 'package:school_ui_toolkit/src/font_size/font_size.dart'; 7 | export 'package:school_ui_toolkit/src/school_toolkit_button/school_toolkit_button.dart'; 8 | export 'package:school_ui_toolkit/src/school_toolkit_text_field/school_toolkit_text_field.dart'; 9 | export 'package:school_ui_toolkit/src/school_toolkit_role_button/school_toolkit_role_button.dart'; 10 | export 'package:school_ui_toolkit/src/overlapping_button_card/overlapping_button_card.dart'; 11 | export 'package:school_ui_toolkit/src/calendar/calendar.dart'; 12 | export 'package:school_ui_toolkit/src/event_card/event_card.dart'; 13 | export 'package:school_ui_toolkit/src/routine_card/routine_card.dart'; 14 | export 'package:school_ui_toolkit/src/deadline_card/deadline_card.dart'; 15 | export 'package:school_ui_toolkit/src/assignment_card/assignment_card.dart'; 16 | export 'package:school_ui_toolkit/src/highlighted_icon/highlighted_icon.dart'; 17 | export 'package:school_ui_toolkit/src/featured_video_card/featured_video_card.dart'; 18 | export 'package:school_ui_toolkit/src/video_list_tile_card/video_list_tile_card.dart'; 19 | export 'package:school_ui_toolkit/src/information_tile_widget/information_tile_widget.dart'; 20 | export 'package:school_ui_toolkit/src/profile_card/profile_card.dart'; 21 | export 'package:school_ui_toolkit/src/outlined_button/outlined_button.dart'; 22 | export 'package:school_ui_toolkit/src/notice_card/notice_card.dart'; 23 | export 'package:school_ui_toolkit/src/label_card/label_card.dart'; 24 | export 'package:school_ui_toolkit/src/custom_circular_progress/custom_circular_progress.dart'; 25 | export 'package:school_ui_toolkit/src/nepali_calendar/nepali_calendar.dart'; 26 | export 'package:school_ui_toolkit/src/calendar/calendar_event.dart'; 27 | export 'package:school_ui_toolkit/src/nepali_calendar/nepali_calendar_event.dart'; 28 | export 'package:school_ui_toolkit/src/assignment_card/file_wrapper.dart'; 29 | -------------------------------------------------------------------------------- /lib/src/assignment_card/assignment_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 5 | import 'package:school_ui_toolkit/src/assignment_card/assignment_card_file_element.dart'; 6 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 7 | import 'package:school_ui_toolkit/src/deadline_card/deadline_card.dart'; 8 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 9 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 10 | 11 | class AssignmentCard extends StatelessWidget { 12 | final String question; 13 | final String subject; 14 | final String teacher; 15 | final DateTime deadline; 16 | final Color deadlineBackgroundColor; 17 | final Color deadlineTextColor; 18 | final Function onUploadHandler; 19 | final List fileList; 20 | 21 | const AssignmentCard({ 22 | Key key, 23 | this.question, 24 | this.subject, 25 | this.teacher, 26 | this.deadline, 27 | this.deadlineBackgroundColor, 28 | this.deadlineTextColor, 29 | this.onUploadHandler, 30 | this.fileList, 31 | }) : super(key: key); 32 | 33 | @override 34 | Widget build(BuildContext context) { 35 | if (ScreenUtil() == null) { 36 | ScreenUtil.init( 37 | context, 38 | designSize: Size( 39 | ScreenSize.width, 40 | ScreenSize.height, 41 | ), 42 | allowFontScaling: true, 43 | ); 44 | } 45 | 46 | return Container( 47 | width: ScreenUtil().setWidth(374), 48 | padding: EdgeInsets.symmetric( 49 | vertical: ScreenUtil().setHeight(15), 50 | horizontal: ScreenUtil().setWidth(15), 51 | ), 52 | constraints: BoxConstraints( 53 | minHeight: ScreenUtil().setHeight(140), 54 | ), 55 | decoration: BoxDecoration( 56 | color: SchoolToolkitColors.blueGrey, 57 | borderRadius: BorderRadius.circular( 58 | ScreenUtil().setWidth(10), 59 | ), 60 | ), 61 | child: Column( 62 | mainAxisAlignment: MainAxisAlignment.start, 63 | crossAxisAlignment: CrossAxisAlignment.start, 64 | children: [ 65 | Row( 66 | mainAxisAlignment: MainAxisAlignment.start, 67 | crossAxisAlignment: CrossAxisAlignment.start, 68 | children: [ 69 | Icon( 70 | FontAwesomeIcons.questionCircle, 71 | color: SchoolToolkitColors.mediumGrey, 72 | size: FontSize.fontSize16, 73 | ), 74 | SizedBox( 75 | width: ScreenUtil().setWidth(5), 76 | ), 77 | Container( 78 | width: ScreenUtil().setWidth(320), 79 | child: Text( 80 | '$question', 81 | style: TextStyle( 82 | color: SchoolToolkitColors.darkBlack, 83 | fontSize: FontSize.fontSize16, 84 | fontWeight: FontSize.semiBold, 85 | ), 86 | ), 87 | ), 88 | ], 89 | ), 90 | SizedBox( 91 | height: ScreenUtil().setHeight(20), 92 | ), 93 | Row( 94 | mainAxisAlignment: MainAxisAlignment.start, 95 | crossAxisAlignment: CrossAxisAlignment.center, 96 | children: [ 97 | Icon( 98 | FontAwesomeIcons.book, 99 | color: SchoolToolkitColors.mediumGrey, 100 | size: FontSize.fontSize16, 101 | ), 102 | SizedBox( 103 | width: ScreenUtil().setWidth(7), 104 | ), 105 | Text( 106 | '$subject', 107 | style: TextStyle( 108 | color: SchoolToolkitColors.mediumGrey, 109 | fontSize: FontSize.fontSize14, 110 | fontWeight: FontSize.medium, 111 | ), 112 | ), 113 | ], 114 | ), 115 | SizedBox( 116 | height: ScreenUtil().setHeight(10), 117 | ), 118 | Row( 119 | mainAxisAlignment: MainAxisAlignment.start, 120 | crossAxisAlignment: CrossAxisAlignment.center, 121 | children: [ 122 | Icon( 123 | FontAwesomeIcons.userGraduate, 124 | color: SchoolToolkitColors.mediumGrey, 125 | size: FontSize.fontSize16, 126 | ), 127 | SizedBox( 128 | width: ScreenUtil().setWidth(7), 129 | ), 130 | Text( 131 | '$teacher', 132 | style: TextStyle( 133 | color: SchoolToolkitColors.mediumGrey, 134 | fontSize: FontSize.fontSize14, 135 | fontWeight: FontSize.medium, 136 | ), 137 | ), 138 | ], 139 | ), 140 | SizedBox( 141 | height: ScreenUtil().setHeight(15), 142 | ), 143 | Row( 144 | mainAxisAlignment: MainAxisAlignment.start, 145 | crossAxisAlignment: CrossAxisAlignment.center, 146 | children: [ 147 | if (deadline != null) 148 | DeadlineCard( 149 | deadline: deadline, 150 | primaryColor: deadlineTextColor, 151 | secondaryColor: deadlineBackgroundColor, 152 | ), 153 | Expanded( 154 | child: Container(), 155 | ), 156 | if (onUploadHandler != null) 157 | ConstrainedBox( 158 | constraints: BoxConstraints( 159 | maxHeight: ScreenUtil().setWidth(36), 160 | maxWidth: ScreenUtil().setWidth(36), 161 | ), 162 | child: FlatButton( 163 | onPressed: onUploadHandler, 164 | shape: RoundedRectangleBorder( 165 | borderRadius: BorderRadius.circular( 166 | ScreenUtil().setWidth(10), 167 | ), 168 | side: BorderSide( 169 | color: SchoolToolkitColors.blue, 170 | width: ScreenUtil().setWidth(1), 171 | ), 172 | ), 173 | splashColor: SchoolToolkitColors.lightBlue, 174 | padding: EdgeInsets.symmetric( 175 | horizontal: ScreenUtil().setWidth(5.0), 176 | ), 177 | child: Icon( 178 | Icons.file_upload, 179 | size: FontSize.fontSize18, 180 | color: SchoolToolkitColors.blue, 181 | ), 182 | ), 183 | ), 184 | ], 185 | ), 186 | if (fileList != null && ((fileList?.length ?? 0) > 0)) ...[ 187 | SizedBox( 188 | height: ScreenUtil().setHeight(10), 189 | ), 190 | ...fileList?.map((e) { 191 | return Padding( 192 | padding: EdgeInsets.only( 193 | bottom: ScreenUtil().setHeight(10), 194 | ), 195 | child: AssignmentCardFileElement(fileWrapper: e), 196 | ); 197 | })?.toList(), 198 | ] 199 | ], 200 | ), 201 | ); 202 | } 203 | } 204 | -------------------------------------------------------------------------------- /lib/src/assignment_card/assignment_card_file_element.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 5 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 6 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 7 | 8 | class AssignmentCardFileElement extends StatelessWidget { 9 | final FileWrapper fileWrapper; 10 | 11 | const AssignmentCardFileElement({ 12 | Key key, 13 | @required this.fileWrapper, 14 | }) : super(key: key); 15 | 16 | @override 17 | Widget build(BuildContext context) { 18 | return Row( 19 | mainAxisAlignment: MainAxisAlignment.start, 20 | crossAxisAlignment: CrossAxisAlignment.center, 21 | children: [ 22 | Icon( 23 | FontAwesomeIcons.file, 24 | color: SchoolToolkitColors.mediumGrey, 25 | size: FontSize.fontSize16, 26 | ), 27 | SizedBox( 28 | width: ScreenUtil().setWidth(7), 29 | ), 30 | Expanded( 31 | child: GestureDetector( 32 | onTap: fileWrapper.onTap, 33 | child: Column( 34 | mainAxisAlignment: MainAxisAlignment.start, 35 | crossAxisAlignment: CrossAxisAlignment.start, 36 | children: [ 37 | SingleChildScrollView( 38 | scrollDirection: Axis.horizontal, 39 | child: Text( 40 | '${fileWrapper.fileName}', 41 | overflow: TextOverflow.ellipsis, 42 | style: TextStyle( 43 | color: SchoolToolkitColors.blue, 44 | fontSize: FontSize.fontSize14, 45 | fontWeight: FontSize.medium, 46 | ), 47 | ), 48 | ), 49 | if (fileWrapper.fileSize != null) 50 | Text( 51 | '${fileWrapper.fileSize}', 52 | style: TextStyle( 53 | color: SchoolToolkitColors.mediumGrey, 54 | fontSize: FontSize.fontSize14, 55 | fontWeight: FontSize.medium, 56 | ), 57 | ), 58 | ], 59 | ), 60 | ), 61 | ), 62 | SizedBox( 63 | width: ScreenUtil().setWidth(10), 64 | ), 65 | GestureDetector( 66 | onTap: fileWrapper.onTap, 67 | child: Container( 68 | width: ScreenUtil().setWidth(32), 69 | height: ScreenUtil().setHeight(32), 70 | padding: EdgeInsets.all( 71 | ScreenUtil().setWidth(5.0), 72 | ), 73 | decoration: BoxDecoration( 74 | color: Colors.white, 75 | shape: BoxShape.circle, 76 | ), 77 | child: Icon( 78 | fileWrapper.icon, 79 | size: FontSize.fontSize14, 80 | color: SchoolToolkitColors.mediumGrey, 81 | ), 82 | ), 83 | ), 84 | ], 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/src/assignment_card/file_wrapper.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 3 | 4 | class FileWrapper { 5 | final String fileName; 6 | final String fileSize; 7 | final Function onTap; 8 | final IconData icon; 9 | 10 | FileWrapper({ 11 | this.fileName, 12 | this.fileSize, 13 | this.onTap, 14 | this.icon = FontAwesomeIcons.download, 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /lib/src/calendar/calendar.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:intl/intl.dart'; 5 | import 'package:school_ui_toolkit/src/calendar/calendar_date_element.dart'; 6 | import 'package:school_ui_toolkit/src/calendar/calendar_event.dart'; 7 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 8 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 9 | import 'package:school_ui_toolkit/src/utils/calendar_utils.dart'; 10 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 11 | 12 | class Calendar extends StatefulWidget { 13 | final bool startExpanded; 14 | final Function(DateTime) onDateSelected; 15 | final Function(DateTime) onPreviousMonth; 16 | final Function(DateTime) onNextMonth; 17 | final List recurringEventsByWeekday; 18 | final List calendarEvents; 19 | final List recurringEventsByDay; 20 | 21 | const Calendar({ 22 | Key key, 23 | this.startExpanded = false, 24 | this.onDateSelected, 25 | this.onPreviousMonth, 26 | this.onNextMonth, 27 | this.calendarEvents, 28 | this.recurringEventsByWeekday, 29 | this.recurringEventsByDay, 30 | }) : super(key: key); 31 | 32 | @override 33 | _CalendarState createState() => _CalendarState(); 34 | } 35 | 36 | class _CalendarState extends State 37 | with SingleTickerProviderStateMixin { 38 | DateTime _selectedDate = DateTime.now(); 39 | List _weekDayDateTimeList; 40 | bool _expanded = false; 41 | DateTime _startOfMonth; 42 | List _monthDateTimeList; 43 | List> _calendarData; 44 | 45 | @override 46 | void initState() { 47 | _expanded = widget.startExpanded; 48 | _initCalendar(); 49 | super.initState(); 50 | } 51 | 52 | void _initCalendar() { 53 | _weekDayDateTimeList = List(); 54 | _monthDateTimeList = List(); 55 | _calendarData = List>(); 56 | 57 | if (_selectedDate.day == 1) { 58 | _startOfMonth = _selectedDate; 59 | } else { 60 | _startOfMonth = _selectedDate.subtract( 61 | Duration(days: _selectedDate.day - 1), 62 | ); 63 | } 64 | 65 | if (_startOfMonth.day != DateTime.sunday) { 66 | _startOfMonth = _startOfMonth.subtract( 67 | Duration(days: _startOfMonth.weekday), 68 | ); 69 | } 70 | 71 | for (int i = 0;; i = i + 7) { 72 | DateTime date = _startOfMonth.add(Duration(days: i)); 73 | List tempDateList = List(); 74 | 75 | for (int i = 0; i < 7; i++) { 76 | tempDateList.add(date.add(Duration(days: i))); 77 | } 78 | _calendarData.add(tempDateList); 79 | if (_startOfMonth.add(Duration(days: i + 7)).month != 80 | _selectedDate.month) { 81 | break; 82 | } 83 | } 84 | 85 | DateTime weekDayCalendar; 86 | if (_selectedDate.weekday == DateTime.sunday) { 87 | weekDayCalendar = _selectedDate; 88 | } else { 89 | weekDayCalendar = _selectedDate.subtract(Duration( 90 | days: _selectedDate.weekday, 91 | )); 92 | } 93 | for (int i = 0; i < 7; i++) { 94 | _weekDayDateTimeList?.add(weekDayCalendar.add(Duration(days: i))); 95 | } 96 | 97 | for (int i = 0;; i++) { 98 | DateTime date = _startOfMonth.add(Duration(days: i)); 99 | if (date.month != _selectedDate.month) { 100 | break; 101 | } 102 | _monthDateTimeList.add(date); 103 | } 104 | } 105 | 106 | void _nextMonth() { 107 | if (_selectedDate.month == DateTime.december) { 108 | _selectedDate = DateTime( 109 | _selectedDate.year + 1, 110 | 1, 111 | _selectedDate.day, 112 | ); 113 | } else { 114 | _selectedDate = DateTime( 115 | _selectedDate.year, 116 | _selectedDate.month + 1, 117 | _selectedDate.day, 118 | ); 119 | } 120 | setState(() { 121 | _initCalendar(); 122 | }); 123 | } 124 | 125 | void _previousMonth() { 126 | if (_selectedDate.month == DateTime.january) { 127 | _selectedDate = DateTime( 128 | _selectedDate.year - 1, 129 | 12, 130 | _selectedDate.day, 131 | ); 132 | } else { 133 | _selectedDate = DateTime( 134 | _selectedDate.year, 135 | _selectedDate.month - 1, 136 | _selectedDate.day, 137 | ); 138 | } 139 | setState(() { 140 | _initCalendar(); 141 | }); 142 | } 143 | 144 | void _selectDate(DateTime date) { 145 | _selectedDate = date; 146 | setState(() { 147 | _initCalendar(); 148 | }); 149 | } 150 | 151 | @override 152 | Widget build(BuildContext context) { 153 | if (ScreenUtil() == null) { 154 | ScreenUtil.init( 155 | context, 156 | designSize: Size( 157 | ScreenSize.width, 158 | ScreenSize.height, 159 | ), 160 | allowFontScaling: true, 161 | ); 162 | } 163 | 164 | return Column( 165 | mainAxisAlignment: MainAxisAlignment.start, 166 | mainAxisSize: MainAxisSize.min, 167 | children: [ 168 | Container( 169 | width: ScreenUtil().setWidth(414), 170 | padding: EdgeInsets.all( 171 | ScreenUtil().setWidth(25), 172 | ), 173 | margin: EdgeInsets.zero, 174 | decoration: BoxDecoration( 175 | color: Colors.white, 176 | boxShadow: [ 177 | BoxShadow( 178 | blurRadius: ScreenUtil().setHeight(15), 179 | color: SchoolToolkitColors.blackShadow, 180 | offset: Offset( 181 | 0, 182 | ScreenUtil().setHeight(15), 183 | ), 184 | spreadRadius: ScreenUtil().setHeight(13), 185 | ), 186 | ], 187 | ), 188 | child: Column( 189 | mainAxisAlignment: MainAxisAlignment.start, 190 | crossAxisAlignment: CrossAxisAlignment.start, 191 | children: [ 192 | Row( 193 | crossAxisAlignment: CrossAxisAlignment.center, 194 | mainAxisAlignment: MainAxisAlignment.spaceBetween, 195 | children: [ 196 | IconButton( 197 | onPressed: () { 198 | _previousMonth(); 199 | if (widget.onPreviousMonth != null) { 200 | widget.onPreviousMonth(_selectedDate); 201 | } 202 | }, 203 | icon: Icon( 204 | FontAwesomeIcons.chevronLeft, 205 | size: FontSize.fontSize20, 206 | color: SchoolToolkitColors.black, 207 | ), 208 | ), 209 | Text( 210 | '${DateFormat('MMMM, yyyy').format(_selectedDate)}', 211 | style: TextStyle( 212 | color: SchoolToolkitColors.darkBlack, 213 | fontWeight: FontSize.semiBold, 214 | fontSize: FontSize.fontSize20, 215 | ), 216 | ), 217 | IconButton( 218 | onPressed: () { 219 | _nextMonth(); 220 | if (widget.onNextMonth != null) { 221 | widget.onNextMonth(_selectedDate); 222 | } 223 | }, 224 | icon: Icon( 225 | FontAwesomeIcons.chevronRight, 226 | size: FontSize.fontSize20, 227 | color: SchoolToolkitColors.black, 228 | ), 229 | ), 230 | ], 231 | ), 232 | SizedBox( 233 | height: ScreenUtil().setHeight(22), 234 | ), 235 | AnimatedSize( 236 | vsync: this, 237 | curve: Curves.ease, 238 | duration: Duration(milliseconds: 200), 239 | child: AnimatedSwitcher( 240 | duration: Duration(milliseconds: 200), 241 | switchInCurve: Curves.easeIn, 242 | switchOutCurve: Curves.easeOut, 243 | child: _expanded 244 | ? Container( 245 | child: Table( 246 | defaultVerticalAlignment: 247 | TableCellVerticalAlignment.middle, 248 | children: [ 249 | TableRow( 250 | children: _weekDayDateTimeList.map((day) { 251 | String dayInital = DateFormat('E') 252 | .format(day) 253 | .substring(0, 1); 254 | return Center( 255 | child: Text( 256 | '$dayInital', 257 | style: TextStyle( 258 | color: day.weekday == 259 | DateTime.now().weekday 260 | ? SchoolToolkitColors.blue 261 | : SchoolToolkitColors.lightGrey, 262 | fontWeight: FontSize.semiBold, 263 | fontSize: FontSize.fontSize20, 264 | ), 265 | ), 266 | ); 267 | }).toList(), 268 | ), 269 | for (List dateList 270 | in _calendarData) ...[ 271 | TableRow( 272 | children: [ 273 | for (int i = 0; i < 7; i++) 274 | Container( 275 | height: ScreenUtil().setHeight(5), 276 | ), 277 | ], 278 | ), 279 | TableRow( 280 | children: dateList.map((date) { 281 | return Column( 282 | children: [ 283 | CalendarDateElement( 284 | date: date.day, 285 | today: 286 | date.day == DateTime.now().day && 287 | date.month == 288 | DateTime.now().month, 289 | fade: 290 | date.month != _selectedDate.month, 291 | selected: date.day == 292 | _selectedDate.day && 293 | date.month == _selectedDate.month, 294 | onTap: () { 295 | _selectDate(date); 296 | if (widget.onDateSelected != null) { 297 | widget.onDateSelected(date); 298 | } 299 | }, 300 | ), 301 | SizedBox( 302 | height: ScreenUtil().setHeight(5.0), 303 | ), 304 | Container( 305 | width: ScreenUtil().setWidth(6), 306 | height: ScreenUtil().setWidth(6), 307 | decoration: BoxDecoration( 308 | shape: BoxShape.circle, 309 | color: CalendarUtils 310 | .getCalendarEventColor( 311 | date, 312 | widget.recurringEventsByWeekday, 313 | widget.recurringEventsByDay, 314 | widget.calendarEvents, 315 | ), 316 | ), 317 | ), 318 | ], 319 | ); 320 | }).toList(), 321 | ), 322 | ], 323 | ], 324 | ), 325 | ) 326 | : Table( 327 | defaultVerticalAlignment: 328 | TableCellVerticalAlignment.middle, 329 | children: [ 330 | TableRow( 331 | children: _weekDayDateTimeList.map((day) { 332 | String dayInitial = 333 | DateFormat('E').format(day).substring(0, 1); 334 | return Center( 335 | child: Text( 336 | '$dayInitial', 337 | style: TextStyle( 338 | color: 339 | day.weekday == DateTime.now().weekday 340 | ? SchoolToolkitColors.blue 341 | : SchoolToolkitColors.lightGrey, 342 | fontWeight: FontSize.semiBold, 343 | fontSize: FontSize.fontSize20, 344 | ), 345 | ), 346 | ); 347 | }).toList(), 348 | ), 349 | TableRow( 350 | children: [ 351 | for (int i = 0; i < 7; i++) 352 | Container( 353 | height: ScreenUtil().setHeight(5), 354 | ), 355 | ], 356 | ), 357 | TableRow( 358 | children: _weekDayDateTimeList.map((date) { 359 | return Column( 360 | children: [ 361 | CalendarDateElement( 362 | date: date.day, 363 | today: date.day == DateTime.now().day && 364 | date.month == DateTime.now().month, 365 | fade: date.month != _selectedDate.month, 366 | selected: date.day == _selectedDate.day && 367 | date.month == _selectedDate.month, 368 | onTap: () { 369 | _selectDate(date); 370 | if (widget.onDateSelected != null) { 371 | widget.onDateSelected(date); 372 | } 373 | }, 374 | ), 375 | SizedBox( 376 | height: ScreenUtil().setHeight(5.0), 377 | ), 378 | Container( 379 | width: ScreenUtil().setWidth(6), 380 | height: ScreenUtil().setWidth(6), 381 | decoration: BoxDecoration( 382 | shape: BoxShape.circle, 383 | color: 384 | CalendarUtils.getCalendarEventColor( 385 | date, 386 | widget.recurringEventsByWeekday, 387 | widget.recurringEventsByDay, 388 | widget.calendarEvents, 389 | ), 390 | ), 391 | ), 392 | ], 393 | ); 394 | }).toList(), 395 | ), 396 | ], 397 | ), 398 | ), 399 | ), 400 | ], 401 | ), 402 | ), 403 | Center( 404 | child: GestureDetector( 405 | onTap: () { 406 | setState(() { 407 | _expanded = !_expanded; 408 | }); 409 | }, 410 | child: Container( 411 | width: ScreenUtil().setWidth(66), 412 | height: ScreenUtil().setHeight(30), 413 | color: SchoolToolkitColors.lighterBlue, 414 | child: Icon( 415 | _expanded 416 | ? FontAwesomeIcons.chevronUp 417 | : FontAwesomeIcons.chevronDown, 418 | color: SchoolToolkitColors.blue, 419 | size: ScreenUtil().setWidth(18), 420 | ), 421 | ), 422 | ), 423 | ), 424 | ], 425 | ); 426 | } 427 | } 428 | -------------------------------------------------------------------------------- /lib/src/calendar/calendar_date_element.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class CalendarDateElement extends StatelessWidget { 8 | final int date; 9 | final bool today; 10 | final bool fade; 11 | final Function onTap; 12 | final bool selected; 13 | 14 | const CalendarDateElement({ 15 | Key key, 16 | @required this.date, 17 | this.today = false, 18 | this.fade = false, 19 | this.onTap, 20 | this.selected = false, 21 | }) : assert(date != null), 22 | super(key: key); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | if (ScreenUtil() == null) { 27 | ScreenUtil.init( 28 | context, 29 | designSize: Size( 30 | ScreenSize.width, 31 | ScreenSize.height, 32 | ), 33 | allowFontScaling: true, 34 | ); 35 | } 36 | 37 | if (today) { 38 | return GestureDetector( 39 | onTap: onTap, 40 | child: Container( 41 | alignment: Alignment.center, 42 | width: ScreenUtil().setWidth(40), 43 | height: ScreenUtil().setWidth(40), 44 | decoration: BoxDecoration( 45 | shape: BoxShape.circle, 46 | color: SchoolToolkitColors.lighterBlue, 47 | border: Border.all( 48 | color: today && selected 49 | ? SchoolToolkitColors.blue 50 | : Colors.transparent, 51 | width: ScreenUtil().setWidth(2.0), 52 | ), 53 | ), 54 | child: Text( 55 | '$date', 56 | style: TextStyle( 57 | color: SchoolToolkitColors.blue, 58 | fontSize: FontSize.fontSize16, 59 | fontWeight: FontSize.semiBold, 60 | ), 61 | ), 62 | ), 63 | ); 64 | } else if (selected) { 65 | return GestureDetector( 66 | onTap: onTap, 67 | child: Container( 68 | alignment: Alignment.center, 69 | width: ScreenUtil().setWidth(40), 70 | height: ScreenUtil().setWidth(40), 71 | decoration: BoxDecoration( 72 | shape: BoxShape.circle, 73 | // color: SchoolToolkitColors.lighter_blue, 74 | border: Border.all( 75 | color: SchoolToolkitColors.blue, 76 | width: ScreenUtil().setWidth(2.0), 77 | ), 78 | ), 79 | child: Text( 80 | '$date', 81 | style: TextStyle( 82 | color: SchoolToolkitColors.blue, 83 | fontSize: FontSize.fontSize16, 84 | fontWeight: FontSize.semiBold, 85 | ), 86 | ), 87 | ), 88 | ); 89 | } else { 90 | return GestureDetector( 91 | onTap: onTap, 92 | child: Container( 93 | width: ScreenUtil().setWidth(40), 94 | height: ScreenUtil().setWidth(40), 95 | alignment: Alignment.center, 96 | decoration: BoxDecoration( 97 | shape: BoxShape.circle, 98 | color: Colors.transparent, 99 | ), 100 | child: Text( 101 | '$date', 102 | style: TextStyle( 103 | color: fade 104 | ? SchoolToolkitColors.lightGrey 105 | : SchoolToolkitColors.darkBlack, 106 | fontSize: FontSize.fontSize16, 107 | fontWeight: FontSize.semiBold, 108 | ), 109 | ), 110 | ), 111 | ); 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /lib/src/calendar/calendar_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/painting.dart'; 3 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 4 | 5 | class CalendarEvent { 6 | DateTime dateTime; 7 | int weekDay; 8 | final Color color; 9 | final bool holiday; 10 | 11 | CalendarEvent.fromDateTime({ 12 | @required this.dateTime, 13 | this.color = SchoolToolkitColors.blue, 14 | this.holiday = false, 15 | }); 16 | 17 | CalendarEvent.fromWeekDay({ 18 | @required this.weekDay, 19 | this.color = SchoolToolkitColors.blue, 20 | this.holiday = false, 21 | }); 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/colors/school_toolkit_colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | 3 | class SchoolToolkitColors { 4 | static const Color blueGrey = Color(0xfff0f0f8); 5 | static const Color lightGrey = Color(0xffCDD1D5); 6 | static const Color lighterGrey = Color(0xffF1F3F8); 7 | static const Color grey = Color(0xff7D85A3); 8 | static const Color darkGrey = Color(0xff656B7D); 9 | static const Color mediumGrey = Color(0xffA2A7BC); 10 | static const Color greyShadow = Color(0x172E631C); 11 | 12 | static const Color black = Color(0xff4D4E51); 13 | static const Color darkBlack = Color(0xff1A1D23); 14 | static const Color lightBlack = Color(0xff818181); 15 | 16 | static const Color blue = Color(0xff3362CC); 17 | static const Color lightBlue = Color(0xff3D72DE); 18 | static const Color lighterBlue = Color(0xffEAEFFA); 19 | 20 | static const Color yellow = Color(0xffFBD46D); 21 | static const Color darkYellow = Color(0xffFFC758); 22 | 23 | static const Color blackShadow = Color(0x0500000D); 24 | 25 | static const Color brown = Color(0xff965519); 26 | static const Color lightBrown = Color(0xffFDECDC); 27 | 28 | static const Color green = Color(0xff248484); 29 | static const Color tealGreen = Color(0xff27B893); 30 | static const Color lightGreen = Color(0xffD8F9F5); 31 | 32 | static const Color red = Color(0xffFF3131); 33 | } 34 | -------------------------------------------------------------------------------- /lib/src/custom_circular_progress/custom_circular_progress.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 5 | 6 | class CustomCircularProgress extends StatelessWidget { 7 | final Color color; 8 | 9 | const CustomCircularProgress({ 10 | Key key, 11 | this.color = SchoolToolkitColors.blue, 12 | }) : super(key: key); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | if (ScreenUtil() == null) { 17 | ScreenUtil.init( 18 | context, 19 | designSize: Size( 20 | ScreenSize.width, 21 | ScreenSize.height, 22 | ), 23 | allowFontScaling: true, 24 | ); 25 | } 26 | 27 | return Theme( 28 | data: ThemeData( 29 | accentColor: color, 30 | ), 31 | child: Container( 32 | height: ScreenUtil().setWidth(15), 33 | width: ScreenUtil().setWidth(15), 34 | child: CircularProgressIndicator(), 35 | ), 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /lib/src/deadline_card/deadline_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:intl/intl.dart'; 4 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 5 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 6 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 7 | 8 | class DeadlineCard extends StatelessWidget { 9 | final DateTime deadline; 10 | final Color primaryColor; 11 | final Color secondaryColor; 12 | 13 | const DeadlineCard({ 14 | Key key, 15 | @required this.deadline, 16 | this.primaryColor = Colors.white, 17 | this.secondaryColor = SchoolToolkitColors.tealGreen, 18 | }) : assert(deadline != null), 19 | super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | if (ScreenUtil() == null) { 24 | ScreenUtil.init( 25 | context, 26 | designSize: Size( 27 | ScreenSize.width, 28 | ScreenSize.height, 29 | ), 30 | allowFontScaling: true, 31 | ); 32 | } 33 | 34 | return Container( 35 | height: ScreenUtil().setHeight(40), 36 | constraints: BoxConstraints( 37 | minWidth: ScreenUtil().setWidth(200), 38 | maxWidth: ScreenUtil().setWidth(280), 39 | ), 40 | alignment: Alignment.centerLeft, 41 | padding: EdgeInsets.symmetric( 42 | horizontal: ScreenUtil().setWidth(10), 43 | vertical: ScreenUtil().setWidth(5), 44 | ), 45 | decoration: BoxDecoration( 46 | color: secondaryColor ?? SchoolToolkitColors.tealGreen, 47 | borderRadius: BorderRadius.circular( 48 | ScreenUtil().setWidth(5.0), 49 | ), 50 | ), 51 | child: Row( 52 | mainAxisSize: MainAxisSize.min, 53 | crossAxisAlignment: CrossAxisAlignment.center, 54 | mainAxisAlignment: MainAxisAlignment.start, 55 | children: [ 56 | Container( 57 | width: ScreenUtil().setWidth(6), 58 | height: ScreenUtil().setHeight(6), 59 | decoration: BoxDecoration( 60 | shape: BoxShape.circle, 61 | color: Colors.white, 62 | ), 63 | ), 64 | SizedBox( 65 | width: ScreenUtil().setWidth(5.0), 66 | ), 67 | Expanded( 68 | child: SingleChildScrollView( 69 | scrollDirection: Axis.horizontal, 70 | child: Text( 71 | 'Deadline: ${DateFormat('h:mm a | dd MMMM, yyyy').format(deadline)}' 72 | .toUpperCase(), 73 | style: TextStyle( 74 | color: primaryColor ?? Colors.white, 75 | fontSize: FontSize.fontSize14, 76 | fontWeight: FontSize.semiBold, 77 | ), 78 | ), 79 | ), 80 | ), 81 | ], 82 | ), 83 | ); 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /lib/src/event_card/event_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 6 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 7 | 8 | class EventCard extends StatelessWidget { 9 | final double width; 10 | final double height; 11 | final String time; 12 | final String event; 13 | final Color primaryColor; 14 | final Color secondaryColor; 15 | 16 | const EventCard({ 17 | Key key, 18 | this.width, 19 | this.height, 20 | this.time, 21 | this.event, 22 | this.primaryColor = SchoolToolkitColors.brown, 23 | this.secondaryColor = SchoolToolkitColors.lightBrown, 24 | }) : super(key: key); 25 | 26 | @override 27 | Widget build(BuildContext context) { 28 | if (ScreenUtil() == null) { 29 | ScreenUtil.init( 30 | context, 31 | designSize: Size( 32 | ScreenSize.width, 33 | ScreenSize.height, 34 | ), 35 | allowFontScaling: true, 36 | ); 37 | } 38 | 39 | return SchoolToolkitCard( 40 | width: width ?? ScreenUtil().setWidth(374), 41 | height: height ?? ScreenUtil().setHeight(80), 42 | backgroundColor: secondaryColor, 43 | alignment: Alignment.centerLeft, 44 | child: Column( 45 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 46 | crossAxisAlignment: CrossAxisAlignment.start, 47 | children: [ 48 | Text( 49 | '$time', 50 | style: TextStyle( 51 | color: SchoolToolkitColors.darkBlack, 52 | fontWeight: FontSize.semiBold, 53 | fontSize: FontSize.fontSize14, 54 | ), 55 | ), 56 | Text( 57 | '$event', 58 | style: TextStyle( 59 | color: primaryColor, 60 | fontWeight: FontSize.semiBold, 61 | fontSize: FontSize.fontSize16, 62 | ), 63 | ), 64 | ], 65 | ), 66 | ); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /lib/src/featured_video_card/featured_video_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/screenutil.dart'; 4 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 5 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 6 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 7 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 8 | 9 | class FeaturedVideoCard extends StatelessWidget { 10 | final String thumbnailURL; 11 | final Function onTap; 12 | final String title; 13 | 14 | const FeaturedVideoCard({ 15 | Key key, 16 | @required this.thumbnailURL, 17 | this.onTap, 18 | this.title, 19 | }) : assert(thumbnailURL != null), 20 | super(key: key); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | if (ScreenUtil() == null) { 25 | ScreenUtil.init( 26 | context, 27 | designSize: Size( 28 | ScreenSize.width, 29 | ScreenSize.height, 30 | ), 31 | allowFontScaling: true, 32 | ); 33 | } 34 | 35 | return ClipRRect( 36 | borderRadius: BorderRadius.circular( 37 | ScreenUtil().setWidth(10), 38 | ), 39 | child: Container( 40 | width: ScreenUtil().setWidth(374), 41 | height: ScreenUtil().setHeight(222), 42 | color: SchoolToolkitColors.black, 43 | child: Stack( 44 | alignment: Alignment.center, 45 | children: [ 46 | CachedNetworkImage( 47 | width: ScreenUtil().setWidth(374), 48 | height: ScreenUtil().setHeight(222), 49 | fit: BoxFit.cover, 50 | imageUrl: thumbnailURL, 51 | ), 52 | Opacity( 53 | opacity: 0.35, 54 | child: Container( 55 | width: ScreenUtil().setWidth(374), 56 | height: ScreenUtil().setHeight(222), 57 | color: SchoolToolkitColors.black, 58 | ), 59 | ), 60 | Icon( 61 | FontAwesomeIcons.playCircle, 62 | color: Colors.white, 63 | size: FontSize.fontSize36, 64 | ), 65 | Positioned( 66 | bottom: ScreenUtil().setHeight(10), 67 | left: ScreenUtil().setWidth(20), 68 | child: Container( 69 | width: 315, 70 | child: Text( 71 | '${title ?? 'Untitled'}', 72 | style: TextStyle( 73 | color: Colors.white, 74 | fontSize: FontSize.fontSize16, 75 | fontWeight: FontSize.bold, 76 | ), 77 | ), 78 | ), 79 | ), 80 | Material( 81 | color: Colors.transparent, 82 | child: InkWell( 83 | onTap: onTap, 84 | child: Container( 85 | width: ScreenUtil().setWidth(374), 86 | height: ScreenUtil().setHeight(222), 87 | // color: Colors.red, 88 | ), 89 | ), 90 | ), 91 | ], 92 | ), 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/src/font_size/font_size.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | 4 | class FontSize { 5 | static const double _fontSize10 = 10.0; 6 | static const double _fontSize12 = 12.0; 7 | static const double _fontSize14 = 14.0; 8 | static const double _fontSize15 = 15.0; 9 | static const double _fontSize16 = 16.0; 10 | static const double _fontSize18 = 18.0; 11 | static const double _fontSize20 = 20.0; 12 | static const double _fontSize22 = 22.0; 13 | static const double _fontSize24 = 24.0; 14 | static const double _fontSize26 = 26.0; 15 | static const double _fontSize28 = 28.0; 16 | static const double _fontSize30 = 30.0; 17 | static const double _fontSize32 = 32.0; 18 | static const double _fontSize34 = 34.0; 19 | static const double _fontSize36 = 36.0; 20 | 21 | static double get fontSize10 => ScreenUtil().setSp(_fontSize10); 22 | static double get fontSize12 => ScreenUtil().setSp(_fontSize12); 23 | static double get fontSize14 => ScreenUtil().setSp(_fontSize14); 24 | static double get fontSize15 => ScreenUtil().setSp(_fontSize15); 25 | static double get fontSize16 => ScreenUtil().setSp(_fontSize16); 26 | static double get fontSize18 => ScreenUtil().setSp(_fontSize18); 27 | static double get fontSize20 => ScreenUtil().setSp(_fontSize20); 28 | static double get fontSize22 => ScreenUtil().setSp(_fontSize22); 29 | static double get fontSize24 => ScreenUtil().setSp(_fontSize24); 30 | static double get fontSize26 => ScreenUtil().setSp(_fontSize26); 31 | static double get fontSize28 => ScreenUtil().setSp(_fontSize28); 32 | static double get fontSize30 => ScreenUtil().setSp(_fontSize30); 33 | static double get fontSize32 => ScreenUtil().setSp(_fontSize32); 34 | static double get fontSize34 => ScreenUtil().setSp(_fontSize34); 35 | static double get fontSize36 => ScreenUtil().setSp(_fontSize36); 36 | 37 | static FontWeight get thin => FontWeight.w100; 38 | static FontWeight get extraLight => FontWeight.w200; 39 | static FontWeight get light => FontWeight.w300; 40 | static FontWeight get regular => FontWeight.w400; 41 | static FontWeight get medium => FontWeight.w500; 42 | static FontWeight get semiBold => FontWeight.w600; 43 | static FontWeight get bold => FontWeight.w700; 44 | static FontWeight get extraBold => FontWeight.w800; 45 | static FontWeight get black => FontWeight.w900; 46 | } 47 | -------------------------------------------------------------------------------- /lib/src/highlighted_icon/highlighted_icon.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class HighlightedIcon extends StatelessWidget { 8 | final IconData icon; 9 | final bool busy; 10 | 11 | const HighlightedIcon({ 12 | Key key, 13 | @required this.icon, 14 | this.busy = false, 15 | }) : assert(icon != null), 16 | super(key: key); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | if (ScreenUtil() == null) { 21 | ScreenUtil.init( 22 | context, 23 | designSize: Size( 24 | ScreenSize.width, 25 | ScreenSize.height, 26 | ), 27 | allowFontScaling: true, 28 | ); 29 | } 30 | 31 | return Stack( 32 | alignment: Alignment.center, 33 | children: [ 34 | Container( 35 | width: ScreenUtil().setWidth(124), 36 | height: ScreenUtil().setWidth(124), 37 | decoration: BoxDecoration( 38 | shape: BoxShape.circle, 39 | color: SchoolToolkitColors.blueGrey, 40 | ), 41 | ), 42 | Container( 43 | width: ScreenUtil().setWidth(94), 44 | height: ScreenUtil().setHeight(94), 45 | constraints: BoxConstraints( 46 | maxHeight: ScreenUtil().setHeight(94), 47 | maxWidth: ScreenUtil().setHeight(94), 48 | ), 49 | decoration: BoxDecoration( 50 | shape: BoxShape.circle, 51 | color: Colors.white, 52 | boxShadow: [ 53 | BoxShadow( 54 | blurRadius: ScreenUtil().setWidth(21), 55 | color: SchoolToolkitColors.greyShadow, 56 | offset: Offset( 57 | 0, 58 | ScreenUtil().setHeight(3), 59 | ), 60 | ), 61 | ], 62 | ), 63 | child: busy 64 | ? Center( 65 | child: Theme( 66 | data: ThemeData( 67 | primaryColor: SchoolToolkitColors.blue, 68 | accentColor: SchoolToolkitColors.blue, 69 | ), 70 | child: Container( 71 | height: ScreenUtil().setWidth(32), 72 | width: ScreenUtil().setWidth(32), 73 | child: CircularProgressIndicator(), 74 | ), 75 | ), 76 | ) 77 | : Icon( 78 | icon, 79 | color: SchoolToolkitColors.blue, 80 | size: FontSize.fontSize30, 81 | ), 82 | ), 83 | ], 84 | ); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /lib/src/information_tile_widget/information_tile_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class InformationTileWidget extends StatelessWidget { 8 | final String title; 9 | final String subTitle; 10 | final EdgeInsets padding; 11 | final EdgeInsets margin; 12 | final Color color; 13 | final IconData icon; 14 | final bool biggerTitle; 15 | final bool rounded; 16 | final Color iconColor; 17 | final Color iconBackgroundColor; 18 | final Function onTap; 19 | final Color titleColor; 20 | final Color subTitleColor; 21 | 22 | const InformationTileWidget({ 23 | Key key, 24 | this.title, 25 | this.subTitle, 26 | this.padding, 27 | this.margin, 28 | this.color = Colors.transparent, 29 | @required this.icon, 30 | this.biggerTitle = false, 31 | this.rounded = true, 32 | this.iconColor = SchoolToolkitColors.grey, 33 | this.iconBackgroundColor = Colors.white, 34 | this.onTap, 35 | this.titleColor = SchoolToolkitColors.darkBlack, 36 | this.subTitleColor = SchoolToolkitColors.grey, 37 | }) : assert(icon != null), 38 | super(key: key); 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | if (ScreenUtil() == null) { 43 | ScreenUtil.init( 44 | context, 45 | designSize: Size( 46 | ScreenSize.width, 47 | ScreenSize.height, 48 | ), 49 | allowFontScaling: true, 50 | ); 51 | } 52 | 53 | return Container( 54 | margin: margin, 55 | padding: padding, 56 | decoration: BoxDecoration( 57 | borderRadius: BorderRadius.circular( 58 | ScreenUtil().setWidth(5.0), 59 | ), 60 | color: color, 61 | ), 62 | child: Material( 63 | color: Colors.transparent, 64 | child: InkWell( 65 | onTap: onTap, 66 | child: Row( 67 | mainAxisAlignment: MainAxisAlignment.start, 68 | crossAxisAlignment: CrossAxisAlignment.center, 69 | children: [ 70 | Container( 71 | width: ScreenUtil().setWidth(42), 72 | height: ScreenUtil().setWidth(42), 73 | alignment: Alignment.center, 74 | decoration: BoxDecoration( 75 | shape: rounded ? BoxShape.circle : BoxShape.rectangle, 76 | color: iconBackgroundColor, 77 | borderRadius: !rounded 78 | ? BorderRadius.circular( 79 | ScreenUtil().setWidth(5), 80 | ) 81 | : null, 82 | ), 83 | child: Icon( 84 | icon, 85 | color: iconColor, 86 | size: FontSize.fontSize20, 87 | ), 88 | ), 89 | SizedBox( 90 | width: ScreenUtil().setWidth(18), 91 | ), 92 | Column( 93 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 94 | crossAxisAlignment: CrossAxisAlignment.start, 95 | children: [ 96 | if (title != null) 97 | Container( 98 | width: ScreenUtil().setWidth(250), 99 | child: Text( 100 | '${title ?? 'Untitled'}', 101 | style: TextStyle( 102 | color: biggerTitle ? titleColor : subTitleColor, 103 | fontSize: biggerTitle 104 | ? FontSize.fontSize16 105 | : FontSize.fontSize14, 106 | fontWeight: 107 | biggerTitle ? FontSize.bold : FontSize.regular, 108 | ), 109 | ), 110 | ), 111 | if (subTitle != null) 112 | Container( 113 | width: ScreenUtil().setWidth(250), 114 | child: Text( 115 | '${subTitle ?? 'Untitled'}', 116 | style: TextStyle( 117 | color: !biggerTitle ? titleColor : subTitleColor, 118 | fontSize: !biggerTitle 119 | ? FontSize.fontSize16 120 | : FontSize.fontSize14, 121 | fontWeight: 122 | !biggerTitle ? FontSize.bold : FontSize.regular, 123 | ), 124 | ), 125 | ), 126 | ], 127 | ), 128 | ], 129 | ), 130 | ), 131 | ), 132 | ); 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /lib/src/label_card/label_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 4 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 5 | 6 | class LabelCard extends StatelessWidget { 7 | final String label; 8 | final double width; 9 | final double height; 10 | final Color color; 11 | final TextStyle textStyle; 12 | 13 | const LabelCard({ 14 | Key key, 15 | this.label, 16 | this.width, 17 | this.height, 18 | this.color = Colors.black26, 19 | this.textStyle, 20 | }) : super(key: key); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | if (ScreenUtil() == null) { 25 | ScreenUtil.init( 26 | context, 27 | designSize: Size( 28 | ScreenSize.width, 29 | ScreenSize.height, 30 | ), 31 | allowFontScaling: true, 32 | ); 33 | } 34 | 35 | return Container( 36 | width: width, 37 | height: height, 38 | padding: EdgeInsets.symmetric( 39 | horizontal: ScreenUtil().setWidth(14), 40 | vertical: ScreenUtil().setHeight(5), 41 | ), 42 | decoration: BoxDecoration( 43 | color: color, 44 | borderRadius: BorderRadius.circular( 45 | ScreenUtil().setWidth(5), 46 | ), 47 | ), 48 | child: Text( 49 | '$label', 50 | style: textStyle ?? 51 | TextStyle( 52 | color: Colors.white, 53 | fontWeight: FontSize.bold, 54 | fontSize: FontSize.fontSize16, 55 | ), 56 | ), 57 | ); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /lib/src/nepali_calendar/nepali_calendar_event.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/foundation.dart'; 2 | import 'package:flutter/painting.dart'; 3 | import 'package:nepali_date_picker/nepali_date_picker.dart'; 4 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 5 | 6 | class NepaliCalendarEvent { 7 | NepaliDateTime dateTime; 8 | int weekDay; 9 | final Color color; 10 | final bool holiday; 11 | 12 | NepaliCalendarEvent.fromDateTime({ 13 | @required this.dateTime, 14 | this.color = SchoolToolkitColors.blue, 15 | this.holiday = false, 16 | }); 17 | 18 | NepaliCalendarEvent.fromWeekDay({ 19 | @required this.weekDay, 20 | this.color = SchoolToolkitColors.blue, 21 | this.holiday = false, 22 | }); 23 | } 24 | -------------------------------------------------------------------------------- /lib/src/notice_card/notice_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 5 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 6 | import 'package:school_ui_toolkit/src/label_card/label_card.dart'; 7 | import 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 8 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 9 | 10 | class NoticeCard extends StatelessWidget { 11 | final String title; 12 | final String subTitile; 13 | final Function onTap; 14 | final String date; 15 | 16 | const NoticeCard({ 17 | Key key, 18 | this.title, 19 | this.subTitile, 20 | this.onTap, 21 | this.date, 22 | }) : super(key: key); 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | if (ScreenUtil() == null) { 27 | ScreenUtil.init( 28 | context, 29 | designSize: Size( 30 | ScreenSize.width, 31 | ScreenSize.height, 32 | ), 33 | allowFontScaling: true, 34 | ); 35 | } 36 | 37 | return SchoolToolkitCard( 38 | active: true, 39 | height: ScreenUtil().setHeight(275), 40 | alignment: Alignment.center, 41 | child: Column( 42 | mainAxisAlignment: MainAxisAlignment.start, 43 | crossAxisAlignment: CrossAxisAlignment.center, 44 | children: [ 45 | Container( 46 | height: ScreenUtil().setWidth(48), 47 | width: ScreenUtil().setWidth(48), 48 | decoration: BoxDecoration( 49 | color: SchoolToolkitColors.darkYellow, 50 | borderRadius: BorderRadius.circular( 51 | ScreenUtil().setWidth(10), 52 | ), 53 | ), 54 | child: Icon( 55 | FontAwesomeIcons.exclamationTriangle, 56 | color: Colors.white, 57 | size: FontSize.fontSize20, 58 | ), 59 | ), 60 | SizedBox( 61 | height: ScreenUtil().setHeight(10), 62 | ), 63 | Text( 64 | '$title', 65 | style: TextStyle( 66 | color: Colors.white, 67 | fontWeight: FontSize.semiBold, 68 | letterSpacing: 1.0, 69 | fontSize: FontSize.fontSize16, 70 | ), 71 | ), 72 | SizedBox( 73 | height: ScreenUtil().setHeight(10), 74 | ), 75 | Text( 76 | '$subTitile', 77 | textAlign: TextAlign.center, 78 | overflow: TextOverflow.ellipsis, 79 | maxLines: 3, 80 | style: TextStyle( 81 | color: Colors.white70, 82 | fontWeight: FontSize.regular, 83 | fontSize: FontSize.fontSize16, 84 | ), 85 | ), 86 | SizedBox( 87 | height: ScreenUtil().setHeight(10), 88 | ), 89 | Row( 90 | crossAxisAlignment: CrossAxisAlignment.center, 91 | children: [ 92 | LabelCard( 93 | label: '$date', 94 | ), 95 | Expanded( 96 | child: Container(), 97 | ), 98 | GestureDetector( 99 | onTap: onTap, 100 | child: Text( 101 | 'READ MORE', 102 | style: TextStyle( 103 | color: Colors.white, 104 | fontWeight: FontSize.bold, 105 | fontSize: FontSize.fontSize16, 106 | ), 107 | ), 108 | ), 109 | IconButton( 110 | onPressed: onTap, 111 | icon: Icon( 112 | FontAwesomeIcons.arrowRight, 113 | color: Colors.white, 114 | size: FontSize.fontSize20, 115 | ), 116 | ), 117 | ], 118 | ), 119 | ], 120 | ), 121 | ); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /lib/src/outlined_button/outlined_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class OutlinedButton extends StatelessWidget { 8 | final Function onPressed; 9 | final String label; 10 | final bool busy; 11 | final EdgeInsets padding; 12 | 13 | const OutlinedButton({ 14 | Key key, 15 | this.onPressed, 16 | this.label, 17 | this.busy = false, 18 | this.padding, 19 | }) : super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | if (ScreenUtil() == null) { 24 | ScreenUtil.init( 25 | context, 26 | designSize: Size( 27 | ScreenSize.width, 28 | ScreenSize.height, 29 | ), 30 | allowFontScaling: true, 31 | ); 32 | } 33 | 34 | return FlatButton( 35 | onPressed: onPressed, 36 | shape: RoundedRectangleBorder( 37 | side: BorderSide( 38 | color: onPressed != null 39 | ? SchoolToolkitColors.blue 40 | : SchoolToolkitColors.lightGrey, 41 | width: ScreenUtil().setWidth(1.5), 42 | ), 43 | borderRadius: BorderRadius.circular( 44 | ScreenUtil().setWidth(5.0), 45 | ), 46 | ), 47 | disabledColor: Colors.white, 48 | color: Colors.white, 49 | textColor: SchoolToolkitColors.blue, 50 | disabledTextColor: SchoolToolkitColors.grey, 51 | child: Padding( 52 | padding: padding ?? 53 | EdgeInsets.symmetric( 54 | vertical: ScreenUtil().setWidth(16), 55 | ), 56 | child: Row( 57 | mainAxisAlignment: MainAxisAlignment.center, 58 | crossAxisAlignment: CrossAxisAlignment.center, 59 | children: [ 60 | Text( 61 | '$label', 62 | style: TextStyle( 63 | fontSize: FontSize.fontSize16, 64 | fontWeight: FontSize.semiBold, 65 | ), 66 | ), 67 | if (busy) ...[ 68 | SizedBox( 69 | width: ScreenUtil().setWidth(10), 70 | ), 71 | Theme( 72 | data: ThemeData( 73 | accentColor: SchoolToolkitColors.blue, 74 | ), 75 | child: Container( 76 | height: ScreenUtil().setWidth(15), 77 | width: ScreenUtil().setWidth(15), 78 | child: CircularProgressIndicator(), 79 | ), 80 | ), 81 | ] 82 | ], 83 | ), 84 | ), 85 | ); 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /lib/src/overlapping_button_card/overlapping_button_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class OverlappingButtonCard extends StatelessWidget { 8 | final Function onPressed; 9 | final String label; 10 | final Widget child; 11 | final EdgeInsets padding; 12 | final double height; 13 | final double width; 14 | 15 | const OverlappingButtonCard({ 16 | Key key, 17 | this.onPressed, 18 | this.label, 19 | this.padding, 20 | this.height, 21 | this.width, 22 | this.child, 23 | }) : super(key: key); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | if (ScreenUtil() == null) { 28 | ScreenUtil.init( 29 | context, 30 | designSize: Size( 31 | ScreenSize.width, 32 | ScreenSize.height, 33 | ), 34 | allowFontScaling: true, 35 | ); 36 | } 37 | 38 | return Stack( 39 | alignment: Alignment.center, 40 | overflow: Overflow.visible, 41 | children: [ 42 | Container( 43 | width: width, 44 | height: height, 45 | padding: padding, 46 | decoration: BoxDecoration( 47 | color: Colors.white, 48 | borderRadius: BorderRadius.circular( 49 | ScreenUtil().setWidth(20), 50 | ), 51 | boxShadow: [ 52 | BoxShadow( 53 | blurRadius: ScreenUtil().setWidth(34), 54 | color: SchoolToolkitColors.blackShadow, 55 | offset: Offset( 56 | 0, 57 | ScreenUtil().setHeight(1), 58 | ), 59 | ), 60 | ]), 61 | child: child, 62 | ), 63 | Positioned( 64 | top: (height ?? 0) - ScreenUtil().setHeight(30), 65 | child: FlatButton( 66 | onPressed: onPressed, 67 | disabledColor: SchoolToolkitColors.lightBlack, 68 | disabledTextColor: Colors.white54, 69 | textColor: SchoolToolkitColors.black, 70 | shape: RoundedRectangleBorder( 71 | borderRadius: BorderRadius.circular( 72 | ScreenUtil().setWidth(10), 73 | ), 74 | ), 75 | color: SchoolToolkitColors.yellow, 76 | child: Padding( 77 | padding: EdgeInsets.symmetric( 78 | vertical: ScreenUtil().setHeight(18), 79 | horizontal: ScreenUtil().setWidth(20), 80 | ), 81 | child: Text( 82 | '$label', 83 | style: TextStyle( 84 | fontSize: FontSize.fontSize16, 85 | fontWeight: FontSize.bold, 86 | ), 87 | ), 88 | ), 89 | ), 90 | ), 91 | ], 92 | ); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/src/profile_card/profile_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 5 | import 'package:school_ui_toolkit/src/information_tile_widget/information_tile_widget.dart'; 6 | import 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 7 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 8 | import 'package:school_ui_toolkit/src/video_list_tile_card/video_list_tile_card.dart'; 9 | 10 | class ProfileCard extends StatelessWidget { 11 | final String imageURL; 12 | final String name; 13 | final String post; 14 | final String email; 15 | final String phoneNumber; 16 | final EdgeInsets margin; 17 | final Function onPhoneNumberTap; 18 | final String infoTitle; 19 | final String info; 20 | 21 | const ProfileCard({ 22 | Key key, 23 | @required this.imageURL, 24 | this.name, 25 | this.post, 26 | this.email, 27 | this.phoneNumber, 28 | this.margin, 29 | this.onPhoneNumberTap, 30 | this.infoTitle, 31 | this.info, 32 | }) : assert(imageURL != null), 33 | super(key: key); 34 | 35 | @override 36 | Widget build(BuildContext context) { 37 | if (ScreenUtil() == null) { 38 | ScreenUtil.init( 39 | context, 40 | designSize: Size( 41 | ScreenSize.width, 42 | ScreenSize.height, 43 | ), 44 | allowFontScaling: true, 45 | ); 46 | } 47 | 48 | return SchoolToolkitCard( 49 | margin: margin, 50 | backgroundColor: Colors.white, 51 | showShadow: true, 52 | child: Column( 53 | mainAxisAlignment: MainAxisAlignment.start, 54 | crossAxisAlignment: CrossAxisAlignment.start, 55 | children: [ 56 | VideoListTileCard( 57 | title: '$name', 58 | author: '$post', 59 | thumbnailURL: imageURL, 60 | showIcon: false, 61 | ), 62 | SizedBox( 63 | height: ScreenUtil().setHeight(15), 64 | ), 65 | SchoolToolkitCard( 66 | backgroundColor: SchoolToolkitColors.blueGrey, 67 | child: Column( 68 | mainAxisAlignment: MainAxisAlignment.start, 69 | children: [ 70 | InformationTileWidget( 71 | icon: FontAwesomeIcons.envelope, 72 | title: 'Email', 73 | subTitle: '$email', 74 | ), 75 | SizedBox( 76 | height: ScreenUtil().setHeight(10), 77 | ), 78 | InformationTileWidget( 79 | icon: FontAwesomeIcons.phoneAlt, 80 | title: 'Phone Number', 81 | subTitle: '$phoneNumber', 82 | onTap: onPhoneNumberTap, 83 | ), 84 | if (infoTitle != null) ...[ 85 | SizedBox( 86 | height: ScreenUtil().setHeight(10), 87 | ), 88 | InformationTileWidget( 89 | icon: FontAwesomeIcons.info, 90 | title: '$infoTitle', 91 | subTitle: '$info', 92 | ), 93 | ], 94 | ], 95 | ), 96 | ), 97 | ], 98 | ), 99 | ); 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /lib/src/routine_card/routine_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 4 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 5 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 6 | import 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 7 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 8 | 9 | class RoutineCard extends StatelessWidget { 10 | final String classTopic; 11 | final String classType; 12 | final String subject; 13 | final String professor; 14 | final String time; 15 | 16 | const RoutineCard({ 17 | Key key, 18 | this.classTopic, 19 | this.classType, 20 | this.subject, 21 | this.professor, 22 | this.time, 23 | }) : super(key: key); 24 | 25 | @override 26 | Widget build(BuildContext context) { 27 | if (ScreenUtil() == null) { 28 | ScreenUtil.init( 29 | context, 30 | designSize: Size( 31 | ScreenSize.width, 32 | ScreenSize.height, 33 | ), 34 | allowFontScaling: true, 35 | ); 36 | } 37 | 38 | return SchoolToolkitCard( 39 | active: true, 40 | height: ScreenUtil().setHeight(210), 41 | width: ScreenUtil().setWidth(374), 42 | child: Column( 43 | mainAxisAlignment: MainAxisAlignment.start, 44 | crossAxisAlignment: CrossAxisAlignment.start, 45 | children: [ 46 | Row( 47 | mainAxisAlignment: MainAxisAlignment.start, 48 | crossAxisAlignment: CrossAxisAlignment.center, 49 | children: [ 50 | Container( 51 | width: ScreenUtil().setWidth(64), 52 | height: ScreenUtil().setWidth(64), 53 | decoration: BoxDecoration( 54 | color: Colors.white30, 55 | borderRadius: BorderRadius.circular( 56 | ScreenUtil().setWidth(10), 57 | ), 58 | ), 59 | child: Icon( 60 | FontAwesomeIcons.book, 61 | color: SchoolToolkitColors.blue, 62 | size: FontSize.fontSize28, 63 | ), 64 | ), 65 | SizedBox( 66 | width: ScreenUtil().setWidth(15), 67 | ), 68 | Column( 69 | children: [ 70 | Container( 71 | width: ScreenUtil().setWidth(240), 72 | child: Text( 73 | '$classTopic', 74 | style: TextStyle( 75 | color: Colors.white, 76 | fontSize: FontSize.fontSize18, 77 | fontWeight: FontSize.semiBold, 78 | letterSpacing: 1.0, 79 | ), 80 | ), 81 | ), 82 | Container( 83 | width: ScreenUtil().setWidth(240), 84 | child: Text( 85 | '${classType ?? ''}', 86 | style: TextStyle( 87 | color: Colors.white60, 88 | fontSize: FontSize.fontSize14, 89 | fontWeight: FontSize.regular, 90 | ), 91 | ), 92 | ), 93 | ], 94 | ), 95 | ], 96 | ), 97 | SizedBox( 98 | height: ScreenUtil().setHeight(15), 99 | ), 100 | Row( 101 | mainAxisAlignment: MainAxisAlignment.start, 102 | crossAxisAlignment: CrossAxisAlignment.center, 103 | children: [ 104 | Column( 105 | mainAxisAlignment: MainAxisAlignment.start, 106 | crossAxisAlignment: CrossAxisAlignment.start, 107 | children: [ 108 | Text( 109 | 'Subject', 110 | style: TextStyle( 111 | color: Colors.white60, 112 | fontSize: FontSize.fontSize14, 113 | fontWeight: FontSize.regular, 114 | ), 115 | ), 116 | Container( 117 | width: ScreenUtil().setWidth(150), 118 | height: ScreenUtil().setHeight(20), 119 | alignment: Alignment.centerLeft, 120 | child: FittedBox( 121 | child: Text( 122 | '$subject', 123 | style: TextStyle( 124 | color: Colors.white, 125 | fontSize: FontSize.fontSize14, 126 | fontWeight: FontSize.semiBold, 127 | letterSpacing: 1.0, 128 | ), 129 | ), 130 | ), 131 | ), 132 | ], 133 | ), 134 | Column( 135 | mainAxisAlignment: MainAxisAlignment.start, 136 | crossAxisAlignment: CrossAxisAlignment.start, 137 | children: [ 138 | Text( 139 | 'Professor/Teacher', 140 | style: TextStyle( 141 | color: Colors.white60, 142 | fontSize: FontSize.fontSize14, 143 | fontWeight: FontSize.regular, 144 | ), 145 | ), 146 | Container( 147 | width: ScreenUtil().setWidth(190), 148 | height: ScreenUtil().setHeight(20), 149 | alignment: Alignment.centerLeft, 150 | child: Text( 151 | '$professor', 152 | style: TextStyle( 153 | color: Colors.white, 154 | fontSize: FontSize.fontSize14, 155 | fontWeight: FontSize.semiBold, 156 | letterSpacing: 1.0, 157 | ), 158 | ), 159 | ), 160 | ], 161 | ), 162 | ], 163 | ), 164 | SizedBox( 165 | height: ScreenUtil().setHeight(10), 166 | ), 167 | Container( 168 | width: ScreenUtil().setWidth(132), 169 | height: ScreenUtil().setHeight(32), 170 | decoration: BoxDecoration( 171 | color: Colors.black26, 172 | borderRadius: BorderRadius.circular( 173 | ScreenUtil().setWidth(5), 174 | ), 175 | ), 176 | alignment: Alignment.center, 177 | child: Text( 178 | '$time', 179 | style: TextStyle( 180 | color: Colors.white, 181 | fontSize: FontSize.fontSize14, 182 | fontWeight: FontSize.semiBold, 183 | letterSpacing: 1.0, 184 | ), 185 | ), 186 | ), 187 | ], 188 | ), 189 | ); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /lib/src/school_location_widget/school_location_widget.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter/rendering.dart'; 4 | import 'package:flutter_screenutil/screenutil.dart'; 5 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 6 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 7 | import 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 8 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 9 | 10 | class SchoolLocationWidget extends StatelessWidget { 11 | final String imageURL; 12 | final String address; 13 | final String name; 14 | 15 | const SchoolLocationWidget({ 16 | Key key, 17 | this.imageURL, 18 | this.address, 19 | this.name, 20 | }) : super(key: key); 21 | 22 | @override 23 | Widget build(BuildContext context) { 24 | if (ScreenUtil() == null) { 25 | ScreenUtil.init( 26 | context, 27 | designSize: Size( 28 | ScreenSize.width, 29 | ScreenSize.height, 30 | ), 31 | allowFontScaling: true, 32 | ); 33 | } 34 | 35 | return SchoolToolkitCard( 36 | width: 374, 37 | height: 97, 38 | child: Row( 39 | mainAxisAlignment: MainAxisAlignment.start, 40 | children: [ 41 | Container( 42 | height: ScreenUtil().setHeight(67), 43 | width: ScreenUtil().setWidth(67), 44 | child: CachedNetworkImage( 45 | imageUrl: imageURL, 46 | width: ScreenUtil().setHeight(67), 47 | height: ScreenUtil().setWidth(67), 48 | placeholder: (context, string) => Center( 49 | child: CircularProgressIndicator(), 50 | ), 51 | ), 52 | ), 53 | SizedBox( 54 | width: ScreenUtil().setWidth(17), 55 | ), 56 | Column( 57 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 58 | crossAxisAlignment: CrossAxisAlignment.start, 59 | children: [ 60 | Container( 61 | width: ScreenUtil().setWidth(250), 62 | height: ScreenUtil().setHeight(25), 63 | child: SingleChildScrollView( 64 | scrollDirection: Axis.horizontal, 65 | physics: AlwaysScrollableScrollPhysics(), 66 | child: Text( 67 | '$name', 68 | style: TextStyle( 69 | fontSize: FontSize.fontSize16, 70 | fontWeight: FontSize.bold, 71 | color: SchoolToolkitColors.darkBlack, 72 | ), 73 | ), 74 | ), 75 | ), 76 | Row( 77 | mainAxisAlignment: MainAxisAlignment.start, 78 | crossAxisAlignment: CrossAxisAlignment.center, 79 | children: [ 80 | Icon( 81 | Icons.location_on, 82 | color: SchoolToolkitColors.blue, 83 | size: FontSize.fontSize18, 84 | ), 85 | Container( 86 | width: ScreenUtil().setWidth(232), 87 | height: ScreenUtil().setHeight(25), 88 | child: SingleChildScrollView( 89 | scrollDirection: Axis.horizontal, 90 | child: Text( 91 | '$address', 92 | overflow: TextOverflow.ellipsis, 93 | style: TextStyle( 94 | fontSize: FontSize.fontSize14, 95 | color: SchoolToolkitColors.lightBlack, 96 | ), 97 | ), 98 | ), 99 | ), 100 | ], 101 | ), 102 | ], 103 | ), 104 | ], 105 | ), 106 | ); 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /lib/src/school_toolkit_button/school_toolkit_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class SchoolToolkitButton extends StatelessWidget { 8 | final Function onPressed; 9 | final String label; 10 | final bool busy; 11 | 12 | const SchoolToolkitButton({ 13 | Key key, 14 | this.onPressed, 15 | this.label, 16 | this.busy = false, 17 | }) : super(key: key); 18 | 19 | @override 20 | Widget build(BuildContext context) { 21 | if (ScreenUtil() == null) { 22 | ScreenUtil.init( 23 | context, 24 | designSize: Size( 25 | ScreenSize.width, 26 | ScreenSize.height, 27 | ), 28 | allowFontScaling: true, 29 | ); 30 | } 31 | 32 | return FlatButton( 33 | onPressed: onPressed, 34 | shape: RoundedRectangleBorder( 35 | borderRadius: BorderRadius.circular( 36 | ScreenUtil().setWidth(5.0), 37 | ), 38 | ), 39 | disabledColor: SchoolToolkitColors.lightBlack, 40 | color: SchoolToolkitColors.blue, 41 | child: Padding( 42 | padding: EdgeInsets.symmetric( 43 | vertical: ScreenUtil().setWidth(16), 44 | ), 45 | child: Row( 46 | mainAxisAlignment: MainAxisAlignment.center, 47 | crossAxisAlignment: CrossAxisAlignment.center, 48 | children: [ 49 | Text( 50 | '$label', 51 | style: TextStyle( 52 | color: Colors.white, 53 | fontSize: FontSize.fontSize16, 54 | fontWeight: FontSize.semiBold, 55 | ), 56 | ), 57 | if (busy) ...[ 58 | SizedBox( 59 | width: ScreenUtil().setWidth(10), 60 | ), 61 | Theme( 62 | data: ThemeData( 63 | primaryColor: SchoolToolkitColors.blue, 64 | accentColor: Colors.white, 65 | ), 66 | child: Container( 67 | height: ScreenUtil().setWidth(15), 68 | width: ScreenUtil().setWidth(15), 69 | child: CircularProgressIndicator(), 70 | ), 71 | ), 72 | ] 73 | ], 74 | ), 75 | ), 76 | ); 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /lib/src/school_toolkit_card/school_toolkit_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 4 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 5 | 6 | class SchoolToolkitCard extends StatelessWidget { 7 | final Widget child; 8 | final Color backgroundColor; 9 | final Color activeColor; 10 | final bool active; 11 | final Duration animationDuration; 12 | final Alignment alignment; 13 | final double width; 14 | final double height; 15 | final bool showShadow; 16 | final EdgeInsets margin; 17 | 18 | const SchoolToolkitCard({ 19 | Key key, 20 | this.child, 21 | this.backgroundColor = SchoolToolkitColors.blueGrey, 22 | this.activeColor = SchoolToolkitColors.blue, 23 | this.active = false, 24 | this.animationDuration = const Duration(milliseconds: 300), 25 | this.alignment = Alignment.center, 26 | this.width, 27 | this.height, 28 | this.showShadow = false, 29 | this.margin, 30 | }) : super(key: key); 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | if (ScreenUtil() == null) { 35 | ScreenUtil.init( 36 | context, 37 | designSize: Size( 38 | ScreenSize.width, 39 | ScreenSize.height, 40 | ), 41 | allowFontScaling: true, 42 | ); 43 | } 44 | 45 | return AnimatedContainer( 46 | duration: animationDuration, 47 | padding: EdgeInsets.all( 48 | ScreenUtil().setWidth(15), 49 | ), 50 | margin: margin, 51 | curve: Curves.ease, 52 | width: width, 53 | height: height, 54 | alignment: alignment, 55 | decoration: BoxDecoration( 56 | color: active ? activeColor : backgroundColor, 57 | borderRadius: BorderRadius.circular( 58 | ScreenUtil().setWidth(10), 59 | ), 60 | boxShadow: showShadow 61 | ? [ 62 | BoxShadow( 63 | blurRadius: ScreenUtil().setHeight(15), 64 | color: SchoolToolkitColors.blackShadow, 65 | offset: Offset( 66 | 0, 67 | ScreenUtil().setHeight(15), 68 | ), 69 | spreadRadius: ScreenUtil().setHeight(13), 70 | ), 71 | ] 72 | : [], 73 | ), 74 | child: child, 75 | ); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /lib/src/school_toolkit_role_button/school_toolkit_role_button.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 4 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 5 | import 'package:school_ui_toolkit/src/school_toolkit_card/school_toolkit_card.dart'; 6 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 7 | 8 | class SchoolToolkitRoleButton extends StatelessWidget { 9 | final String label; 10 | final IconData iconData; 11 | final bool selected; 12 | 13 | const SchoolToolkitRoleButton({ 14 | Key key, 15 | this.label, 16 | @required this.iconData, 17 | this.selected = false, 18 | }) : assert(iconData != null), 19 | super(key: key); 20 | 21 | @override 22 | Widget build(BuildContext context) { 23 | if (ScreenUtil() == null) { 24 | ScreenUtil.init( 25 | context, 26 | designSize: Size( 27 | ScreenSize.width, 28 | ScreenSize.height, 29 | ), 30 | allowFontScaling: true, 31 | ); 32 | } 33 | 34 | return SchoolToolkitCard( 35 | width: ScreenUtil().setWidth(177), 36 | height: ScreenUtil().setHeight(120), 37 | active: selected, 38 | alignment: Alignment.centerLeft, 39 | child: AnimatedSwitcher( 40 | duration: Duration( 41 | milliseconds: 300, 42 | ), 43 | child: Column( 44 | mainAxisAlignment: MainAxisAlignment.start, 45 | crossAxisAlignment: CrossAxisAlignment.start, 46 | children: [ 47 | Opacity( 48 | opacity: selected ? 0.3 : 1.0, 49 | child: Container( 50 | width: ScreenUtil().setWidth(48), 51 | height: ScreenUtil().setWidth(48), 52 | decoration: BoxDecoration( 53 | color: selected ? Colors.black : Colors.white, 54 | borderRadius: BorderRadius.circular( 55 | ScreenUtil().setWidth(10), 56 | ), 57 | ), 58 | child: Icon( 59 | iconData, 60 | color: selected ? Colors.white : SchoolToolkitColors.blue, 61 | ), 62 | ), 63 | ), 64 | SizedBox( 65 | height: ScreenUtil().setHeight(6), 66 | ), 67 | Text( 68 | '$label', 69 | style: TextStyle( 70 | color: selected ? Colors.white : SchoolToolkitColors.blue, 71 | fontSize: FontSize.fontSize16, 72 | fontWeight: FontSize.semiBold, 73 | ), 74 | ), 75 | ], 76 | ), 77 | ), 78 | ); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /lib/src/school_toolkit_text_field/school_toolkit_text_field.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_screenutil/screenutil.dart'; 3 | import 'package:school_ui_toolkit/school_ui_toolkit.dart'; 4 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 5 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 6 | 7 | class SchoolToolkitTextField extends StatefulWidget { 8 | final bool obscureText; 9 | final TextEditingController controller; 10 | final Function(String) onChanged; 11 | final Function(String) onSaved; 12 | final Function(String) onFieldSubmitted; 13 | final VoidCallback onTap; 14 | final String errorText; 15 | final String label; 16 | final String hint; 17 | 18 | const SchoolToolkitTextField({ 19 | Key key, 20 | this.obscureText = false, 21 | this.controller, 22 | this.onChanged, 23 | this.onSaved, 24 | this.onFieldSubmitted, 25 | this.onTap, 26 | this.errorText, 27 | this.label, 28 | this.hint, 29 | }) : super(key: key); 30 | 31 | @override 32 | _SchoolToolkitTextFieldState createState() => _SchoolToolkitTextFieldState(); 33 | } 34 | 35 | class _SchoolToolkitTextFieldState extends State { 36 | @override 37 | Widget build(BuildContext context) { 38 | if (ScreenUtil() == null) { 39 | ScreenUtil.init( 40 | context, 41 | designSize: Size( 42 | ScreenSize.width, 43 | ScreenSize.height, 44 | ), 45 | allowFontScaling: true, 46 | ); 47 | } 48 | 49 | return TextFormField( 50 | controller: widget.controller, 51 | obscureText: widget.obscureText, 52 | onChanged: widget.onChanged, 53 | onSaved: widget.onSaved, 54 | onFieldSubmitted: widget.onFieldSubmitted, 55 | onTap: widget.onTap, 56 | decoration: InputDecoration( 57 | fillColor: SchoolToolkitColors.blueGrey, 58 | filled: true, 59 | hintStyle: TextStyle( 60 | fontSize: FontSize.fontSize18, 61 | color: SchoolToolkitColors.mediumGrey, 62 | ), 63 | hintText: widget.hint, 64 | border: OutlineInputBorder( 65 | borderRadius: BorderRadius.circular( 66 | ScreenUtil().setWidth(5.0), 67 | ), 68 | borderSide: BorderSide( 69 | color: Colors.transparent, 70 | ), 71 | ), 72 | enabledBorder: OutlineInputBorder( 73 | borderRadius: BorderRadius.circular( 74 | ScreenUtil().setWidth(5.0), 75 | ), 76 | borderSide: BorderSide( 77 | color: Colors.transparent, 78 | ), 79 | ), 80 | focusedBorder: OutlineInputBorder( 81 | borderRadius: BorderRadius.circular( 82 | ScreenUtil().setWidth(5.0), 83 | ), 84 | borderSide: BorderSide( 85 | color: SchoolToolkitColors.lightBlue, 86 | ), 87 | ), 88 | contentPadding: EdgeInsets.symmetric( 89 | horizontal: ScreenUtil().setWidth(20), 90 | ), 91 | errorText: widget.errorText, 92 | labelText: widget.label, 93 | ), 94 | ); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /lib/src/utils/calendar_utils.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:nepali_date_picker/nepali_date_picker.dart'; 3 | import 'package:school_ui_toolkit/src/calendar/calendar_event.dart'; 4 | import 'package:school_ui_toolkit/src/nepali_calendar/nepali_calendar_event.dart'; 5 | 6 | class CalendarUtils { 7 | /// holday takes precedence over other colors 8 | static Color getNepaliCalendarEventColor( 9 | NepaliDateTime date, 10 | List recurringEventsByWeekday, 11 | List recurringEventsByDay, 12 | List calendarEvents, 13 | ) { 14 | Color color = Colors.transparent; 15 | NepaliCalendarEvent holidayEvent; 16 | 17 | if (checkIfRecurringByWeekDayBS(date, recurringEventsByWeekday)) { 18 | recurringEventsByWeekday.forEach((element) { 19 | if (element.weekDay == date.weekday) { 20 | if (element.holiday) { 21 | holidayEvent = element; 22 | color = element.color; 23 | } else if (holidayEvent == null) { 24 | color = element.color; 25 | } 26 | } 27 | }); 28 | } 29 | 30 | if (checkIfRecurringByDayBS(date, recurringEventsByDay)) { 31 | recurringEventsByDay.forEach((element) { 32 | if (element.dateTime.day == date.day) { 33 | if (element.holiday) { 34 | holidayEvent = element; 35 | color = element.color; 36 | } else if (holidayEvent == null) { 37 | color = element.color; 38 | } 39 | } 40 | }); 41 | } 42 | 43 | if (checkIfCalendarEventBS(date, calendarEvents)) { 44 | calendarEvents.forEach((element) { 45 | if (element.dateTime.day == date.day && 46 | element.dateTime.month == date.month && 47 | element.dateTime.year == date.year) { 48 | if (element.holiday) { 49 | holidayEvent = element; 50 | color = element.color; 51 | } else if (holidayEvent == null) { 52 | color = element.color; 53 | } 54 | } 55 | }); 56 | } 57 | 58 | return color; 59 | } 60 | 61 | /// holday takes precedence over other colors 62 | static Color getCalendarEventColor( 63 | DateTime date, 64 | List recurringEventsByWeekday, 65 | List recurringEventsByDay, 66 | List calendarEvents, 67 | ) { 68 | Color color = Colors.transparent; 69 | CalendarEvent holidayEvent; 70 | 71 | if (checkIfRecurringByWeekDay(date, recurringEventsByWeekday)) { 72 | recurringEventsByWeekday.forEach((element) { 73 | if (element.weekDay == date.weekday) { 74 | if (element.holiday) { 75 | holidayEvent = element; 76 | color = element.color; 77 | } else if (holidayEvent == null) { 78 | color = element.color; 79 | } 80 | } 81 | }); 82 | } 83 | 84 | if (checkIfRecurringByDay(date, recurringEventsByDay)) { 85 | recurringEventsByDay.forEach((element) { 86 | if (element.dateTime.day == date.day) { 87 | if (element.holiday) { 88 | holidayEvent = element; 89 | color = element.color; 90 | } else if (holidayEvent == null) { 91 | color = element.color; 92 | } 93 | } 94 | }); 95 | } 96 | 97 | if (checkIfCalendarEvent(date, calendarEvents)) { 98 | calendarEvents.forEach((element) { 99 | if (element.dateTime.day == date.day && 100 | element.dateTime.month == date.month && 101 | element.dateTime.year == date.year) { 102 | if (element.holiday) { 103 | holidayEvent = element; 104 | color = element.color; 105 | } else if (holidayEvent == null) { 106 | color = element.color; 107 | } 108 | } 109 | }); 110 | } 111 | 112 | return color; 113 | } 114 | 115 | static bool checkIfRecurringByDay( 116 | DateTime date, List eventList) { 117 | if (eventList == null) return false; 118 | return eventList?.indexWhere((event) => event.dateTime.day == date.day) != 119 | -1; 120 | } 121 | 122 | static bool checkIfCalendarEvent( 123 | DateTime date, List eventList) { 124 | if (eventList == null) return false; 125 | return eventList?.indexWhere((event) => (event.dateTime.day == date.day && 126 | event.dateTime.month == date.month && 127 | event.dateTime.year == date.year)) != 128 | -1; 129 | } 130 | 131 | static bool checkIfRecurringByWeekDay( 132 | DateTime date, List eventList) { 133 | if (eventList == null) return false; 134 | return eventList?.indexWhere((event) => event.weekDay == date.weekday) != 135 | -1; 136 | } 137 | 138 | static bool checkIfRecurringByDayBS( 139 | NepaliDateTime date, List eventList) { 140 | if (eventList == null) return false; 141 | return eventList?.indexWhere((event) => event.dateTime.day == date.day) != 142 | -1; 143 | } 144 | 145 | static bool checkIfCalendarEventBS( 146 | NepaliDateTime date, List eventList) { 147 | if (eventList == null) return false; 148 | return eventList?.indexWhere((event) => (event.dateTime.day == date.day && 149 | event.dateTime.month == date.month && 150 | event.dateTime.year == date.year)) != 151 | -1; 152 | } 153 | 154 | static bool checkIfRecurringByWeekDayBS( 155 | NepaliDateTime date, List eventList) { 156 | if (eventList == null) return false; 157 | return eventList?.indexWhere((event) => event.weekDay == date.weekday) != 158 | -1; 159 | } 160 | } 161 | -------------------------------------------------------------------------------- /lib/src/utils/screen_size.dart: -------------------------------------------------------------------------------- 1 | class ScreenSize { 2 | static const double width = 414.0; 3 | static const double height = 896.0; 4 | } 5 | -------------------------------------------------------------------------------- /lib/src/video_list_tile_card/video_list_tile_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:cached_network_image/cached_network_image.dart'; 2 | import 'package:flutter/material.dart'; 3 | import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 | import 'package:font_awesome_flutter/font_awesome_flutter.dart'; 5 | import 'package:school_ui_toolkit/src/colors/school_toolkit_colors.dart'; 6 | import 'package:school_ui_toolkit/src/font_size/font_size.dart'; 7 | import 'package:school_ui_toolkit/src/utils/screen_size.dart'; 8 | 9 | class VideoListTileCard extends StatelessWidget { 10 | final String title; 11 | final String author; 12 | final String thumbnailURL; 13 | final EdgeInsets padding; 14 | final EdgeInsets margin; 15 | final Color color; 16 | final bool showIcon; 17 | final Function onTap; 18 | 19 | const VideoListTileCard({ 20 | Key key, 21 | this.title, 22 | this.author, 23 | @required this.thumbnailURL, 24 | this.padding, 25 | this.margin, 26 | this.color = Colors.transparent, 27 | this.showIcon = true, 28 | this.onTap, 29 | }) : assert(thumbnailURL != null), 30 | super(key: key); 31 | 32 | @override 33 | Widget build(BuildContext context) { 34 | if (ScreenUtil() == null) { 35 | ScreenUtil.init( 36 | context, 37 | designSize: Size( 38 | ScreenSize.width, 39 | ScreenSize.height, 40 | ), 41 | allowFontScaling: true, 42 | ); 43 | } 44 | 45 | return Container( 46 | margin: margin, 47 | padding: padding, 48 | decoration: BoxDecoration( 49 | borderRadius: BorderRadius.circular( 50 | ScreenUtil().setWidth(5.0), 51 | ), 52 | color: color, 53 | ), 54 | child: Material( 55 | color: Colors.transparent, 56 | child: InkWell( 57 | onTap: onTap, 58 | child: Row( 59 | mainAxisAlignment: MainAxisAlignment.start, 60 | crossAxisAlignment: CrossAxisAlignment.center, 61 | children: [ 62 | ClipRRect( 63 | borderRadius: BorderRadius.circular( 64 | ScreenUtil().setWidth(5), 65 | ), 66 | child: Container( 67 | width: ScreenUtil().setWidth(60), 68 | height: ScreenUtil().setWidth(60), 69 | color: SchoolToolkitColors.black, 70 | child: CachedNetworkImage( 71 | imageUrl: thumbnailURL, 72 | errorWidget: (context, string, _) => Container(), 73 | width: ScreenUtil().setWidth(60), 74 | height: ScreenUtil().setWidth(60), 75 | fit: BoxFit.cover, 76 | ), 77 | ), 78 | ), 79 | SizedBox( 80 | width: ScreenUtil().setWidth(18), 81 | ), 82 | Column( 83 | mainAxisAlignment: MainAxisAlignment.spaceEvenly, 84 | crossAxisAlignment: CrossAxisAlignment.start, 85 | children: [ 86 | Container( 87 | width: ScreenUtil().setWidth(260), 88 | child: Text( 89 | '${title ?? 'Untitled Video'}', 90 | style: TextStyle( 91 | color: SchoolToolkitColors.darkBlack, 92 | fontSize: FontSize.fontSize16, 93 | fontWeight: FontSize.bold, 94 | ), 95 | ), 96 | ), 97 | Row( 98 | mainAxisAlignment: MainAxisAlignment.start, 99 | crossAxisAlignment: CrossAxisAlignment.center, 100 | children: [ 101 | if (showIcon) ...[ 102 | Icon( 103 | FontAwesomeIcons.userGraduate, 104 | size: FontSize.fontSize16, 105 | color: SchoolToolkitColors.grey, 106 | ), 107 | SizedBox( 108 | width: ScreenUtil().setWidth(10), 109 | ), 110 | ], 111 | Container( 112 | width: ScreenUtil().setWidth(234), 113 | child: Text( 114 | '${author ?? 'Unknown Author'}', 115 | style: TextStyle( 116 | color: SchoolToolkitColors.grey, 117 | fontSize: FontSize.fontSize14, 118 | fontWeight: FontSize.regular, 119 | ), 120 | ), 121 | ), 122 | ], 123 | ), 124 | ], 125 | ), 126 | ], 127 | ), 128 | ), 129 | ), 130 | ); 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.5.0-nullsafety.1" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "2.1.0-nullsafety.1" 18 | cached_network_image: 19 | dependency: "direct main" 20 | description: 21 | name: cached_network_image 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "2.3.3" 25 | characters: 26 | dependency: transitive 27 | description: 28 | name: characters 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.1.0-nullsafety.3" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "1.2.0-nullsafety.1" 39 | clock: 40 | dependency: transitive 41 | description: 42 | name: clock 43 | url: "https://pub.dartlang.org" 44 | source: hosted 45 | version: "1.1.0-nullsafety.1" 46 | collection: 47 | dependency: transitive 48 | description: 49 | name: collection 50 | url: "https://pub.dartlang.org" 51 | source: hosted 52 | version: "1.15.0-nullsafety.3" 53 | convert: 54 | dependency: transitive 55 | description: 56 | name: convert 57 | url: "https://pub.dartlang.org" 58 | source: hosted 59 | version: "2.1.1" 60 | crypto: 61 | dependency: transitive 62 | description: 63 | name: crypto 64 | url: "https://pub.dartlang.org" 65 | source: hosted 66 | version: "2.1.5" 67 | fake_async: 68 | dependency: transitive 69 | description: 70 | name: fake_async 71 | url: "https://pub.dartlang.org" 72 | source: hosted 73 | version: "1.2.0-nullsafety.1" 74 | ffi: 75 | dependency: transitive 76 | description: 77 | name: ffi 78 | url: "https://pub.dartlang.org" 79 | source: hosted 80 | version: "0.1.3" 81 | file: 82 | dependency: transitive 83 | description: 84 | name: file 85 | url: "https://pub.dartlang.org" 86 | source: hosted 87 | version: "5.2.1" 88 | flutter: 89 | dependency: "direct main" 90 | description: flutter 91 | source: sdk 92 | version: "0.0.0" 93 | flutter_blurhash: 94 | dependency: transitive 95 | description: 96 | name: flutter_blurhash 97 | url: "https://pub.dartlang.org" 98 | source: hosted 99 | version: "0.5.0" 100 | flutter_cache_manager: 101 | dependency: transitive 102 | description: 103 | name: flutter_cache_manager 104 | url: "https://pub.dartlang.org" 105 | source: hosted 106 | version: "2.0.0" 107 | flutter_screenutil: 108 | dependency: "direct main" 109 | description: 110 | name: flutter_screenutil 111 | url: "https://pub.dartlang.org" 112 | source: hosted 113 | version: "3.2.0" 114 | flutter_test: 115 | dependency: "direct dev" 116 | description: flutter 117 | source: sdk 118 | version: "0.0.0" 119 | font_awesome_flutter: 120 | dependency: "direct main" 121 | description: 122 | name: font_awesome_flutter 123 | url: "https://pub.dartlang.org" 124 | source: hosted 125 | version: "8.10.0" 126 | http: 127 | dependency: transitive 128 | description: 129 | name: http 130 | url: "https://pub.dartlang.org" 131 | source: hosted 132 | version: "0.12.2" 133 | http_parser: 134 | dependency: transitive 135 | description: 136 | name: http_parser 137 | url: "https://pub.dartlang.org" 138 | source: hosted 139 | version: "3.1.4" 140 | intl: 141 | dependency: "direct main" 142 | description: 143 | name: intl 144 | url: "https://pub.dartlang.org" 145 | source: hosted 146 | version: "0.16.1" 147 | matcher: 148 | dependency: transitive 149 | description: 150 | name: matcher 151 | url: "https://pub.dartlang.org" 152 | source: hosted 153 | version: "0.12.10-nullsafety.1" 154 | meta: 155 | dependency: transitive 156 | description: 157 | name: meta 158 | url: "https://pub.dartlang.org" 159 | source: hosted 160 | version: "1.3.0-nullsafety.4" 161 | nepali_date_picker: 162 | dependency: "direct main" 163 | description: 164 | name: nepali_date_picker 165 | url: "https://pub.dartlang.org" 166 | source: hosted 167 | version: "4.2.0+1" 168 | nepali_utils: 169 | dependency: transitive 170 | description: 171 | name: nepali_utils 172 | url: "https://pub.dartlang.org" 173 | source: hosted 174 | version: "2.2.1" 175 | octo_image: 176 | dependency: transitive 177 | description: 178 | name: octo_image 179 | url: "https://pub.dartlang.org" 180 | source: hosted 181 | version: "0.3.0" 182 | path: 183 | dependency: transitive 184 | description: 185 | name: path 186 | url: "https://pub.dartlang.org" 187 | source: hosted 188 | version: "1.8.0-nullsafety.1" 189 | path_provider: 190 | dependency: transitive 191 | description: 192 | name: path_provider 193 | url: "https://pub.dartlang.org" 194 | source: hosted 195 | version: "1.6.22" 196 | path_provider_linux: 197 | dependency: transitive 198 | description: 199 | name: path_provider_linux 200 | url: "https://pub.dartlang.org" 201 | source: hosted 202 | version: "0.0.1+2" 203 | path_provider_macos: 204 | dependency: transitive 205 | description: 206 | name: path_provider_macos 207 | url: "https://pub.dartlang.org" 208 | source: hosted 209 | version: "0.0.4+4" 210 | path_provider_platform_interface: 211 | dependency: transitive 212 | description: 213 | name: path_provider_platform_interface 214 | url: "https://pub.dartlang.org" 215 | source: hosted 216 | version: "1.0.3" 217 | path_provider_windows: 218 | dependency: transitive 219 | description: 220 | name: path_provider_windows 221 | url: "https://pub.dartlang.org" 222 | source: hosted 223 | version: "0.0.4+1" 224 | pedantic: 225 | dependency: transitive 226 | description: 227 | name: pedantic 228 | url: "https://pub.dartlang.org" 229 | source: hosted 230 | version: "1.9.2" 231 | platform: 232 | dependency: transitive 233 | description: 234 | name: platform 235 | url: "https://pub.dartlang.org" 236 | source: hosted 237 | version: "2.2.1" 238 | plugin_platform_interface: 239 | dependency: transitive 240 | description: 241 | name: plugin_platform_interface 242 | url: "https://pub.dartlang.org" 243 | source: hosted 244 | version: "1.0.3" 245 | process: 246 | dependency: transitive 247 | description: 248 | name: process 249 | url: "https://pub.dartlang.org" 250 | source: hosted 251 | version: "3.0.13" 252 | rxdart: 253 | dependency: transitive 254 | description: 255 | name: rxdart 256 | url: "https://pub.dartlang.org" 257 | source: hosted 258 | version: "0.24.1" 259 | sky_engine: 260 | dependency: transitive 261 | description: flutter 262 | source: sdk 263 | version: "0.0.99" 264 | source_span: 265 | dependency: transitive 266 | description: 267 | name: source_span 268 | url: "https://pub.dartlang.org" 269 | source: hosted 270 | version: "1.8.0-nullsafety.2" 271 | sqflite: 272 | dependency: transitive 273 | description: 274 | name: sqflite 275 | url: "https://pub.dartlang.org" 276 | source: hosted 277 | version: "1.3.2+1" 278 | sqflite_common: 279 | dependency: transitive 280 | description: 281 | name: sqflite_common 282 | url: "https://pub.dartlang.org" 283 | source: hosted 284 | version: "1.0.2+1" 285 | stack_trace: 286 | dependency: transitive 287 | description: 288 | name: stack_trace 289 | url: "https://pub.dartlang.org" 290 | source: hosted 291 | version: "1.10.0-nullsafety.4" 292 | stream_channel: 293 | dependency: transitive 294 | description: 295 | name: stream_channel 296 | url: "https://pub.dartlang.org" 297 | source: hosted 298 | version: "2.1.0-nullsafety.1" 299 | string_scanner: 300 | dependency: transitive 301 | description: 302 | name: string_scanner 303 | url: "https://pub.dartlang.org" 304 | source: hosted 305 | version: "1.1.0-nullsafety.1" 306 | synchronized: 307 | dependency: transitive 308 | description: 309 | name: synchronized 310 | url: "https://pub.dartlang.org" 311 | source: hosted 312 | version: "2.2.0+2" 313 | term_glyph: 314 | dependency: transitive 315 | description: 316 | name: term_glyph 317 | url: "https://pub.dartlang.org" 318 | source: hosted 319 | version: "1.2.0-nullsafety.1" 320 | test_api: 321 | dependency: transitive 322 | description: 323 | name: test_api 324 | url: "https://pub.dartlang.org" 325 | source: hosted 326 | version: "0.2.19-nullsafety.2" 327 | typed_data: 328 | dependency: transitive 329 | description: 330 | name: typed_data 331 | url: "https://pub.dartlang.org" 332 | source: hosted 333 | version: "1.3.0-nullsafety.3" 334 | uuid: 335 | dependency: transitive 336 | description: 337 | name: uuid 338 | url: "https://pub.dartlang.org" 339 | source: hosted 340 | version: "2.2.2" 341 | vector_math: 342 | dependency: transitive 343 | description: 344 | name: vector_math 345 | url: "https://pub.dartlang.org" 346 | source: hosted 347 | version: "2.1.0-nullsafety.3" 348 | win32: 349 | dependency: transitive 350 | description: 351 | name: win32 352 | url: "https://pub.dartlang.org" 353 | source: hosted 354 | version: "1.7.3" 355 | xdg_directories: 356 | dependency: transitive 357 | description: 358 | name: xdg_directories 359 | url: "https://pub.dartlang.org" 360 | source: hosted 361 | version: "0.1.2" 362 | sdks: 363 | dart: ">=2.10.2 <=2.11.0-229.0.dev" 364 | flutter: ">=1.22.2 <2.0.0" 365 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: school_ui_toolkit 2 | description: A basic UI toolkit to get you started with flutter application development. A collection of over 18+ custom widgets such as Calendar, Buttons with busy indicator and more. 3 | version: 5.0.0 4 | homepage: https://github.com/bprayush/school-ui-toolkit 5 | 6 | environment: 7 | sdk: ">=2.7.1 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | flutter_screenutil: ^3.2.0 14 | cached_network_image: ^2.2.0+1 15 | font_awesome_flutter: ^8.8.1 16 | intl: ^0.16.1 17 | nepali_date_picker: ^4.1.0 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | 23 | # For information on the generic Dart part of this file, see the 24 | # following page: https://dart.dev/tools/pub/pubspec 25 | 26 | # The following section is specific to Flutter. 27 | flutter: 28 | # To add assets to your package, add an assets section, like this: 29 | # assets: 30 | # - images/a_dot_burr.jpeg 31 | # - images/a_dot_ham.jpeg 32 | # 33 | # For details regarding assets in packages, see 34 | # https://flutter.dev/assets-and-images/#from-packages 35 | # 36 | # An image asset can refer to one or more resolution-specific "variants", see 37 | # https://flutter.dev/assets-and-images/#resolution-aware. 38 | # To add custom fonts to your package, add a fonts section here, 39 | # in this "flutter" section. Each entry in this list should have a 40 | # "family" key with the font family name, and a "fonts" key with a 41 | # list giving the asset and other descriptors for the font. For 42 | # example: 43 | # fonts: 44 | # - family: Schyler 45 | # fonts: 46 | # - asset: fonts/Schyler-Regular.ttf 47 | # - asset: fonts/Schyler-Italic.ttf 48 | # style: italic 49 | # - family: Trajan Pro 50 | # fonts: 51 | # - asset: fonts/TrajanPro.ttf 52 | # - asset: fonts/TrajanPro_Bold.ttf 53 | # weight: 700 54 | # 55 | # For details regarding fonts in packages, see 56 | # https://flutter.dev/custom-fonts/#from-packages 57 | -------------------------------------------------------------------------------- /screenshot/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bugthedebugger/school-ui-toolkit/04cfb7a1429a9dc2f9505746f6900957fc6e8abb/screenshot/screenshot.png -------------------------------------------------------------------------------- /test/school_ui_toolkit_test.dart: -------------------------------------------------------------------------------- 1 | 2 | --------------------------------------------------------------------------------