diff --git a/android/settings.gradle b/android/settings.gradle index d3b6a40..ce10ffd 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -13,3 +13,18 @@ localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } def flutterSdkPath = properties.getProperty("flutter.sdk") assert flutterSdkPath != null, "flutter.sdk not set in local.properties" apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" + + +def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + +def plugins = new Properties() +def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') +if (pluginsFile.exists()) { + pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } +} + +plugins.each { name, path -> + def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() + include ":$name" + project(":$name").projectDir = pluginDirectory +} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index dc0ca8a..6b4e9f4 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,8 @@ +import 'package:elearning/ui/pages/help.dart'; import 'package:elearning/ui/pages/home.dart'; import 'package:elearning/ui/pages/navmenu/menu_dashboard_layout.dart'; import 'package:elearning/ui/pages/onboarding1.dart'; +import 'package:elearning/ui/pages/setting.dart'; import 'package:elearning/ui/pages/undefinedScreen.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/routes/router.dart b/lib/routes/router.dart index 5ad4591..3db3afb 100644 --- a/lib/routes/router.dart +++ b/lib/routes/router.dart @@ -1,10 +1,15 @@ import 'package:elearning/routes/routing_constants.dart'; import 'package:elearning/ui/pages/home.dart'; +import 'package:elearning/ui/pages/setting.dart'; import 'package:elearning/ui/pages/undefinedScreen.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:elearning/analytics/analytics_service.dart'; +import '../auth/google_auth.dart'; +import 'routing_constants.dart'; +import 'routing_constants.dart'; + List navStack = ["Home"]; Route generateRoute(RouteSettings settings) { switch (settings.name) { @@ -13,6 +18,11 @@ Route generateRoute(RouteSettings settings) { print(navStack); analytics.setCurrentScreen(screenName: HomeRoute); return CupertinoPageRoute(builder: (context) => Home()); + // case GoogleSignInRoute: + // return CupertinoPageRoute(builder: (context) => GoogleAuth()); + case SettingsRoute: + return CupertinoPageRoute(builder: (context) => Settings()); + // case SearchRoute: // navStack.add("Search"); // print(navStack); diff --git a/lib/routes/routing_constants.dart b/lib/routes/routing_constants.dart index a6c2c2f..d81e724 100644 --- a/lib/routes/routing_constants.dart +++ b/lib/routes/routing_constants.dart @@ -1,2 +1,4 @@ const String HomeRoute = '/'; const String SearchRoute = '/search'; +const String GoogleSignInRoute = '/googleSigIn'; +const String SettingsRoute = '/settings'; diff --git a/lib/ui/pages/help.dart b/lib/ui/pages/help.dart new file mode 100644 index 0000000..88c5991 --- /dev/null +++ b/lib/ui/pages/help.dart @@ -0,0 +1,118 @@ +import 'dart:math'; +import 'dart:ui'; + +import 'package:elearning/ui/widgets/sectionHeader.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:expand_widget/expand_widget.dart'; + +bool selected = false; + +class Help extends StatefulWidget { + @override + _HelpState createState() => _HelpState(); +} + +class _HelpState extends State { + Widget _container(String title, String txt) { + return Container( + // h, + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(15)), + + // color: Colors.white, + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), + child: Column(children: [ + SectionHeader( + text: title, + onPressed: () { + setState(() { + selected = !selected; + }); + // selected = !selected; + }), + Padding( + padding: const EdgeInsets.fromLTRB(30, 0, 30, 0), + child: GestureDetector( + onTap: () { + setState(() { + selected = !selected; + }); + }, + child: AnimatedContainer( + height: selected ? 0 : double.maxFinite, + duration: Duration(microseconds: 10), + child: Text( + txt, + // maxLength: 2, + + style: TextStyle( + fontSize: 12.0, + color: Colors.black54, + fontFamily: 'Red Hat Display', + ), + + // ), + ), + ), + ), + ), + ]), + ), + ); + } + + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + trailing: CupertinoButton( + child: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: null), + backgroundColor: Colors.white, + leading: CupertinoButton( + child: Icon( + Icons.chevron_left, + color: Colors.black, + ), + onPressed: () { + Navigator.pop(context); + }, + ), + middle: Text( + 'Help', + style: TextStyle( + color: Colors.black, fontFamily: 'Red Hat Display', fontSize: 24), + ), + ), + child: SingleChildScrollView( + // col: Color(0xffE5E5E5), + + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _container('How you eanr coins ?', + "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // Text("asdfghjklkjhgfdsasdfghj"), + // _container('How you eanr coins ?', + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // _container('How you eanr coins ?', + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // _container('How you eanr coins ?', + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // _container('How you eanr coins ?', + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // _container('How you eanr coins ?', + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + // _container('How you eanr coins ?', + // "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."), + ], + ), + ), + ); + } +} diff --git a/lib/ui/pages/onboarding1.dart b/lib/ui/pages/onboarding1.dart index 7dc0608..5a7d00c 100644 --- a/lib/ui/pages/onboarding1.dart +++ b/lib/ui/pages/onboarding1.dart @@ -44,6 +44,7 @@ class _OnboardingState extends State { width: MediaQuery.of(context).size.width * 0.6, child: Text( "Ask questions, earn coins and dominate the global leaderboard.", + // overflow: TextOverflow, textAlign: TextAlign.center, style: TextStyle( fontFamily: 'Red Hat Display', diff --git a/lib/ui/pages/setting.dart b/lib/ui/pages/setting.dart new file mode 100644 index 0000000..352d6dc --- /dev/null +++ b/lib/ui/pages/setting.dart @@ -0,0 +1,96 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:expand_widget/expand_widget.dart'; + +import '../widgets/card.dart'; + +Widget _container(IconData icon, String title) { + return Container( + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(15)), + height: 45, + // color: Colors.white, + child: Padding( + padding: const EdgeInsets.fromLTRB(8, 0, 8, 0), + child: Row(children: [ + Icon( + icon, + color: Colors.black, + ), + SizedBox(width: 20), + Text(title, + style: TextStyle( + color: Color(0xffADADAD), + fontSize: 25, + )), + ]), + ), + ); +} + +class Settings extends StatefulWidget { + @override + _SettingsState createState() => _SettingsState(); +} + +class _SettingsState extends State { + @override + Widget build(BuildContext context) { + return CupertinoPageScaffold( + navigationBar: CupertinoNavigationBar( + trailing: CupertinoButton( + child: Icon( + Icons.search, + color: Colors.black, + ), + onPressed: null), + backgroundColor: Colors.white, + leading: CupertinoButton( + child: Icon( + Icons.chevron_left, + color: Colors.black, + ), + onPressed: () { + Navigator.pop(context); + }, + ), + middle: Text( + 'Settings', + style: TextStyle( + color: Colors.black, fontFamily: 'Red Hat Display', fontSize: 24), + ), + ), + child: Container( + color: Color(0xffE5E5E5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CupertinoButton( + child: _container(Icons.supervised_user_circle, 'Logout'), + onPressed: null), + CupertinoButton( + child: _container(Icons.supervised_user_circle, 'Clear Data'), + onPressed: null), + CupertinoButton( + child: _container(Icons.supervised_user_circle, 'ads '), + onPressed: null), + CupertinoButton( + child: _container( + Icons.supervised_user_circle, 'How you earn coins ?'), + onPressed: null), + + CupertinoButton( + child: _container(Icons.supervised_user_circle, 'Logout'), + onPressed: null), + // CupertinoButton( + // child: _container(Icons.supervised_user_circle, 'Logout'), + // onPressed: null), + // CupertinoButton(child: Text('hello'), onPressed: null), + // CupertinoButton(child: Text('hello'), onPressed: null), + // CardWidget(gradient: false, button: true, child: Text('LOG OUT')), + ], + ), + ), + ); + } +} diff --git a/lib/ui/widgets/sectionHeader.dart b/lib/ui/widgets/sectionHeader.dart index a3334f6..884b9f4 100644 --- a/lib/ui/widgets/sectionHeader.dart +++ b/lib/ui/widgets/sectionHeader.dart @@ -2,7 +2,7 @@ import 'package:elearning/theme/box_icons_icons.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart' as material; -class SectionHeader extends StatelessWidget { +class SectionHeader extends StatefulWidget { const SectionHeader({ Key key, @required this.text, @@ -10,6 +10,12 @@ class SectionHeader extends StatelessWidget { }) : super(key: key); final String text; final Function onPressed; + + @override + _SectionHeaderState createState() => _SectionHeaderState(); +} + +class _SectionHeaderState extends State { @override Widget build(BuildContext context) { return Row( @@ -24,7 +30,7 @@ class SectionHeader extends StatelessWidget { color: Color(0xFF343434)), ), Text( - text, + widget.text, style: TextStyle().copyWith( fontSize: 17.0, ), @@ -33,7 +39,7 @@ class SectionHeader extends StatelessWidget { CupertinoButton( child: Icon(BoxIcons.bx_chevron_right, color: material.Colors.lightBlue), - onPressed: onPressed, + onPressed: widget.onPressed, ) ], ); diff --git a/pubspec.lock b/pubspec.lock index b4ba0d8..feb0669 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -85,6 +85,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.3" + expand_widget: + dependency: "direct main" + description: + name: expand_widget + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0+2" file: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index c525caa..0937ff4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -30,6 +30,7 @@ dependencies: cloud_firestore: ^0.13.7 firebase_auth: ^0.16.1 flutter_calendar_carousel: ^1.4.12 + expand_widget: ^0.2.0+2 # The following adds the Cupertino Icons font to your application.