| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- import 'package:flutter/material.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:wanna_battle/styles/colors.dart';
- import 'package:wanna_battle/styles/totast.dart';
- import '../styles/colors.dart';
- import '../widget/Dialog.dart';
- void showCheckinDialog(BuildContext context) {
- 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 _CheckinDialog1();
- },
- ),
- );
- }
- class _CheckinDialog1 extends Dialog {
- @override
- Widget build(BuildContext context) {
- return WillPopScope(
- child: Scaffold(
- backgroundColor: Color(0xb3000000),
- body: Container(
- child: SizedBox.expand(
- child: UnconstrainedBox(
- child: Container(
- width: 330,
- height: 390,
- decoration: BoxDecoration(color: Color(0xE6293559), border: Border.all(width: 1, color: Color(0xFF1990F8))),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Text(
- '每日签到',
- style: TextStyle(color: Colors.white, fontSize: 18, fontWeight: FontWeight.bold),
- ),
- Container(
- margin: EdgeInsets.only(top: 30),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- item('星期一', 1, '50金币', 1),
- item('星期二', 1, '50金币', 2),
- item('星期三', 1, '50金币', 3),
- item('星期四', 1, '50金币', 1),
- ],
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: 25),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- item('星期五', 1, '50金币', 2),
- item('星期六', 1, '50金币', 3),
- item('星期日', 1, '50金币', 1),
- ],
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: 40),
- child: MaterialButton(
- minWidth: 220,
- elevation: 0,
- highlightElevation: 0,
- color: PRIMARY_COLOR,
- child: Text(
- '立即签到',
- style: TextStyle(color: Colors.white, fontSize: 14, fontWeight: FontWeight.bold),
- ),
- onPressed: () {
- Toast.show(context, '签到成功', 2000, 'info');
- Navigator.of(context).pop();
- },
- ),
- )
- ],
- ),
- ),
- ),
- ),
- ),
- ),
- onWillPop: () {
- return Future.value(true);
- },
- );
- }
- Widget item(String weekDay, int type, String name, int checked) {
- List<Widget> list = [
- Container(
- decoration: BoxDecoration(
- color: Color(0xFF253051),
- border: Border.all(width: 1, color: PRIMARY_COLOR),
- borderRadius: BorderRadius.circular(22),
- ),
- ),
- Center(
- child: Image.asset(
- 'images/icon_jinbi_qiandao.png',
- ),
- ),
- ];
- if (checked == 1) {
- list.add(Center(
- child: Image.asset(
- 'images/icon_yiqiandao.png',
- ),
- ));
- } else if (checked == 2) {
- list.add(Center(
- child: Container(
- decoration: BoxDecoration(
- color: Color(0xFF4f5c87),
- border: Border.all(width: 1, color: Color(0xFF4f5c87)),
- borderRadius: BorderRadius.circular(22),
- ),
- child: Center(
- child: Text(
- '未签到',
- style: TextStyle(color: Colors.white, fontSize: 10),
- ),
- ),
- ),
- ));
- }
- return Container(
- width: 76,
- child: Column(
- children: <Widget>[
- Container(
- width: 44,
- height: 44,
- child: Stack(
- children: list,
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: 6),
- child: Text(
- weekDay,
- style: TextStyle(color: Colors.white, fontSize: 14),
- ),
- ),
- Container(
- margin: EdgeInsets.only(top: 2),
- child: Text(
- '50金币',
- style: TextStyle(
- color: PRIMARY_COLOR,
- fontSize: 12,
- ),
- ),
- )
- ],
- ),
- );
- }
- }
|