Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the old dependencies. #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ const primaryColor = Color(0xFF2697FF);
const secondaryColor = Color(0xFF2A2D3E);
const bgColor = Color(0xFF212332);

const creamColor = Color(0xFFFFFFFF);
const snowColor = Color(0xFFFFFAFA);


const defaultPadding = 16.0;
30 changes: 30 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:admin/constants.dart';
import 'package:admin/controllers/MenuController.dart';
import 'package:admin/screens/main/main_screen.dart';
Expand All @@ -13,6 +14,35 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return AdaptiveTheme(
light: ThemeData.light().copyWith(
scaffoldBackgroundColor: creamColor,
textTheme: GoogleFonts.poppinsTextTheme(Theme.of(context).textTheme)
.apply(bodyColor: Colors.black),
canvasColor: snowColor,
),
dark: ThemeData.dark().copyWith(
scaffoldBackgroundColor: bgColor,
textTheme: GoogleFonts.poppinsTextTheme(Theme.of(context).textTheme)
.apply(bodyColor: Colors.white),
canvasColor: secondaryColor,
),
initial: AdaptiveThemeMode.light,
builder: (theme, darkTheme) => MaterialApp(
title: 'Adaptive Theme Demo',
theme: theme,
darkTheme: darkTheme,
debugShowCheckedModeBanner: false,
home: MultiProvider(
providers: [
ChangeNotifierProvider(
create: (context) => MenuController(),
),
],
child: MainScreen(),
),
),
);
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Admin Panel',
Expand Down
9 changes: 4 additions & 5 deletions lib/screens/dashboard/components/chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,10 @@ class Chart extends StatelessWidget {
SizedBox(height: defaultPadding),
Text(
"29.1",
style: Theme.of(context).textTheme.headline4!.copyWith(
color: Colors.white,
fontWeight: FontWeight.w600,
height: 0.5,
),
style: Theme.of(context).textTheme.bodyText1!.copyWith(
fontWeight: FontWeight.bold,
fontSize: 30
),
),
Text("of 128GB")
],
Expand Down
10 changes: 4 additions & 6 deletions lib/screens/dashboard/components/file_info_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class FileInfoCard extends StatelessWidget {
return Container(
padding: EdgeInsets.all(defaultPadding),
decoration: BoxDecoration(
color: secondaryColor,
color: Theme.of(context).canvasColor,
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Column(
Expand All @@ -40,7 +40,7 @@ class FileInfoCard extends StatelessWidget {
color: info.color,
),
),
Icon(Icons.more_vert, color: Colors.white54)
Icon(Icons.more_vert, color: Theme.of(context).backgroundColor)
],
),
Text(
Expand All @@ -59,15 +59,13 @@ class FileInfoCard extends StatelessWidget {
"${info.numOfFiles} Files",
style: Theme.of(context)
.textTheme
.caption!
.copyWith(color: Colors.white70),
.caption,
),
Text(
info.totalStorage!,
style: Theme.of(context)
.textTheme
.caption!
.copyWith(color: Colors.white),
.caption,
),
],
)
Expand Down
4 changes: 2 additions & 2 deletions lib/screens/dashboard/components/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ProfileCard extends StatelessWidget {
vertical: defaultPadding / 2,
),
decoration: BoxDecoration(
color: secondaryColor,
color: Theme.of(context).canvasColor,
borderRadius: const BorderRadius.all(Radius.circular(10)),
border: Border.all(color: Colors.white10),
),
Expand Down Expand Up @@ -81,7 +81,7 @@ class SearchField extends StatelessWidget {
return TextField(
decoration: InputDecoration(
hintText: "Search",
fillColor: secondaryColor,
fillColor: Theme.of(context).canvasColor,
filled: true,
border: OutlineInputBorder(
borderSide: BorderSide.none,
Expand Down
42 changes: 32 additions & 10 deletions lib/screens/dashboard/components/my_fields.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:admin/models/MyFiles.dart';
import 'package:admin/responsive.dart';
import 'package:flutter/material.dart';
Expand All @@ -22,17 +23,38 @@ class MyFiles extends StatelessWidget {
"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),
Row(
children: [
ElevatedButton.icon(
style: TextButton.styleFrom(
padding: EdgeInsets.symmetric(
horizontal: defaultPadding * 1.5,
vertical: defaultPadding /
(Responsive.isMobile(context) ? 2 : 1),
),
),
onPressed: () {
AdaptiveTheme.of(context).toggleThemeMode();
},
icon: Icon(Icons.ac_unit_sharp),
label: Text("Change Theme"),
),
),
onPressed: () {},
icon: Icon(Icons.add),
label: Text("Add New"),
SizedBox(
width: 20,
),
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"),
),
],
),
],
),
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/dashboard/components/recent_files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class RecentFiles extends StatelessWidget {
return Container(
padding: EdgeInsets.all(defaultPadding),
decoration: BoxDecoration(
color: secondaryColor,
color: Theme.of(context).canvasColor,
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Column(
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/dashboard/components/storage_details.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class StarageDetails extends StatelessWidget {
return Container(
padding: EdgeInsets.all(defaultPadding),
decoration: BoxDecoration(
color: secondaryColor,
color: Theme.of(context).canvasColor,
borderRadius: const BorderRadius.all(Radius.circular(10)),
),
child: Column(
Expand Down
5 changes: 2 additions & 3 deletions lib/screens/dashboard/components/storage_info_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,13 @@ class StorageInfoCard extends StatelessWidget {
"$numOfFiles Files",
style: Theme.of(context)
.textTheme
.caption!
.copyWith(color: Colors.white70),
.caption,
),
],
),
),
),
Text(amountOfFiles)
Text(amountOfFiles,style: Theme.of(context).textTheme.bodyText1,)
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/screens/main/components/side_menu.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class DrawerListTile extends StatelessWidget {
),
title: Text(
title,
style: TextStyle(color: Colors.white54),
style: Theme.of(context).textTheme.bodyText1,
),
);
}
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ dependencies:
cupertino_icons: ^1.0.3

google_fonts: ^2.1.0
flutter_svg: ^0.22.0
fl_chart: ^0.36.1
provider: ^5.0.0
flutter_svg: ^1.0.0
fl_chart: ^0.40.5
provider: ^6.0.1
data_table_2: ^2.0.3
adaptive_theme: ^2.3.0

dev_dependencies:
flutter_test:
Expand Down