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

UI #43

Merged
merged 3 commits into from
Feb 9, 2024
Merged

UI #43

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
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _OrganiserAppState extends State<OrganiserApp> {
statusBarColor: Colors.transparent,
));
return MaterialApp(
theme: Provider.of<ThemeProvider>(context).themeData,
theme: Provider.of<ThemeProvider>(context).themeData,
home: SplashScreen(
onSelectThemeColor: () {},
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:Organiser/models/collection/sub/event.dart';
import 'package:Organiser/models/collections/children/event.dart';

class EventModel extends ChangeNotifier {
List<Event> events = [];
Expand Down
16 changes: 8 additions & 8 deletions lib/pages/theme/dark.dart → lib/models/theme/dark.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@ ThemeData darkMode = ThemeData(
brightness: Brightness.dark,
colorScheme: ColorScheme.dark(
background: Colors.black,
primary: Colors.green.shade200,
secondary: Colors.green.shade800,
primary: Colors.cyan.shade200,
secondary: Colors.cyan.shade800,
),
appBarTheme: AppBarTheme(
centerTitle: true,
backgroundColor: Colors.green.shade800,
backgroundColor: Colors.cyan.shade800,
foregroundColor: Colors.white,
elevation: 1),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
unselectedItemColor: Colors.grey.shade400.withOpacity(0.8),
selectedItemColor: Colors.green.shade200,
selectedLabelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 8),
selectedIconTheme: IconThemeData(size: 35),
selectedItemColor: Colors.cyan.shade200,
selectedLabelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 10),
selectedIconTheme: IconThemeData(size: 25),
unselectedIconTheme: IconThemeData(size: 20),
backgroundColor: Colors.green.shade800),
backgroundColor: Colors.cyan.shade800),
scaffoldBackgroundColor: Colors.grey.shade900,
cardTheme: CardTheme(color: Colors.black12),
shadowColor: Colors.black,
drawerTheme: DrawerThemeData(backgroundColor: Colors.black54),
drawerTheme: DrawerThemeData(backgroundColor: Colors.black87),
dialogTheme: DialogTheme(
backgroundColor: Colors.grey.shade800.withOpacity(0.9),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
Expand Down
19 changes: 10 additions & 9 deletions lib/pages/theme/light.dart → lib/models/theme/light.dart
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
import 'package:flutter/material.dart';

ThemeData lightMode = ThemeData(
primaryColor: Colors.cyan,
cardTheme: CardTheme(color: Colors.white, elevation: 1),
drawerTheme:
DrawerThemeData(backgroundColor: Colors.green.shade50.withOpacity(0.9)),
DrawerThemeData(backgroundColor: Colors.cyan.shade50,),
scaffoldBackgroundColor: Colors.grey.shade50,
brightness: Brightness.light,
colorScheme: ColorScheme.light(
background: Colors.grey.shade400,
primary: Colors.green,
secondary: Colors.green.shade50,
primary: Colors.cyan,
secondary: Colors.cyan.shade50,
),
appBarTheme: AppBarTheme(
centerTitle: true,
backgroundColor: Colors.green.shade50,
backgroundColor: Colors.cyan.shade50,
foregroundColor: Colors.black87,
elevation: 1),
bottomNavigationBarTheme: BottomNavigationBarThemeData(
unselectedItemColor: Colors.black38,
selectedItemColor: Colors.green,
selectedLabelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 8),
selectedIconTheme: IconThemeData(size: 35),
selectedItemColor: Colors.cyan,
selectedLabelStyle: TextStyle(fontWeight: FontWeight.bold, fontSize: 10),
selectedIconTheme: IconThemeData(size: 25),
unselectedIconTheme: IconThemeData(size: 20),
backgroundColor: Colors.green.shade50),
backgroundColor: Colors.cyan.shade50),
dialogTheme: DialogTheme(
backgroundColor: Colors.green.shade50.withOpacity(0.95),
backgroundColor: Colors.cyan.shade50.withOpacity(0.95),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(50)),
),
shadowColor: Colors.grey.shade200,
Expand Down
4 changes: 2 additions & 2 deletions lib/pages/create/add_event.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import 'package:Organiser/widgets/styled/input_adder/repeat.dart';
import 'package:Organiser/widgets/styled/input_adder/timezone.dart';
import 'package:flutter/material.dart';
import 'package:Organiser/models/collection/sub/event.dart';
import 'package:Organiser/models/collection/sub/event_model.dart';
import 'package:Organiser/models/collections/children/event.dart';
import 'package:Organiser/models/collections/children/event_model.dart';
import 'package:Organiser/widgets/styled/input_adder/title.dart';
import 'package:Organiser/widgets/styled/input_adder/note.dart';
import 'package:Organiser/widgets/styled/input_adder/cartegory.dart';
Expand Down
2 changes: 2 additions & 0 deletions lib/pages/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:Organiser/pages/home/screens/food.dart';
import 'package:Organiser/pages/home/screens/schedules.dart';
import 'package:Organiser/pages/home/screens/tasks.dart';
import 'package:Organiser/widgets/common/bottom_app_bar.dart';
import 'package:Organiser/widgets/common/drawer.dart';
import 'package:flutter/material.dart';
import 'screens/dashboard.dart';

