fixed flashing app bar during hero in some cases
This commit is contained in:
parent
3c90ef312a
commit
56b865af13
1 changed files with 21 additions and 17 deletions
|
@ -2,6 +2,7 @@ import 'package:aves/model/settings/settings.dart';
|
||||||
import 'package:aves/theme/durations.dart';
|
import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/widgets/aves_app.dart';
|
import 'package:aves/widgets/aves_app.dart';
|
||||||
import 'package:aves/widgets/common/fx/blurred.dart';
|
import 'package:aves/widgets/common/fx/blurred.dart';
|
||||||
|
import 'package:aves/widgets/common/providers/query_provider.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
@ -100,23 +101,26 @@ class AvesAppBar extends StatelessWidget {
|
||||||
final pushing = direction == HeroFlightDirection.push;
|
final pushing = direction == HeroFlightDirection.push;
|
||||||
Widget popBuilder(context, child) => Opacity(opacity: 1 - animation.value, child: child);
|
Widget popBuilder(context, child) => Opacity(opacity: 1 - animation.value, child: child);
|
||||||
Widget pushBuilder(context, child) => Opacity(opacity: animation.value, child: child);
|
Widget pushBuilder(context, child) => Opacity(opacity: animation.value, child: child);
|
||||||
return Material(
|
return QueryProvider(
|
||||||
type: MaterialType.transparency,
|
initialQuery: null,
|
||||||
child: DefaultTextStyle(
|
child: Material(
|
||||||
style: DefaultTextStyle.of(toHero).style,
|
type: MaterialType.transparency,
|
||||||
child: Stack(
|
child: DefaultTextStyle(
|
||||||
children: [
|
style: DefaultTextStyle.of(toHero).style,
|
||||||
AnimatedBuilder(
|
child: Stack(
|
||||||
animation: animation,
|
children: [
|
||||||
builder: pushing ? popBuilder : pushBuilder,
|
AnimatedBuilder(
|
||||||
child: fromHero.widget,
|
animation: animation,
|
||||||
),
|
builder: pushing ? popBuilder : pushBuilder,
|
||||||
AnimatedBuilder(
|
child: fromHero.widget,
|
||||||
animation: animation,
|
),
|
||||||
builder: pushing ? pushBuilder : popBuilder,
|
AnimatedBuilder(
|
||||||
child: toHero.widget,
|
animation: animation,
|
||||||
),
|
builder: pushing ? pushBuilder : popBuilder,
|
||||||
],
|
child: toHero.widget,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue