2019-05-08 18:54:14 +00:00
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class PlatformScaffold extends StatelessWidget {
|
2019-08-21 13:53:52 +00:00
|
|
|
|
|
|
|
PlatformScaffold(
|
|
|
|
{this.key,
|
|
|
|
this.appBar,
|
|
|
|
this.body,
|
|
|
|
this.floatingActionButton,
|
|
|
|
this.floatingActionButtonLocation,
|
|
|
|
this.floatingActionButtonAnimator,
|
|
|
|
this.persistentFooterButtons,
|
|
|
|
this.drawer,
|
|
|
|
this.endDrawer,
|
|
|
|
this.bottomNavigationBar,
|
|
|
|
this.backgroundColor,
|
|
|
|
this.resizeToAvoidBottomPadding = true,
|
|
|
|
this.primary = true})
|
|
|
|
: assert(primary != null),
|
|
|
|
super(key: key);
|
|
|
|
|
|
|
|
@override
|
2019-05-08 18:54:14 +00:00
|
|
|
final Key key;
|
|
|
|
final PreferredSizeWidget appBar;
|
|
|
|
final Widget body;
|
|
|
|
final Widget floatingActionButton;
|
|
|
|
final FloatingActionButtonLocation floatingActionButtonLocation;
|
|
|
|
final FloatingActionButtonAnimator floatingActionButtonAnimator;
|
|
|
|
final List<Widget> persistentFooterButtons;
|
|
|
|
final Widget drawer;
|
|
|
|
final Widget endDrawer;
|
|
|
|
final Widget bottomNavigationBar;
|
|
|
|
final Color backgroundColor;
|
|
|
|
final bool resizeToAvoidBottomPadding;
|
|
|
|
final bool primary;
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Platform.isIOS
|
|
|
|
? Scaffold(
|
|
|
|
key: key,
|
|
|
|
appBar: appBar,
|
|
|
|
body: body,
|
|
|
|
floatingActionButton: floatingActionButton,
|
|
|
|
persistentFooterButtons: persistentFooterButtons,
|
|
|
|
floatingActionButtonLocation: floatingActionButtonLocation,
|
|
|
|
floatingActionButtonAnimator: floatingActionButtonAnimator,
|
|
|
|
drawer: endDrawer,
|
|
|
|
endDrawer: drawer,
|
|
|
|
bottomNavigationBar: bottomNavigationBar,
|
|
|
|
backgroundColor: backgroundColor,
|
|
|
|
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
|
|
|
primary: primary,
|
|
|
|
)
|
|
|
|
: Scaffold(
|
|
|
|
key: key,
|
|
|
|
appBar: appBar,
|
|
|
|
body: body,
|
|
|
|
floatingActionButton: floatingActionButton,
|
|
|
|
persistentFooterButtons: persistentFooterButtons,
|
|
|
|
floatingActionButtonLocation: floatingActionButtonLocation,
|
|
|
|
floatingActionButtonAnimator: floatingActionButtonAnimator,
|
|
|
|
drawer: drawer,
|
|
|
|
endDrawer: endDrawer,
|
|
|
|
bottomNavigationBar: bottomNavigationBar,
|
|
|
|
backgroundColor: backgroundColor,
|
|
|
|
resizeToAvoidBottomPadding: resizeToAvoidBottomPadding,
|
|
|
|
primary: primary,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|