-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from mdrokz/development
Fix UI Issues
- Loading branch information
Showing
3 changed files
with
125 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
library ani_app.widgets; | ||
|
||
import 'package:flutter/cupertino.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import 'package:ani_app/constants.dart' as constants; | ||
|
||
Widget SettingsDrawer() { | ||
return Drawer( | ||
child: ListView.separated( | ||
padding: EdgeInsets.zero, | ||
separatorBuilder: (_, i) { | ||
return const Divider(); | ||
}, | ||
itemCount: constants.settings.length, | ||
itemBuilder: (BuildContext context, int index) { | ||
if (index == 0) { | ||
return const DrawerHeader( | ||
child: Text('Settings'), | ||
decoration: BoxDecoration( | ||
color: Colors.blue, | ||
), | ||
); | ||
} | ||
return ListTile(title: Text(constants.settings[index])); | ||
}, | ||
)); | ||
} | ||
|
||
Widget ListCard( | ||
String cover, String title, void Function() onTap, TextStyle textStyle,EdgeInsetsGeometry padding) { | ||
return GestureDetector( | ||
onTap: onTap, | ||
child: Flex( | ||
direction: Axis.horizontal, | ||
children: [ | ||
ConstrainedBox( | ||
constraints: const BoxConstraints( | ||
minWidth: 100, | ||
minHeight: 100, | ||
maxWidth: 100, | ||
maxHeight: 200, | ||
), | ||
child: Image.network( | ||
cover, | ||
fit: BoxFit.cover, | ||
)), | ||
Expanded( | ||
child: Container( | ||
child: Text( | ||
title.split('/')[2], | ||
textAlign: TextAlign.center, | ||
style: textStyle | ||
), | ||
padding: padding | ||
), | ||
), | ||
const Icon(Icons.star_border_outlined,color: Colors.blueGrey,) | ||
// const Divider() | ||
], | ||
)); | ||
} |