BG / Restaurant Card
This commit is contained in:
60
lib/components.dart
Normal file
60
lib/components.dart
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class RestaurantCard extends StatelessWidget {
|
||||||
|
RestaurantCard(
|
||||||
|
{@required this.id, this.name, this.city, this.imgUrl, this.tags});
|
||||||
|
|
||||||
|
final id;
|
||||||
|
final name;
|
||||||
|
final city;
|
||||||
|
final imgUrl;
|
||||||
|
final tags;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Card(
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: ClipRRect(
|
||||||
|
child: Image.asset(
|
||||||
|
"img/bg_tile.jpg",
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.all(8),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
name,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.orange[600], fontSize: 16, height: 1.7),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
Text(
|
||||||
|
'Miasto: $city',
|
||||||
|
style: TextStyle(color: Colors.grey, fontSize: 14),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Opis...',
|
||||||
|
style: TextStyle(color: Colors.grey, fontSize: 14),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
color: Color.fromRGBO(50, 50, 50, 0.8),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'components.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(App());
|
runApp(App());
|
||||||
@@ -43,6 +44,16 @@ class _HomePageState extends State<HomePage> {
|
|||||||
"img/logo_mint.png",
|
"img/logo_mint.png",
|
||||||
width: 160,
|
width: 160,
|
||||||
),
|
),
|
||||||
|
RestaurantCard(
|
||||||
|
id: 1,
|
||||||
|
name: "Pierożek",
|
||||||
|
city: "Mikołajki",
|
||||||
|
),
|
||||||
|
RestaurantCard(
|
||||||
|
id: 2,
|
||||||
|
name: "Kuchnie Świata",
|
||||||
|
city: "Mikołajki",
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user