Skip to content

Commit fa6f3dc

Browse files
committed
更新启动动画
1 parent 25ba45d commit fa6f3dc

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

lib/page/welcome_page.dart

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'dart:async';
22

3+
import 'package:flare_flutter/flare_actor.dart';
34
import 'package:flutter/material.dart';
45
import 'package:flutter_lottie/flutter_lottie.dart';
56
import 'package:flutter_redux/flutter_redux.dart';
@@ -49,9 +50,7 @@ class _WelcomePageState extends State<WelcomePage> {
4950
});
5051
}
5152

52-
void onViewCreatedFile(LottieController controller) {
53-
54-
}
53+
void onViewCreatedFile(LottieController controller) {}
5554

5655
@override
5756
Widget build(BuildContext context) {
@@ -71,14 +70,10 @@ class _WelcomePageState extends State<WelcomePage> {
7170
child: new Container(
7271
width: size,
7372
height: size,
74-
color: Colors.white,
75-
child: LottieView.fromFile(
76-
filePath: "static/file/rejection2.json",
77-
autoPlay: true,
78-
loop: true,
79-
reverse: false,
80-
onViewCreated: onViewCreatedFile,
81-
),
73+
child: new FlareActor("static/file/flare_flutter.flr",
74+
alignment: Alignment.topCenter,
75+
fit: BoxFit.fill,
76+
animation: "Placeholder"),
8277
),
8378
)
8479
],

pubspec.lock

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,20 @@ packages:
190190
url: "https://pub.flutter-io.cn"
191191
source: hosted
192192
version: "0.10.9"
193+
flare_dart:
194+
dependency: transitive
195+
description:
196+
name: flare_dart
197+
url: "https://pub.flutter-io.cn"
198+
source: hosted
199+
version: "1.4.1"
200+
flare_flutter:
201+
dependency: "direct main"
202+
description:
203+
name: flare_flutter
204+
url: "https://pub.flutter-io.cn"
205+
source: hosted
206+
version: "1.5.1"
193207
flutter:
194208
dependency: "direct main"
195209
description: flutter

pubspec.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies:
3434
rxdart: ^0.22.0
3535
android_intent: ^0.3.0
3636
webview_flutter: ^0.3.7+1
37+
flare_flutter: ^1.5.0
3738
flutter_localizations:
3839
sdk: flutter
3940
flutter_lottie:
@@ -100,6 +101,7 @@ flutter:
100101
- static/images/default_img.png
101102
- static/file/rejection.json
102103
- static/file/rejection2.json
104+
- static/file/flare_flutter.flr
103105

104106
fonts:
105107
- family: wxcIconFont

static/file/flare_flutter.flr

5.17 KB
Binary file not shown.

0 commit comments

Comments
 (0)