Skip to content

Instantly share code, notes, and snippets.

@mukireus
Created March 22, 2020 22:01
Show Gist options
  • Save mukireus/ccd3bc317e6e4b156bd9ce65b1c6fa21 to your computer and use it in GitHub Desktop.
Save mukireus/ccd3bc317e6e4b156bd9ce65b1c6fa21 to your computer and use it in GitHub Desktop.
void onDrawerButtonPressed(BuildContext _context) {
try {
FocusScope.of(_context).unfocus();
} catch (e) {}
showModalBottomSheet(
context: _context,
backgroundColor: Colors.transparent,
builder: (_context) {
return Container(
height: MediaQuery.of(_context).size.height * .5,
child: Container(child: _buildDrawerItem, decoration: _bottomSheetBoxDecoration),
);
});
}
Widget get _buildDrawerItem => Column(
children: <Widget>[
Stack(
children: <Widget>[
TdkCover(
isKeyboardVisible: false,
context: context,
scale: 0.20,
),
Center(
child: Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height * .14),
child: Column(
children: <Widget>[
Text(
AppConstant.appDescription,
style: TextStyle(fontSize: 14, color: Colors.white),
),
Padding(
padding: const EdgeInsets.only(top: 10.0),
child: Text(
AppConstant.appVersion,
style: TextStyle(fontSize: 12, color: AppConstant.colorVersionText),
),
),
],
),
),
),
AppWidget.pullDown(AppConstant.colorPullDown1),
],
),
SizedBox(
height: 16,
),
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: MaterialButton(
minWidth: 328,
height: 48,
elevation: 0,
color: AppConstant.colorDrawerButton,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8),
),
child: Text(
AppConstant.hakkinda,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: AppConstant.colorHeading),
),
onPressed: () {
_onHakkindaButtonPressed();
},
),
),
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: MaterialButton(
minWidth: 328,
height: 48,
elevation: 0,
color: AppConstant.colorDrawerButton,
shape: RoundedRectangleBorder(
borderRadius: new BorderRadius.circular(8),
),
child: Text(
AppConstant.iletisim,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold, color: AppConstant.colorHeading),
),
onPressed: () {
Navigator.pop(context);
showModalBottomSheet<dynamic>(
isScrollControlled: true,
context: context,
builder: (BuildContext context) {
return AppBottomSheetTab2();
},
);
},
),
),
],
)
],
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment