Basic theme code

This commit is contained in:
NATHANIEL ENDICK
2023-02-26 05:21:45 -05:00
parent 5e63eaf84c
commit 884aa0c249
6 changed files with 256 additions and 249 deletions

View File

@@ -6,20 +6,6 @@ import 'package:material_dialogs/material_dialogs.dart';
enum CampusState { campuses, list_options, offers }
class BuyScreen extends StatefulWidget {
const BuyScreen({Key? key}) : super(key: key);
@override
_BuyScreenState createState() => _BuyScreenState();
}
class _BuyScreenState extends State<BuyScreen> {
@override
Widget build(BuildContext context) {
return ContentDisplay();
}
}
final List<String> entries = <String>[
'Antoinette Beauchamp',
'Iliana Campbell',
@@ -50,115 +36,14 @@ final List<List<String>> eatingLocations = [
];
final List<int> colorCodes = <int>[600, 500, 100];
class OffersListView extends StatelessWidget {
const OffersListView({super.key});
class BuyScreen extends StatefulWidget {
const BuyScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: 30,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Dialogs.materialDialog(
color: Colors.white,
customView: TransactionDetails(),
customViewPosition: CustomViewPosition.BEFORE_ACTION,
msg: 'Please read all the information below before purchasing.',
title: 'Transaction Details',
context: context,
actions: [
IconsOutlineButton(
onPressed: () {},
text: 'Cancel',
iconData: Icons.cancel_outlined,
textStyle: TextStyle(color: Colors.grey),
iconColor: Colors.grey,
),
IconsButton(
onPressed: () {},
text: 'Purchase',
iconData: Icons.done,
color: Colors.blue,
textStyle: TextStyle(color: Colors.white),
iconColor: Colors.white,
),
],
);
},
child: Container(
height: 80,
color: Colors.blue,
margin: const EdgeInsets.only(bottom: 4),
child: Row(
children: [
Expanded(
flex: 7,
child: Container(
color: Colors.red,
margin: EdgeInsets.only(top: 4, left: 4, bottom: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
entries[index % entries.length],
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 24),
),
Row(
children: const [
Icon(Icons.star, size: 16),
Icon(Icons.star, size: 16),
Icon(Icons.star, size: 16),
Icon(Icons.star_half, size: 16),
Icon(Icons.star_border, size: 16),
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: const [
Text(
'88:88PM - 88:88PM',
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 16),
),
],
),
)
],
),
),
),
Expanded(
flex: 3,
child: Container(
color: Colors.orange,
child: const Text(
'\$88',
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 44),
),
),
)
],
),
),
);
});
}
_BuyScreenState createState() => _BuyScreenState();
}
class ContentDisplay extends StatefulWidget {
const ContentDisplay({super.key});
@override
_CampusGridViewState createState() => _CampusGridViewState();
}
class _CampusGridViewState extends State<ContentDisplay> {
class _BuyScreenState extends State<BuyScreen> {
CampusState _currentState = CampusState.campuses;
List<String> _diningOptions = List.empty();
String _selectedLocation = "";
@@ -176,8 +61,8 @@ class _CampusGridViewState extends State<ContentDisplay> {
physics: NeverScrollableScrollPhysics(),
crossAxisCount: 2,
crossAxisSpacing: 15,
childAspectRatio: 1,
mainAxisSpacing: 15,
childAspectRatio: 0.8,
mainAxisSpacing: 20,
padding: EdgeInsets.all(10),
children: [
InkWell(
@@ -267,7 +152,7 @@ class _CampusGridViewState extends State<ContentDisplay> {
Container(
width: double.infinity,
padding: EdgeInsets.all(8),
color: Colors.yellow,
color: Colors.yellow[700],
child: Text(
"Cook-Douglass",
textAlign: TextAlign.center,
@@ -340,128 +225,132 @@ class _CampusGridViewState extends State<ContentDisplay> {
],
));
case CampusState.offers:
return Column(
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Flexible(
flex: 8,
fit: FlexFit.tight,
child: ElevatedButton(
onPressed: () {
setState(() {
_currentState = CampusState.campuses;
});
},
child: const Text("Choose A Different Location")),
),
Flexible(
flex: 2,
return Scaffold(
body: Column(
children: [
Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [
Flexible(
flex: 8,
fit: FlexFit.tight,
child: ElevatedButton(
onPressed: () {}, child: const Icon(Icons.filter_list)))
]),
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemCount: 30,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Dialogs.materialDialog(
color: Colors.white,
customView: TransactionDetails(),
customViewPosition: CustomViewPosition.BEFORE_ACTION,
msg:
'Please read all the information below before purchasing.',
title: 'Transaction Details',
context: context,
actions: [
IconsOutlineButton(
onPressed: () {},
text: 'Cancel',
iconData: Icons.cancel_outlined,
textStyle: TextStyle(color: Colors.grey),
iconColor: Colors.grey,
),
IconsButton(
onPressed: () {},
text: 'Purchase',
iconData: Icons.done,
color: Colors.blue,
textStyle: TextStyle(color: Colors.white),
iconColor: Colors.white,
),
],
);
onPressed: () {
setState(() {
_currentState = CampusState.campuses;
});
},
child: Container(
height: 80,
color: Colors.blue,
margin: const EdgeInsets.only(bottom: 4),
child: Row(
children: [
Expanded(
flex: 7,
child: Container(
color: Colors.red,
margin:
EdgeInsets.only(top: 4, left: 4, bottom: 4),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
entries[index % entries.length] +
" " +
_selectedLocation,
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 24),
),
Row(
children: const [
Icon(Icons.star, size: 16),
Icon(Icons.star, size: 16),
Icon(Icons.star, size: 16),
Icon(Icons.star_half, size: 16),
Icon(Icons.star_border, size: 16),
],
),
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
child: const Text("Choose A Different Location")),
),
Flexible(
flex: 2,
child: ElevatedButton(
onPressed: () {}, child: const Icon(Icons.filter_list)))
]),
Expanded(
child: ListView.builder(
physics: BouncingScrollPhysics(),
itemCount: 30,
padding: EdgeInsets.zero,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Dialogs.materialDialog(
color: Colors.white,
customView: TransactionDetails(),
customViewPosition:
CustomViewPosition.BEFORE_ACTION,
msg:
'Please read all the information below before purchasing.',
title: 'Transaction Details',
context: context,
actions: [
IconsOutlineButton(
onPressed: () {},
text: 'Cancel',
iconData: Icons.cancel_outlined,
textStyle: TextStyle(color: Colors.grey),
iconColor: Colors.grey,
),
IconsButton(
onPressed: () {},
text: 'Purchase',
iconData: Icons.done,
color: Colors.blue,
textStyle: TextStyle(color: Colors.white),
iconColor: Colors.white,
),
],
);
},
child: Container(
height: 80,
// color: Colors.blue,
margin: const EdgeInsets.only(bottom: 4),
child: Row(
children: [
Expanded(
flex: 7,
child: Container(
color: Colors.red,
margin: EdgeInsets.only(
top: 4, left: 4, bottom: 4),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
entries[index % entries.length] +
" " +
_selectedLocation,
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: const TextStyle(fontSize: 24),
),
Row(
children: const [
Text(
'88:88PM - 88:88PM',
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 16),
),
Icon(Icons.star, size: 16),
Icon(Icons.star, size: 16),
Icon(Icons.star, size: 16),
Icon(Icons.star_half, size: 16),
Icon(Icons.star_border, size: 16),
],
),
)
],
Expanded(
child: Column(
mainAxisAlignment:
MainAxisAlignment.end,
children: const [
Text(
'88:88PM - 88:88PM',
textAlign: TextAlign.start,
overflow: TextOverflow.ellipsis,
style: TextStyle(fontSize: 16),
),
],
),
)
],
),
),
),
),
Expanded(
flex: 3,
child: Container(
color: Colors.orange,
child: const Text(
'\$88',
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 44),
Expanded(
flex: 3,
child: Container(
color: Colors.orange,
child: const Text(
'\$88',
textAlign: TextAlign.center,
style: const TextStyle(fontSize: 44),
),
),
),
)
],
)
],
),
),
),
);
}),
),
],
);
}),
),
],
),
);
}
}

