-
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.
Merge pull request #11 from RounakTadvi/master
Added Support For Null-Safety and made some minor changes
- Loading branch information
Showing
17 changed files
with
217 additions
and
138 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
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
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,80 @@ | ||
|
||
import 'package:admin/responsive.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:admin/models/MyFiles.dart'; | ||
import '../../../constants.dart'; | ||
import 'file_info_card.dart'; | ||
|
||
class MyFiles extends StatelessWidget { | ||
const MyFiles({ | ||
Key? key, | ||
}) : super(key: key); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final Size _size = MediaQuery.of(context).size; | ||
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 / (Responsive.isMobile(context) ? 2 : 1), | ||
), | ||
), | ||
onPressed: () {}, | ||
icon: Icon(Icons.add), | ||
label: Text("Add New"), | ||
), | ||
], | ||
), | ||
SizedBox(height: defaultPadding), | ||
Responsive( | ||
mobile: FileInfoCardGridView( | ||
crossAxisCount: _size.width < 650 ? 2 : 4, | ||
childAspectRatio: _size.width < 650 ? 1.3 : 1, | ||
), | ||
tablet: FileInfoCardGridView(), | ||
desktop: FileInfoCardGridView( | ||
childAspectRatio: _size.width < 1400 ? 1.1 : 1.4, | ||
), | ||
), | ||
], | ||
); | ||
} | ||
} | ||
|
||
class FileInfoCardGridView extends StatelessWidget { | ||
const FileInfoCardGridView({ | ||
Key? key, | ||
this.crossAxisCount = 4, | ||
this.childAspectRatio = 1, | ||
}) : super(key: key); | ||
|
||
final int crossAxisCount; | ||
final double childAspectRatio; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return GridView.builder( | ||
physics: NeverScrollableScrollPhysics(), | ||
shrinkWrap: true, | ||
itemCount: demoMyFiles.length, | ||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( | ||
crossAxisCount: crossAxisCount, | ||
crossAxisSpacing: defaultPadding, | ||
mainAxisSpacing: defaultPadding, | ||
childAspectRatio: childAspectRatio, | ||
), | ||
itemBuilder: (context, index) => FileInfoCard(info: demoMyFiles[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
Oops, something went wrong.