Browse Source

Merge branches 'dev' and 'master' of https://git.lotus-wallet.com/fmk/huixiang_app

 Conflicts:
	lib/main.dart
	lib/retrofit/data/member_rank.dart
	lib/retrofit/data/store_info.dart
	lib/retrofit/data/task.dart
null_safety
fmk 4 years ago
parent
commit
01618842d2
  1. 1
      android/app/build.gradle
  2. 4
      android/build.gradle
  3. BIN
      assets/image/2x/icon_story_1.png
  4. BIN
      assets/image/2x/icon_story_2.png
  5. BIN
      assets/image/2x/icon_story_bj.png
  6. BIN
      assets/image/2x/icon_story_td.png
  7. BIN
      assets/image/3x/icon_story_1.png
  8. BIN
      assets/image/3x/icon_story_2.png
  9. BIN
      assets/image/3x/icon_story_bj.png
  10. BIN
      assets/image/3x/icon_story_td.png
  11. BIN
      assets/image/icon_story_1.png
  12. BIN
      assets/image/icon_story_2.png
  13. BIN
      assets/image/icon_story_bj.png
  14. BIN
      assets/image/icon_story_td.png
  15. 2
      lib/retrofit/data/store.dart
  16. 146
      lib/utils/MyPainter.dart
  17. 270
      pubspec.lock

1
android/app/build.gradle

@ -25,6 +25,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
def mfph = [
//宿
"apk.applicationId" : "com.zsw.huixiang",

4
android/build.gradle

@ -11,7 +11,7 @@ buildscript {
url 'http://maven.aliyun.com/nexus/content/groups/public'
}
google()
jcenter()
// jcenter()
}
dependencies {
@ -32,7 +32,7 @@ allprojects {
url 'http://maven.aliyun.com/nexus/content/groups/public'
}
google()
jcenter()
// jcenter()
}
}

BIN
assets/image/2x/icon_story_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
assets/image/2x/icon_story_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
assets/image/2x/icon_story_bj.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

BIN
assets/image/2x/icon_story_td.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB

BIN
assets/image/3x/icon_story_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
assets/image/3x/icon_story_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

BIN
assets/image/3x/icon_story_bj.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 542 B

BIN
assets/image/3x/icon_story_td.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
assets/image/icon_story_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
assets/image/icon_story_2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
assets/image/icon_story_bj.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

BIN
assets/image/icon_story_td.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 KiB

2
lib/retrofit/data/store.dart

@ -1,6 +1,7 @@
import 'package:huixiang/retrofit/data/store_type.dart';
class Store {
Store();
@ -70,6 +71,7 @@ class Store {
..posType = json['posType'] == null
? null
: StoreType.fromJson(json['posType'] as Map<String, dynamic>);
Map<String, dynamic> toJson() => <String, dynamic>{
'id': this.id,
'createTime': this.createTime,

146
lib/utils/MyPainter.dart

@ -0,0 +1,146 @@
/*
* ,
*/
import 'dart:math';
import 'package:flutter/cupertino.dart';
class MyPainter extends CustomPainter {
//线
Color lineColor;
//线
double width;
//线
Color completeColor;
//
double completePercent;
//线
double completeWidth;
// 1, 2 3 4
double startType;
//线
bool isDividerRound;
// 线
bool isGradient;
//
double endAngle;
//线
List<Color> lineColors;
//
// Color shadowColor;
//
bool isTransfrom;
MyPainter({
this.lineColor,
this.completeColor,
this.completePercent,
this.width,
this.completeWidth = 0,
this.startType = 1,
this.isDividerRound = false,
this.isGradient = false,
this.endAngle = pi * 2,
this.lineColors,
this.isTransfrom = false,
// this.shadowColor,
});
@override
void paint(Canvas canvas, Size size) {
Offset center = Offset(size.width / 2, size.height / 2); //
double radius = min(size.width / 2, size.height / 2); //
//
if (lineColor != null) {
// 线
if (isDividerRound) {
//线
Paint line = Paint()
..color = lineColor
// ..strokeCap = StrokeCap.round
..style = PaintingStyle.stroke
..isAntiAlias = true
..strokeWidth = width;
double i = 0.00;
while (i < pi * 2) {
canvas.drawArc(Rect.fromCircle(center: center, radius: radius), i,
0.15, false, line);
i = i + 0.3;
}
} else {
//线 线
Paint line = Paint()
..color = lineColor
..strokeCap = StrokeCap.round
..style = PaintingStyle.stroke
..strokeWidth = width;
canvas.drawCircle(
//
center,
radius,
line);
}
}
//
if (completeWidth > 0) {
double arcAngle = 2 * pi * (completePercent / 100);
// 1, 2 3 4
double start = pi / 2;
if (startType == 2) {
start = -pi / 2;
} else if (startType == 3) {
start = pi;
} else if (startType == 4) {
start = pi * 2;
}
//
Paint paint = Paint()
..strokeCap = StrokeCap.round
..style = PaintingStyle.stroke
..strokeWidth = completeWidth;
///
if (isGradient == true) {
//
double transfrom;
if (isTransfrom == false) {
//
transfrom = -pi / 2;
} else {
//
transfrom = pi * 2;
}
paint.shader = SweepGradient(
startAngle: 0.0,
endAngle: pi * 2,
colors: lineColors,
tileMode: TileMode.clamp,
transform: GradientRotation(transfrom),
).createShader(
Rect.fromCircle(center: center, radius: radius),
);
canvas.drawArc(Rect.fromCircle(center: center, radius: radius), start,
arcAngle, false, paint);
} else {
///
paint.color = completeColor;
canvas.drawArc(
Rect.fromCircle(center: center, radius: radius),
start, // -pi / 2, pi / 2,
arcAngle,
false,
paint,
);
}
}
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => false;
}

270
pubspec.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save