Skip to content

Commit

Permalink
More UI updates
Browse files Browse the repository at this point in the history
  • Loading branch information
WinsDominoes committed Mar 4, 2024
1 parent aa2d8db commit 96e9c19
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 32 deletions.
23 changes: 13 additions & 10 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class MyApp extends StatelessWidget {
brightness: Brightness.dark,
colorScheme: darkColorScheme,
useMaterial3: true,
navigationRailTheme: const NavigationRailThemeData(
unselectedLabelTextStyle: TextStyle(fontSize: 13),
selectedLabelTextStyle: TextStyle(fontSize: 13)),
);

return MaterialApp(
Expand Down Expand Up @@ -130,13 +133,13 @@ class _MyHomePageState extends State<MyHomePage> {
selectedIndex: _selectedTab,
destinations: const <Widget>[
NavigationDestination(
icon: Icon(Icons.calendar_month_outlined),
selectedIcon: Icon(Icons.calendar_month),
label: 'Calendar',
icon: Icon(Icons.date_range_outlined),
selectedIcon: Icon(Icons.date_range),
label: 'Range',
),
NavigationDestination(
icon: Icon(Icons.calendar_today_outlined),
selectedIcon: Icon(Icons.calendar_today),
icon: Icon(Icons.today_outlined),
selectedIcon: Icon(Icons.today),
label: 'Day',
),
NavigationDestination(
Expand All @@ -162,13 +165,13 @@ class _MyHomePageState extends State<MyHomePage> {
extended: extendedValue,
destinations: const [
NavigationRailDestination(
icon: Icon(Icons.calendar_month_outlined),
selectedIcon: Icon(Icons.calendar_month),
label: Text('Calendar'),
icon: Icon(Icons.date_range_outlined),
selectedIcon: Icon(Icons.date_range),
label: Text('Range'),
),
NavigationRailDestination(
icon: Icon(Icons.calendar_today_outlined),
selectedIcon: Icon(Icons.calendar_today),
icon: Icon(Icons.today_outlined),
selectedIcon: Icon(Icons.today),
label: Text('Day'),
),
NavigationRailDestination(
Expand Down
58 changes: 44 additions & 14 deletions lib/pages/calendar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class _CalendarScreenState extends State<CalendarScreen> {

final startDate = _selectedDateRange?.start ?? DateTime(2020, 1, 1);
final endDate = _selectedDateRange?.end ?? DateTime(2022, 1, 1);
final textTheme = Theme.of(context).textTheme;

int diffD = GregorianDate.differenceInDays(startDate, endDate);

Expand All @@ -45,16 +46,42 @@ class _CalendarScreenState extends State<CalendarScreen> {

return Scaffold(
body: _selectedDateRange == null
? const Padding(
? Padding(
padding: EdgeInsets.all(16),
child: Center(
child:
Text('Select the date range by using the calendar button'),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
const Icon(
Icons.date_range_outlined,
size: 150,
),
Text('Date Range',
style: TextStyle(
fontSize: textTheme.displaySmall?.fontSize,
fontWeight: FontWeight.bold)),
Text('Select the date range',
style: TextStyle(
fontSize: textTheme.bodyMedium?.fontSize,
))
],
),
),
)
: Padding(
padding: const EdgeInsets.all(16),
child: Column(children: [
child: ListView(children: [
Container(
alignment: Alignment.centerLeft,
child: Row(
children: <Widget>[
Text("Range",
style: TextStyle(
fontSize: textTheme.displaySmall?.fontSize,
fontWeight: FontWeight.bold))
],
)),
Card(
child: Padding(
padding: const EdgeInsets.all(16),
Expand All @@ -64,19 +91,15 @@ class _CalendarScreenState extends State<CalendarScreen> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("Difference",
style: TextStyle(
fontSize: 40,
)),
const Text("Date Range",
const Text("Full Format",
style: TextStyle(fontSize: 14)),
Text(
"${diffYMD[3]} days \n${diffYMD[2]} weeks \n${diffYMD[1]} months\n${diffYMD[0]} years",
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold)),
const SizedBox(height: 10),
const Text("Date Range in days",
const Text("Days Format",
style: TextStyle(fontSize: 14)),
Text("$diffD days",
style: const TextStyle(
Expand All @@ -86,6 +109,16 @@ class _CalendarScreenState extends State<CalendarScreen> {
),
))),
const SizedBox(height: 16),
Container(
alignment: Alignment.centerLeft,
child: Row(
children: <Widget>[
Text("Dates",
style: TextStyle(
fontSize: textTheme.displaySmall?.fontSize,
fontWeight: FontWeight.bold))
],
)),
Card(
child: Padding(
padding: const EdgeInsets.all(16),
Expand All @@ -95,10 +128,8 @@ class _CalendarScreenState extends State<CalendarScreen> {
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text("Dates", style: TextStyle(fontSize: 40)),
const Text("Start Date",
style: TextStyle(fontSize: 14)),
const SizedBox(height: 5),
Text(
startDateString,
style: const TextStyle(
Expand All @@ -107,7 +138,6 @@ class _CalendarScreenState extends State<CalendarScreen> {
const SizedBox(height: 10),
const Text("End Date",
style: TextStyle(fontSize: 14)),
const SizedBox(height: 5),
Text(endDateString,
style: const TextStyle(
fontSize: 22, fontWeight: FontWeight.bold)),
Expand All @@ -119,7 +149,7 @@ class _CalendarScreenState extends State<CalendarScreen> {
// This button is used to show the date range picker
floatingActionButton: FloatingActionButton(
onPressed: showRangeDialog,
child: const Icon(Icons.date_range),
child: const Icon(Icons.edit_calendar),
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/day.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class _DayScreenState extends State<DayScreen> {
// This button is used to show the date range picker
floatingActionButton: FloatingActionButton(
onPressed: showDateDialog,
child: const Icon(Icons.today),
child: const Icon(Icons.border_color_outlined),
),
);
}
Expand Down
17 changes: 10 additions & 7 deletions lib/widgets/dialogs/community.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const matrixSVG = "assets/app_icons/external/Matrix.svg";
const telegramSVG = "assets/app_icons/external/Telegram.svg";

Future<void> communityDialogBuilder(BuildContext context) {
final colorMode = Theme.of(context).colorScheme.primary;

return showDialog<void>(
context: context,
builder: (BuildContext context) {
Expand All @@ -24,8 +26,7 @@ Future<void> communityDialogBuilder(BuildContext context) {
child: SvgPicture.asset(
discordSVG,
semanticsLabel: 'Discord Logo',
colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
colorFilter: ColorFilter.mode(colorMode, BlendMode.srcIn),
width: 50,
height: 50,
),
Expand All @@ -49,14 +50,17 @@ Future<void> communityDialogBuilder(BuildContext context) {
child: SvgPicture.asset(
matrixSVG,
semanticsLabel: 'Matrix Logo',
colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
colorFilter: ColorFilter.mode(colorMode, BlendMode.srcIn),
width: 50,
height: 50,
),
),
const Expanded(
child: Text('Matrix', textAlign: TextAlign.center),
child: Text(
'Matrix',
textAlign: TextAlign.center,
style: TextStyle(fontSize: 20),
),
),
],
),
Expand All @@ -72,8 +76,7 @@ Future<void> communityDialogBuilder(BuildContext context) {
child: SvgPicture.asset(
telegramSVG,
semanticsLabel: 'Telegram Logo',
colorFilter:
const ColorFilter.mode(Colors.white, BlendMode.srcIn),
colorFilter: ColorFilter.mode(colorMode, BlendMode.srcIn),
width: 50,
height: 50,
),
Expand Down

0 comments on commit 96e9c19

Please sign in to comment.