A Very Flexible Widget that can Implement Material Sheets on all Directions, both modal and persistent, and consequently a Material Navigation Drawer
A Very Flexible Widget that can Implement Material Sheets (bottom, top, side) (modal and persistent)
MULTIPLE SHEETS PER APP
WIDGET PARAMETERS
VARIABLE PARAMETERS
FUNCTIONS TO GRAB INFORMATION
FUNCTIONS TO RUN COMMANDS
import 'package:flutter/material.dart';
import 'materialSheet.dart';
void main() => runApp(new MaterialSheetTestApp());
class MaterialSheetTestApp extends StatelessWidget {
//NOTE: these are required if you want buttons that will be opening or closing the sheet
Sheet matSheet;
getOpenPercent() => matSheet.functions.getOpenPercent();
getSheetSize() => matSheet.functions.getSheetSize();
getAttachmentSize() => matSheet.functions.getAttachmentSize();
toggleInstant() => matSheet.functions.toggleInstantaneous();
toggleAnim() => matSheet.functions.toggleAnimated();
openInstant() => matSheet.functions.openInstantaneous();
closeInstant() => matSheet.functions.closeInstantaneous();
openAnim() => matSheet.functions.openAnimated();
closeAnim() => matSheet.functions.closeAnimated();
@override
Widget build(BuildContext context) {
matSheet = new Sheet(
parameters: new Parameters(
//-----Widgets
app: new Container(
child: new Center(
child: new FlatButton(
color: Colors.redAccent,
onPressed: () => openAnim(),
child: new Text("Press me to open the sheet"),
),
),
),
sheet: new Container(
color: Colors.yellowAccent,
child: new Center(
child: new Text(
"Right Sheet",
style: TextStyle(
color: Colors.black,
fontSize: 14.0,
),
),
),
),
attachment: new Container(
color: Colors.greenAccent,
child: new Icon(
Icons.attachment,
color: Colors.white,
),
),
//-----Other Vars
position: sheetPosition.right,
autoOpenOrCloseIndicator: true,
placement: attachmentPlacement.inside,
),
);
return matSheet;
}
}