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
class Student{ | |
String id; | |
String name; | |
int english; | |
int mathematics; | |
int science; | |
String displayAsString(){ | |
return "Student ID:$id\nStudent Name:$name\nEnglish:$english\nMathematics:$mathematics\nScience:$science"; |
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
class Student{ | |
String id; | |
String name; | |
int english; | |
int mathematics; | |
int science; | |
String displayAsString(){ | |
return "Student ID:$id\nStudent Name:$name\nEnglish:$english\nMathematics:$mathematics\nScience:$science"; |
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
class Student{ | |
String displayAsString(){} | |
void save(){} | |
void delete(){} | |
double calculateScore(){} | |
bool didStudentPass(){} |
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
void _drawHourText({required Canvas canvas, required int minute, required double theta}) { | |
final double fontSize = 12.0; | |
TextSpan span = | |
new TextSpan(style: new TextStyle(color: Colors.white, fontSize: fontSize), text: (minute ~/ 5).toString()); | |
TextPainter tp = new TextPainter( | |
text: span, | |
textAlign: TextAlign.center, | |
textDirection: TextDirection.ltr, | |
); | |
tp.layout(); |
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
final double _hourHandTheta = (dateTime.hour % 12) * Constants.angleBetweenEachHourLine); | |
canvas.drawLine(Offset(0, 0), GetOffset.getOffsetWithRadiusAndTheta(radius: hourHandLength, theta: _hourHandTheta), _paint); |
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
final double _minuteHandTheta = dateTime.minute * Constants.angleBetweenEachMinuteLine; | |
canvas.drawLine(Offset(0, 0), GetOffset.getOffsetWithRadiusAndTheta(radius: minuteHandLength, theta: _minuteHandTheta), _paint); |
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
final double _secondHandTheta = dateTime.minute * Constants.angleBetweenEachSecondLine; | |
canvas.drawLine(Offset(0, 0), GetOffset.getOffsetWithRadiusAndTheta(radius: secondHandLength, theta: _secondHandTheta), _paint); |
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
final double _hourHandTheta = ((dateTime.hour % 12) * Constants.angleBetweenEachHourLine) + | |
(Constants.angleBetweenEachHourLine * ((1 / Constants.numberOfMinutes) * dateTime.minute)); | |
canvas.drawLine( | |
Offset(0, 0), GetOffset.getOffsetWithRadiusAndTheta(radius: hourHandLength, theta: _hourHandTheta), _paint); |
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
final double _minuteHandTheta = (dateTime.minute * Constants.angleBetweenEachMinuteLine) + | |
(Constants.angleBetweenEachMinuteLine * ((1 / Constants.numberOfSeconds) * dateTime.second)); | |
canvas.drawLine( | |
Offset(0, 0), GetOffset.getOffsetWithRadiusAndTheta(radius: minuteHandLength, theta: _minuteHandTheta), _paint); |
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
void _drawMinutesLine(Canvas canvas) { | |
for (int minute = 1; minute <= Constants.numberOfMinutes; minute++) { | |
final double _theta = Constants.angleBetweenEachMinuteLine * minute; | |
final double _radiusOfInnerPoint = _getInnerPointRadiusOfMinuteLine(minute); | |
final Offset _extremePoint = | |
GetOffset.getOffsetWithRadiusAndTheta(radius: _minuteLineExtremePointRadius, theta: _theta); | |
final Offset _innerPoint = GetOffset.getOffsetWithRadiusAndTheta(radius: _radiusOfInnerPoint, theta: _theta); | |
canvas.drawLine(_extremePoint, _innerPoint, _paint); |
OlderNewer