-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80270e2
commit 55d3a8b
Showing
4 changed files
with
251 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import 'package:admin/models/MyFiles.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
import '../../../constants.dart'; | ||
|
||
class FileInfoCard extends StatelessWidget { | ||
const FileInfoCard({ | ||
Key key, | ||
@required this.info, | ||
}) : super(key: key); | ||
|
||
final CloudStorageInfo info; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: EdgeInsets.all(defaultPadding), | ||
decoration: BoxDecoration( | ||
color: secondaryColor, | ||
borderRadius: const BorderRadius.all(Radius.circular(10)), | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Container( | ||
padding: EdgeInsets.all(defaultPadding * 0.75), | ||
height: 40, | ||
width: 40, | ||
decoration: BoxDecoration( | ||
color: info.color.withOpacity(0.1), | ||
borderRadius: const BorderRadius.all(Radius.circular(10)), | ||
), | ||
child: SvgPicture.asset( | ||
info.svgSrc, | ||
color: info.color, | ||
), | ||
), | ||
Icon(Icons.more_vert, color: Colors.white54) | ||
], | ||
), | ||
Text( | ||
info.title, | ||
maxLines: 1, | ||
overflow: TextOverflow.ellipsis, | ||
), | ||
ProgressLine( | ||
color: info.color, | ||
percentage: info.percentage, | ||
), | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
"${info.numOfFiels} Files", | ||
style: Theme.of(context) | ||
.textTheme | ||
.caption | ||
.copyWith(color: Colors.white70), | ||
), | ||
Text( | ||
info.totalStorage, | ||
style: Theme.of(context) | ||
.textTheme | ||
.caption | ||
.copyWith(color: Colors.white), | ||
), | ||
], | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
class ProgressLine extends StatelessWidget { | ||
const ProgressLine({ | ||
Key key, | ||
this.color = primaryColor, | ||
@required this.percentage, | ||
}) : super(key: key); | ||
|
||
final Color color; | ||
final int percentage; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Stack( | ||
children: [ | ||
Container( | ||
width: double.infinity, | ||
height: 5, | ||
decoration: BoxDecoration( | ||
color: color.withOpacity(0.1), | ||
borderRadius: BorderRadius.all(Radius.circular(10)), | ||
), | ||
), | ||
LayoutBuilder( | ||
builder: (context, constraints) => Container( | ||
width: constraints.maxWidth * (percentage / 100), | ||
height: 5, | ||
decoration: BoxDecoration( | ||
color: color, | ||
borderRadius: BorderRadius.all(Radius.circular(10)), | ||
), | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} |
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,51 @@ | ||
import 'package:admin/models/MyFiles.dart'; | ||
import 'package:flutter/material.dart'; | ||
|
||
import '../../../constants.dart'; | ||
import 'file_info_card.dart'; | ||
|
||
class MyFiels extends StatelessWidget { | ||
const MyFiels({ | ||
Key key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Column( | ||
children: [ | ||
Row( | ||
mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
children: [ | ||
Text( | ||
"My Files", | ||
style: Theme.of(context).textTheme.subtitle1, | ||
), | ||
ElevatedButton.icon( | ||
style: TextButton.styleFrom( | ||
padding: EdgeInsets.symmetric( | ||
horizontal: defaultPadding * 1.5, | ||
vertical: defaultPadding, | ||
), | ||
), | ||
onPressed: () {}, | ||
icon: Icon(Icons.add), | ||
label: Text("Add New"), | ||
), | ||
], | ||
), | ||
SizedBox(height: defaultPadding), | ||
GridView.builder( | ||
shrinkWrap: true, | ||
itemCount: demoMyFiels.length, | ||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
crossAxisCount: 4, | ||
crossAxisSpacing: defaultPadding, | ||
childAspectRatio: 1.4, | ||
), | ||
itemBuilder: (context, index) => | ||
FileInfoCard(info: demoMyFiels[index]), | ||
), | ||
], | ||
); | ||
} | ||
} |
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,77 @@ | ||
import 'package:admin/models/RecentFile.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:flutter_svg/svg.dart'; | ||
|
||
import '../../../constants.dart'; | ||
|
||
class RecentFiles extends StatelessWidget { | ||
const RecentFiles({ | ||
Key key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Container( | ||
padding: EdgeInsets.all(defaultPadding), | ||
decoration: BoxDecoration( | ||
color: secondaryColor, | ||
borderRadius: const BorderRadius.all(Radius.circular(10)), | ||
), | ||
child: Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
Text( | ||
"Recent Files", | ||
style: Theme.of(context).textTheme.subtitle1, | ||
), | ||
SizedBox( | ||
width: double.infinity, | ||
child: DataTable( | ||
horizontalMargin: 0, | ||
columnSpacing: defaultPadding, | ||
columns: [ | ||
DataColumn( | ||
label: Text("File Name"), | ||
), | ||
DataColumn( | ||
label: Text("Date"), | ||
), | ||
DataColumn( | ||
label: Text("Size"), | ||
), | ||
], | ||
rows: List.generate( | ||
demoRecentFiles.length, | ||
(index) => recentFileDataRow(demoRecentFiles[index]), | ||
), | ||
), | ||
), | ||
], | ||
), | ||
); | ||
} | ||
} | ||
|
||
DataRow recentFileDataRow(RecentFile fileInfo) { | ||
return DataRow( | ||
cells: [ | ||
DataCell( | ||
Row( | ||
children: [ | ||
SvgPicture.asset( | ||
fileInfo.icon, | ||
height: 30, | ||
width: 30, | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: defaultPadding), | ||
child: Text(fileInfo.title), | ||
), | ||
], | ||
), | ||
), | ||
DataCell(Text(fileInfo.date)), | ||
DataCell(Text(fileInfo.size)), | ||
], | ||
); | ||
} |
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