Skip to content

Commit

Permalink
Add country flags
Browse files Browse the repository at this point in the history
  • Loading branch information
aguilaair committed Dec 7, 2021
1 parent 3f071da commit aa4d71a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/widgets/cert_detailed_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
),
Expand Down
2 changes: 2 additions & 0 deletions lib/widgets/cert_spimplified_info.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 14 additions & 4 deletions lib/widgets/detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -19,16 +21,24 @@ class Detail extends StatelessWidget {
style: Theme.of(context).textTheme.headline6,
),
const SizedBox(
width: 10
,
width: 10,
),
Expanded(
child: Text(
detail ?? S.of(context).unk,
maxLines: 3,
textAlign: TextAlign.end,
),
)
),
if (trialing != null)
Container(
height: 40,
width: 40,
padding: const EdgeInsets.symmetric(
horizontal: 5,
),
child: trialing,
)
],
);
}
Expand Down
9 changes: 8 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit aa4d71a

Please sign in to comment.