concise-pdx/web/card_templates.dart

256 lines
5.6 KiB
Dart
Raw Normal View History

2019-08-30 13:05:00 -07:00
import 'package:flutter_web/material.dart';
import 'defaults.dart';
import 'dart:html' as html;
2019-11-04 01:21:25 -08:00
import 'concisepdx.dart';
IconButton Home(BuildContext context) {
return IconButton(
icon: Icon(Icons.home),
onPressed: () {
Navigator.pushReplacement(context, MaterialPageRoute(builder: (context) => ConcisePDX()));
},
);
}
2019-08-30 13:05:00 -07:00
Card infoCard(String leftText,String infoUrl,String infoUrlName) {
return Card(
margin: EdgeInsets.only(
left: 4,
top: 4,
right: 4,
bottom: 0,
),
color: Colors.black,
child: Card(
margin: EdgeInsets.all(4.0),
color: ivory,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Expanded(
2019-09-11 21:37:55 -07:00
flex: 1,
child: Card(),
),
Expanded(
flex: 7,
2019-08-30 13:05:00 -07:00
child: Text(
leftText,
style: TextStyle(
fontSize: 20.0,
),
),
),
Expanded(
flex: 2,
child: InkWell(
child: Icon(
Icons.info,
size: 50.0,
color: Colors.black,
),
onTap: () {
html.window.open(infoUrl,infoUrlName);
},
),
),
],
),
),
),
);
}
Card cardThree(String allText) {
return Card(
margin: EdgeInsets.only(
left: 4,
top: 4,
right: 4,
bottom: 0,
),
color: Colors.black,
child: Card(
margin: EdgeInsets.all(4.0),
color: ivory,
child: Padding(
padding: EdgeInsets.all(8.0),
2019-09-11 17:53:29 -07:00
child: Row(
children: <Widget>[
Expanded(
flex: 1,
child: Card(),
),
Expanded(
flex: 8,
child: Text(
allText,
style: TextStyle(
fontSize: 20.0,
),
),
),
Expanded(
flex: 1,
child: Card(),
),
],
2019-08-30 13:05:00 -07:00
),
),
),
);
}
Card cardOne(String leftText) {
return Card(
margin: EdgeInsets.only(
left: 4,
top: 4,
right: 4,
bottom: 0,
),
color: Colors.black,
child: Card(
margin: EdgeInsets.all(4.0),
color: ivory,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Expanded(
2019-09-11 17:53:29 -07:00
flex: 1,
child: Card(),
),
Expanded(
flex: 7,
2019-08-30 13:05:00 -07:00
child: Text(
leftText,
style: TextStyle(
fontSize: 20.0,
),
),
),
2019-09-11 17:53:29 -07:00
Expanded(
flex: 2,
2019-08-30 13:05:00 -07:00
child: Icon(
Icons.arrow_right,
size: 50.0,
color: candyApple,
),
),
],
),
),
),
);
}
Card cardTwo(String leftText,String mapUrl,String mapUrlName) {
return Card(
margin: EdgeInsets.only(
left: 4,
top: 4,
right: 4,
bottom: 0,
),
color: Colors.black,
child: Card(
margin: EdgeInsets.all(4.0),
color: ivory,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Expanded(
2019-09-11 17:53:29 -07:00
flex: 1,
child: Card(),
),
Expanded(
flex: 7,
2019-08-30 13:05:00 -07:00
child: Text(
leftText,
style: TextStyle(
fontSize: 20.0,
),
),
),
Expanded(
flex: 2,
child: InkWell(
child: Icon(
Icons.map,
size: 50.0,
color: Colors.black,
),
onTap: () {
html.window.open(mapUrl,mapUrlName);
},
),
),
],
),
),
),
);
}
Card convenienceCardOne(String infoUrl,String infoUrlName,String middleText,String mapUrl,String mapUrlName) {
return Card(
margin: EdgeInsets.only(
left: 4,
top: 4,
right: 4,
bottom: 0,
),
color: Colors.black,
child: Card(
margin: EdgeInsets.all(4.0),
color: ivory,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Row(
children: <Widget>[
Expanded(
2019-09-11 17:53:29 -07:00
flex: 3,
2019-08-30 13:05:00 -07:00
child: InkWell(
child: Icon(
Icons.info,
size: 50.0,
color: candyApple,
),
onTap: () {
html.window.open(infoUrl,infoUrlName);
},
),
),
Expanded(
2019-09-11 17:53:29 -07:00
flex: 5,
2019-08-30 13:05:00 -07:00
child: Text(
middleText,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 20.0,
fontStyle: FontStyle.italic,
),
),
),
Expanded(
flex: 2,
child: InkWell(
child: Icon(
Icons.map,
size: 50.0,
color: Colors.black,
),
onTap: () {
html.window.open(mapUrl,mapUrlName);
},
),
),
],
),
),
),
);
}