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

Dark Mode and UI Color Changes #15

Open
wants to merge 3 commits into
base: main
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
43 changes: 36 additions & 7 deletions lib/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@ import 'dart:wasm';

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gradient_colors/flutter_gradient_colors.dart';
import 'package:page_transition/page_transition.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import './syllabusPage.dart';
import './viewallPage.dart';
import './notePage.dart';
import './search_page.dart';
import './chaptersPage.dart';
import 'main.dart';

class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
bool _switchValue = false;
@override
Widget build(BuildContext context) {
return SafeArea(
child: Scaffold(
backgroundColor: Color(0xFFd8e5e1),
backgroundColor: _switchValue ? Color(0xFF619B8A) : Color(0xFFEDEFE3),
appBar: AppBar(
actions: <Widget>[
Padding(
Expand All @@ -41,17 +44,20 @@ class _HomePageState extends State<HomePage> {
),
centerTitle: true,
elevation: 0,
backgroundColor: Color(0xFFd8e5e1),
backgroundColor:
_switchValue ? Color(0xFFA1C181) : Color(0xFFFE7F2D),
),
drawer: Drawer(
child: ListView(
// Important: Remove any padding from the ListView.

padding: EdgeInsets.zero,

children: <Widget>[
DrawerHeader(
child: Text('Drawer Header'),
decoration: BoxDecoration(
color: Color(0xFF619b8a),
color: _switchValue ? Color(0xFFA1C181) : Color(0xFFFE7F2D),
),
),
ListTile(
Expand Down Expand Up @@ -90,6 +96,21 @@ class _HomePageState extends State<HomePage> {
child: SyllabusPage()));
},
),
Row(
children: [
SizedBox(width: 20),
Text('Light'),
Switch(
value: _switchValue,
onChanged: (newValue) {
setState(() {
_switchValue = newValue;
});
},
),
Text('Dark'),
],
),
],
),
),
Expand All @@ -108,6 +129,8 @@ class _HomePageState extends State<HomePage> {
Text(
'My Notes',
style: TextStyle(
color:
_switchValue ? Colors.black : Color(0xFF233D4D),
fontSize: 20.0,
fontFamily: 'RobotoMono',
fontWeight: FontWeight.bold),
Expand All @@ -121,7 +144,7 @@ class _HomePageState extends State<HomePage> {
type: PageTransitionType.rightToLeft,
child: ViewallPage()));
},
)
),
],
),
),
Expand All @@ -133,7 +156,9 @@ class _HomePageState extends State<HomePage> {
height: MediaQuery.of(context).size.height * 1.5,
width: MediaQuery.of(context).size.width * 1.0,
decoration: BoxDecoration(
color: Color(0xfffbfcfc),
color: _switchValue
? Color(0xFF619B8A)
: Color(0xFFEDEFE3),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(55.0),
topRight: Radius.circular(55.0),
Expand Down Expand Up @@ -176,7 +201,11 @@ class _HomePageState extends State<HomePage> {
child: Text(
'More to learn',
style: TextStyle(

//fontWeight: FontWeight.bold,
color: _switchValue
? Colors.black
: Color(0xFF233D4D),
fontSize: 20.0,
fontFamily: 'RobotoMono',
fontWeight: FontWeight.bold),
Expand Down Expand Up @@ -272,7 +301,7 @@ class HorizontalCard extends StatelessWidget {
bottomRight: Radius.circular(30.0),
),
//color: Colors.red,
//color: Color(0xFF619b8a).withOpacity(0.11),
color: Colors.white,
image: DecorationImage(
image: AssetImage('images/$imgpPath'), fit: BoxFit.cover),
),
Expand All @@ -285,7 +314,7 @@ class HorizontalCard extends StatelessWidget {
width: MediaQuery.of(context).size.width * 0.9,
decoration: BoxDecoration(
//color: Color(0xfffbfcfc),
color: Color(0xFF619b8a).withOpacity(0.11),
color: Colors.white,
//color: Colors.grey[200],
borderRadius: BorderRadius.all(
Radius.circular(30.0),
Expand Down
109 changes: 44 additions & 65 deletions pubspec.lock
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
archive:
dependency: transitive
description:
name: archive
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.13"
args:
dependency: transitive
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.0"
async:
dependency: transitive
description:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.1"
version: "2.5.0-nullsafety.1"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
charcode:
version: "2.1.0-nullsafety.1"
characters:
dependency: transitive
description:
name: charcode
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.3"
collection:
version: "1.1.0-nullsafety.3"
charcode:
dependency: transitive
description:
name: collection
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.12"
convert:
version: "1.2.0-nullsafety.1"
clock:
dependency: transitive
description:
name: convert
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.1"
crypto:
version: "1.1.0-nullsafety.1"
collection:
dependency: transitive
description:
name: crypto
name: collection
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.4"
version: "1.15.0-nullsafety.3"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0-nullsafety.1"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_gradient_colors:
dependency: "direct main"
description:
name: flutter_gradient_colors
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -81,27 +81,20 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "8.10.0"
image:
dependency: transitive
description:
name: image
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.12"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.6"
version: "0.12.10-nullsafety.1"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.8"
version: "1.3.0-nullsafety.3"
page_transition:
dependency: "direct main"
description:
Expand All @@ -115,21 +108,14 @@ packages:
name: path
url: "https://pub.dartlang.org"
source: hosted
version: "1.6.4"
petitparser:
dependency: transitive
description:
name: petitparser
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.0"
quiver:
dependency: transitive
version: "1.8.0-nullsafety.1"
provider:
dependency: "direct main"
description:
name: quiver
name: provider
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.3"
version: "2.0.1+1"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -148,42 +134,42 @@ packages:
name: source_span
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.0"
version: "1.8.0-nullsafety.2"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0-nullsafety.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0-nullsafety.1"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0-nullsafety.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0-nullsafety.1"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.15"
version: "0.2.19-nullsafety.2"
timeline_tile:
dependency: "direct main"
description:
Expand All @@ -197,28 +183,21 @@ packages:
name: typed_data
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0-nullsafety.3"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0-nullsafety.3"
vibration:
dependency: transitive
description:
name: vibration
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.0"
xml:
dependency: transitive
description:
name: xml
url: "https://pub.dartlang.org"
source: hosted
version: "3.6.1"
sdks:
dart: ">=2.7.0 <3.0.0"
dart: ">=2.10.0-110 <2.11.0"
flutter: ">=1.10.0 <2.0.0"
4 changes: 3 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ dependencies:
page_transition: ^1.1.7+2
font_awesome_flutter: ^8.10.0
timeline_tile: ^0.1.0
flutter_gradient_colors: ^1.0.0


flutter:
sdk: flutter
slider_button: ^0.6.0

provider: ^2.0.1

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down