|
|
@@ -108,8 +108,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
|
|
|
@override
|
|
|
void dispose() {
|
|
|
- WidgetsBinding.instance.removeObserver(this);
|
|
|
super.dispose();
|
|
|
+ WidgetsBinding.instance.removeObserver(this);
|
|
|
}
|
|
|
|
|
|
@override
|
|
|
@@ -176,7 +176,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
style: TextStyle(
|
|
|
color: Colors.white,
|
|
|
fontSize: 68,
|
|
|
- fontFamily: 'AgencyFB',
|
|
|
+ fontFamily: 'DINEngschrift',
|
|
|
),
|
|
|
),
|
|
|
Text(
|
|
|
@@ -184,7 +184,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
style: TextStyle(
|
|
|
color: Colors.white,
|
|
|
fontSize: 36,
|
|
|
- fontFamily: 'AgencyFB',
|
|
|
+ fontFamily: 'DINEngschrift',
|
|
|
),
|
|
|
)
|
|
|
],
|
|
|
@@ -275,55 +275,66 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
- Container(
|
|
|
- child: GridView.count(
|
|
|
- physics: new BouncingScrollPhysics(),
|
|
|
- shrinkWrap: true,
|
|
|
- crossAxisCount: 2,
|
|
|
- children: <Widget>[
|
|
|
- HomeMenu(
|
|
|
- "images/home_icon_fangjian.png",
|
|
|
- "创建房间",
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.of(context).push(PageRouteBuilder(
|
|
|
- opaque: false,
|
|
|
- transitionDuration: Duration(milliseconds: 300),
|
|
|
- transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
|
|
- return FadeTransition(
|
|
|
- opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
|
- child: child,
|
|
|
- );
|
|
|
- },
|
|
|
- pageBuilder: (BuildContext context, _, __) {
|
|
|
- return CreateRoom();
|
|
|
- }));
|
|
|
- },
|
|
|
- ),
|
|
|
- HomeMenu(
|
|
|
- "images/home_icon_kuaisu.png",
|
|
|
- "快速进入",
|
|
|
- onTapHomeMenu: () {
|
|
|
- getOneRoom();
|
|
|
- },
|
|
|
- ),
|
|
|
- HomeMenu(
|
|
|
- "images/home_icon_sousuo.png",
|
|
|
- "搜索",
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
|
|
|
- },
|
|
|
- ),
|
|
|
- HomeMenu(
|
|
|
- "images/home_icon_youjian.png",
|
|
|
- "邮件",
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
|
|
|
- },
|
|
|
- showBadge: showBadge,
|
|
|
+ Builder(
|
|
|
+ builder: (BuildContext context) {
|
|
|
+ double width = MediaQuery.of(context).size.width;
|
|
|
+ double height = MediaQuery.of(context).size.height;
|
|
|
+ double aspectRatio = 1;
|
|
|
+ if (height / width < 17 / 9) {
|
|
|
+ aspectRatio = width / (height - 334);
|
|
|
+ }
|
|
|
+ return Container(
|
|
|
+ child: GridView.count(
|
|
|
+ physics: new BouncingScrollPhysics(),
|
|
|
+ shrinkWrap: true,
|
|
|
+ crossAxisCount: 2,
|
|
|
+ childAspectRatio: aspectRatio,
|
|
|
+ children: <Widget>[
|
|
|
+ HomeMenu(
|
|
|
+ "images/home_icon_fangjian.png",
|
|
|
+ "创建房间",
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ Navigator.of(context).push(PageRouteBuilder(
|
|
|
+ opaque: false,
|
|
|
+ transitionDuration: Duration(milliseconds: 300),
|
|
|
+ transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
|
|
+ return FadeTransition(
|
|
|
+ opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
|
+ child: child,
|
|
|
+ );
|
|
|
+ },
|
|
|
+ pageBuilder: (BuildContext context, _, __) {
|
|
|
+ return CreateRoom();
|
|
|
+ }));
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ HomeMenu(
|
|
|
+ "images/home_icon_kuaisu.png",
|
|
|
+ "快速进入",
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ getOneRoom();
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ HomeMenu(
|
|
|
+ "images/home_icon_sousuo.png",
|
|
|
+ "搜索",
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ HomeMenu(
|
|
|
+ "images/home_icon_youjian.png",
|
|
|
+ "邮件",
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
|
|
|
+ },
|
|
|
+ showBadge: showBadge,
|
|
|
+ ),
|
|
|
+ ],
|
|
|
),
|
|
|
- ],
|
|
|
- ),
|
|
|
- )
|
|
|
+ );
|
|
|
+ },
|
|
|
+ ),
|
|
|
],
|
|
|
);
|
|
|
}
|
|
|
@@ -342,51 +353,48 @@ class HomeMenu extends StatelessWidget {
|
|
|
return Container(
|
|
|
decoration:
|
|
|
BoxDecoration(gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [Color(0xFF626C85), Color(0xFF3D3E6C)])),
|
|
|
- child: AspectRatio(
|
|
|
- aspectRatio: 1,
|
|
|
- child: Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- border: Border(
|
|
|
- left: BorderSide(width: 0.5, color: Color(0x80000000)),
|
|
|
- right: BorderSide(width: 0.5, color: Color(0x80000000)),
|
|
|
- bottom: BorderSide(width: 1, color: Color(0x80000000)))),
|
|
|
- child: Material(
|
|
|
- color: Colors.transparent,
|
|
|
- child: InkWell(
|
|
|
- onTap: onTapHomeMenu,
|
|
|
- child: Column(
|
|
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
- children: <Widget>[
|
|
|
- Container(
|
|
|
- width: 44,
|
|
|
- height: 34,
|
|
|
- child: Stack(
|
|
|
- children: <Widget>[
|
|
|
- Image.asset(
|
|
|
- icon,
|
|
|
- fit: BoxFit.contain,
|
|
|
- width: 44,
|
|
|
- height: 34,
|
|
|
+ child: Container(
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ border: Border(
|
|
|
+ left: BorderSide(width: 0.5, color: Color(0x80000000)),
|
|
|
+ right: BorderSide(width: 0.5, color: Color(0x80000000)),
|
|
|
+ bottom: BorderSide(width: 1, color: Color(0x80000000)))),
|
|
|
+ child: Material(
|
|
|
+ color: Colors.transparent,
|
|
|
+ child: InkWell(
|
|
|
+ onTap: onTapHomeMenu,
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ Container(
|
|
|
+ width: 44,
|
|
|
+ height: 34,
|
|
|
+ child: Stack(
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset(
|
|
|
+ icon,
|
|
|
+ fit: BoxFit.contain,
|
|
|
+ width: 44,
|
|
|
+ height: 34,
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ right: 0,
|
|
|
+ top: 0,
|
|
|
+ child: Container(
|
|
|
+ width: showBadge ? 10 : 0,
|
|
|
+ height: showBadge ? 10 : 0,
|
|
|
+ decoration: BoxDecoration(color: Color.fromARGB(255, 239, 0, 9), borderRadius: BorderRadius.all(Radius.circular(10))),
|
|
|
),
|
|
|
- Positioned(
|
|
|
- right: 0,
|
|
|
- top: 0,
|
|
|
- child: Container(
|
|
|
- width: showBadge ? 10 : 0,
|
|
|
- height: showBadge ? 10 : 0,
|
|
|
- decoration: BoxDecoration(color: Color.fromARGB(255, 239, 0, 9), borderRadius: BorderRadius.all(Radius.circular(10))),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
- Text(
|
|
|
- title,
|
|
|
- style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
- textAlign: TextAlign.center,
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ title,
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
+ textAlign: TextAlign.center,
|
|
|
+ )
|
|
|
+ ],
|
|
|
),
|
|
|
),
|
|
|
),
|