mirror of
https://github.com/SoPat712/RUSwipeShare.git
synced 2025-08-21 19:08:46 -04:00
Basic theme code
This commit is contained in:
359
lib/buy.dart
359
lib/buy.dart
@@ -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),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@@ -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(
|
||||
|
@@ -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(),
|
||||
);
|
||||
|
Reference in New Issue
Block a user