Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
7 changes: 5 additions & 2 deletions lib/feature/app/chr_connect_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ class CHRConnectApp extends StatelessWidget {
onGenerateTitle: (context) => context.localizations.chr_connect,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
scrollBehavior: const MaterialScrollBehavior().copyWith(dragDevices: {PointerDeviceKind.mouse, ...const MaterialScrollBehavior().dragDevices}),
home: const MainScreen(),
scrollBehavior: const MaterialScrollBehavior().copyWith(dragDevices: {
PointerDeviceKind.mouse,
...const MaterialScrollBehavior().dragDevices
}),
home: MainScreen(),
theme: ThemeData(
colorScheme: AppTheme.colorScheme,
scaffoldBackgroundColor: AppTheme.colorScheme.background,
Expand Down
10 changes: 10 additions & 0 deletions lib/feature/home/components/appointments/appointments.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@ import 'appointments_item.dart';
class Appointments extends StatelessWidget {
const Appointments({
Key? key,
required this.appointmentsKey,
required this.joinButtonKey,
required this.appointmentsViewAllKey,
this.verticalLayout = false,
}) : super(key: key);

final bool verticalLayout;
final GlobalKey appointmentsKey;
final GlobalKey joinButtonKey;
final GlobalKey appointmentsViewAllKey;

@override
Widget build(BuildContext context) {
return Section(
key: appointmentsKey, // Set the key for the Section widget
name: context.localizations.upcoming_appointments,
showViewAll: true,
appointmentsViewAllKey: appointmentsViewAllKey,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expand Down Expand Up @@ -64,6 +72,7 @@ class Appointments extends StatelessWidget {
cta: "Join virtual visit",
image: Image.asset('images/house.png').image,
condensed: verticalLayout,
joinButtonKey: joinButtonKey,
),
AppointmentsItem(
date: DateTime.now(),
Expand All @@ -74,6 +83,7 @@ class Appointments extends StatelessWidget {
cta: "Check in",
image: Image.asset('images/house.png').image,
condensed: verticalLayout,
joinButtonKey: GlobalKey(),
),
];

Expand Down
29 changes: 16 additions & 13 deletions lib/feature/home/components/appointments/appointments_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';

class AppointmentsItem extends StatelessWidget {
const AppointmentsItem({
Key? key,
required this.date,
required this.image,
this.duration = Duration.zero,
this.title = '',
this.subtitle = '',
this.place = '',
this.cta = '',
this.calendarSize = const Size(64, 64),
this.imageRadius = 12,
this.condensed = false,
}) : super(key: key);
const AppointmentsItem(
{Key? key,
required this.date,
required this.image,
this.duration = Duration.zero,
this.title = '',
this.subtitle = '',
this.place = '',
this.cta = '',
this.calendarSize = const Size(64, 64),
this.imageRadius = 12,
this.condensed = false,
required this.joinButtonKey})
: super(key: key);

final String title;
final String subtitle;
Expand All @@ -28,6 +29,7 @@ class AppointmentsItem extends StatelessWidget {
final double imageRadius;
final Size calendarSize;
final bool condensed;
final GlobalKey joinButtonKey;

@override
Widget build(BuildContext context) =>
Expand Down Expand Up @@ -111,6 +113,7 @@ class AppointmentsItem extends StatelessWidget {
),
const SizedBox(width: 16),
TextButton(
key: joinButtonKey,
onPressed: () {},
child: Text(
cta,
Expand Down
4 changes: 4 additions & 0 deletions lib/feature/home/components/inbox/inbox.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,20 @@ import 'inbox_item.dart';
class Inbox extends StatelessWidget {
const Inbox({
Key? key,
required this.inboxKey,
this.verticalLayout = false,
}) : super(key: key);

final bool verticalLayout;
final GlobalKey inboxKey;

@override
Widget build(BuildContext context) {
return Section(
key: inboxKey,
name: context.localizations.inbox,
showViewAll: true,
appointmentsViewAllKey: GlobalKey(),
child: _sectionLayoutContent(),
);
}
Expand Down
7 changes: 6 additions & 1 deletion lib/feature/home/components/more_resources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ import 'section/section.dart';
import 'section/section_column.dart';

class MoreResources extends StatelessWidget {
const MoreResources({Key? key}) : super(key: key);
const MoreResources({Key? key, required this.moreResourcesKey})
: super(key: key);

final GlobalKey moreResourcesKey;

@override
Widget build(BuildContext context) {
return Section(
key: moreResourcesKey,
name: context.localizations.more_resources,
appointmentsViewAllKey: GlobalKey(),
child: SectionColumn(
children: [
Resource(
Expand Down
53 changes: 25 additions & 28 deletions lib/feature/home/components/reminders/reminders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,35 @@ import '../section/section.dart';
import '../section/section_row.dart';

class Reminders extends StatelessWidget {
const Reminders({Key? key}) : super(key: key);
const Reminders({
Key? key,
required this.remindersKey,
}) : super(key: key);

final GlobalKey remindersKey;

@override
Widget build(BuildContext context) {
return Section(
key: remindersKey, // Set the key for the Section widget
name: context.localizations.reminders,
showViewAll: true,
appointmentsViewAllKey: GlobalKey(),
child: SectionRow(
children: [
ReminderItemGeneral(
title: "Intake Questionnaire",
subtitle: 'LMC Optometry & Eye Care',
body:
'Please, fill out the pre-visit questionnaire',
body: 'Please, fill out the pre-visit questionnaire',
cta: 'Start',
ctaStyle: Theme.of(context)
.textButtonTheme
.style
?.copyWith(
backgroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.background),
foregroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.primary),
),
ctaStyle: Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.background),
foregroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.primary),
),
image: CircleAvatar(
backgroundImage:
Image.asset('images/treatment.png').image,
backgroundImage: Image.asset('images/treatment.png').image,
),
),
ReminderItemGeneral(
Expand All @@ -42,27 +44,22 @@ class Reminders extends StatelessWidget {
body: 'Counselling Session May 27th, at 10:00 AM',
cta: 'Check in',
image: CircleAvatar(
backgroundColor: Theme.of(context)
.colorScheme
.tertiaryContainer,
backgroundImage:
Image.asset('images/check.png').image,
backgroundColor:
Theme.of(context).colorScheme.tertiaryContainer,
backgroundImage: Image.asset('images/check.png').image,
),
),
ReminderItemBilling(
title: "Contact Lenses Fitting Exam",
subtitle: 'LMC Optometry & Eye Care',
body: '\$47.25 CAD',
cta: 'Pay',
ctaStyle: Theme.of(context)
.textButtonTheme
.style
?.copyWith(
backgroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.background),
foregroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.primary),
),
ctaStyle: Theme.of(context).textButtonTheme.style?.copyWith(
backgroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.background),
foregroundColor: MaterialStatePropertyAll(
Theme.of(context).colorScheme.primary),
),
dueDate: 'Due date: May 27th, 2022',
),
],
Expand Down
15 changes: 9 additions & 6 deletions lib/feature/home/components/section/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ import 'package:chrconnecthpdraft/feature/app/extension/context.dart';
import 'package:flutter/material.dart';

class Section extends StatelessWidget {
const Section({
Key? key,
this.name,
this.child,
this.showViewAll = false,
}) : super(key: key);
const Section(
{Key? key,
this.name,
this.child,
this.showViewAll = false,
required this.appointmentsViewAllKey})
: super(key: key);

final String? name;
final Widget? child;
final bool showViewAll;
final GlobalKey appointmentsViewAllKey;

@override
Widget build(BuildContext context) {
Expand All @@ -30,6 +32,7 @@ class Section extends StatelessWidget {
const Spacer(),
if (showViewAll)
Text(
key: appointmentsViewAllKey,
context.localizations.view_all,
style: Theme.of(context).textTheme.displaySmall?.copyWith(
decoration: TextDecoration.underline,
Expand Down
Loading