Expand All @@ -27,6 +28,7 @@ class _HomePageState extends State<HomePage> {
Widget build(BuildContext context) {
return Scaffold(
body: _screens[_currentIndex],
drawer: CustomDrawer(),
bottomNavigationBar: CustomBottomAppBar(
currentIndex: _currentIndex,
onTap: (index) {
Expand Down
107 changes: 102 additions & 5 deletions lib/pages/home/screens/dashboard.dart
Original file line number Diff line number Diff line change
@@ -1,30 +1,127 @@
import 'package:Organiser/widgets/common/action_button.dart';
import 'package:Organiser/widgets/common/app_bar.dart';
import 'package:Organiser/widgets/common/drawer.dart';
import 'package:flutter/material.dart';

class Dashboard extends StatefulWidget {
const Dashboard({Key? key});
const Dashboard({Key? key}) : super(key: key);

@override
State<Dashboard> createState() => _DashboardState();
}

class _DashboardState extends State<Dashboard> {
String selectedFilter = 'This Week';

@override
Widget build(BuildContext context) {
return Scaffold(
appBar: CustomAppBar(),
drawer: CustomDrawer(),
body: SingleChildScrollView(
child: IntrinsicHeight(
child: Column(
children: [Center(child: Text("Dashboard"))],
mainAxisAlignment: MainAxisAlignment.center,
children: [
_buildFilterChips(),
SizedBox(height: 20),
_buildHighlights(),
SizedBox(height: 20),
_buildInsights(),
],
),
),
),
floatingActionButton: CustomFAB(),
floatingActionButton: CustomFAB(),
floatingActionButtonLocation: FloatingActionButtonLocation.miniEndFloat,
);
}

Widget _buildFilterChips() {
List<String> filters = ['This Week', 'Today', 'This Month', 'This Year'];

return Wrap(
spacing: 8.0,
children: filters.map((filter) {
return FilterChip(
label: Text(filter),
selected: selectedFilter == filter,
onSelected: (isSelected) {
setState(() {
selectedFilter = isSelected ? filter : 'This Week';
});
},
);
}).toList(),
);
}

Widget _buildHighlights() {
return Container(
padding: EdgeInsets.all(16),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Highlights',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
// Add widgets for highlights (tasks, events, calendars)
// Example:
ListTile(
leading: Icon(Icons.check_circle, color: Colors.green),
title: Text('Completed Task 1'),
),
ListTile(
leading: Icon(Icons.event, color: Colors.blue),
title: Text('Upcoming Event 1'),
),
ListTile(
leading: Icon(Icons.calendar_today, color: Colors.orange),
title: Text('Calendar Event 1'),
),
],
),
);
}

Widget _buildInsights() {
return Container(
padding: EdgeInsets.all(16),
margin: EdgeInsets.symmetric(vertical: 20),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Insights',
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
),
SizedBox(height: 10),
// Add widgets for insights (progress bars, charts, etc.)
// Example:
_buildProgressBar('Task Progress', 0.8), // 80% progress
_buildProgressBar('Event Completion', 0.6), // 60% completion
],
),
);
}

Widget _buildProgressBar(String label, double value) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(label),
LinearProgressIndicator(
value: value,
valueColor: AlwaysStoppedAnimation<Color>(Colors.blue),
),
SizedBox(height: 10),
],
);
}
}
69 changes: 64 additions & 5 deletions lib/pages/home/screens/food.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

class Food extends StatefulWidget {
const Food({Key? key});
const Food({Key? key}) : super(key: key);

@override
State<Food> createState() => _FoodState();
Expand All @@ -10,12 +10,71 @@ class Food extends StatefulWidget {
class _FoodState extends State<Food> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: IntrinsicHeight(
child: Column(
children: [Center(child: Text("Food"))],
return DefaultTabController(
length: 2,
child: Scaffold(
appBar: AppBar(
title: Text('Food'),
bottom: TabBar(
labelColor: Theme.of(context).colorScheme.primary,
indicatorColor: Theme.of(context).colorScheme.primary,
unselectedLabelColor: Theme.of(context).hintColor,
tabs: [
Tab(text: 'Meals'),
Tab(text: 'Marketplace'),
],
),
),
body: TabBarView(
children: [
_buildMealsPage(),
_buildMarketplacePage(),
],
),
),
);
}

Widget _buildMealsPage() {
return SingleChildScrollView(
child: Column(
children: [
Card(
child: ListTile(
title: Text('Meal 1'),
subtitle: Text('Description for Meal 1'),
// Customize the card as needed for your meal representation
),
),
Card(
child: ListTile(
title: Text('Meal 2'),
subtitle: Text('Description for Meal 2'),
// Customize the card as needed for your meal representation
),
),
// Add more cards for other meals
],
),
);
}

Widget _buildMarketplacePage() {
List<String> restaurants = [
'Restaurant A',
'Restaurant B',
'Restaurant C',
// Add more restaurants as needed
];

return ListView.builder(
itemCount: restaurants.length,
itemBuilder: (context, index) {
return ListTile(
title: Text(restaurants[index]),
// Customize the ListTile as needed for your restaurant representation
);
},
);
}
}
Loading