View File

@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
import 'package:ruswipeshare/buy.dart';
import 'package:ruswipeshare/main.dart';
import 'package:ruswipeshare/sell.dart';
import 'profile_screen_custom.dart';
import 'main_screen.dart';
@@ -31,14 +32,13 @@ class _HomeScreenState extends State<HomeScreen> {
PersistentBottomNavBarItem(
icon: const Icon(Icons.shopping_cart),
title: "Buy",
activeColorPrimary: Colors.blue,
inactiveColorPrimary: Colors.grey,
inactiveColorSecondary: Colors.purple),
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
inactiveColorPrimary: Colors.black38),
PersistentBottomNavBarItem(
icon: const Icon(Icons.attach_money),
title: "Sell",
activeColorPrimary: Colors.teal,
inactiveColorPrimary: Colors.grey,
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
inactiveColorPrimary: Colors.black38,
routeAndNavigatorSettings: const RouteAndNavigatorSettings(
initialRoute: "/",
),
@@ -46,8 +46,8 @@ class _HomeScreenState extends State<HomeScreen> {
PersistentBottomNavBarItem(
icon: const Icon(Icons.person),
title: "Profile",
activeColorPrimary: Colors.blueAccent,
inactiveColorPrimary: Colors.grey,
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
inactiveColorPrimary: Colors.black38,
routeAndNavigatorSettings: const RouteAndNavigatorSettings(
initialRoute: "/",
),
@@ -55,8 +55,8 @@ class _HomeScreenState extends State<HomeScreen> {
PersistentBottomNavBarItem(
icon: const Icon(Icons.settings),
title: "Settings",
activeColorPrimary: Colors.indigo,
inactiveColorPrimary: Colors.grey,
activeColorPrimary: CustomMaterialColor(240, 240, 240).mdColor,
inactiveColorPrimary: Colors.black38,
routeAndNavigatorSettings: const RouteAndNavigatorSettings(
initialRoute: "/",
),
@@ -71,7 +71,8 @@ class _HomeScreenState extends State<HomeScreen> {
screens: _buildScreens(),
items: _navBarsItems(),
confineInSafeArea: true,
backgroundColor: Colors.white, // Default is Colors.white.
backgroundColor:
Theme.of(context).primaryColor, // Default is Colors.white.
handleAndroidBackButtonPress: true, // Default is true.
resizeToAvoidBottomInset:
true, // This needs to be true if you want to move up the screen when keyboard appears. Default is true.
@@ -79,9 +80,12 @@ class _HomeScreenState extends State<HomeScreen> {
hideNavigationBarWhenKeyboardShows:
true, // Recommended to set 'resizeToAvoidBottomInset' as true while using this argument. Default is true.
decoration: NavBarDecoration(
borderRadius: BorderRadius.circular(10.0),
colorBehindNavBar: Colors.white,
),
// border: Border(
// top: BorderSide(width: 2.0, color: Colors.white),
// ),
// borderRadius: BorderRadius.circular(10.0),
// colorBehindNavBar: Colors.white,
),
popAllScreensOnTapOfSelectedTab: true,
popActionScreens: PopActionScreensType.all,
itemAnimationProperties: const ItemAnimationProperties(

View File

@@ -1,5 +1,6 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
import 'firebase_options.dart';
import 'auth_gate.dart';
@@ -17,7 +18,13 @@ class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
primarySwatch: CustomMaterialColor(200, 61, 61).mdColor,
primarySwatch: CustomMaterialColor(205, 0, 48).mdColor,
scaffoldBackgroundColor: Colors.black87,
fontFamily: GoogleFonts.figtree().fontFamily,
textTheme: Theme.of(context).textTheme.apply(
bodyColor: CustomMaterialColor(240, 240, 240).mdColor,
displayColor: CustomMaterialColor(240, 240, 240).mdColor,
),
),
home: const AuthGate(),
);

View File

@@ -11,6 +11,7 @@ import firebase_auth
import firebase_core
import firebase_database
import geolocator_apple
import path_provider_foundation
import sign_in_with_apple
import twitter_login
@@ -21,6 +22,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseDatabasePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseDatabasePlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SignInWithApplePlugin.register(with: registry.registrar(forPlugin: "SignInWithApplePlugin"))
TwitterLoginPlugin.register(with: registry.registrar(forPlugin: "TwitterLoginPlugin"))
}

View File

@@ -129,6 +129,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.3.1"
ffi:
dependency: transitive
description:
name: ffi
sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978
url: "https://pub.dev"
source: hosted
version: "2.0.1"
file:
dependency: transitive
description:
name: file
sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d"
url: "https://pub.dev"
source: hosted
version: "6.1.4"
firebase_auth:
dependency: "direct main"
description:
@@ -365,6 +381,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.1.1"
google_fonts:
dependency: "direct main"
description:
name: google_fonts
sha256: "927573f2e8a8d65c17931e21918ad0ab0666b1b636537de7c4932bdb487b190f"
url: "https://pub.dev"
source: hosted
version: "4.0.3"
google_sign_in:
dependency: transitive
description:
@@ -517,6 +541,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.1"
path_provider:
dependency: transitive
description:
name: path_provider
sha256: "04890b994ee89bfa80bf3080bfec40d5a92c5c7a785ebb02c13084a099d2b6f9"
url: "https://pub.dev"
source: hosted
version: "2.0.13"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: "7623b7d4be0f0f7d9a8b5ee6879fc13e4522d4c875ab86801dee4af32b54b83e"
url: "https://pub.dev"
source: hosted
version: "2.0.23"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: eec003594f19fe2456ea965ae36b3fc967bc5005f508890aafe31fa75e41d972
url: "https://pub.dev"
source: hosted
version: "2.1.2"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: "525ad5e07622d19447ad740b1ed5070031f7a5437f44355ae915ff56e986429a"
url: "https://pub.dev"
source: hosted
version: "2.1.9"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec"
url: "https://pub.dev"
source: hosted
version: "2.0.6"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: "642ddf65fde5404f83267e8459ddb4556316d3ee6d511ed193357e25caa3632d"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
persistent_bottom_nav_bar:
dependency: "direct main"
description:
@@ -533,6 +605,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "5.1.0"
platform:
dependency: transitive
description:
name: platform
sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
plugin_platform_interface:
dependency: transitive
description:
@@ -549,6 +629,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.6.2"
process:
dependency: transitive
description:
name: process
sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09"
url: "https://pub.dev"
source: hosted
version: "4.2.4"
quiver:
dependency: transitive
description:
@@ -682,6 +770,22 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.4"
win32:
dependency: transitive
description:
name: win32
sha256: c9ebe7ee4ab0c2194e65d3a07d8c54c5d00bb001b76081c4a04cdb8448b59e46
url: "https://pub.dev"
source: hosted
version: "3.1.3"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1
url: "https://pub.dev"
source: hosted
version: "1.0.0"
xml:
dependency: transitive
description:

View File

@@ -44,6 +44,7 @@ dependencies:
flutter_credit_card: any
flutter_stripe: any
material_dialogs: any
google_fonts: ^4.0.3
dev_dependencies:
flutter_test: