Initial commit
This commit is contained in:
19
lib/src/utils/date_range.dart
Normal file
19
lib/src/utils/date_range.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
DateTimeRange constructDateRange(DateTime startDateTime, DateTime endDateTime) {
|
||||
var startDate = DateTime(
|
||||
startDateTime.year,
|
||||
startDateTime.month,
|
||||
startDateTime.day,
|
||||
);
|
||||
var endDate = DateTime(
|
||||
endDateTime.year,
|
||||
endDateTime.month,
|
||||
endDateTime.day,
|
||||
23,
|
||||
59,
|
||||
59,
|
||||
);
|
||||
|
||||
return DateTimeRange(start: startDate, end: endDate);
|
||||
}
|
12
lib/src/utils/greeting.dart
Normal file
12
lib/src/utils/greeting.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
String greeting() {
|
||||
var currentHour = DateTime.now().hour;
|
||||
if (currentHour > 4 && currentHour < 11) {
|
||||
return "Good morning";
|
||||
} else if (currentHour >= 11 && currentHour < 17) {
|
||||
return "Good afternoon";
|
||||
} else if (currentHour >= 17 && currentHour < 21) {
|
||||
return "Good evening";
|
||||
} else {
|
||||
return "Good night";
|
||||
}
|
||||
}
|
23
lib/src/utils/theme.dart
Normal file
23
lib/src/utils/theme.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:google_fonts/google_fonts.dart';
|
||||
|
||||
ThemeData _baseTheme = ThemeData(
|
||||
primarySwatch: Colors.deepPurple,
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: Colors.grey[100],
|
||||
unselectedItemColor: Colors.grey[500],
|
||||
),
|
||||
textTheme: TextTheme(
|
||||
subtitle2: TextStyle(
|
||||
color: Colors.grey[500],
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
ThemeData myFurmanTheme = _baseTheme.copyWith(
|
||||
textTheme: GoogleFonts.interTextTheme(_baseTheme.textTheme),
|
||||
);
|
||||
|
||||
var furmanTextStyle = (TextStyle baseStyle) => GoogleFonts.inter(textStyle: baseStyle);
|
Reference in New Issue
Block a user