您最多选择25个主题 主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

40 行
1.3 KiB

using Unity.UIWidgets.animation;
using Unity.UIWidgets.material;
using Unity.UIWidgets.ui;
using Unity.UIWidgets.widgets;
namespace UIWidgetsGallery.gallery {
class ShrineDemoUtils {
public static Widget buildShrine(BuildContext context, Widget child) {
return new Theme(
data: new ThemeData(
primarySwatch: Colors.grey,
iconTheme: new IconThemeData(color: new Color(0xFF707070)),
platform: Theme.of(context).platform
),
child: new ShrineTheme(child: child)
);
}
}
public class ShrinePageRoute<T> : MaterialPageRoute {
public ShrinePageRoute(
WidgetBuilder builder,
RouteSettings settings
) : base(builder: builder, settings: settings) {
}
public override Widget buildPage(BuildContext context, Animation<float> animation,
Animation<float> secondaryAnimation) {
return ShrineDemoUtils.buildShrine(context, base.buildPage(context, animation, secondaryAnimation));
}
}
public class ShrineDemo : StatelessWidget {
public const string routeName = "/shrine";
public override Widget build(BuildContext context) {
return ShrineDemoUtils.buildShrine(context, new ShrineHome());
}
}
}