Skip to content

Commit

Permalink
Added Google Fonts, Made more responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulmominsakib committed Jan 11, 2021
1 parent 7f4c878 commit 64108f2
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 56 deletions.
1 change: 1 addition & 0 deletions ios/Flutter/Debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
#include "Generated.xcconfig"
1 change: 1 addition & 0 deletions ios/Flutter/Release.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
#include "Generated.xcconfig"
41 changes: 41 additions & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}

def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end

File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
use_frameworks!
use_modular_headers!

flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
2 changes: 1 addition & 1 deletion lib/data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const Color cardBackground = Color(0xFF081257);

/* <----------- Text Style ------------> */
const TextStyle h1 =
TextStyle(fontSize: 30, color: Colors.white, fontWeight: FontWeight.bold);
TextStyle(fontSize: 26, color: Colors.white, fontWeight: FontWeight.bold);

const TextStyle h2 =
TextStyle(fontSize: 20, color: Colors.white, fontWeight: FontWeight.bold);
Expand Down
10 changes: 9 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:groceries_flutter_ui/data.dart';
import 'package:groceries_flutter_ui/pages/homeScreen.dart';
import 'package:groceries_flutter_ui/pages/introScreen.dart';

void main() {
Expand All @@ -19,9 +21,15 @@ class MyApp extends StatelessWidget {
primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity,
scaffoldBackgroundColor: scaffoldColor,
textTheme: GoogleFonts.poppinsTextTheme(
Theme.of(context).textTheme,
),
),
debugShowCheckedModeBanner: false,
home: IntroScreen(),
routes: {
'/': (context) => IntroScreen(),
'home': (context) => HomeScreen(),
},
);
}
}
2 changes: 1 addition & 1 deletion lib/pages/cartScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CartScreen extends StatelessWidget {
hGap30,
/* <----------- List of Products ------------> */
Expanded(
child: Column(
child: ListView(
children: [
CartItem(
mediaQuery: mediaQuery,
Expand Down
106 changes: 58 additions & 48 deletions lib/pages/foodDetailsScreen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,56 +132,66 @@ class FoodDetails extends StatelessWidget {
/* <----------- End Food Name And Ratings ------------> */

/* <----------- Product Description ------------> */
Container(
margin: EdgeInsets.symmetric(horizontal: 20, vertical: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Product Description',
style: h2,
),
hGap10,
Text(
'''Green Cabbage – The king of cabbages and our old friend! The wide fan-like leaves are pale green in color and with a slightly rubbery texture when raw. Pick heads that are tight and feel heavy for their size. The outer few layers are usually wilted and should be discarded before preparing.''',
style: lessImportantText,
),
],
),
),
/* <----------- End Product Description ------------> */

/* <----------- Add To Cart Button ------------> */
InkWell(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => CartScreen(),
),
);
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 20, vertical: mediaQuery.height * 0.04),
padding: EdgeInsets.all(mediaQuery.height * 0.02),
decoration: BoxDecoration(
color: primaryColor,
borderRadius: BorderRadius.circular(15),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
Expanded(
child: SingleChildScrollView(
child: Column(
children: [
Icon(
Icons.shopping_cart_rounded,
color: Colors.white,
size: 30,
Container(
margin:
EdgeInsets.symmetric(horizontal: 20, vertical: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Product Description',
style: h2,
),
hGap10,
Text(
'''Green Cabbage – The king of cabbages and our old friend! The wide fan-like leaves are pale green in color and with a slightly rubbery texture when raw. Pick heads that are tight and feel heavy for their size. The outer few layers are usually wilted and should be discarded before preparing.''',
style: lessImportantText,
),
],
),
),
wGap10,
Text(
'Add To Cart',
style: h1.copyWith(fontSize: 20),
/* <----------- End Product Description ------------> */

/* <----------- Add To Cart Button ------------> */
InkWell(
onTap: () {
Navigator.push(
context,
CupertinoPageRoute(
builder: (context) => CartScreen(),
),
);
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 20,
vertical: mediaQuery.height * 0.04),
padding: EdgeInsets.all(mediaQuery.height * 0.02),
decoration: BoxDecoration(
color: primaryColor,
borderRadius: BorderRadius.circular(15),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
Icons.shopping_cart_rounded,
color: Colors.white,
size: 30,
),
wGap10,
Text(
'Add To Cart',
style: h1.copyWith(fontSize: 20),
),
],
),
),
),
],
),
Expand Down
9 changes: 4 additions & 5 deletions lib/pages/paymentSuccessFul.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:groceries_flutter_ui/data.dart';
import 'package:groceries_flutter_ui/pages/homeScreen.dart';

class PaymentSuccesful extends StatelessWidget {
@override
Expand All @@ -27,11 +28,9 @@ class PaymentSuccesful extends StatelessWidget {
/* <----------- PayButton ------------> */
InkWell(
onTap: () {
Navigator.push(
Navigator.popUntil(
context,
CupertinoPageRoute(
builder: (context) => PaymentSuccesful(),
),
ModalRoute.withName('/'),
);
},
child: Container(
Expand All @@ -50,7 +49,7 @@ class PaymentSuccesful extends StatelessWidget {
wGap10,
Text(
'Track Order',
style: h1.copyWith(fontSize: 20),
style: h1.copyWith(fontSize: mediaQuery.height * 0.02),
),
],
),
Expand Down
Loading

0 comments on commit 64108f2

Please sign in to comment.