You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
HMG_Patient_App/lib/pages/ErService/widgets/card_position.dart

88 lines
2.6 KiB
Dart

5 years ago
//import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
5 years ago
import 'package:diplomaticquarterapp/config/size_config.dart';
5 years ago
import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart';
5 years ago
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
5 years ago
import 'package:flutter/material.dart';
import '../NearestEr.dart';
class CardPosition extends StatelessWidget {
final image;
final text;
final subText;
final type;
const CardPosition(
{
@required this.image,
@required this.text,
@required this.subText,
@required this.type});
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
navigateToSearch(context, this.type);
print("=============this.type============="+this.type);
},
child: Container(
5 years ago
margin: EdgeInsets.fromLTRB(7.0, 7.0, 7.0, 7.0),
5 years ago
decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(this.text,
overflow: TextOverflow.clip,
style: TextStyle(
5 years ago
color: Colors.black,
5 years ago
letterSpacing: 1.0,
5 years ago
fontSize: 2 * SizeConfig.textMultiplier)),
5 years ago
),
Container(
alignment: Alignment.center,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: 60.0),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(this.subText,
overflow: TextOverflow.clip,
style: TextStyle(
5 years ago
color: Color(0xFFc5272d), letterSpacing: 1.0, fontSize: 15.0)),
5 years ago
),
],
),
),
);
}
Future navigateToSearch(context, type) async {
//===Switch case===
if(type==0)
{print("========Ambalunce=========");}
else{
print("=========Nearest ER===========");
Navigator.push(
context,
5 years ago
FadePage(
page: NearestEr(isAppbar: true,)));
5 years ago
}
5 years ago
//NearestEr(isAppbar: true,)
5 years ago
// Navigator.push(
// context,
// MaterialPageRoute(
// builder: (context) => Search(
// type: type,
// )));
}
}