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

Main #72

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Main #72

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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ This flutter dashboard library is versatile; it's tailored to work seamlessly on
![Preview](/gif.gif)

![App UI](/ui.png)
# mbooke_web_source_code
Binary file added assets/images/app.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions lib/controllers/home_navigation_controller.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import 'package:flutter/material.dart';

class HomeNavigationController extends ChangeNotifier {
int _screenNumber = 0; // Initialize to zero by default

// Getter for screenNumber
int get screenNumber => _screenNumber;

// Setter for screenNumber
set screenNumber(int value) {
if (_screenNumber != value) {
_screenNumber = value;
notifyListeners(); // Notify listeners when the value changes
}
}
}
24 changes: 19 additions & 5 deletions lib/controllers/menu_app_controller.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
// menu_app_controller.dart

import 'package:admin/screens/dashboard/bookings_screen.dart';
import 'package:flutter/material.dart';
import 'package:admin/screens/dashboard/dashboard_screen.dart';

class MenuAppController with ChangeNotifier {
final GlobalKey<ScaffoldState> scaffoldKey = GlobalKey<ScaffoldState>();

class MenuAppController extends ChangeNotifier {
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
// Initialize currentScreen to your default screen
Widget currentScreen = BookingsScreen();

GlobalKey<ScaffoldState> get scaffoldKey => _scaffoldKey;
//DashboardScreen();

// Method to change the screen
void changeScreen(Widget screen) {
currentScreen = screen;
notifyListeners(); // Notify listeners to rebuild widgets
}

// Existing method to control the menu
void controlMenu() {
if (!_scaffoldKey.currentState!.isDrawerOpen) {
_scaffoldKey.currentState!.openDrawer();
if (!scaffoldKey.currentState!.isDrawerOpen) {
scaffoldKey.currentState!.openDrawer();
}
}
}
29 changes: 20 additions & 9 deletions lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
import 'package:admin/constants.dart';
import 'package:admin/controllers/home_navigation_controller.dart';
import 'package:admin/controllers/menu_app_controller.dart';
import 'package:admin/screens/authentication/login.dart';
import 'package:admin/screens/main/main_screen.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';

void main() {
runApp(MyApp());
runApp(MultiProvider(providers: [




ChangeNotifierProvider(
create: (_) => HomeNavigationController(),),

ChangeNotifierProvider(
create: (context) => MenuAppController(),
),
], child: MyApp()));
}

class MyApp extends StatelessWidget {
Expand All @@ -22,14 +35,12 @@ class MyApp extends StatelessWidget {
.apply(bodyColor: Colors.white),
canvasColor: secondaryColor,
),
home: MultiProvider(
providers: [
ChangeNotifierProvider(
create: (context) => MenuAppController(),
),
],
child: MainScreen(),
),
initialRoute: '/',
routes: {
'/': (context) => HomePage(),
'/home': (context) => MainScreen()
},

);
}
}
24 changes: 12 additions & 12 deletions lib/models/my_files.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,34 @@ class CloudStorageInfo {

List demoMyFiles = [
CloudStorageInfo(
title: "Documents",
numOfFiles: 1328,
title: "Visits",
numOfFiles: 20,
svgSrc: "assets/icons/Documents.svg",
totalStorage: "1.9GB",
totalStorage: "12/07/2024",
color: primaryColor,
percentage: 35,
),
CloudStorageInfo(
title: "Google Drive",
numOfFiles: 1328,
title: "Booked",
numOfFiles: 15,
svgSrc: "assets/icons/google_drive.svg",
totalStorage: "2.9GB",
totalStorage: "12/07/24",
color: Color(0xFFFFA113),
percentage: 35,
),
CloudStorageInfo(
title: "One Drive",
numOfFiles: 1328,
title: "Pending bookings",
numOfFiles: 5,
svgSrc: "assets/icons/one_drive.svg",
totalStorage: "1GB",
totalStorage: "12/07/24",
color: Color(0xFFA4CDFF),
percentage: 10,
),
CloudStorageInfo(
title: "Documents",
numOfFiles: 5328,
title: "Closed bookings",
numOfFiles: 10,
svgSrc: "assets/icons/drop_box.svg",
totalStorage: "7.3GB",
totalStorage: "12/07/24",
color: Color(0xFF007EE5),
percentage: 78,
),
Expand Down
55 changes: 26 additions & 29 deletions lib/models/recent_file.dart
Original file line number Diff line number Diff line change
@@ -1,50 +1,47 @@
import 'package:flutter/material.dart';

class RecentFile {
final String? icon, title, date, size;
final String? title, date, size;
final IconData? icon;

RecentFile({this.icon, this.title, this.date, this.size});
}

List demoRecentFiles = [
RecentFile(
icon: "assets/icons/xd_file.svg",
title: "XD File",
date: "01-03-2021",
size: "3.5mb",
title: "Brian Molwantwa",
date: "[email protected]",
size: "plaiting",
),
RecentFile(
icon: "assets/icons/Figma_file.svg",
title: "Figma File",
date: "27-02-2021",
size: "19.0mb",
title: "Fitzgerald Kebadire",
date: "[email protected]",
size: "plaiting",
),
RecentFile(
icon: "assets/icons/doc_file.svg",
title: "Document",
date: "23-02-2021",
size: "32.5mb",
title: "Tombo Fisiwe",
date: "[email protected]",
size: "hair cut",
),
RecentFile(
icon: "assets/icons/sound_file.svg",
title: "Sound File",
date: "21-02-2021",
size: "3.5mb",
title: "Huma Babylon",
date: "[email protected]",
size: "plaitinghair",
),
RecentFile(
icon: "assets/icons/media_file.svg",
title: "Media File",
date: "23-02-2021",
size: "2.5gb",
title: "Benoni Ishmael",
date: "[email protected]",
size: "haircut",
),
RecentFile(
icon: "assets/icons/pdf_file.svg",
title: "Sales PDF",
date: "25-02-2021",
size: "3.5mb",
title: "Peter Piano",
date: "[email protected]",
size: "dreadlocks",
),
RecentFile(
icon: "assets/icons/excel_file.svg",
title: "Excel File",
date: "25-02-2021",
size: "34.5mb",

title: "Simon Bro",
date: "[email protected]",
size: "haircut",
),
];
20 changes: 20 additions & 0 deletions lib/screens/authentication/bottom_text.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class BottomText extends StatelessWidget {
final String mainText;
final String secondaryText;

const BottomText({Key? key, required this.mainText, required this.secondaryText})
: super(key: key);
@override
Widget build(BuildContext context) {
return RichText(
text: TextSpan(children: [
TextSpan(text: "$mainText \n"),
TextSpan(
text: secondaryText,
style: GoogleFonts.roboto(fontSize: 16, fontWeight: FontWeight.w300)),
], style: GoogleFonts.roboto(fontSize: 58, fontWeight: FontWeight.bold)));
}
}
22 changes: 22 additions & 0 deletions lib/screens/authentication/button.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import 'package:admin/screens/authentication/style.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';

class CustomButton extends StatelessWidget {
final String text;

const CustomButton({ Key? key, required this.text}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
decoration:
BoxDecoration(color: active, borderRadius: BorderRadius.circular(30)),
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 12),
child: Text(
text,
style: GoogleFonts.roboto(
fontSize: 16, fontWeight: FontWeight.bold, color: Colors.white),
),
);
}
}
2 changes: 2 additions & 0 deletions lib/screens/authentication/content.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const mainParagraph =
"You’re more than just a photo. You have stories to tell, and passions to share, and things to talk about that are more interesting than the weather. Because you deserve what dating deserves: better.";
Loading