initial commit to gitea
This commit is contained in:
70
lib/widgets/desktop/shop_bulletin.dart
Normal file
70
lib/widgets/desktop/shop_bulletin.dart
Normal file
@@ -0,0 +1,70 @@
|
||||
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../models/business.dart';
|
||||
|
||||
class ShopBulletin extends StatefulWidget {
|
||||
final Business business;
|
||||
|
||||
const ShopBulletin(this.business, {Key key}): super(key: key);
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => ShopBulletinState();
|
||||
|
||||
}
|
||||
|
||||
class ShopBulletinState extends State<ShopBulletin> {
|
||||
double sideSpace = 0;
|
||||
double mainSpace = 1200;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (MediaQuery.of(context).size.width <= 1200) {
|
||||
mainSpace = MediaQuery.of(context).size.width;
|
||||
sideSpace = 0;
|
||||
} else {
|
||||
mainSpace = 1200;
|
||||
sideSpace = (MediaQuery.of(context).size.width - 1200) / 2;
|
||||
}
|
||||
|
||||
if (widget.business.bulletin != null && widget.business.bulletin.isNotEmpty) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: sideSpace,
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(top: 10, left: 16.0, right: 16.0, bottom: 10.0),
|
||||
child: Text(
|
||||
'${widget.business.bulletin}',
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 3,
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.orangeAccent,
|
||||
border: Border.all(
|
||||
color: Colors.red[500],
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: BorderRadius.all(Radius.circular(16)),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
width: sideSpace,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user