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

Rating page added #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions fuel_ease_app/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml


linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
Expand Down
9 changes: 4 additions & 5 deletions fuel_ease_app/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:fuel_ease_app/screens/rate_us_page1.dart';

void main() {
runApp(const MyApp());
Expand All @@ -10,16 +11,14 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {

return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const Scaffold(
body: Center(
child: Text('Sample Home Page'),
),
),
home: const RatingPage(),
);
}
}
161 changes: 161 additions & 0 deletions fuel_ease_app/lib/screens/rate_us_page1.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@


import 'package:flutter/material.dart';
import 'package:flutter_rating_bar/flutter_rating_bar.dart';

class RatingPage extends StatefulWidget {
const RatingPage({super.key});

@override
State<RatingPage> createState() => _RatingPageState();
}



class _RatingPageState extends State<RatingPage> {
@override
Widget build(BuildContext context) {
Future openDialog() => showDialog(
context: context,
builder: (context) => AlertDialog(
icon: Icon(Icons.thumb_up,size:200.0 ,color: Color.fromARGB(255, 237, 160, 169),),
title: Text("Thank you!",style: TextStyle(fontSize: 20,color: Colors.black26),),
content: Text("Thank you for sharing your valuable review and rating us"),
),
);
return Scaffold(
appBar: AppBar(
backgroundColor: Color.fromARGB(60, 236, 193, 193),
title: Center(child: const Text('Rate Us')),
),
backgroundColor: Colors.white,
body: SafeArea(
child: Center(
child: Column(
children: [
//icon
CircleAvatar(
radius: 210.0,
backgroundColor: Color.fromARGB(255, 235, 236, 236),
backgroundImage: NetworkImage(
"https://cdn5.vectorstock.com/i/1000x1000/13/54/high-rating-color-icon-vector-29051354.jpg",
),
),
Center(
child: Text("Review Refuelers to help us improve"),
),
SizedBox(
height: 10,
),
//dialogbox
RatingBar.builder(
initialRating: 3,
minRating: 1,
direction: Axis.horizontal,
allowHalfRating: true,
itemCount: 5,
itemPadding: EdgeInsets.symmetric(horizontal: 4.0),
itemBuilder: (context, _) => Icon(
Icons.star,
color: Colors.amber,
),
onRatingUpdate: (rating) {
print(rating);
},
),
SizedBox(
height: 20,
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15.0),
child: Container(
height: 100.0,
decoration: BoxDecoration(
color: Color.fromARGB(255, 240, 172, 172),
border:
Border.all(color: Color.fromARGB(255, 214, 205, 205)),
borderRadius: BorderRadius.circular(15),
),
child: Padding(
padding: const EdgeInsets.only(left: 18.0),
child: TextField(
maxLines: null,
keyboardType: TextInputType.multiline,
expands: true,
decoration: InputDecoration(
border: InputBorder.none,
hintText: 'Write your reviews here',
),
),
),
),
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: const EdgeInsets.only(left: 11.0),
child: TextButton(
onPressed: (() {}),
child: Container(
height: 40.0,
width: 85.0,
decoration: BoxDecoration(
color: Color.fromARGB(255, 244, 164, 164),
border: Border.all(
color: Color.fromARGB(255, 51, 49, 49)),
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0, vertical: 7.0),
child: Text(
"Later",
selectionColor: Colors.black,
style: TextStyle(
color: Color.fromARGB(255, 112, 34, 34),
fontSize: 18.0),
),
),
)),
),
SizedBox(
width: 100.0,
),
Padding(
padding: const EdgeInsets.only(left: 11.0),
child: TextButton(
onPressed: (() {
openDialog();
}),
child: Container(
height: 40.0,
width: 105.0,
decoration: BoxDecoration(
color: Color.fromARGB(255, 225, 214, 214),
border: Border.all(
color: Color.fromARGB(255, 51, 49, 49)),
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding: const EdgeInsets.symmetric(
horizontal: 20.0, vertical: 7.0),
child: Text(
"Submit",
selectionColor: Colors.black,
style: TextStyle(
color: Color.fromARGB(255, 112, 34, 34),
fontSize: 18.0),
),
),
)),
)
],
),
],
),
),
),
);
}
}
10 changes: 9 additions & 1 deletion fuel_ease_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.1"
flutter_rating_bar:
dependency: "direct main"
description:
name: flutter_rating_bar
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.1"
flutter_test:
dependency: "direct dev"
description: flutter
Expand Down Expand Up @@ -157,4 +164,5 @@ packages:
source: hosted
version: "2.1.2"
sdks:
dart: ">=2.18.6 <3.0.0"
dart: ">=2.18.5 <3.0.0"
flutter: ">=2.5.0"
19 changes: 6 additions & 13 deletions fuel_ease_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1

environment:
sdk: '>=2.18.6 <3.0.0'
sdk: '>=2.18.5 <3.0.0'

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
Expand All @@ -29,47 +29,40 @@ environment:
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
cupertino_icons: ^1.0.2
flutter:
sdk: flutter


# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
flutter_rating_bar: ^4.0.0

dev_dependencies:
flutter_test:
sdk: flutter

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^2.0.0
flutter_test:
sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:

# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# - images/ratingicon.jpg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
Expand Down