Created
December 6, 2019 17:47
-
-
Save a7me63azzab/40911c7d5dfbda9f4a58bc8162d85d74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
debugShowCheckedModeBanner: false, | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
), | |
home: MyHomePage(title: 'Flutter Demo Home Page'), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
Widget _cardWidget(BuildContext context){ | |
return Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Card( | |
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), | |
child: Container( | |
width: MediaQuery.of(context).size.width, | |
height: 100, | |
decoration: BoxDecoration( | |
borderRadius: BorderRadius.circular(10), | |
), | |
child: Row( | |
children: <Widget>[ | |
SizedBox(width:5), | |
ClipRRect( | |
borderRadius: BorderRadius.circular(10), | |
child: new Image.network( | |
"https://cdn.pixabay.com/photo/2015/04/19/08/32/rose-729509_1280.jpg", | |
width: 90, | |
height: 90, | |
fit: BoxFit.fill, | |
), | |
), | |
SizedBox( | |
width: 10, | |
), | |
Column( | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: <Widget>[ | |
Text( | |
"اسم العميل فهد", | |
style: TextStyle( | |
color: Colors.red, | |
fontSize: 18, | |
), | |
), | |
Text( | |
"حى المصيف منزل ١", | |
style: TextStyle( | |
color: Colors.grey, | |
fontSize: 14, | |
), | |
), | |
SizedBox( | |
height: 5, | |
), | |
Row( | |
children: <Widget>[ | |
Icon( | |
Icons.location_on, | |
size: 20, | |
), | |
SizedBox( | |
width: 10, | |
), | |
Text("يبعد عنك ٣٠ كيلو", | |
style: TextStyle( | |
fontSize: 14, | |
)), | |
], | |
), | |
], | |
), | |
Expanded( | |
child: Container(), | |
), | |
Padding( | |
padding: const EdgeInsets.all(8.0), | |
child: Align( | |
alignment: Alignment.center, | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: <Widget>[ | |
Icon( | |
Icons.location_on, | |
color: Colors.blueAccent, | |
), | |
SizedBox( | |
width: 10, | |
), | |
Icon( | |
Icons.phone, | |
color: Colors.green, | |
), | |
], | |
), | |
], | |
), | |
), | |
), | |
], | |
), | |
), | |
), | |
); | |
} | |
@override | |
Widget build(BuildContext context) { | |
return Directionality( | |
textDirection:TextDirection.rtl, | |
child:Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: ListView.builder( | |
itemCount:20, | |
itemBuilder:(BuildContext context,int index){ | |
return _cardWidget(context); | |
} | |
), | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment