Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to fhir 0.11.0 and flutter 3.10.0 #15

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
## 0.9.0-dev.1
### Faiadashu
* Added displaying units in numeric answer input
* Added questionnaire-unitOption extension support to make ability choose quantity units in numeric answers
* Fixed drop down style for numeric answer input

## 0.9.0-alpha.1
**[Breaking]** This alpha release is beginning to use Flutter 3.10.0 and fhir 0.11.0.

### Faiadashu
* Flutter 3.10.0 and fhir 0.11.0 support

### Faiadashu Online
* Temporary disabled while fhir_auth has not support fhir 0.11.0.

## 0.8.1
**[Breaking]** This release is beginning to make use of features in Flutter 3.0.
It does not work with Flutter 2.*x*.
Expand Down
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,5 @@ dart_code_metrics:
- prefer-trailing-comma
- prefer-conditional-expressions
- no-equal-then-else
- no-magic-number
- prefer-single-widget-per-file:
ignore-private-widgets: true
4 changes: 2 additions & 2 deletions example/lib/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:simple_html_css/simple_html_css.dart';
import 'exhibit_page.dart';

class AboutPage extends ExhibitPage {
const AboutPage({Key? key}) : super(key: key);
const AboutPage({super.key});

@override
Widget buildExhibit(BuildContext context) {
Expand All @@ -21,7 +21,7 @@ class AboutPage extends ExhibitPage {
<p><b>I love the sound of it.</b><br>
<div style="font-size: 10px; color:#888888">私はその音が大好きです。</div></p>
''',
defaultTextStyle: Theme.of(context).textTheme.bodyText1,
defaultTextStyle: Theme.of(context).textTheme.bodyLarge,
),
);
}
Expand Down
108 changes: 54 additions & 54 deletions example/lib/cherry_blossom_theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ class CherryBlossomScaffoldBuilder extends QuestionnairePageScaffoldBuilder {

@override
Widget build(
BuildContext context, {
required void Function(void Function() p1) setStateCallback,
required Widget child,
}) {
BuildContext context, {
required void Function(void Function() p1) setStateCallback,
required Widget child,
}) {
return Theme(
data: ThemeData.light().copyWith(
scrollbarTheme: ThemeData.light().scrollbarTheme.copyWith(
thumbVisibility: MaterialStateProperty.all(true),
thumbColor: MaterialStateProperty.all(
const Color(0xFF5C1349),
),
),
thumbVisibility: MaterialStateProperty.all(true),
thumbColor: MaterialStateProperty.all(
const Color(0xFF5C1349),
),
),
textTheme: GoogleFonts.ralewayTextTheme(),
iconTheme: ThemeData.light().iconTheme.copyWith(
color: const Color(0xFF5C1349),
),
color: const Color(0xFF5C1349),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ButtonStyle(
textStyle: MaterialStateProperty.all(
Expand All @@ -41,52 +41,52 @@ class CherryBlossomScaffoldBuilder extends QuestionnairePageScaffoldBuilder {
),
),
checkboxTheme: ThemeData.light().checkboxTheme.copyWith(
fillColor: MaterialStateProperty.all(
const Color(0xFFE30425),
),
),
radioTheme: ThemeData.light().radioTheme.copyWith(
fillColor: MaterialStateProperty.all(
const Color(0xFFE30425),
),
),
sliderTheme: ThemeData.light().sliderTheme.copyWith(
thumbColor: const Color(0xFFE30425),
activeTrackColor: const Color(0xFFE30425),
inactiveTrackColor: const Color(0x60E30425),
),
inputDecorationTheme: ThemeData.light().inputDecorationTheme.copyWith(
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: Color.fromRGBO(0, 0, 0, 0.12),
),
),
disabledBorder: const OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Color.fromRGBO(0, 0, 0, 0.0),
fillColor: MaterialStateProperty.all(
const Color(0xFFE30425),
),
),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: ThemeData.light().errorColor,
radioTheme: ThemeData.light().radioTheme.copyWith(
fillColor: MaterialStateProperty.all(
const Color(0xFFE30425),
),
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: ThemeData.light().errorColor.withOpacity(0.12),
sliderTheme: ThemeData.light().sliderTheme.copyWith(
thumbColor: const Color(0xFFE30425),
activeTrackColor: const Color(0xFFE30425),
inactiveTrackColor: const Color(0x60E30425),
),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: Color.fromRGBO(0, 0, 0, 0.54),
inputDecorationTheme: ThemeData.light().inputDecorationTheme.copyWith(
enabledBorder: const OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: Color.fromRGBO(0, 0, 0, 0.12),
),
),
disabledBorder: const OutlineInputBorder(
borderSide: BorderSide(
width: 0,
color: Color.fromRGBO(0, 0, 0, 0.0),
),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: ThemeData.light().colorScheme.error,
),
),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: ThemeData.light().colorScheme.error.withOpacity(0.12),
),
),
focusedBorder: const OutlineInputBorder(
borderSide: BorderSide(
width: 2.0,
color: Color.fromRGBO(0, 0, 0, 0.54),
),
),
),
),
),
), // Make it always light
// We have to take care of SafeArea ourselves
child: SafeArea(
Expand All @@ -101,7 +101,7 @@ class CherryBlossomScaffoldBuilder extends QuestionnairePageScaffoldBuilder {
padding: const EdgeInsets.symmetric(vertical: 8),
child: Text(
'🦄🌸🦄🌸🦄🌸🦄',
style: Theme.of(context).textTheme.headline4,
style: Theme.of(context).textTheme.headlineMedium,
),
),
Expanded(
Expand Down
2 changes: 1 addition & 1 deletion example/lib/disclaimer_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
import 'exhibit_page.dart';

class DisclaimerPage extends ExhibitPage {
const DisclaimerPage({Key? key}) : super(key: key);
const DisclaimerPage({super.key});

@override
Widget buildExhibit(BuildContext context) {
Expand Down
2 changes: 1 addition & 1 deletion example/lib/exhibit_page.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

abstract class ExhibitPage extends StatelessWidget {
const ExhibitPage({Key? key}) : super(key: key);
const ExhibitPage({super.key});

String get title;

Expand Down
37 changes: 19 additions & 18 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import 'package:faiadashu_example/primitive_page.dart';
import 'package:faiadashu_example/questionnaire_launch_tile.dart';
import 'package:faiadashu_example/questionnaire_response_storage.dart';
import 'package:faiadashu_example/value_set_provider.dart';
import 'package:faiadashu_online/restful/restful.dart';
import 'package:fhir/r4.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -44,7 +43,7 @@ void main() {
}

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
const MyApp({super.key});

@override
Widget build(BuildContext context) {
Expand All @@ -71,7 +70,7 @@ class MyApp extends StatelessWidget {
}

class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
const HomePage({super.key});

@override
// ignore: library_private_types_in_public_api
Expand All @@ -89,16 +88,16 @@ class _HomePageState extends State<HomePage> {

// Patient ID matches a patient on Meld Sandbox server.
final sandboxPatient = Patient(
id: Id('smart-880378'),
fhirId: 'smart-880378',
name: [
HumanName(
given: ['Amy', 'R'],
family: 'Lee',
use: HumanNameUse.official,
)
],
birthDate: Date('1999-12-08'),
gender: PatientGender.female,
birthDate: FhirDate('1999-12-08'),
gender: FhirCode('female'),
);

late final LaunchContext launchContext;
Expand All @@ -123,7 +122,6 @@ class _HomePageState extends State<HomePage> {
clientId: '4564f6f7-335f-43d3-8867-a0f4e6f901d6',
redirectUri: FhirUri('com.legentix.faiagallery://callback'),
);

}

@override
Expand All @@ -134,7 +132,9 @@ class _HomePageState extends State<HomePage> {

/// Schedules repaint after login / logout.
void _onLoginChanged() {
_logger.debug('_onLoginChanged: ${questionnaireResponseStorage.smartClient.isLoggedIn()}');
_logger.debug(
'_onLoginChanged: ${questionnaireResponseStorage.smartClient.isLoggedIn()}',
);
setState(() {
// Rebuild
});
Expand Down Expand Up @@ -171,7 +171,7 @@ class _HomePageState extends State<HomePage> {
title,
style: Theme.of(context)
.textTheme
.headline6
.titleLarge
?.copyWith(fontWeight: FontWeight.bold),
),
Text(subtitle)
Expand Down Expand Up @@ -205,9 +205,6 @@ class _HomePageState extends State<HomePage> {
),
),
),
actions: [
SmartLoginButton(questionnaireResponseStorage.smartClient, onLoginChanged: _onLoginChanged)
],
),
body: SafeArea(
child: Scrollbar(
Expand All @@ -225,7 +222,8 @@ class _HomePageState extends State<HomePage> {
launchContext: launchContext,
questionnairePath: 'assets/instruments/beverage_ig.json',
saveResponseFunction: questionnaireResponseStorage.saveToMemory,
restoreResponseFunction: questionnaireResponseStorage.restoreFromMemory,
restoreResponseFunction:
questionnaireResponseStorage.restoreFromMemory,
uploadResponseFunction: uploadResponseFunction,
questionnaireModelDefaults: QuestionnaireModelDefaults(
prefixBuilder: (fim) {
Expand Down Expand Up @@ -255,7 +253,6 @@ class _HomePageState extends State<HomePage> {
builder: (context) => QuestionnaireScroller(
scaffoldBuilder: const CherryBlossomScaffoldBuilder(),
fhirResourceProvider: RegistryFhirResourceProvider([
resourceBundleProvider,
AssetResourceProvider.singleton(
questionnaireResourceUri,
'assets/instruments/sdc_demo.json',
Expand Down Expand Up @@ -369,7 +366,8 @@ class _HomePageState extends State<HomePage> {
launchContext: launchContext,
questionnairePath: 'assets/instruments/bluebook.json',
saveResponseFunction: questionnaireResponseStorage.saveToMemory,
restoreResponseFunction: questionnaireResponseStorage.restoreFromMemory,
restoreResponseFunction:
questionnaireResponseStorage.restoreFromMemory,
uploadResponseFunction: uploadResponseFunction,
),
_launchQuestionnaire(
Expand Down Expand Up @@ -398,7 +396,8 @@ class _HomePageState extends State<HomePage> {
launchContext: launchContext,
questionnairePath: 'assets/instruments/argonaut_sampler.json',
saveResponseFunction: questionnaireResponseStorage.saveToMemory,
restoreResponseFunction: questionnaireResponseStorage.restoreFromMemory,
restoreResponseFunction:
questionnaireResponseStorage.restoreFromMemory,
uploadResponseFunction: uploadResponseFunction,
),
QuestionnaireLaunchTile(
Expand All @@ -412,7 +411,8 @@ class _HomePageState extends State<HomePage> {
launchContext: launchContext,
questionnairePath: 'assets/instruments/argonaut_sampler.json',
saveResponseFunction: questionnaireResponseStorage.saveToMemory,
restoreResponseFunction: questionnaireResponseStorage.restoreFromMemory,
restoreResponseFunction:
questionnaireResponseStorage.restoreFromMemory,
uploadResponseFunction: uploadResponseFunction,
),
QuestionnaireLaunchTile(
Expand All @@ -426,7 +426,8 @@ class _HomePageState extends State<HomePage> {
launchContext: launchContext,
questionnairePath: 'assets/instruments/argonaut_sampler.json',
saveResponseFunction: questionnaireResponseStorage.saveToMemory,
restoreResponseFunction: questionnaireResponseStorage.restoreFromMemory,
restoreResponseFunction:
questionnaireResponseStorage.restoreFromMemory,
uploadResponseFunction: uploadResponseFunction,
),
_headline(
Expand Down
Loading