diff --git a/lib/widgets/cert_detailed_view.dart b/lib/widgets/cert_detailed_view.dart index bcc0cee..abf1478 100644 --- a/lib/widgets/cert_detailed_view.dart +++ b/lib/widgets/cert_detailed_view.dart @@ -199,7 +199,7 @@ class CertDetailedView extends StatelessWidget { return Container( decoration: BoxDecoration( - borderRadius: BorderRadius.only( + borderRadius: const BorderRadius.only( topLeft: Radius.circular(15), topRight: Radius.circular(15), ), diff --git a/lib/widgets/cert_spimplified_info.dart b/lib/widgets/cert_spimplified_info.dart index 3e9d82c..51385db 100644 --- a/lib/widgets/cert_spimplified_info.dart +++ b/lib/widgets/cert_spimplified_info.dart @@ -1,3 +1,4 @@ +import 'package:circle_flags/circle_flags.dart'; import 'package:covid_checker/generated/l10n.dart'; import 'package:covid_checker/widgets/cert_detailed_view.dart'; import 'package:covid_checker/widgets/detail.dart'; @@ -54,6 +55,7 @@ class CertInfoViewer extends StatelessWidget { Detail( title: S.of(context).country, detail: coseResult!.payload[1], + trialing: CircleFlag(coseResult!.payload[1]), ), const SizedBox( height: 5, diff --git a/lib/widgets/detail.dart b/lib/widgets/detail.dart index ce21f46..72bd320 100644 --- a/lib/widgets/detail.dart +++ b/lib/widgets/detail.dart @@ -2,11 +2,13 @@ import 'package:covid_checker/generated/l10n.dart'; import 'package:flutter/material.dart'; class Detail extends StatelessWidget { - const Detail({required this.detail, required this.title, Key? key}) + const Detail( + {this.trialing, required this.detail, required this.title, Key? key}) : super(key: key); final String title; final String? detail; + final Widget? trialing; @override Widget build(BuildContext context) { @@ -19,8 +21,7 @@ class Detail extends StatelessWidget { style: Theme.of(context).textTheme.headline6, ), const SizedBox( - width: 10 - , + width: 10, ), Expanded( child: Text( @@ -28,7 +29,16 @@ class Detail extends StatelessWidget { maxLines: 3, textAlign: TextAlign.end, ), - ) + ), + if (trialing != null) + Container( + height: 40, + width: 40, + padding: const EdgeInsets.symmetric( + horizontal: 5, + ), + child: trialing, + ) ], ); } diff --git a/pubspec.lock b/pubspec.lock index 9e96b43..a9e262a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -57,6 +57,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.1" + circle_flags: + dependency: "direct main" + description: + name: circle_flags + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2" clock: dependency: transitive description: @@ -371,4 +378,4 @@ packages: version: "3.1.0" sdks: dart: ">=2.14.0 <3.0.0" - flutter: ">=1.24.0-7.0" + flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 87b0ebb..924a239 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -37,6 +37,7 @@ dependencies: dart_cose: ^1.1.3 typed_data: ^1.3.0 flutter_svg: ^1.0.0 + circle_flags: ^0.0.2 dev_dependencies: flutter_test: