mirror of
https://github.com/nisrulz/flutter-examples.git
synced 2025-09-23 01:32:22 +08:00
Example for Unit Test (#52)
This commit is contained in:
55
unit_testing/lib/components/place_info_card.dart
Normal file
55
unit_testing/lib/components/place_info_card.dart
Normal file
@ -0,0 +1,55 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:unit_testing/model/location.dart';
|
||||
|
||||
class PlaceInfo extends StatelessWidget {
|
||||
final Location data;
|
||||
PlaceInfo({this.data});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
offset: Offset(0, 10),
|
||||
blurRadius: 20,
|
||||
color: Colors.black45,
|
||||
)
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
data.name + "\n" + data.country,
|
||||
style: TextStyle(
|
||||
fontSize: 25,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Image.asset(
|
||||
data.image,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20,
|
||||
),
|
||||
Text(
|
||||
data.info,
|
||||
style: TextStyle(fontSize: 23),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user