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

Feature Social Page #254

Merged
merged 3 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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 android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.apps.blt"
minSdkVersion 18
minSdkVersion 19
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
46 changes: 46 additions & 0 deletions lib/src/pages/drawer/social.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

class SocialPage extends ConsumerStatefulWidget{
const SocialPage({Key? key}) : super(key: key);

@override
_SocialPageState createState() => _SocialPageState();
}

class _SocialPageState extends ConsumerState<SocialPage> {
late InAppWebViewController webViewController;
late PullToRefreshController refreshController;


@override
Widget build(BuildContext context){
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(
Icons.arrow_back_ios_new_rounded,
),
onPressed: () {
Navigator.of(context).pop();
},
),
title: Text("Social"),
backgroundColor: Color(0xFFDC4654),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(child: InAppWebView(
initialUrlRequest: URLRequest(url: Uri.parse("https://twitter.com/Bugheist")),
fredfalcon marked this conversation as resolved.
Show resolved Hide resolved
shouldOverrideUrlLoading: (controller, navigationAction) async{
return NavigationActionPolicy.CANCEL;
},
)),
],
)
);

}
}
5 changes: 4 additions & 1 deletion lib/src/pages/home/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,10 @@ class _HomeState extends ConsumerState<Home> {
// Update the state of the app
// ...
// Then close the drawer
Navigator.pop(context);
Navigator.pushNamed(
context,
RouteManager.socialPage
);
},
),
ListTile(
Expand Down
21 changes: 21 additions & 0 deletions lib/src/routes/routing.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import '../pages/leaderboards/company_scoreboard.dart';
import '../pages/leaderboards/global_leaderboard.dart';
import '../pages/issues/issue_detail.dart';
import '../pages/leaderboards/monthly_leaderboard.dart';
import '../pages/drawer/social.dart';

/// The managing class for App Navigation, also adds custom page transitions.
class RouteManager {
Expand All @@ -27,6 +28,7 @@ class RouteManager {
static const String signupPage = "/signup";
static const String forgotPage = "/forgot";
static const String homePage = "/home";
static const String socialPage = "/social";
static String currentRoute = "/loginSignup";
static const String legalPage = "/legal";
static const String aboutPage = "/about";
Expand Down Expand Up @@ -162,6 +164,25 @@ class RouteManager {
},
transitionDuration: const Duration(milliseconds: 500),
);
case socialPage:
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) =>
const SocialPage(),
transitionsBuilder: (context, animation, secondaryAnimation, child) {
const begin = Offset(1.0, 0);
const end = Offset.zero;
const curve = Curves.ease;

var tween =
Tween(begin: begin, end: end).chain(CurveTween(curve: curve));

return SlideTransition(
position: animation.drive(tween),
child: child,
);
},
transitionDuration: const Duration(milliseconds: 500),
);
case companyDashboardPage:
return PageRouteBuilder(
pageBuilder: (context, animation, secondaryAnimation) =>
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
pasteboard: ^0.2.0
path_provider: ^2.0.13
url_launcher: ^6.1.10
flutter_inappwebview: ^5.7.2+3
#flutter_lints: ^1.0.4

dev_dependencies:
Expand Down