-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
496f095
commit 4e7484e
Showing
6 changed files
with
63 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import 'dart:ui'; | ||
|
||
import 'package:flutter/material.dart'; | ||
|
||
class Tools { | ||
|
||
//private constructor | ||
Tools._(); | ||
|
||
static String extractCourseIds(String title) { | ||
final pattern = RegExp(r'(?:CIT|IN|MA|CH|MW|PH)\d[\w-]*'); | ||
final matches = pattern.allMatches(title); | ||
List<String> ids = []; | ||
for (var match in matches) { | ||
ids.add(match.group(0)!); | ||
} | ||
return ids.join(' , '); | ||
} | ||
|
||
static String formatDuration(int durationInMinutes) { | ||
int hours = durationInMinutes ~/ 60; | ||
int minutes = durationInMinutes % 60; | ||
int seconds = 0; | ||
|
||
String formattedHours = hours < 10 ? '0$hours' : '$hours'; | ||
String formattedMinutes = minutes < 10 ? '0$minutes' : '$minutes'; | ||
String formattedSeconds = seconds < 10 ? '0$seconds' : '$seconds'; | ||
|
||
return '$formattedHours:$formattedMinutes:$formattedSeconds'; | ||
} | ||
|
||
static Color colorPicker(tumID) { | ||
if (tumID.length < 2) return Colors.grey; | ||
switch (tumID.substring(0, 2)) { | ||
case 'IN': | ||
return Colors.blue; | ||
case 'MA': | ||
return Colors.purple; | ||
case 'CH': | ||
return Colors.green; | ||
case 'PH': | ||
return Colors.orange; | ||
case 'MW': | ||
return Colors.red; | ||
case 'EL': | ||
return Colors.black87; | ||
case 'CI': | ||
return Colors.teal; | ||
default: | ||
return Colors.grey; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 0 additions & 66 deletions
66
lib/views/components/custom_search_filter_top_nav_bar.dart
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters