|
@@ -1,4 +1,5 @@
|
|
|
import 'dart:math';
|
|
|
+import 'dart:ui';
|
|
|
|
|
|
import 'package:cached_network_image/cached_network_image.dart';
|
|
|
import 'package:flutter/cupertino.dart';
|
|
@@ -273,259 +274,329 @@ Future<bool> showSharePopup(
|
|
|
context: context,
|
|
|
barrierDismissible: true,
|
|
|
barrierLabel: '',
|
|
|
- barrierColor: Color(0xff241D19).withOpacity(0.8),
|
|
|
+// barrierColor: Color(0xff241D19).withOpacity(0.8),
|
|
|
transitionDuration: Duration(milliseconds: 200),
|
|
|
// useRootNavigator: false,
|
|
|
pageBuilder: (BuildContext context, Animation<double> animation,
|
|
|
Animation<double> secondaryAnimation) {
|
|
|
- return Material(
|
|
|
- color: Colors.transparent,
|
|
|
- child: Column(
|
|
|
+ return BackdropFilter(
|
|
|
+ filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
|
|
|
+ child: Material(
|
|
|
+ color: Colors.transparent.withOpacity(0.8),
|
|
|
+ child: Column(
|
|
|
// mainAxisSize: MainAxisSize.max,
|
|
|
- children: <Widget>[
|
|
|
- Space(
|
|
|
- height: MediaQuery.of(context).padding.top + 31,
|
|
|
- ),
|
|
|
- Column(
|
|
|
- mainAxisSize: MainAxisSize.max,
|
|
|
- mainAxisAlignment: MainAxisAlignment.start,
|
|
|
- children: <Widget>[
|
|
|
- Container(
|
|
|
- padding: EdgeInsets.symmetric(horizontal: 17.0),
|
|
|
- alignment: Alignment.centerRight,
|
|
|
- child: InkWell(
|
|
|
- child: Container(
|
|
|
- width: 22.0,
|
|
|
- height: 22.0,
|
|
|
- decoration: BoxDecoration(
|
|
|
- image: DecorationImage(
|
|
|
- image: AssetImage(
|
|
|
- "lib/assets/img/btn_close_white.png"))),
|
|
|
- ),
|
|
|
- onTap: () {
|
|
|
- Navigator.pop(context, false);
|
|
|
- },
|
|
|
- )),
|
|
|
- Space(
|
|
|
- height: 145,
|
|
|
- ),
|
|
|
- Stack(
|
|
|
+ children: <Widget>[
|
|
|
+ Space(
|
|
|
+ height: MediaQuery.of(context).padding.top + 31,
|
|
|
+ ),
|
|
|
+ Column(
|
|
|
+ mainAxisSize: MainAxisSize.max,
|
|
|
+ mainAxisAlignment: MainAxisAlignment.start,
|
|
|
+ children: <Widget>[
|
|
|
+ Container(
|
|
|
+ padding: EdgeInsets.symmetric(horizontal: 17.0),
|
|
|
+ alignment: Alignment.centerRight,
|
|
|
+ child: InkWell(
|
|
|
+ child: Container(
|
|
|
+ width: 22.0,
|
|
|
+ height: 22.0,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ image: DecorationImage(
|
|
|
+ image: AssetImage(
|
|
|
+ "lib/assets/img/btn_close_white.png"))),
|
|
|
+ ),
|
|
|
+ onTap: () {
|
|
|
+ Navigator.pop(context, false);
|
|
|
+ },
|
|
|
+ )),
|
|
|
+ Space(
|
|
|
+ height: 115,
|
|
|
+ ),
|
|
|
+ Stack(
|
|
|
// fit: StackFit.expand,
|
|
|
- alignment: Alignment.topCenter,
|
|
|
- overflow: Overflow.visible,
|
|
|
- children: <Widget>[
|
|
|
- Container(
|
|
|
- height: 278,
|
|
|
- child: new Swiper(
|
|
|
+ alignment: Alignment.topCenter,
|
|
|
+ overflow: Overflow.visible,
|
|
|
+ children: <Widget>[
|
|
|
+ Container(
|
|
|
+ height: 278,
|
|
|
+ child: new Swiper(
|
|
|
// itemWidth: MediaQuery.of(context).size.width,
|
|
|
- loop: false,
|
|
|
- index: startIndex,
|
|
|
- itemBuilder: (BuildContext context, int index) {
|
|
|
- return Column(
|
|
|
- children: <Widget>[
|
|
|
- relateAchievements[index].createdAt != ""
|
|
|
- ? CachedNetworkImage(
|
|
|
- imageUrl:
|
|
|
- relateAchievements[index].logo,
|
|
|
- width: 180,
|
|
|
- height: 180,
|
|
|
- )
|
|
|
- : ColorFiltered(
|
|
|
- colorFilter:
|
|
|
- ColorFilter.matrix(<double>[
|
|
|
- 0.2126,
|
|
|
- 0.7152,
|
|
|
- 0.0722,
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- 0.2126,
|
|
|
- 0.7152,
|
|
|
- 0.0722,
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- 0.2126,
|
|
|
- 0.7152,
|
|
|
- 0.0722,
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- 0,
|
|
|
- 1,
|
|
|
- 0,
|
|
|
- ]),
|
|
|
- child: CachedNetworkImage(
|
|
|
+ loop: false,
|
|
|
+ index: startIndex,
|
|
|
+ itemBuilder: (BuildContext context, int index) {
|
|
|
+ return Column(
|
|
|
+ children: <Widget>[
|
|
|
+ relateAchievements[index].createdAt != ""
|
|
|
+ ? index != currentIndex
|
|
|
+ ? Opacity(
|
|
|
+ opacity: 0.5,
|
|
|
+ child: Container(
|
|
|
+ child: CachedNetworkImage(
|
|
|
+ imageUrl:
|
|
|
+ relateAchievements[index]
|
|
|
+ .logo,
|
|
|
+ width: 180,
|
|
|
+ height: 180,
|
|
|
+ )))
|
|
|
+ : Container(
|
|
|
+ child: CachedNetworkImage(
|
|
|
+ imageUrl:
|
|
|
+ relateAchievements[index]
|
|
|
+ .logo,
|
|
|
+ width: 180,
|
|
|
+ height: 180,
|
|
|
+ ))
|
|
|
+ : index == currentIndex
|
|
|
+ ? ColorFiltered(
|
|
|
+ colorFilter:
|
|
|
+ ColorFilter.matrix(<double>[
|
|
|
+ 0.2126,
|
|
|
+ 0.7152,
|
|
|
+ 0.0722,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0.2126,
|
|
|
+ 0.7152,
|
|
|
+ 0.0722,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0.2126,
|
|
|
+ 0.7152,
|
|
|
+ 0.0722,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 1,
|
|
|
+ 0,
|
|
|
+ ]),
|
|
|
+ child: CachedNetworkImage(
|
|
|
// width: 70.0,
|
|
|
// height: 70.0,
|
|
|
- imageUrl:
|
|
|
- relateAchievements[index]
|
|
|
- .logo),
|
|
|
- ),
|
|
|
- if (index == currentIndex)
|
|
|
- Column(
|
|
|
- children: <Widget>[
|
|
|
- Space(
|
|
|
- height: 20.0,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "${relateAchievements[index].name}",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 18.0,
|
|
|
- color: Colors.white),
|
|
|
- ),
|
|
|
- Space(
|
|
|
- height: 5.0,
|
|
|
- ),
|
|
|
- ],
|
|
|
- )
|
|
|
- ],
|
|
|
- );
|
|
|
- },
|
|
|
- viewportFraction: 0.5,
|
|
|
- scale: 0.3,
|
|
|
- itemCount: relateAchievements.length,
|
|
|
- pagination: new SwiperPagination(
|
|
|
- margin: new EdgeInsets.symmetric(vertical: 0.0),
|
|
|
- builder: DotSwiperPaginationBuilder(
|
|
|
- size: 6,
|
|
|
- activeSize: 6,
|
|
|
- activeColor:
|
|
|
- Theme.of(context).accentColor)),
|
|
|
- onIndexChanged: (index) {
|
|
|
- _valueNotifierIndex.value = index;
|
|
|
- currentIndex = index;
|
|
|
- },
|
|
|
+ imageUrl:
|
|
|
+ relateAchievements[index]
|
|
|
+ .logo),
|
|
|
+ )
|
|
|
+ : Opacity(
|
|
|
+ opacity: 0.5,
|
|
|
+ child: ColorFiltered(
|
|
|
+ colorFilter:
|
|
|
+ ColorFilter.matrix(<double>[
|
|
|
+ 0.2126,
|
|
|
+ 0.7152,
|
|
|
+ 0.0722,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0.2126,
|
|
|
+ 0.7152,
|
|
|
+ 0.0722,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0.2126,
|
|
|
+ 0.7152,
|
|
|
+ 0.0722,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 0,
|
|
|
+ 1,
|
|
|
+ 0,
|
|
|
+ ]),
|
|
|
+ child: CachedNetworkImage(
|
|
|
+// width: 70.0,
|
|
|
+// height: 70.0,
|
|
|
+ imageUrl:
|
|
|
+ relateAchievements[
|
|
|
+ index]
|
|
|
+ .logo),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+// if (index == currentIndex)
|
|
|
+// Column(
|
|
|
+// children: <Widget>[
|
|
|
+// Space(
|
|
|
+// height: 20.0,
|
|
|
+// ),
|
|
|
+// Space(
|
|
|
+// height: 5.0,
|
|
|
+// ),
|
|
|
+// ],
|
|
|
+// )
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ },
|
|
|
+ viewportFraction: 0.5,
|
|
|
+ scale: 0.3,
|
|
|
+ itemCount: relateAchievements.length,
|
|
|
+ pagination: new SwiperPagination(
|
|
|
+ margin: new EdgeInsets.symmetric(vertical: 0.0),
|
|
|
+ builder: DotSwiperPaginationBuilder(
|
|
|
+ size: 6,
|
|
|
+ activeSize: 6,
|
|
|
+ color: Colors.white.withOpacity(0.5),
|
|
|
+ activeColor:
|
|
|
+ Theme.of(context).accentColor)),
|
|
|
+ onIndexChanged: (index) {
|
|
|
+ _valueNotifierIndex.value = index;
|
|
|
+ currentIndex = index;
|
|
|
+ },
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- Positioned(
|
|
|
+ Positioned(
|
|
|
// top: 120.0,
|
|
|
- top: 180,
|
|
|
- child: Container(
|
|
|
- child: ValueListenableBuilder(
|
|
|
- valueListenable: _valueNotifierIndex,
|
|
|
- builder: (BuildContext context, int value,
|
|
|
- Widget child) {
|
|
|
- if (currentIndex == value) {
|
|
|
- return relateAchievements[value]
|
|
|
- .createdAt !=
|
|
|
- ""
|
|
|
- ? Column(
|
|
|
- mainAxisSize: MainAxisSize.min,
|
|
|
- children: <Widget>[
|
|
|
- Space(
|
|
|
- height: 57.0,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- alignment: Alignment.center,
|
|
|
- child: Text(
|
|
|
- "${relateAchievements[value].conditionDetail}",
|
|
|
+ top: 175,
|
|
|
+ child: Container(
|
|
|
+ child: ValueListenableBuilder(
|
|
|
+ valueListenable: _valueNotifierIndex,
|
|
|
+ builder: (BuildContext context, int value,
|
|
|
+ Widget child) {
|
|
|
+ if (currentIndex == value) {
|
|
|
+ return relateAchievements[value]
|
|
|
+ .createdAt !=
|
|
|
+ ""
|
|
|
+ ? Column(
|
|
|
+ mainAxisSize: MainAxisSize.min,
|
|
|
+ children: <Widget>[
|
|
|
+ Space(
|
|
|
+ height: 25.0,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ "${relateAchievements[value].name}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 18.0,
|
|
|
+ color: Colors.white,
|
|
|
+ fontWeight:
|
|
|
+ FontWeight.bold),
|
|
|
+ ),
|
|
|
+ Space(
|
|
|
+ height: 10.0,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ alignment: Alignment.center,
|
|
|
+ child: Text(
|
|
|
+ "${relateAchievements[value].conditionDetail}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.0,
|
|
|
+ color: Colors.white)),
|
|
|
+ ),
|
|
|
+ Space(
|
|
|
+ height: 60.0,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ "获取时间 ${relateAchievements[value].createdAt.split(" ")[0]}"),
|
|
|
+ Space(
|
|
|
+ height: 16.0,
|
|
|
+ ),
|
|
|
+ Container(
|
|
|
+ alignment: Alignment.center,
|
|
|
+ height: 37.5,
|
|
|
+ width: MediaQuery.of(context)
|
|
|
+ .size
|
|
|
+ .width,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ image: DecorationImage(
|
|
|
+ image: AssetImage(
|
|
|
+ "lib/assets/img/bg1_pop_achievement.png"),
|
|
|
+ fit: BoxFit.cover)),
|
|
|
+ child: Text(
|
|
|
+ "晋级奖励 : 经验值 +${relateAchievements[value].rewardExp} 积分 +${relateAchievements[value].rewardScore}",
|
|
|
style: TextStyle(
|
|
|
- fontSize: 14.0,
|
|
|
- color:
|
|
|
- Color(0xff999999))),
|
|
|
- ),
|
|
|
- Space(
|
|
|
- height: 50.0,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "获取时间 ${relateAchievements[value].createdAt.split(" ")[0]}"),
|
|
|
- Space(
|
|
|
- height: 16.0,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- alignment: Alignment.center,
|
|
|
- height: 25.0,
|
|
|
-// width:
|
|
|
-// MediaQuery.of(context).size.width * 0.7,
|
|
|
- decoration: BoxDecoration(
|
|
|
- image: DecorationImage(
|
|
|
- image: AssetImage(
|
|
|
- "lib/assets/img/bg1_pop_achievement.png"))),
|
|
|
- child: Text(
|
|
|
+ fontSize: 14.0,
|
|
|
+ color: Theme.of(context)
|
|
|
+ .accentColor,
|
|
|
+ ),
|
|
|
+ strutStyle: fixedLine,
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ : Column(
|
|
|
+ children: <Widget>[
|
|
|
+ Space(
|
|
|
+ height: 25.0,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ "${relateAchievements[value].name}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 18.0,
|
|
|
+ color: Colors.white),
|
|
|
+ ),
|
|
|
+ Space(
|
|
|
+ height: 10.0,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
+ "成就条件: ${relateAchievements[value].conditionDetail}",
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.0,
|
|
|
+ color: Colors.white),
|
|
|
+ ),
|
|
|
+ Space(
|
|
|
+ height: 60.0,
|
|
|
+ ),
|
|
|
+ Text("未获得"),
|
|
|
+ Space(
|
|
|
+ height: 12.0,
|
|
|
+ ),
|
|
|
+ Text(
|
|
|
"晋级奖励 : 经验值 +${relateAchievements[value].rewardExp} 积分 +${relateAchievements[value].rewardScore}",
|
|
|
style: TextStyle(
|
|
|
fontSize: 14.0,
|
|
|
- color: Theme.of(context)
|
|
|
- .accentColor),
|
|
|
+ color: Color(0xff999999)),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- )
|
|
|
- : Column(
|
|
|
- children: <Widget>[
|
|
|
- Space(
|
|
|
- height: 57.0,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "成就条件: ${relateAchievements[value].conditionDetail}",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.0,
|
|
|
- color: Color(0xff999999)),
|
|
|
- ),
|
|
|
- Space(
|
|
|
- height: 50.0,
|
|
|
- ),
|
|
|
- Text("未获得"),
|
|
|
- Space(
|
|
|
- height: 22.0,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "晋级奖励 : 经验值 +${relateAchievements[value].rewardExp} 积分 +${relateAchievements[value].rewardScore}",
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.0,
|
|
|
- color: Color(0xff999999)),
|
|
|
- ),
|
|
|
- Space(
|
|
|
- height: 16.0,
|
|
|
- ),
|
|
|
- Padding(
|
|
|
- padding: EdgeInsets.symmetric(
|
|
|
- vertical: 10.0),
|
|
|
- child: ClipRRect(
|
|
|
- borderRadius:
|
|
|
- BorderRadius.circular(12),
|
|
|
- child: Container(
|
|
|
- width: 183.0,
|
|
|
- child: CustomPaint(
|
|
|
- painter: _ProgressBar(
|
|
|
- ((relateAchievements[
|
|
|
- value]
|
|
|
- ?.conditionProgress ??
|
|
|
- 0) >
|
|
|
- 0)
|
|
|
- ? relateAchievements[
|
|
|
- value]
|
|
|
- .conditionProgress /
|
|
|
- relateAchievements[
|
|
|
- value]
|
|
|
- .conditionCount
|
|
|
- : 0,
|
|
|
- ),
|
|
|
- child: Container(
|
|
|
- height: 8,
|
|
|
+// Space(
|
|
|
+// height: 8.0,
|
|
|
+// ),
|
|
|
+ Padding(
|
|
|
+ padding: EdgeInsets.symmetric(
|
|
|
+ vertical: 10.0),
|
|
|
+ child: ClipRRect(
|
|
|
+ borderRadius:
|
|
|
+ BorderRadius.circular(12),
|
|
|
+ child: Container(
|
|
|
+ width: 183.0,
|
|
|
+ child: CustomPaint(
|
|
|
+ painter: _ProgressBar(
|
|
|
+ ((relateAchievements[
|
|
|
+ value]
|
|
|
+ ?.conditionProgress ??
|
|
|
+ 0) >
|
|
|
+ 0)
|
|
|
+ ? relateAchievements[
|
|
|
+ value]
|
|
|
+ .conditionProgress /
|
|
|
+ relateAchievements[
|
|
|
+ value]
|
|
|
+ .conditionCount
|
|
|
+ : 0,
|
|
|
+ ),
|
|
|
+ child: Container(
|
|
|
+ height: 8,
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
- ),
|
|
|
- Space(
|
|
|
- height: 5.0,
|
|
|
- ),
|
|
|
- Text(
|
|
|
- "${relateAchievements[value].conditionProgress} / ${relateAchievements[value].conditionCount}")
|
|
|
- ],
|
|
|
- );
|
|
|
- } else {
|
|
|
- return Container();
|
|
|
- }
|
|
|
- }),
|
|
|
+// Space(
|
|
|
+// height: 5.0,
|
|
|
+// ),
|
|
|
+ Text(
|
|
|
+ "${relateAchievements[value].conditionProgress} / ${relateAchievements[value].conditionCount}")
|
|
|
+ ],
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ return Container();
|
|
|
+ }
|
|
|
+ }),
|
|
|
+ ),
|
|
|
),
|
|
|
- ),
|
|
|
- ],
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ],
|
|
|
+ ],
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
);
|
|
|
});
|