Browse Source

safety

master
fmk 3 years ago
parent
commit
47b2f1861e
  1. 19
      lib/view_widget/classic_header.dart

19
lib/view_widget/classic_header.dart

@ -7,14 +7,16 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'
hide RefreshIndicator, RefreshIndicatorState;
import 'package:flutter/services.dart';
import 'package:huixiang/generated/l10n.dart';
import 'package:huixiang/view_widget/rotate_container.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:rive/rive.dart';
class MyHeader extends StatelessWidget {
@override
Widget build(BuildContext context) {
return CustomHeader();
/*MyClassicHeader(
// return CustomHeader();
return MyClassicHeader(
completeIcon: const Icon(Icons.done, color: Color(0xFF32A060)),
completeText: S.of(context).shuaxinchenggong,
failedText: S.of(context).shuaxinshibai,
@ -30,7 +32,7 @@ class MyHeader extends StatelessWidget {
height: 24,
),
),
);*/
);
}
}
@ -42,13 +44,14 @@ class CustomHeader extends RefreshIndicator {
}
class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
String _animation = "loading";
FlareControls flareController = FlareControls();
Artboard _riveArtboard;
RiveAnimationController _controllerIdle;
@override
void initState() {
super.initState();
@ -58,6 +61,7 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
riveFile.import(value);
final artboard = riveFile.mainArtboard;
artboard.addController(_controllerIdle = SimpleAnimation("Idle_1"));
setState(() {
_riveArtboard = artboard;
});
@ -66,6 +70,13 @@ class _CustomHeader extends RefreshIndicatorState<CustomHeader> {
@override
Widget buildContent(BuildContext context, RefreshStatus mode) {
if (mode == RefreshStatus.idle) {
_controllerIdle.isActive = false;
} else {
_controllerIdle.isActive = true;
}
return Container(
height: 50,
child: Rive(

Loading…
Cancel
Save